evalution 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{check-BTg6THHB.d.ts → check-CR4fU1S5.d.ts} +43 -15
- package/dist/checks/index.d.ts +1 -1
- package/dist/cli/index.js +50 -21
- 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-Dqi5vVg-.d.ts} +20 -5
- package/dist/index.d.ts +8 -7
- package/dist/index.js +22 -11
- package/dist/{trace-Dn6Pfcc5.d.ts → trace-DGj5oW7z.d.ts} +1 -1
- package/dist/{trace-event-ingestor-DI-HkA4Q.js → trace-event-ingestor-BghQcCHe.js} +124 -16
- package/dist/views/datasets/index.d.ts +1 -1
- package/dist/views/index.d.ts +2 -2
- package/dist/views/react/index.d.ts +1 -1
- package/package.json +2 -2
- 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>
|
|
@@ -97,9 +97,19 @@ interface SpanToolResultPart {
|
|
|
97
97
|
/** Whether the result reports a failure (an error, or a denied call). */
|
|
98
98
|
isError?: boolean;
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* The reasoning (thinking) a model produced ahead of its answer, within a
|
|
102
|
+
* multi-part {@link SpanMessage} content — how a conversation's earlier
|
|
103
|
+
* assistant turns carry theirs. The turn a span records keeps its own in
|
|
104
|
+
* {@link LLMSpanDetails.reasoning}.
|
|
105
|
+
*/
|
|
106
|
+
interface SpanReasoningPart {
|
|
107
|
+
type: "reasoning";
|
|
108
|
+
text: string;
|
|
109
|
+
}
|
|
100
110
|
type SpanMessageRole = "user" | "assistant" | "system" | "tool" | (string & {});
|
|
101
111
|
/** One segment of a multi-part {@link SpanMessage} content. */
|
|
102
|
-
type SpanContentPart = SpanTextPart | SpanImagePart | SpanToolCallPart | SpanToolResultPart;
|
|
112
|
+
type SpanContentPart = SpanTextPart | SpanImagePart | SpanToolCallPart | SpanToolResultPart | SpanReasoningPart;
|
|
103
113
|
/**
|
|
104
114
|
* A single message within an LLM span's input/output.
|
|
105
115
|
*
|
|
@@ -138,6 +148,11 @@ interface LLMSpanDetails {
|
|
|
138
148
|
* output and for any model whose answer is data rather than prose.
|
|
139
149
|
*/
|
|
140
150
|
output?: unknown;
|
|
151
|
+
/**
|
|
152
|
+
* The reasoning the model produced on the way to {@link output}, kept apart
|
|
153
|
+
* from it so an output stays the answer that checks and agents read.
|
|
154
|
+
*/
|
|
155
|
+
reasoning?: string;
|
|
141
156
|
/** Input tokens, counting any read from or written to a prompt cache. */
|
|
142
157
|
promptTokens?: number;
|
|
143
158
|
completionTokens?: number;
|
|
@@ -440,10 +455,10 @@ interface DatasetField {
|
|
|
440
455
|
/** Name, type, description — the checker's view of the slot this field came from. */
|
|
441
456
|
def: PropDefinition;
|
|
442
457
|
/**
|
|
443
|
-
* Set on a field added by hand
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
* parameters.
|
|
458
|
+
* Set on a field added by hand — through `DatasetProvider.addField`, or
|
|
459
|
+
* given as `{ name, type }` or `{ from }` when the dataset was created —
|
|
460
|
+
* rather than derived from the linked prompt. Such a field never came from
|
|
461
|
+
* that prompt, so it isn't flagged when it matches none of its parameters.
|
|
447
462
|
*/
|
|
448
463
|
added?: true;
|
|
449
464
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as NormalizedPromptBase, $t as
|
|
1
|
+
import { $ as NormalizedPromptBase, $t as Annotation, A as DatasetRowsOverview, An as TraceSummary, At as EvalArm, B as ChatPromptUpdates, Bt as EvalProviderInfo, C as DatasetFieldShape, Cn as Trace, Ct as ValueCatalogPreset, D as DatasetRow, Dn as TraceLiveEvent, Dt as VariationInfo, E as DatasetProviderInfo, En as TraceEvalRun, Et as VariationId, F as KnownColumnSpec, Ft as EvalCheckOutcome, G as ExecutionInput, Gt as EvalRunProgress, H as ConflictChoices, Ht as EvalRowResult, I as AddPromptContext, It as EvalCheckResult, J as InputLayout, Jt as EvalSummary, K as ExtractedProps, Kt as EvalRunStatus, L as AddPromptField, Lt as EvalDefinition, M as ColumnPath, Mn as isCheckSpan, Mt as EvalChangeEvent, N as DatasetColumnSpec, Nn as spanMessages, Nt as EvalChangeType, O as DatasetRowSource, On as TraceProviderInfo, Ot as VersionId, P as ForeignColumnSpec, Pt as EvalCheck, Q as NormalizedPrompt, Qt as TraceCheckResult, R as CalleeBinding, Rt as EvalDefinitionPatch, S as DatasetField, Sn as ToolSpanDetails, St as ValueCatalogGroup, T as DatasetPathChild, Tn as TraceChangeType, Tt as VariationConflict, U as ExecuteRequest, Ut as EvalRowStatus, V as CheckInfo, Vt as EvalResults, W as ExecuteResponse, Wt as EvalRun, X as NormalizedMessage, Xt as NewEvalDefinition, Y as NormalizedChatPrompt, Yt as EvalTraceRun, Z as NormalizedParameter, Zt as NewEvalRun, _ as isStandardSchema, _n as SpanMessageRole, _t as ResourceScope, a as check, an as CHECK_ATTRIBUTE, at as PromptChangeEvent, b as DatasetChangeEvent, bn as SpanToolCallPart, bt as UpdatePromptResponse, c as ResolvedResourceInputs, cn as LLMSpanDetails, ct as PromptRef, d as ResourceInput, dn as SERVICE_NAME_ATTRIBUTE, dt as PropType, en as AnnotationChanges, et as NormalizedPromptUpdates, f as ResourceInputs, fn as Span, ft as PropValue, g as isResource, gn as SpanMessage, gt as ResourceInstanceInput, h as StaticResourceDefinition, hn as SpanKind, ht as ResourceInfo, i as CheckRun, in as AnnotationSource, it as PendingConflicts, j as DatasetSummary, jn as TraceWithSpans, jt as EvalArmSpec, k as DatasetRowUpdate, kn as TraceStreamEvent, kt as VersionInfo, l as Resource, ln as PLAYGROUND_ENVIRONMENT, lt as PromptStyle, m as ResourceOutputDefinition, mn as SpanImagePart, mt as RebaseResult, n as CheckDefinition, nn as AnnotationEventOp, nt as NormalizedToolCall, o as isCheck, on as DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, ot as PromptInputSources, p as ResourceInstance, pn as SpanContentPart, pt as QuestionsPromptUpdates, q as FieldValues, qt as EvalRunSummary, r as CheckOutcome, rn as AnnotationKind, rt as ParsedPrompt, s as DynamicResourceDefinition, sn as EvalCounts, st as PromptProviderInfo, t as Check, tn as AnnotationEvent, tt as NormalizedQuestionsPrompt, u as ResourceDefinition, un as PromptID, ut as PropDefinition, v as resource, vn as SpanReasoningPart, vt as RunResources, w as DatasetInstanceShape, wn as TraceChangeEvent, wt as ValueFactory, x as DatasetChangeType, xn as SpanToolResultPart, xt as ValueCatalog, y as Dataset, yn as SpanTextPart, yt as SourceSpan, z as ChangeEventType, zt as EvalInputs } from "./check-CR4fU1S5.js";
|
|
2
2
|
import { AttributeValue, Attributes, Tracer } from "@opentelemetry/api";
|
|
3
3
|
import { PropDefinition as PropDefinition$1, PropValue as PropValue$1, ValueFactory as ValueFactory$1 } from "ts-proppy";
|
|
4
4
|
import { Database } from "@tursodatabase/sync";
|
|
@@ -553,10 +553,11 @@ interface TraceProvider {
|
|
|
553
553
|
subscribeAnnotations?(traceId: string, callback: (event: AnnotationEvent) => void): () => void;
|
|
554
554
|
/**
|
|
555
555
|
* Notifies this trace's {@link subscribeAnnotations} subscribers of an
|
|
556
|
-
* annotation change
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
*
|
|
556
|
+
* annotation change, and {@link watch}ers with an `update` event, since a
|
|
557
|
+
* trace's summary carries its annotation counts. Called by the annotation
|
|
558
|
+
* REST handlers immediately after
|
|
559
|
+
* {@link createAnnotation}/{@link updateAnnotation}/{@link deleteAnnotation}
|
|
560
|
+
* succeeds — the provider itself never calls this on its own.
|
|
560
561
|
*/
|
|
561
562
|
emitAnnotation?(traceId: string, op: AnnotationEventOp, annotation: Annotation): void;
|
|
562
563
|
}
|
|
@@ -4122,7 +4123,7 @@ declare function createLocalTursoClient({
|
|
|
4122
4123
|
* server. A test checks every column of `./schema.ts` is described here.
|
|
4123
4124
|
*/
|
|
4124
4125
|
/** The trace database's tables, described for someone writing SQL against them. */
|
|
4125
|
-
declare const TRACE_QUERY_SCHEMA = "-- Trace database (SQLite). Timestamps are milliseconds since the Unix epoch.\n-- Columns marked JSON hold JSON text; read into them with json_extract(),\n-- e.g. json_extract(llm_parameters, '$.temperature').\n\n-- One row per trace: a single run, e.g. one prompt execution.\nCREATE TABLE traces (\n id TEXT PRIMARY KEY,\n provider_id TEXT, -- the trace provider that recorded it\n name TEXT NOT NULL, -- usually the prompt's name\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT NOT NULL, -- 'running' | 'ok' | 'error'\n attributes TEXT -- JSON object of free-form attributes\n);\n\n-- One row per span. Spans form a tree per trace via parent_id.\nCREATE TABLE spans (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n parent_id TEXT, -- spans.id; NULL for the root span\n name TEXT NOT NULL,\n kind TEXT NOT NULL, -- 'LLM' | 'TOOL' | 'AGENT' | 'EMBEDDING' | 'CHECK' | 'DEFAULT'\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT, -- 'ok' | 'error'; NULL while running\n error_message TEXT,\n llm_provider TEXT, -- e.g. 'openai', 'anthropic'\n llm_model TEXT, -- e.g. 'gpt-4o'\n llm_finish_reason TEXT, -- e.g. 'stop', 'length', 'tool-calls'\n llm_prompt_tokens INTEGER, -- includes cache reads and writes\n llm_completion_tokens INTEGER,\n llm_total_tokens INTEGER,\n llm_cache_read_tokens INTEGER, -- of llm_prompt_tokens, read from a prompt cache\n llm_cache_write_tokens INTEGER, -- of llm_prompt_tokens, written to a prompt cache\n llm_cost_prompt REAL, -- USD, cache reads and writes included\n llm_cost_completion REAL, -- USD\n llm_cost_cache_read REAL, -- USD, the part of llm_cost_prompt spent on cache reads\n llm_cost_cache_write REAL, -- USD, the part of llm_cost_prompt spent on cache writes\n llm_input TEXT, -- JSON: an array of messages {role, content}, or any JSON object\n llm_output TEXT, -- JSON: always encoded, so a text output is a JSON string\n llm_parameters TEXT, -- JSON object of model parameters (temperature, ...)\n attributes TEXT, -- JSON object of free-form attributes; \"evalution.check\" is set on spans an eval check recorded while judging the trace (its CHECK span and everything under it), which aren't part of the run\n resource TEXT, -- JSON object: the OTel resource that produced the span (\"service.name\", \"deployment.environment.name\" = 'playground' for runs evalution made, ...)\n prompt TEXT, -- JSON {id, providerId?, version?, variation?, functionInputs?, executeInputs?, ...}: the prompt this span ran\n tool TEXT -- JSON {toolName, input, output?} for TOOL spans\n);\n\n-- Notes left on a trace, or on one span of it.\nCREATE TABLE annotations (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n span_id TEXT, -- spans.id; NULL for a note on the whole trace\n kind TEXT NOT NULL, -- 'issue' | 'good' | 'note'\n note TEXT NOT NULL,\n source TEXT NOT NULL, -- 'user' | 'claude-code' | 'codex' | 'agent'\n created_at REAL NOT NULL -- ms since epoch\n);\n";
|
|
4126
|
+
declare const TRACE_QUERY_SCHEMA = "-- Trace database (SQLite). Timestamps are milliseconds since the Unix epoch.\n-- Columns marked JSON hold JSON text; read into them with json_extract(),\n-- e.g. json_extract(llm_parameters, '$.temperature').\n\n-- One row per trace: a single run, e.g. one prompt execution.\nCREATE TABLE traces (\n id TEXT PRIMARY KEY,\n provider_id TEXT, -- the trace provider that recorded it\n name TEXT NOT NULL, -- usually the prompt's name\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT NOT NULL, -- 'running' | 'ok' | 'error'\n attributes TEXT -- JSON object of free-form attributes\n);\n\n-- One row per span. Spans form a tree per trace via parent_id.\nCREATE TABLE spans (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n parent_id TEXT, -- spans.id; NULL for the root span\n name TEXT NOT NULL,\n kind TEXT NOT NULL, -- 'LLM' | 'TOOL' | 'AGENT' | 'EMBEDDING' | 'CHECK' | 'DEFAULT'\n start_time REAL NOT NULL, -- ms since epoch\n end_time REAL, -- ms since epoch; NULL while running\n status TEXT, -- 'ok' | 'error'; NULL while running\n error_message TEXT,\n llm_provider TEXT, -- e.g. 'openai', 'anthropic'\n llm_model TEXT, -- e.g. 'gpt-4o'\n llm_finish_reason TEXT, -- e.g. 'stop', 'length', 'tool-calls'\n llm_prompt_tokens INTEGER, -- includes cache reads and writes\n llm_completion_tokens INTEGER,\n llm_total_tokens INTEGER,\n llm_cache_read_tokens INTEGER, -- of llm_prompt_tokens, read from a prompt cache\n llm_cache_write_tokens INTEGER, -- of llm_prompt_tokens, written to a prompt cache\n llm_cost_prompt REAL, -- USD, cache reads and writes included\n llm_cost_completion REAL, -- USD\n llm_cost_cache_read REAL, -- USD, the part of llm_cost_prompt spent on cache reads\n llm_cost_cache_write REAL, -- USD, the part of llm_cost_prompt spent on cache writes\n llm_input TEXT, -- JSON: an array of messages {role, content}, or any JSON object\n llm_output TEXT, -- JSON: always encoded, so a text output is a JSON string\n llm_reasoning TEXT, -- the model's reasoning for this turn, as plain text\n llm_parameters TEXT, -- JSON object of model parameters (temperature, ...)\n attributes TEXT, -- JSON object of free-form attributes; \"evalution.check\" is set on spans an eval check recorded while judging the trace (its CHECK span and everything under it), which aren't part of the run\n resource TEXT, -- JSON object: the OTel resource that produced the span (\"service.name\", \"deployment.environment.name\" = 'playground' for runs evalution made, ...)\n prompt TEXT, -- JSON {id, providerId?, version?, variation?, functionInputs?, executeInputs?, ...}: the prompt this span ran\n tool TEXT -- JSON {toolName, input, output?} for TOOL spans\n);\n\n-- Notes left on a trace, or on one span of it.\nCREATE TABLE annotations (\n id TEXT PRIMARY KEY,\n trace_id TEXT NOT NULL, -- traces.id\n span_id TEXT, -- spans.id; NULL for a note on the whole trace\n kind TEXT NOT NULL, -- 'issue' | 'good' | 'note'\n note TEXT NOT NULL,\n source TEXT NOT NULL, -- 'user' | 'claude-code' | 'codex' | 'agent'\n created_at REAL NOT NULL -- ms since epoch\n);\n";
|
|
4126
4127
|
//#endregion
|
|
4127
4128
|
//#region src/trace/http-trace-sink.d.ts
|
|
4128
4129
|
/**
|
|
@@ -4538,4 +4539,4 @@ declare class TursoTraceProvider extends BaseTraceProvider {
|
|
|
4538
4539
|
deleteAnnotation(id: string): Promise<void>;
|
|
4539
4540
|
}
|
|
4540
4541
|
//#endregion
|
|
4541
|
-
export { type AddPromptContext, type AddPromptField, type Annotation, type AnnotationChanges, type AnnotationEvent, type AnnotationEventOp, type AnnotationKind, type AnnotationSource, BaseTraceIngestor, BaseTraceProvider, CHECK_ATTRIBUTE, type CalleeBinding, type ChangeEventType, type ChatPromptUpdates, type Check, type CheckDefinition, type CheckInfo, type CheckOutcome, type CheckRun, type ColumnPath, type ConflictChoices, type CreateDatasetInput, DEFAULT_EVAL_CONCURRENCY, DEFAULT_MAX_QUERY_ROWS, DEFAULT_PLAYGROUND_IGNORE_PATTERNS, DEFAULT_PLAYGROUND_INCLUDE_PATTERNS, DEFAULT_QUERY_TIMEOUT_MS, DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, type Dataset, type DatasetChangeEvent, type DatasetChangeType, type DatasetColumnSpec, type DatasetField, type DatasetFieldShape, type DatasetInstanceShape, DatasetNotFoundError, type DatasetPathChild, type DatasetProvider, type DatasetProviderInfo, type DatasetRow, type DatasetRowSource, type DatasetRowUpdate, type DatasetRowsOverview, type DatasetSummary, DatasetValidationError, type DeclaredInstance, type DynamicResourceDefinition, type EvalArm, type EvalArmSpec, type EvalChangeEvent, type EvalChangeType, type EvalCheck, type EvalCheckOutcome, type EvalCheckResult, type EvalCounts, type EvalDefinition, type EvalDefinitionPatch, type EvalInputs, EvalNotFoundError, type EvalProvider, type EvalProviderInfo, type EvalResults, type EvalRowResult, type EvalRowStatus, type EvalRun, type EvalRunProgress, EvalRunRefusedError, type EvalRunStatus, type EvalRunSummary, EvalRunner, type EvalRunnerOptions, type EvalSummary, type EvalTraceRun, type EvalutionConfig, type ExecuteConfigOptions, type ExecuteOptions, type ExecuteRequest, type ExecuteResponse, type ExecuteResult, type ExecutionHandle, type ExecutionInput, type ExtractedProps, type FactoriesProbe, type FieldValues, type FilePromptMetadata, FilePromptProvider, type FilePromptProviderOptions, type FileProvider, type FileWatchCallback, type FileWatchOptions, type ForeignColumnSpec, GeminiInteractionsSDK, GitVersioning, type GitVersioningOptions, type GlobOptions, type HeadState, HttpTraceSink, type HttpTraceSinkOptions, type ImportOptions, type InputBindings, type InputLayout, type InputSignature, type InputSlot, type InputSource, type InstanceResolver, type KnownColumnSpec, type LLMSpanDetails, type ListRowsOptions, LocalDatabaseTraceProvider, type LocalDatabaseTraceProviderOptions, LocalDirectoryDatasetProvider, type LocalDirectoryDatasetProviderOptions, LocalEvalProvider, type LocalEvalProviderOptions, LocalFileProvider, type LocalTursoClientOptions, LocalVariationStore, MIGRATIONS_TABLE, MemoryFileProvider, MemoryTraceProvider, type MergeOutcome, type NewDatasetRow, type NewEvalDefinition, type NewEvalRun, type NewWip, type NormalizedChatPrompt, type NormalizedFilePrompt, type NormalizedMessage, type NormalizedOtlpEvent, type NormalizedOtlpSpan, type NormalizedParameter, type NormalizedPrompt, type NormalizedPromptBase, type NormalizedPromptUpdates, type NormalizedQuestionsPrompt, type NormalizedToolCall, OTelTraceIngestor, type OpenOnHeadOptions, OtlpTraceIngestor, OverlayFileProvider, PLAYGROUND_ENVIRONMENT, PLAYGROUND_RESOURCE, PROMPT_FIELD, PROMPT_IDENTITY, PROMPT_ID_ATTRIBUTE, PROMPT_INPUTS_ATTRIBUTE, PROMPT_NAME_ATTRIBUTE, PROMPT_PROVIDER_ID_ATTRIBUTE, PROMPT_VARIATION_ATTRIBUTE, PROMPT_VERSION_ATTRIBUTE, type ParsePromptsOptions, type ParsedFilePrompt, type ParsedPrompt, type PendingConflicts, type PerPromptTelemetry, type PerTraceTelemetry, type PlaygroundModuleError, type PreparedCheck, type ProbeResult, type ProbeResults, type ProjectProbeRequest, type PromptChangeEvent, type PromptFileType, type PromptID, type PromptInputSources, type PromptProvider, type PromptProviderInfo, type PromptRef, type PromptRefLike, type PromptSpanInfo, type PromptStyle, type PromptVariations, type PromptVersions, type PromptsFactory, type PromptsHelper, type PromptsHelperOptions, type PropDefinition, type PropType, type PropValue, type QuestionsPromptUpdates, type ReadOnlyQueryRunner, type RebaseResult, type RegisteredCheck, type RegisteredResource, type RegisteredSource, type ResolutionContext, type ResolvedPromptInputs, type ResolvedResourceInputs, type Resource, type ResourceBinding, type ResourceDefinition, type ResourceInfo, type ResourceInput, type ResourceInputs, type ResourceInstance, type ResourceInstanceInput, type ResourceLease, type ResourceOutputDefinition, ResourceRegistry, type ResourceScope, type RunResources, type SDKAdapter, SERVICE_NAME_ATTRIBUTE, SPAN_KIND_ATTRIBUTE, type SlotMatchRequest, type SlotMatchSource, type SourceSpan, type Span, type SpanContentPart, type SpanImagePart, type SpanKind, type SpanMessage, type SpanMessageRole, type SpanTextPart, type SpanToolCallPart, type SpanToolResultPart, SqlQueryError, type SqlQueryOptions, type SqlQueryResult, type StartEvalRunOptions, type StaticResourceDefinition, type StoredVariation, type SystemOneCallOptions, type SystemOneCallRecord, TRACE_EVENTS_PATH, TRACE_QUERY_SCHEMA, TSPromptFileType, type ToolSpanDetails, type Trace, type TraceChangeEvent, type TraceChangeType, type TraceCheckResult, type TraceEvalRun, TraceEventIngestor, type TraceEventsRequest, type TraceIngestor, type TraceLiveEvent, type TraceProvider, type TraceProviderInfo, type TraceSink, type TraceSinkEvent, type TraceStreamEvent, type TraceSummary, type TraceWithSpans, type TursoCreateDatasetOptions, TursoDatasetProvider, TursoEvalProvider, TursoTraceProvider, TursoVariationStore, type TypeExpressionProbe, type TypeProbe, type TypeProbeRequest, type TypeResolutionRequest, type TypeResolutionResult, TypeSafeSDK, type TypeSafeSDKOptions, TypeSafeTelemetry, type UpdatePromptResponse, type UpdatePromptResult, type ValueCatalog, type ValueCatalogGroup, type ValueCatalogPreset, type ValueFactory, type VariationConflict, VariationConflictError, type VariationContent, type VariationId, type VariationInfo, type VariationStore, VercelAISDK, VercelAISDKTelemetry, type VercelAISDKTelemetryOptions, type VersionHistoryOptions, type VersionId, type VersionInfo, type VersioningAdapter, type WipChanges, assertUpdateStyle, canonicalizeUpdates, check, collectInputSlots, createLocalTursoClient, createTracerForPrompt, decodeOtlpProtobuf, fieldValuesOf, findInputCycle, getPromptSpanAttributes, inputReferenceProblems, isCheck, isCheckSpan, isFreshImportHookRegistered, isResource, isStandardSchema, isValidInstanceName, isVariationLoaderHookRegistered, matchSourcesToSlots, mergeIntoWip, mergePromptIdentity, mergeSpans, mergeUpdates, namedBindings, normalizeOtlpRequest, openLocalEvalProvider, openLocalVariationStore, promptIdOf, rebaseUpdates, registerFreshImportHook, registerVariationLoaderHook, resolveConflicts, resolveExecutionInput, resolveExecutionInputs, resource, resourceParameterNames, runDatasetMigrations, runEvalMigrations, runMigrations, runVariationMigrations, serializeUpdates, setupGlobalOTelPipeline, spanMessages, stampReceipts, toPromptRef };
|
|
4542
|
+
export { type AddPromptContext, type AddPromptField, type Annotation, type AnnotationChanges, type AnnotationEvent, type AnnotationEventOp, type AnnotationKind, type AnnotationSource, BaseTraceIngestor, BaseTraceProvider, CHECK_ATTRIBUTE, type CalleeBinding, type ChangeEventType, type ChatPromptUpdates, type Check, type CheckDefinition, type CheckInfo, type CheckOutcome, type CheckRun, type ColumnPath, type ConflictChoices, type CreateDatasetInput, DEFAULT_EVAL_CONCURRENCY, DEFAULT_MAX_QUERY_ROWS, DEFAULT_PLAYGROUND_IGNORE_PATTERNS, DEFAULT_PLAYGROUND_INCLUDE_PATTERNS, DEFAULT_QUERY_TIMEOUT_MS, DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, type Dataset, type DatasetChangeEvent, type DatasetChangeType, type DatasetColumnSpec, type DatasetField, type DatasetFieldShape, type DatasetInstanceShape, DatasetNotFoundError, type DatasetPathChild, type DatasetProvider, type DatasetProviderInfo, type DatasetRow, type DatasetRowSource, type DatasetRowUpdate, type DatasetRowsOverview, type DatasetSummary, DatasetValidationError, type DeclaredInstance, type DynamicResourceDefinition, type EvalArm, type EvalArmSpec, type EvalChangeEvent, type EvalChangeType, type EvalCheck, type EvalCheckOutcome, type EvalCheckResult, type EvalCounts, type EvalDefinition, type EvalDefinitionPatch, type EvalInputs, EvalNotFoundError, type EvalProvider, type EvalProviderInfo, type EvalResults, type EvalRowResult, type EvalRowStatus, type EvalRun, type EvalRunProgress, EvalRunRefusedError, type EvalRunStatus, type EvalRunSummary, EvalRunner, type EvalRunnerOptions, type EvalSummary, type EvalTraceRun, type EvalutionConfig, type ExecuteConfigOptions, type ExecuteOptions, type ExecuteRequest, type ExecuteResponse, type ExecuteResult, type ExecutionHandle, type ExecutionInput, type ExtractedProps, type FactoriesProbe, type FieldValues, type FilePromptMetadata, FilePromptProvider, type FilePromptProviderOptions, type FileProvider, type FileWatchCallback, type FileWatchOptions, type ForeignColumnSpec, GeminiInteractionsSDK, GitVersioning, type GitVersioningOptions, type GlobOptions, type HeadState, HttpTraceSink, type HttpTraceSinkOptions, type ImportOptions, type InputBindings, type InputLayout, type InputSignature, type InputSlot, type InputSource, type InstanceResolver, type KnownColumnSpec, type LLMSpanDetails, type ListRowsOptions, LocalDatabaseTraceProvider, type LocalDatabaseTraceProviderOptions, LocalDirectoryDatasetProvider, type LocalDirectoryDatasetProviderOptions, LocalEvalProvider, type LocalEvalProviderOptions, LocalFileProvider, type LocalTursoClientOptions, LocalVariationStore, MIGRATIONS_TABLE, MemoryFileProvider, MemoryTraceProvider, type MergeOutcome, type NewDatasetRow, type NewEvalDefinition, type NewEvalRun, type NewWip, type NormalizedChatPrompt, type NormalizedFilePrompt, type NormalizedMessage, type NormalizedOtlpEvent, type NormalizedOtlpSpan, type NormalizedParameter, type NormalizedPrompt, type NormalizedPromptBase, type NormalizedPromptUpdates, type NormalizedQuestionsPrompt, type NormalizedToolCall, OTelTraceIngestor, type OpenOnHeadOptions, OtlpTraceIngestor, OverlayFileProvider, PLAYGROUND_ENVIRONMENT, PLAYGROUND_RESOURCE, PROMPT_FIELD, PROMPT_IDENTITY, PROMPT_ID_ATTRIBUTE, PROMPT_INPUTS_ATTRIBUTE, PROMPT_NAME_ATTRIBUTE, PROMPT_PROVIDER_ID_ATTRIBUTE, PROMPT_VARIATION_ATTRIBUTE, PROMPT_VERSION_ATTRIBUTE, type ParsePromptsOptions, type ParsedFilePrompt, type ParsedPrompt, type PendingConflicts, type PerPromptTelemetry, type PerTraceTelemetry, type PlaygroundModuleError, type PreparedCheck, type ProbeResult, type ProbeResults, type ProjectProbeRequest, type PromptChangeEvent, type PromptFileType, type PromptID, type PromptInputSources, type PromptProvider, type PromptProviderInfo, type PromptRef, type PromptRefLike, type PromptSpanInfo, type PromptStyle, type PromptVariations, type PromptVersions, type PromptsFactory, type PromptsHelper, type PromptsHelperOptions, type PropDefinition, type PropType, type PropValue, type QuestionsPromptUpdates, type ReadOnlyQueryRunner, type RebaseResult, type RegisteredCheck, type RegisteredResource, type RegisteredSource, type ResolutionContext, type ResolvedPromptInputs, type ResolvedResourceInputs, type Resource, type ResourceBinding, type ResourceDefinition, type ResourceInfo, type ResourceInput, type ResourceInputs, type ResourceInstance, type ResourceInstanceInput, type ResourceLease, type ResourceOutputDefinition, ResourceRegistry, type ResourceScope, type RunResources, type SDKAdapter, SERVICE_NAME_ATTRIBUTE, SPAN_KIND_ATTRIBUTE, type SlotMatchRequest, type SlotMatchSource, type SourceSpan, type Span, type SpanContentPart, type SpanImagePart, type SpanKind, type SpanMessage, type SpanMessageRole, type SpanReasoningPart, type SpanTextPart, type SpanToolCallPart, type SpanToolResultPart, SqlQueryError, type SqlQueryOptions, type SqlQueryResult, type StartEvalRunOptions, type StaticResourceDefinition, type StoredVariation, type SystemOneCallOptions, type SystemOneCallRecord, TRACE_EVENTS_PATH, TRACE_QUERY_SCHEMA, TSPromptFileType, type ToolSpanDetails, type Trace, type TraceChangeEvent, type TraceChangeType, type TraceCheckResult, type TraceEvalRun, TraceEventIngestor, type TraceEventsRequest, type TraceIngestor, type TraceLiveEvent, type TraceProvider, type TraceProviderInfo, type TraceSink, type TraceSinkEvent, type TraceStreamEvent, type TraceSummary, type TraceWithSpans, type TursoCreateDatasetOptions, TursoDatasetProvider, TursoEvalProvider, TursoTraceProvider, TursoVariationStore, type TypeExpressionProbe, type TypeProbe, type TypeProbeRequest, type TypeResolutionRequest, type TypeResolutionResult, TypeSafeSDK, type TypeSafeSDKOptions, TypeSafeTelemetry, type UpdatePromptResponse, type UpdatePromptResult, type ValueCatalog, type ValueCatalogGroup, type ValueCatalogPreset, type ValueFactory, type VariationConflict, VariationConflictError, type VariationContent, type VariationId, type VariationInfo, type VariationStore, VercelAISDK, VercelAISDKTelemetry, type VercelAISDKTelemetryOptions, type VersionHistoryOptions, type VersionId, type VersionInfo, type VersioningAdapter, type WipChanges, assertUpdateStyle, canonicalizeUpdates, check, collectInputSlots, createLocalTursoClient, createTracerForPrompt, decodeOtlpProtobuf, fieldValuesOf, findInputCycle, getPromptSpanAttributes, inputReferenceProblems, isCheck, isCheckSpan, isFreshImportHookRegistered, isResource, isStandardSchema, isValidInstanceName, isVariationLoaderHookRegistered, matchSourcesToSlots, mergeIntoWip, mergePromptIdentity, mergeSpans, mergeUpdates, namedBindings, normalizeOtlpRequest, openLocalEvalProvider, openLocalVariationStore, promptIdOf, rebaseUpdates, registerFreshImportHook, registerVariationLoaderHook, resolveConflicts, resolveExecutionInput, resolveExecutionInputs, resource, resourceParameterNames, runDatasetMigrations, runEvalMigrations, runMigrations, runVariationMigrations, serializeUpdates, setupGlobalOTelPipeline, spanMessages, stampReceipts, toPromptRef };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as SPAN_KIND_ATTRIBUTE, A as DEFAULT_QUERY_TIMEOUT_MS, B as DEFAULT_EVAL_CONCURRENCY, Bt as SERVICE_NAME_ATTRIBUTE, C as VariationConflictError, Ct as VercelAISDKTelemetry, D as normalizeOtlpRequest, Dt as OTelTraceIngestor, E as decodeOtlpProtobuf, Et as setupGlobalOTelPipeline, Ft as BaseTraceIngestor, Gt as isMissingPackage, H as EvalRunner, Ht as spanMessages, It as PLAYGROUND_RESOURCE, Jt as PROMPT_INPUTS_ATTRIBUTE, Kt as missingPackageMessage, Lt as CHECK_ATTRIBUTE, Mt as TypeSafeSDK, Nt as PROMPT_IDENTITY, O as EvalNotFoundError, Ot as isEditable, Pt as TypeSafeTelemetry, Qt as PROMPT_VERSION_ATTRIBUTE, R as DatasetNotFoundError, Rt as DEPLOYMENT_ENVIRONMENT_ATTRIBUTE, St as resource, T as toPromptRef, Tt as TRACE_EVENTS_PATH, Ut as assertUpdateStyle, V as EvalRunRefusedError, Vt as isCheckSpan, Wt as findPackageDts, Xt as PROMPT_PROVIDER_ID_ATTRIBUTE, Yt as PROMPT_NAME_ATTRIBUTE, Zt as PROMPT_VARIATION_ATTRIBUTE, _ as runMigrations, _t as resourceParameterNames, a as mergeSpans, an as LocalFileProvider, at as resolveExecutionInput, b as mkdirSelfIgnoring, bt as isResource, c as TRACE_QUERY_SCHEMA, cn as isFreshImportHookRegistered, ct as collectInputSlots, d as TursoEvalProvider, en as createTracerForPrompt, f as runEvalMigrations, ft as namedBindings, g as MIGRATIONS_TABLE, gt as parameterDetails, h as runDatasetMigrations, ht as ResourceRegistry, i as TursoTraceProvider, it as matchSourcesToSlots, j as SqlQueryError, jt as shortId, k as DEFAULT_MAX_QUERY_ROWS, l as LocalEvalProvider, ln as registerFreshImportHook, lt as findInputCycle, m as TursoDatasetProvider, mt as DEFAULT_PLAYGROUND_INCLUDE_PATTERNS, n as OtlpTraceIngestor, nn as mergePromptIdentity, o as BaseTraceProvider, on as isVariationLoaderHookRegistered, ot as resolveExecutionInputs, p as LocalDirectoryDatasetProvider, pt as DEFAULT_PLAYGROUND_IGNORE_PATTERNS, qt as PROMPT_ID_ATTRIBUTE, r as LocalDatabaseTraceProvider, sn as registerVariationLoaderHook, st as stampReceipts, t as TraceEventIngestor, tn as getPromptSpanAttributes, u as openLocalEvalProvider, ut as inputReferenceProblems, v as assertSqliteFile, vt as isValidInstanceName, w as promptIdOf, wt as HttpTraceSink, x as rollupSpans, xt as isStandardSchema, y as createLocalTursoClient, yt as VercelAISDK, z as DatasetValidationError, zt as PLAYGROUND_ENVIRONMENT } from "./trace-event-ingestor-BghQcCHe.js";
|
|
2
2
|
import { _ as isCheck, g as check, n as builtinCheck, r as builtinCheckInfos } from "./checks-Cq97JU-h.js";
|
|
3
3
|
import "node:module";
|
|
4
4
|
import path, { dirname } from "node:path";
|
|
@@ -2383,6 +2383,20 @@ function isDefinition(result) {
|
|
|
2383
2383
|
return !!result && !Array.isArray(result);
|
|
2384
2384
|
}
|
|
2385
2385
|
/**
|
|
2386
|
+
* A declared argument's definition: its probe's answer, or the unresolved
|
|
2387
|
+
* fallback, with what its schema says added — the probe sees an output type
|
|
2388
|
+
* alone, which can't say whether it can be left out, or what it's for.
|
|
2389
|
+
*/
|
|
2390
|
+
function parameterDefinition(name, result, details) {
|
|
2391
|
+
const definition = isDefinition(result) ? result : unresolvedParameter(name);
|
|
2392
|
+
const { optional = false, description } = details.get(name) ?? {};
|
|
2393
|
+
return {
|
|
2394
|
+
...definition,
|
|
2395
|
+
optional,
|
|
2396
|
+
...description && { description }
|
|
2397
|
+
};
|
|
2398
|
+
}
|
|
2399
|
+
/**
|
|
2386
2400
|
* A file type's slot-match answer (slot path → source uris) turned around into
|
|
2387
2401
|
* source uri → the slot paths it fits, or `undefined` when there is none.
|
|
2388
2402
|
*/
|
|
@@ -2749,9 +2763,11 @@ var FilePromptProvider = class {
|
|
|
2749
2763
|
const names = resourceParameterNames(resource.resource);
|
|
2750
2764
|
if (names.length === 0) continue;
|
|
2751
2765
|
const candidates = (await this.resources.inScopeFor(resource.modulePath)).filter((s) => !dependsOn(s.resource, resource, byResource));
|
|
2766
|
+
const details = await parameterDetails(resource.resource);
|
|
2752
2767
|
withParams.push({
|
|
2753
2768
|
resource,
|
|
2754
2769
|
names,
|
|
2770
|
+
details,
|
|
2755
2771
|
candidates
|
|
2756
2772
|
});
|
|
2757
2773
|
}
|
|
@@ -2833,13 +2849,10 @@ var FilePromptProvider = class {
|
|
|
2833
2849
|
*/
|
|
2834
2850
|
assembleResourceParameters(withParams, resolved) {
|
|
2835
2851
|
let cursor = 0;
|
|
2836
|
-
return new Map(withParams.map(({ resource, names }) => {
|
|
2852
|
+
return new Map(withParams.map(({ resource, names, details }) => {
|
|
2837
2853
|
const start = cursor;
|
|
2838
2854
|
cursor += names.length;
|
|
2839
|
-
return [resource.uri, names.map((name, j) =>
|
|
2840
|
-
const result = resolved?.[start + j];
|
|
2841
|
-
return isDefinition(result) ? result : unresolvedParameter(name);
|
|
2842
|
-
})];
|
|
2855
|
+
return [resource.uri, names.map((name, j) => parameterDefinition(name, resolved?.[start + j], details))];
|
|
2843
2856
|
}));
|
|
2844
2857
|
}
|
|
2845
2858
|
/**
|
|
@@ -3040,8 +3053,9 @@ var FilePromptProvider = class {
|
|
|
3040
3053
|
promptName: c.key
|
|
3041
3054
|
})));
|
|
3042
3055
|
const resolved = requests.length > 0 ? await this.resolveTypes(requests, []) : {};
|
|
3056
|
+
const details = await Promise.all(withNames.map(({ registered: c }) => parameterDetails(c.check)));
|
|
3043
3057
|
let cursor = 0;
|
|
3044
|
-
const user = withNames.map(({ registered: c, names }) => {
|
|
3058
|
+
const user = withNames.map(({ registered: c, names }, i) => {
|
|
3045
3059
|
const start = cursor;
|
|
3046
3060
|
cursor += names.length;
|
|
3047
3061
|
return {
|
|
@@ -3050,10 +3064,7 @@ var FilePromptProvider = class {
|
|
|
3050
3064
|
...c.check.group && { group: c.check.group },
|
|
3051
3065
|
...c.check.description && { description: c.check.description },
|
|
3052
3066
|
...c.check.runsOnError && { runsOnError: true },
|
|
3053
|
-
parameters: names.map((name, j) =>
|
|
3054
|
-
const result = resolved.probes?.[start + j];
|
|
3055
|
-
return isDefinition(result) ? result : unresolvedParameter(name);
|
|
3056
|
-
})
|
|
3067
|
+
parameters: names.map((name, j) => parameterDefinition(name, resolved.probes?.[start + j], details[i]))
|
|
3057
3068
|
};
|
|
3058
3069
|
});
|
|
3059
3070
|
return [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DatasetRowsOverview, n as DatasetRow, r as DatasetRowUpdate, t as Dataset, x as TraceWithSpans } from "./dataset-types-
|
|
1
|
+
import { i as DatasetRowsOverview, n as DatasetRow, r as DatasetRowUpdate, t as Dataset, x as TraceWithSpans } from "./dataset-types-Dqi5vVg-.js";
|
|
2
2
|
|
|
3
3
|
//#region src/views/view.d.ts
|
|
4
4
|
/** What every view is given, whatever its surface. */
|