@seldonqa/cli 0.2.1 → 0.2.3
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/bin.js +46 -45
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createHash as xo}from"crypto";import{mkdir as So,readFile as Ti,writeFile as Co}from"fs/promises";import{homedir as _o,tmpdir as Io}from"os";import{join as Di}from"path";import{execFileSync as Ro}from"child_process";import{readdir as Eo,readFile as Ui,stat as ji}from"fs/promises";import{join as qi,relative as Oo,sep as Ri}from"path";import{createRequire as Nr}from"module";var Fr=Nr("/"),$e,Dr,Pr;try{$e=Fr("worker_threads"),Dr=$e.Worker,Pr=$e.isMarkedAsUntransferable}catch{}var ue=Uint8Array,ve=Uint16Array,Sn=Int32Array,Cn=new ue([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_n=new ue([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),St=new ue([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Et=function(n,t){for(var i=new ve(31),r=0;r<31;++r)i[r]=t+=1<<n[r-1];for(var o=new Sn(i[30]),r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)o[s]=s-i[r]<<5|r;return{b:i,r:o}},$e=Et(Cn,2),Br=$e.b,wn=$e.r;Br[28]=258,wn[258]=28;var Ot=Et(_n,0),Na=Ot.b,Ct=Ot.r,bn=new ve(32768);for(G=0;G<32768;++G)Ce=(G&43690)>>1|(G&21845)<<1,Ce=(Ce&52428)>>2|(Ce&13107)<<2,Ce=(Ce&61680)>>4|(Ce&3855)<<4,bn[G]=((Ce&65280)>>8|(Ce&255)<<8)>>1;var Ce,G,Be=(function(n,t,i){for(var r=n.length,o=0,s=new ve(t);o<r;++o)n[o]&&++s[n[o]-1];var l=new ve(t);for(o=1;o<t;++o)l[o]=l[o-1]+s[o-1]<<1;var c;if(i){c=new ve(1<<t);var p=15-t;for(o=0;o<r;++o)if(n[o])for(var u=o<<4|n[o],f=t-n[o],m=l[n[o]-1]++<<f,g=m|(1<<f)-1;m<=g;++m)c[bn[m]>>p]=u}else for(c=new ve(r),o=0;o<r;++o)n[o]&&(c[o]=bn[l[n[o]-1]++]>>15-n[o]);return c}),Le=new ue(288);for(G=0;G<144;++G)Le[G]=8;var G;for(G=144;G<256;++G)Le[G]=9;var G;for(G=256;G<280;++G)Le[G]=7;var G;for(G=280;G<288;++G)Le[G]=8;var G,Ze=new ue(32);for(G=0;G<32;++G)Ze[G]=5;var G,Ur=Be(Le,9,0);var jr=Be(Ze,5,0);var Lt=function(n){return(n+7)/8|0},Mt=function(n,t,i){return(t==null||t<0)&&(t=0),(i==null||i>n.length)&&(i=n.length),new ue(n.subarray(t,i))};var qr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xe=function(n,t,i){var r=new Error(t||qr[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Xe),!i)throw r;return r};var _e=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8},De=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8,n[r+2]|=i>>16},yn=function(n,t){for(var i=[],r=0;r<n.length;++r)n[r]&&i.push({s:r,f:n[r]});var o=i.length,s=i.slice();if(!o)return{t:Nt,l:0};if(o==1){var l=new ue(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function(X,oe){return X.f-oe.f}),i.push({s:-1,f:25001});var c=i[0],p=i[1],u=0,f=1,m=2;for(i[0]={s:-1,f:c.f+p.f,l:c,r:p};f!=o-1;)c=i[i[u].f<i[m].f?u++:m++],p=i[u!=f&&i[u].f<i[m].f?u++:m++],i[f++]={s:-1,f:c.f+p.f,l:c,r:p};for(var g=s[0].s,r=1;r<o;++r)s[r].s>g&&(g=s[r].s);var T=new ve(g+1),D=An(i[f-1],T,0);if(D>t){var r=0,R=0,j=D-t,ne=1<<j;for(s.sort(function(oe,te){return T[te.s]-T[oe.s]||oe.f-te.f});r<o;++r){var W=s[r].s;if(T[W]>t)R+=ne-(1<<D-T[W]),T[W]=t;else break}for(R>>=j;R>0;){var V=s[r].s;T[V]<t?R-=1<<t-T[V]++-1:++r}for(;r>=0&&R;--r){var z=s[r].s;T[z]==t&&(--T[z],++R)}D=t}return{t:new ue(T),l:D}},An=function(n,t,i){return n.s==-1?Math.max(An(n.l,t,i+1),An(n.r,t,i+1)):t[n.s]=i},_t=function(n){for(var t=n.length;t&&!n[--t];);for(var i=new ve(++t),r=0,o=n[0],s=1,l=function(p){i[r++]=p},c=1;c<=t;++c)if(n[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=n[c]}return{c:i.subarray(0,r),n:t}},Pe=function(n,t){for(var i=0,r=0;r<t.length;++r)i+=n[r]*t[r];return i},$t=function(n,t,i){var r=i.length,o=Lt(t+2);n[o]=r&255,n[o+1]=r>>8,n[o+2]=n[o]^255,n[o+3]=n[o+1]^255;for(var s=0;s<r;++s)n[o+s+4]=i[s];return(o+4+r)*8},It=function(n,t,i,r,o,s,l,c,p,u,f){_e(t,f++,i),++o[256];for(var m=yn(o,15),g=m.t,T=m.l,D=yn(s,15),R=D.t,j=D.l,ne=_t(g),W=ne.c,V=ne.n,z=_t(R),X=z.c,oe=z.n,te=new ve(19),Y=0;Y<W.length;++Y)++te[W[Y]&31];for(var Y=0;Y<X.length;++Y)++te[X[Y]&31];for(var U=yn(te,7),ae=U.t,he=U.l,re=19;re>4&&!ae[St[re-1]];--re);var me=u+5<<3,H=Pe(o,Le)+Pe(s,Ze)+l,se=Pe(o,g)+Pe(s,R)+l+14+3*re+Pe(te,ae)+2*te[16]+3*te[17]+7*te[18];if(p>=0&&me<=H&&me<=se)return $t(t,f,n.subarray(p,p+u));var E,J,w,k;if(_e(t,f,1+(se<H)),f+=2,se<H){E=Be(g,T,0),J=g,w=Be(R,j,0),k=R;var L=Be(ae,he,0);_e(t,f,V-257),_e(t,f+5,oe-1),_e(t,f+10,re-4),f+=14;for(var Y=0;Y<re;++Y)_e(t,f+3*Y,ae[St[Y]]);f+=3*re;for(var B=[W,X],q=0;q<2;++q)for(var F=B[q],Y=0;Y<F.length;++Y){var Q=F[Y]&31;_e(t,f,L[Q]),f+=ae[Q],Q>15&&(_e(t,f,F[Y]>>5&127),f+=F[Y]>>12)}}else E=Ur,J=Le,w=jr,k=Ze;for(var Y=0;Y<c;++Y){var $=r[Y];if($>255){var Q=$>>18&31;De(t,f,E[Q+257]),f+=J[Q+257],Q>7&&(_e(t,f,$>>23&31),f+=Cn[Q]);var Z=$&31;De(t,f,w[Z]),f+=k[Z],Z>3&&(De(t,f,$>>5&8191),f+=_n[Z])}else De(t,f,E[$]),f+=J[$]}return De(t,f,E[256]),f+J[256]},Yr=new Sn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Nt=new ue(0),zr=function(n,t,i,r,o,s){var l=s.z||n.length,c=new ue(r+l+5*(1+Math.ceil(l/7e3))+o),p=c.subarray(r,c.length-o),u=s.l,f=(s.r||0)&7;if(t){f&&(p[0]=s.r>>3);for(var m=Yr[t-1],g=m>>13,T=m&8191,D=(1<<i)-1,R=s.p||new ve(32768),j=s.h||new ve(D+1),ne=Math.ceil(i/3),W=2*ne,V=function(Ae){return(n[Ae]^n[Ae+1]<<ne^n[Ae+2]<<W)&D},z=new Sn(25e3),X=new ve(288),oe=new ve(32),te=0,Y=0,U=s.i||0,ae=0,he=s.w||0,re=0;U+2<l;++U){var me=V(U),H=U&32767,se=j[me];if(R[H]=se,j[me]=H,he<=U){var E=l-U;if((te>7e3||ae>24576)&&(E>423||!u)){f=It(n,p,0,z,X,oe,Y,ae,re,U-re,f),ae=te=Y=0,re=U;for(var J=0;J<286;++J)X[J]=0;for(var J=0;J<30;++J)oe[J]=0}var w=2,k=0,L=T,B=H-se&32767;if(E>2&&me==V(U-B))for(var q=Math.min(g,E)-1,F=Math.min(32767,U),Q=Math.min(258,E);B<=F&&--L&&H!=se;){if(n[U+w]==n[U+w-B]){for(var $=0;$<Q&&n[U+$]==n[U+$-B];++$);if($>w){if(w=$,k=B,$>q)break;for(var Z=Math.min(B,$-2),pe=0,J=0;J<Z;++J){var we=U-B+J&32767,ie=R[we],be=we-ie&32767;be>pe&&(pe=be,se=we)}}}H=se,se=R[H],B+=H-se&32767}if(k){z[ae++]=268435456|wn[w]<<18|Ct[k];var ye=wn[w]&31,Oe=Ct[k]&31;Y+=Cn[ye]+_n[Oe],++X[257+ye],++oe[Oe],he=U+w,++te}else z[ae++]=n[U],++X[n[U]]}}for(U=Math.max(U,he);U<l;++U)z[ae++]=n[U],++X[n[U]];f=It(n,p,u,z,X,oe,Y,ae,re,U-re,f),u||(s.r=f&7|p[f/8|0]<<3,f-=7,s.h=j,s.p=R,s.i=U,s.w=he)}else{for(var U=s.w||0;U<l+u;U+=65535){var ke=U+65535;ke>=l&&(p[f/8|0]=u,ke=l),f=$t(p,f+1,n.subarray(U,ke))}s.i=l}return Mt(c,0,r+Lt(f)+o)},Kr=(function(){for(var n=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(i&1&&-306674912)^i>>>1;n[t]=i}return n})(),Hr=function(){var n=-1;return{p:function(t){for(var i=n,r=0;r<t.length;++r)i=Kr[i&255^t[r]]^i>>>8;n=i},d:function(){return~n}}};var Gr=function(n,t,i,r,o){if(!o&&(o={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new ue(s.length+n.length);l.set(s),l.set(n,s.length),n=l,o.w=s.length}return zr(n,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+t.mem,i,r,o)},Ft=function(n,t){var i={};for(var r in n)i[r]=n[r];for(var r in t)i[r]=t[r];return i};var le=function(n,t,i){for(;i;++t)n[t]=i,i>>>=8};function Wr(n,t){return Gr(n,t||{},0,0)}var Dt=function(n,t,i,r){for(var o in n){var s=n[o],l=t+o,c=r;Array.isArray(s)&&(c=Ft(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?i[l]=[s,c]:(i[l+="/"]=[new ue(0),c],Dt(s,l,i,r))}},kt=typeof TextEncoder<"u"&&new TextEncoder,Qr=typeof TextDecoder<"u"&&new TextDecoder,Vr=0;try{Qr.decode(Nt,{stream:!0}),Vr=1}catch{}function Tt(n,t){if(t){for(var i=new ue(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}if(kt)return kt.encode(n);for(var o=n.length,s=new ue(n.length+(n.length>>1)),l=0,c=function(f){s[l++]=f},r=0;r<o;++r){if(l+5>s.length){var p=new ue(l+8+(o-r<<1));p.set(s),s=p}var u=n.charCodeAt(r);u<128||t?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|n.charCodeAt(++r)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return Mt(s,0,l)}var xn=function(n){var t=0;if(n)for(var i in n){var r=n[i].length;r>65535&&Xe(9),t+=r+4}return t},Rt=function(n,t,i,r,o,s,l,c){var p=r.length,u=i.extra,f=c&&c.length,m=xn(u);le(n,t,l!=null?33639248:67324752),t+=4,l!=null&&(n[t++]=20,n[t++]=i.os),n[t]=20,t+=2,n[t++]=i.flag<<1|(s<0&&8),n[t++]=o&&8,n[t++]=i.compression&255,n[t++]=i.compression>>8;var g=new Date(i.mtime==null?Date.now():i.mtime),T=g.getFullYear()-1980;if((T<0||T>119)&&Xe(10),le(n,t,T<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),t+=4,s!=-1&&(le(n,t,i.crc),le(n,t+4,s<0?-s-2:s),le(n,t+8,i.size)),le(n,t+12,p),le(n,t+14,m),t+=16,l!=null&&(le(n,t,f),le(n,t+6,i.attrs),le(n,t+10,l),t+=14),n.set(r,t),t+=p,m)for(var D in u){var R=u[D],j=R.length;le(n,t,+D),le(n,t+2,j),n.set(R,t+4),t+=4+j}return f&&(n.set(c,t),t+=f),t},Jr=function(n,t,i,r,o){le(n,t,101010256),le(n,t+8,i),le(n,t+10,i),le(n,t+12,r),le(n,t+16,o)};function In(n,t){t||(t={});var i={},r=[];Dt(n,"",i,t);var o=0,s=0;for(var l in i){var c=i[l],p=c[0],u=c[1],f=u.level==0?0:8,m=Tt(l),g=m.length,T=u.comment,D=T&&Tt(T),R=D&&D.length,j=xn(u.extra);g>65535&&Xe(11);var ne=f?Wr(p,u):p,W=ne.length,V=Hr();V.p(p),r.push(Ft(u,{size:p.length,crc:V.d(),c:ne,f:m,m:D,u:g!=l.length||D&&T.length!=R,o,compression:f})),o+=30+g+j+W,s+=76+2*(g+j)+(R||0)+W}for(var z=new ue(s+22),X=o,oe=s-o,te=0;te<r.length;++te){var m=r[te];Rt(z,m.o,m,m.f,m.u,m.c.length);var Y=30+m.f.length+xn(m.extra);z.set(m.c,m.o+Y),Rt(z,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+Y+(m.m?m.m.length:0)}return Jr(z,o,r.length,oe,X),z}import{readFileSync as hr,writeFileSync as Jo}from"fs";import{join as Zo,resolve as Xo}from"path";function Zr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fe={},en={},Te={},Pt;function Ue(){if(Pt)return Te;Pt=1;function n(l){return typeof l>"u"||l===null}function t(l){return typeof l=="object"&&l!==null}function i(l){return Array.isArray(l)?l:n(l)?[]:[l]}function r(l,c){if(c){let p=Object.keys(c);for(let u=0,f=p.length;u<f;u+=1){let m=p[u];l[m]=c[m]}}return l}function o(l,c){let p="";for(let u=0;u<c;u+=1)p+=l;return p}function s(l){return l===0&&Number.NEGATIVE_INFINITY===1/l}return Te.isNothing=n,Te.isObject=t,Te.toArray=i,Te.repeat=o,Te.isNegativeZero=s,Te.extend=r,Te}var kn,Bt;function je(){if(Bt)return kn;Bt=1;function n(i,r){let o="",s=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(o+='in "'+i.mark.name+'" '),o+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!r&&i.mark.snippet&&(o+=`
|
|
2
|
+
import{createHash as So}from"crypto";import{mkdir as Co,readFile as Ri,writeFile as _o}from"fs/promises";import{homedir as Io,tmpdir as ko}from"os";import{join as Pi}from"path";import{execFileSync as Eo}from"child_process";import{readdir as Oo,readFile as ji,stat as qi}from"fs/promises";import{join as Yi,relative as Lo,sep as Ei}from"path";import{createRequire as Fr}from"module";var Dr=Fr("/"),$e,Pr,Br;try{$e=Dr("worker_threads"),Pr=$e.Worker,Br=$e.isMarkedAsUntransferable}catch{}var fe=Uint8Array,ye=Uint16Array,Sn=Int32Array,Cn=new fe([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_n=new fe([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ot=function(n,t){for(var i=new ye(31),r=0;r<31;++r)i[r]=t+=1<<n[r-1];for(var o=new Sn(i[30]),r=1;r<30;++r)for(var s=i[r];s<i[r+1];++s)o[s]=s-i[r]<<5|r;return{b:i,r:o}},$e=Ot(Cn,2),Ur=$e.b,wn=$e.r;Ur[28]=258,wn[258]=28;var Lt=Ot(_n,0),Da=Lt.b,_t=Lt.r,bn=new ye(32768);for(G=0;G<32768;++G)Ce=(G&43690)>>1|(G&21845)<<1,Ce=(Ce&52428)>>2|(Ce&13107)<<2,Ce=(Ce&61680)>>4|(Ce&3855)<<4,bn[G]=((Ce&65280)>>8|(Ce&255)<<8)>>1;var Ce,G,Be=(function(n,t,i){for(var r=n.length,o=0,s=new ye(t);o<r;++o)n[o]&&++s[n[o]-1];var l=new ye(t);for(o=1;o<t;++o)l[o]=l[o-1]+s[o-1]<<1;var c;if(i){c=new ye(1<<t);var p=15-t;for(o=0;o<r;++o)if(n[o])for(var u=o<<4|n[o],f=t-n[o],m=l[n[o]-1]++<<f,g=m|(1<<f)-1;m<=g;++m)c[bn[m]>>p]=u}else for(c=new ye(r),o=0;o<r;++o)n[o]&&(c[o]=bn[l[n[o]-1]++]>>15-n[o]);return c}),Le=new fe(288);for(G=0;G<144;++G)Le[G]=8;var G;for(G=144;G<256;++G)Le[G]=9;var G;for(G=256;G<280;++G)Le[G]=7;var G;for(G=280;G<288;++G)Le[G]=8;var G,Ze=new fe(32);for(G=0;G<32;++G)Ze[G]=5;var G,jr=Be(Le,9,0);var qr=Be(Ze,5,0);var Mt=function(n){return(n+7)/8|0},$t=function(n,t,i){return(t==null||t<0)&&(t=0),(i==null||i>n.length)&&(i=n.length),new fe(n.subarray(t,i))};var Yr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Xe=function(n,t,i){var r=new Error(t||Yr[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,Xe),!i)throw r;return r};var _e=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8},De=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8,n[r+2]|=i>>16},yn=function(n,t){for(var i=[],r=0;r<n.length;++r)n[r]&&i.push({s:r,f:n[r]});var o=i.length,s=i.slice();if(!o)return{t:Ft,l:0};if(o==1){var l=new fe(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function(X,ae){return X.f-ae.f}),i.push({s:-1,f:25001});var c=i[0],p=i[1],u=0,f=1,m=2;for(i[0]={s:-1,f:c.f+p.f,l:c,r:p};f!=o-1;)c=i[i[u].f<i[m].f?u++:m++],p=i[u!=f&&i[u].f<i[m].f?u++:m++],i[f++]={s:-1,f:c.f+p.f,l:c,r:p};for(var g=s[0].s,r=1;r<o;++r)s[r].s>g&&(g=s[r].s);var T=new ye(g+1),F=xn(i[f-1],T,0);if(F>t){var r=0,R=0,q=F-t,ne=1<<q;for(s.sort(function(ae,te){return T[te.s]-T[ae.s]||ae.f-te.f});r<o;++r){var W=s[r].s;if(T[W]>t)R+=ne-(1<<F-T[W]),T[W]=t;else break}for(R>>=q;R>0;){var V=s[r].s;T[V]<t?R-=1<<t-T[V]++-1:++r}for(;r>=0&&R;--r){var z=s[r].s;T[z]==t&&(--T[z],++R)}F=t}return{t:new fe(T),l:F}},xn=function(n,t,i){return n.s==-1?Math.max(xn(n.l,t,i+1),xn(n.r,t,i+1)):t[n.s]=i},It=function(n){for(var t=n.length;t&&!n[--t];);for(var i=new ye(++t),r=0,o=n[0],s=1,l=function(p){i[r++]=p},c=1;c<=t;++c)if(n[c]==o&&c!=t)++s;else{if(!o&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(o),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(o);s=1,o=n[c]}return{c:i.subarray(0,r),n:t}},Pe=function(n,t){for(var i=0,r=0;r<t.length;++r)i+=n[r]*t[r];return i},Nt=function(n,t,i){var r=i.length,o=Mt(t+2);n[o]=r&255,n[o+1]=r>>8,n[o+2]=n[o]^255,n[o+3]=n[o+1]^255;for(var s=0;s<r;++s)n[o+s+4]=i[s];return(o+4+r)*8},kt=function(n,t,i,r,o,s,l,c,p,u,f){_e(t,f++,i),++o[256];for(var m=yn(o,15),g=m.t,T=m.l,F=yn(s,15),R=F.t,q=F.l,ne=It(g),W=ne.c,V=ne.n,z=It(R),X=z.c,ae=z.n,te=new ye(19),Y=0;Y<W.length;++Y)++te[W[Y]&31];for(var Y=0;Y<X.length;++Y)++te[X[Y]&31];for(var U=yn(te,7),se=U.t,me=U.l,oe=19;oe>4&&!se[Ct[oe-1]];--oe);var ge=u+5<<3,H=Pe(o,Le)+Pe(s,Ze)+l,le=Pe(o,g)+Pe(s,R)+l+14+3*oe+Pe(te,se)+2*te[16]+3*te[17]+7*te[18];if(p>=0&&ge<=H&&ge<=le)return Nt(t,f,n.subarray(p,p+u));var E,Z,ie,de;if(_e(t,f,1+(le<H)),f+=2,le<H){E=Be(g,T,0),Z=g,ie=Be(R,q,0),de=R;var b=Be(se,me,0);_e(t,f,V-257),_e(t,f+5,ae-1),_e(t,f+10,oe-4),f+=14;for(var Y=0;Y<oe;++Y)_e(t,f+3*Y,se[Ct[Y]]);f+=3*oe;for(var I=[W,X],O=0;O<2;++O)for(var P=I[O],Y=0;Y<P.length;++Y){var B=P[Y]&31;_e(t,f,b[B]),f+=se[B],B>15&&(_e(t,f,P[Y]>>5&127),f+=P[Y]>>12)}}else E=jr,Z=Le,ie=qr,de=Ze;for(var Y=0;Y<c;++Y){var L=r[Y];if(L>255){var B=L>>18&31;De(t,f,E[B+257]),f+=Z[B+257],B>7&&(_e(t,f,L>>23&31),f+=Cn[B]);var Q=L&31;De(t,f,ie[Q]),f+=de[Q],Q>3&&(De(t,f,L>>5&8191),f+=_n[Q])}else De(t,f,E[L]),f+=Z[L]}return De(t,f,E[256]),f+Z[256]},zr=new Sn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ft=new fe(0),Kr=function(n,t,i,r,o,s){var l=s.z||n.length,c=new fe(r+l+5*(1+Math.ceil(l/7e3))+o),p=c.subarray(r,c.length-o),u=s.l,f=(s.r||0)&7;if(t){f&&(p[0]=s.r>>3);for(var m=zr[t-1],g=m>>13,T=m&8191,F=(1<<i)-1,R=s.p||new ye(32768),q=s.h||new ye(F+1),ne=Math.ceil(i/3),W=2*ne,V=function(xe){return(n[xe]^n[xe+1]<<ne^n[xe+2]<<W)&F},z=new Sn(25e3),X=new ye(288),ae=new ye(32),te=0,Y=0,U=s.i||0,se=0,me=s.w||0,oe=0;U+2<l;++U){var ge=V(U),H=U&32767,le=q[ge];if(R[H]=le,q[ge]=H,me<=U){var E=l-U;if((te>7e3||se>24576)&&(E>423||!u)){f=kt(n,p,0,z,X,ae,Y,se,oe,U-oe,f),se=te=Y=0,oe=U;for(var Z=0;Z<286;++Z)X[Z]=0;for(var Z=0;Z<30;++Z)ae[Z]=0}var ie=2,de=0,b=T,I=H-le&32767;if(E>2&&ge==V(U-I))for(var O=Math.min(g,E)-1,P=Math.min(32767,U),B=Math.min(258,E);I<=P&&--b&&H!=le;){if(n[U+ie]==n[U+ie-I]){for(var L=0;L<B&&n[U+L]==n[U+L-I];++L);if(L>ie){if(ie=L,de=I,L>O)break;for(var Q=Math.min(I,L-2),j=0,Z=0;Z<Q;++Z){var re=U-I+Z&32767,J=R[re],be=re-J&32767;be>j&&(j=be,le=re)}}}H=le,le=R[H],I+=H-le&32767}if(de){z[se++]=268435456|wn[ie]<<18|_t[de];var we=wn[ie]&31,Oe=_t[de]&31;Y+=Cn[we]+_n[Oe],++X[257+we],++ae[Oe],me=U+ie,++te}else z[se++]=n[U],++X[n[U]]}}for(U=Math.max(U,me);U<l;++U)z[se++]=n[U],++X[n[U]];f=kt(n,p,u,z,X,ae,Y,se,oe,U-oe,f),u||(s.r=f&7|p[f/8|0]<<3,f-=7,s.h=q,s.p=R,s.i=U,s.w=me)}else{for(var U=s.w||0;U<l+u;U+=65535){var ke=U+65535;ke>=l&&(p[f/8|0]=u,ke=l),f=Nt(p,f+1,n.subarray(U,ke))}s.i=l}return $t(c,0,r+Mt(f)+o)},Hr=(function(){for(var n=new Int32Array(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(i&1&&-306674912)^i>>>1;n[t]=i}return n})(),Gr=function(){var n=-1;return{p:function(t){for(var i=n,r=0;r<t.length;++r)i=Hr[i&255^t[r]]^i>>>8;n=i},d:function(){return~n}}};var Wr=function(n,t,i,r,o){if(!o&&(o={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new fe(s.length+n.length);l.set(s),l.set(n,s.length),n=l,o.w=s.length}return Kr(n,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):20:12+t.mem,i,r,o)},Dt=function(n,t){var i={};for(var r in n)i[r]=n[r];for(var r in t)i[r]=t[r];return i};var ce=function(n,t,i){for(;i;++t)n[t]=i,i>>>=8};function Qr(n,t){return Wr(n,t||{},0,0)}var Pt=function(n,t,i,r){for(var o in n){var s=n[o],l=t+o,c=r;Array.isArray(s)&&(c=Dt(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?i[l]=[s,c]:(i[l+="/"]=[new fe(0),c],Pt(s,l,i,r))}},Tt=typeof TextEncoder<"u"&&new TextEncoder,Vr=typeof TextDecoder<"u"&&new TextDecoder,Jr=0;try{Vr.decode(Ft,{stream:!0}),Jr=1}catch{}function Rt(n,t){if(t){for(var i=new fe(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}if(Tt)return Tt.encode(n);for(var o=n.length,s=new fe(n.length+(n.length>>1)),l=0,c=function(f){s[l++]=f},r=0;r<o;++r){if(l+5>s.length){var p=new fe(l+8+(o-r<<1));p.set(s),s=p}var u=n.charCodeAt(r);u<128||t?c(u):u<2048?(c(192|u>>6),c(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|n.charCodeAt(++r)&1023,c(240|u>>18),c(128|u>>12&63),c(128|u>>6&63),c(128|u&63)):(c(224|u>>12),c(128|u>>6&63),c(128|u&63))}return $t(s,0,l)}var An=function(n){var t=0;if(n)for(var i in n){var r=n[i].length;r>65535&&Xe(9),t+=r+4}return t},Et=function(n,t,i,r,o,s,l,c){var p=r.length,u=i.extra,f=c&&c.length,m=An(u);ce(n,t,l!=null?33639248:67324752),t+=4,l!=null&&(n[t++]=20,n[t++]=i.os),n[t]=20,t+=2,n[t++]=i.flag<<1|(s<0&&8),n[t++]=o&&8,n[t++]=i.compression&255,n[t++]=i.compression>>8;var g=new Date(i.mtime==null?Date.now():i.mtime),T=g.getFullYear()-1980;if((T<0||T>119)&&Xe(10),ce(n,t,T<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),t+=4,s!=-1&&(ce(n,t,i.crc),ce(n,t+4,s<0?-s-2:s),ce(n,t+8,i.size)),ce(n,t+12,p),ce(n,t+14,m),t+=16,l!=null&&(ce(n,t,f),ce(n,t+6,i.attrs),ce(n,t+10,l),t+=14),n.set(r,t),t+=p,m)for(var F in u){var R=u[F],q=R.length;ce(n,t,+F),ce(n,t+2,q),n.set(R,t+4),t+=4+q}return f&&(n.set(c,t),t+=f),t},Zr=function(n,t,i,r,o){ce(n,t,101010256),ce(n,t+8,i),ce(n,t+10,i),ce(n,t+12,r),ce(n,t+16,o)};function In(n,t){t||(t={});var i={},r=[];Pt(n,"",i,t);var o=0,s=0;for(var l in i){var c=i[l],p=c[0],u=c[1],f=u.level==0?0:8,m=Rt(l),g=m.length,T=u.comment,F=T&&Rt(T),R=F&&F.length,q=An(u.extra);g>65535&&Xe(11);var ne=f?Qr(p,u):p,W=ne.length,V=Gr();V.p(p),r.push(Dt(u,{size:p.length,crc:V.d(),c:ne,f:m,m:F,u:g!=l.length||F&&T.length!=R,o,compression:f})),o+=30+g+q+W,s+=76+2*(g+q)+(R||0)+W}for(var z=new fe(s+22),X=o,ae=s-o,te=0;te<r.length;++te){var m=r[te];Et(z,m.o,m,m.f,m.u,m.c.length);var Y=30+m.f.length+An(m.extra);z.set(m.c,m.o+Y),Et(z,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+Y+(m.m?m.m.length:0)}return Zr(z,o,r.length,ae,X),z}import{readFileSync as gr,writeFileSync as Zo}from"fs";import{join as Xo,resolve as ea}from"path";function Xr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pe={},en={},Te={},Bt;function Ue(){if(Bt)return Te;Bt=1;function n(l){return typeof l>"u"||l===null}function t(l){return typeof l=="object"&&l!==null}function i(l){return Array.isArray(l)?l:n(l)?[]:[l]}function r(l,c){if(c){let p=Object.keys(c);for(let u=0,f=p.length;u<f;u+=1){let m=p[u];l[m]=c[m]}}return l}function o(l,c){let p="";for(let u=0;u<c;u+=1)p+=l;return p}function s(l){return l===0&&Number.NEGATIVE_INFINITY===1/l}return Te.isNothing=n,Te.isObject=t,Te.toArray=i,Te.repeat=o,Te.isNegativeZero=s,Te.extend=r,Te}var kn,Ut;function je(){if(Ut)return kn;Ut=1;function n(i,r){let o="",s=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(o+='in "'+i.mark.name+'" '),o+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!r&&i.mark.snippet&&(o+=`
|
|
3
3
|
|
|
4
|
-
`+i.mark.snippet),s+" "+o):s}function t(i,r){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=r,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(r){return this.name+": "+n(this,r)},kn=t,kn}var Tn,
|
|
5
|
-
`+m}let
|
|
6
|
-
`,m+=n.repeat("-",s.indent+g+3+
|
|
7
|
-
`;for(let R=1;R<=s.linesAfter&&!(f+R>=p.length);R++){let
|
|
8
|
-
`}return m.replace(/\n$/,"")}return Tn=r,Tn}var Rn,
|
|
9
|
-
\r`;function i(l){if(l===null)return!1;let c=0,p=l.length,u=t;for(let f=0;f<p;f++){let m=u.indexOf(l.charAt(f));if(!(m>64)){if(m<0)return!1;c+=6}}return c%8===0}function r(l){let c=l.replace(/[\r\n=]/g,""),p=c.length,u=t,f=0,m=[];for(let T=0;T<p;T++)T%4===0&&T&&(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)),f=f<<6|u.indexOf(c.charAt(T));let g=p%4*6;return g===0?(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)):g===18?(m.push(f>>10&255),m.push(f>>2&255)):g===12&&m.push(f>>4&255),new Uint8Array(m)}function o(l){let c="",p=0,u=l.length,f=t;for(let g=0;g<u;g++)g%3===0&&g&&(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]),p=(p<<8)+l[g];let m=u%3;return m===0?(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]):m===2?(c+=f[p>>10&63],c+=f[p>>4&63],c+=f[p<<2&63],c+=f[64]):m===1&&(c+=f[p>>2&63],c+=f[p<<4&63],c+=f[64],c+=f[64]),c}function s(l){return Object.prototype.toString.call(l)==="[object Uint8Array]"}return Yn=new n("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:r,predicate:s,represent:o}),Yn}var zn,
|
|
10
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function
|
|
11
|
-
`,d-1))}function Oe(e,d,y){let
|
|
12
|
-
`,v?1+h:h):
|
|
13
|
-
`);break}y?V(
|
|
4
|
+
`+i.mark.snippet),s+" "+o):s}function t(i,r){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=r,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(r){return this.name+": "+n(this,r)},kn=t,kn}var Tn,jt;function eo(){if(jt)return Tn;jt=1;let n=Ue();function t(o,s,l,c,p){let u="",f="",m=Math.floor(p/2)-1;return c-s>m&&(u=" ... ",s=c-m+u.length),l-c>m&&(f=" ...",l=c+m-f.length),{str:u+o.slice(s,l).replace(/\t/g,"\u2192")+f,pos:c-s+u.length}}function i(o,s){return n.repeat(" ",s-o.length)+o}function r(o,s){if(s=Object.create(s||null),!o.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let l=/\r?\n|\r|\0/g,c=[0],p=[],u,f=-1;for(;u=l.exec(o.buffer);)p.push(u.index),c.push(u.index+u[0].length),o.position<=u.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let m="",g=Math.min(o.line+s.linesAfter,p.length).toString().length,T=s.maxLength-(s.indent+g+3);for(let R=1;R<=s.linesBefore&&!(f-R<0);R++){let q=t(o.buffer,c[f-R],p[f-R],o.position-(c[f]-c[f-R]),T);m=n.repeat(" ",s.indent)+i((o.line-R+1).toString(),g)+" | "+q.str+`
|
|
5
|
+
`+m}let F=t(o.buffer,c[f],p[f],o.position,T);m+=n.repeat(" ",s.indent)+i((o.line+1).toString(),g)+" | "+F.str+`
|
|
6
|
+
`,m+=n.repeat("-",s.indent+g+3+F.pos)+`^
|
|
7
|
+
`;for(let R=1;R<=s.linesAfter&&!(f+R>=p.length);R++){let q=t(o.buffer,c[f+R],p[f+R],o.position-(c[f]-c[f+R]),T);m+=n.repeat(" ",s.indent)+i((o.line+R+1).toString(),g)+" | "+q.str+`
|
|
8
|
+
`}return m.replace(/\n$/,"")}return Tn=r,Tn}var Rn,qt;function he(){if(qt)return Rn;qt=1;let n=je(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function r(s){let l={};return s!==null&&Object.keys(s).forEach(function(c){s[c].forEach(function(p){l[String(p)]=c})}),l}function o(s,l){if(l=l||{},Object.keys(l).forEach(function(c){if(t.indexOf(c)===-1)throw new n('Unknown option "'+c+'" is met in definition of "'+s+'" YAML type.')}),this.options=l,this.tag=s,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(c){return c},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.representName=l.representName||null,this.defaultStyle=l.defaultStyle||null,this.multi=l.multi||!1,this.styleAliases=r(l.styleAliases||null),i.indexOf(this.kind)===-1)throw new n('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return Rn=o,Rn}var En,Yt;function ui(){if(Yt)return En;Yt=1;let n=je(),t=he();function i(s,l){let c=[];return s[l].forEach(function(p){let u=c.length;c.forEach(function(f,m){f.tag===p.tag&&f.kind===p.kind&&f.multi===p.multi&&(u=m)}),c[u]=p}),c}function r(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function l(c){c.multi?(s.multi[c.kind].push(c),s.multi.fallback.push(c)):s[c.kind][c.tag]=s.fallback[c.tag]=c}for(let c=0,p=arguments.length;c<p;c+=1)arguments[c].forEach(l);return s}function o(s){return this.extend(s)}return o.prototype.extend=function(l){let c=[],p=[];if(l instanceof t)p.push(l);else if(Array.isArray(l))p=p.concat(l);else if(l&&(Array.isArray(l.implicit)||Array.isArray(l.explicit)))l.implicit&&(c=c.concat(l.implicit)),l.explicit&&(p=p.concat(l.explicit));else throw new n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof t))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),p.forEach(function(f){if(!(f instanceof t))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(o.prototype);return u.implicit=(this.implicit||[]).concat(c),u.explicit=(this.explicit||[]).concat(p),u.compiledImplicit=i(u,"implicit"),u.compiledExplicit=i(u,"explicit"),u.compiledTypeMap=r(u.compiledImplicit,u.compiledExplicit),u},En=o,En}var On,zt;function fi(){if(zt)return On;zt=1;let n=he();return On=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),On}var Ln,Kt;function pi(){if(Kt)return Ln;Kt=1;let n=he();return Ln=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Ln}var Mn,Ht;function di(){if(Ht)return Mn;Ht=1;let n=he();return Mn=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Mn}var $n,Gt;function hi(){if(Gt)return $n;Gt=1;let n=ui();return $n=new n({explicit:[fi(),pi(),di()]}),$n}var Nn,Wt;function mi(){if(Wt)return Nn;Wt=1;let n=he();function t(o){if(o===null)return!0;let s=o.length;return s===1&&o==="~"||s===4&&(o==="null"||o==="Null"||o==="NULL")}function i(){return null}function r(o){return o===null}return Nn=new n("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:i,predicate:r,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Nn}var Fn,Qt;function gi(){if(Qt)return Fn;Qt=1;let n=he();function t(o){if(o===null)return!1;let s=o.length;return s===4&&(o==="true"||o==="True"||o==="TRUE")||s===5&&(o==="false"||o==="False"||o==="FALSE")}function i(o){return o==="true"||o==="True"||o==="TRUE"}function r(o){return Object.prototype.toString.call(o)==="[object Boolean]"}return Fn=new n("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:i,predicate:r,represent:{lowercase:function(o){return o?"true":"false"},uppercase:function(o){return o?"TRUE":"FALSE"},camelcase:function(o){return o?"True":"False"}},defaultStyle:"lowercase"}),Fn}var Dn,Vt;function vi(){if(Vt)return Dn;Vt=1;let n=Ue(),t=he();function i(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function r(u){return u>=48&&u<=55}function o(u){return u>=48&&u<=57}function s(u){if(u===null)return!1;let f=u.length,m=0,g=!1;if(!f)return!1;let T=u[m];if((T==="-"||T==="+")&&(T=u[++m]),T==="0"){if(m+1===f)return!0;if(T=u[++m],T==="b"){for(m++;m<f;m++){if(T=u[m],T!=="0"&&T!=="1")return!1;g=!0}return g&&isFinite(l(u))}if(T==="x"){for(m++;m<f;m++){if(!i(u.charCodeAt(m)))return!1;g=!0}return g&&isFinite(l(u))}if(T==="o"){for(m++;m<f;m++){if(!r(u.charCodeAt(m)))return!1;g=!0}return g&&isFinite(l(u))}}for(;m<f;m++){if(!o(u.charCodeAt(m)))return!1;g=!0}return g?isFinite(l(u)):!1}function l(u){let f=u,m=1,g=f[0];if((g==="-"||g==="+")&&(g==="-"&&(m=-1),f=f.slice(1),g=f[0]),f==="0")return 0;if(g==="0"){if(f[1]==="b")return m*parseInt(f.slice(2),2);if(f[1]==="x")return m*parseInt(f.slice(2),16);if(f[1]==="o")return m*parseInt(f.slice(2),8)}return m*parseInt(f,10)}function c(u){return l(u)}function p(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!n.isNegativeZero(u)}return Dn=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:c,predicate:p,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Dn}var Pn,Jt;function yi(){if(Jt)return Pn;Jt=1;let n=Ue(),t=he(),i=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(u){return u===null||!i.test(u)?!1:isFinite(parseFloat(u,10))?!0:r.test(u)}function s(u){let f=u.toLowerCase(),m=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?m===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:m*parseFloat(f,10)}let l=/^[-+]?[0-9]+e/;function c(u,f){if(isNaN(u))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(n.isNegativeZero(u))return"-0.0";let m=u.toString(10);return l.test(m)?m.replace("e",".e"):m}function p(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||n.isNegativeZero(u))}return Pn=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:p,represent:c,defaultStyle:"lowercase"}),Pn}var Bn,Zt;function wi(){return Zt||(Zt=1,Bn=hi().extend({implicit:[mi(),gi(),vi(),yi()]})),Bn}var Un,Xt;function bi(){return Xt||(Xt=1,Un=wi()),Un}var jn,ei;function xi(){if(ei)return jn;ei=1;let n=he(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function r(l){return l===null?!1:t.exec(l)!==null||i.exec(l)!==null}function o(l){let c=0,p=null,u=t.exec(l);if(u===null&&(u=i.exec(l)),u===null)throw new Error("Date resolve error");let f=+u[1],m=+u[2]-1,g=+u[3];if(!u[4])return new Date(Date.UTC(f,m,g));let T=+u[4],F=+u[5],R=+u[6];if(u[7]){for(c=u[7].slice(0,3);c.length<3;)c+="0";c=+c}if(u[9]){let ne=+u[10],W=+(u[11]||0);p=(ne*60+W)*6e4,u[9]==="-"&&(p=-p)}let q=new Date(Date.UTC(f,m,g,T,F,R,c));return p&&q.setTime(q.getTime()-p),q}function s(l){return l.toISOString()}return jn=new n("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:o,instanceOf:Date,represent:s}),jn}var qn,ni;function Ai(){if(ni)return qn;ni=1;let n=he();function t(i){return i==="<<"||i===null}return qn=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),qn}var Yn,ti;function Si(){if(ti)return Yn;ti=1;let n=he(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
9
|
+
\r`;function i(l){if(l===null)return!1;let c=0,p=l.length,u=t;for(let f=0;f<p;f++){let m=u.indexOf(l.charAt(f));if(!(m>64)){if(m<0)return!1;c+=6}}return c%8===0}function r(l){let c=l.replace(/[\r\n=]/g,""),p=c.length,u=t,f=0,m=[];for(let T=0;T<p;T++)T%4===0&&T&&(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)),f=f<<6|u.indexOf(c.charAt(T));let g=p%4*6;return g===0?(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)):g===18?(m.push(f>>10&255),m.push(f>>2&255)):g===12&&m.push(f>>4&255),new Uint8Array(m)}function o(l){let c="",p=0,u=l.length,f=t;for(let g=0;g<u;g++)g%3===0&&g&&(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]),p=(p<<8)+l[g];let m=u%3;return m===0?(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]):m===2?(c+=f[p>>10&63],c+=f[p>>4&63],c+=f[p<<2&63],c+=f[64]):m===1&&(c+=f[p>>2&63],c+=f[p<<4&63],c+=f[64],c+=f[64]),c}function s(l){return Object.prototype.toString.call(l)==="[object Uint8Array]"}return Yn=new n("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:r,predicate:s,represent:o}),Yn}var zn,ii;function Ci(){if(ii)return zn;ii=1;let n=he(),t=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function r(s){if(s===null)return!0;let l=[],c=s;for(let p=0,u=c.length;p<u;p+=1){let f=c[p],m=!1;if(i.call(f)!=="[object Object]")return!1;let g;for(g in f)if(t.call(f,g))if(!m)m=!0;else return!1;if(!m)return!1;if(l.indexOf(g)===-1)l.push(g);else return!1}return!0}function o(s){return s!==null?s:[]}return zn=new n("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:o}),zn}var Kn,ri;function _i(){if(ri)return Kn;ri=1;let n=he(),t=Object.prototype.toString;function i(o){if(o===null)return!0;let s=o,l=new Array(s.length);for(let c=0,p=s.length;c<p;c+=1){let u=s[c];if(t.call(u)!=="[object Object]")return!1;let f=Object.keys(u);if(f.length!==1)return!1;l[c]=[f[0],u[f[0]]]}return!0}function r(o){if(o===null)return[];let s=o,l=new Array(s.length);for(let c=0,p=s.length;c<p;c+=1){let u=s[c],f=Object.keys(u);l[c]=[f[0],u[f[0]]]}return l}return Kn=new n("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:r}),Kn}var Hn,oi;function Ii(){if(oi)return Hn;oi=1;let n=he(),t=Object.prototype.hasOwnProperty;function i(o){if(o===null)return!0;let s=o;for(let l in s)if(t.call(s,l)&&s[l]!==null)return!1;return!0}function r(o){return o!==null?o:{}}return Hn=new n("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:r}),Hn}var Gn,ai;function Qn(){return ai||(ai=1,Gn=bi().extend({implicit:[xi(),Ai()],explicit:[Si(),Ci(),_i(),Ii()]})),Gn}var si;function no(){if(si)return en;si=1;let n=Ue(),t=je(),i=eo(),r=Qn(),o=Object.prototype.hasOwnProperty,s=1,l=2,c=3,p=4,u=1,f=2,m=3,g=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,T=/[\x85\u2028\u2029]/,F=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,q=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function ne(e){return Object.prototype.toString.call(e)}function W(e){return e===10||e===13}function V(e){return e===9||e===32}function z(e){return e===9||e===32||e===10||e===13}function X(e){return e===44||e===91||e===93||e===123||e===125}function ae(e){if(e>=48&&e<=57)return e-48;let d=e|32;return d>=97&&d<=102?d-97+10:-1}function te(e){return e===120?2:e===117?4:e===85?8:0}function Y(e){return e>=48&&e<=57?e-48:-1}function U(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
10
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function se(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function me(e,d,y){d==="__proto__"?Object.defineProperty(e,d,{configurable:!0,enumerable:!0,writable:!0,value:y}):e[d]=y}let oe=new Array(256),ge=new Array(256);for(let e=0;e<256;e++)oe[e]=U(e)?1:0,ge[e]=U(e);function H(e,d){this.input=e,this.filename=d.filename||null,this.schema=d.schema||r,this.onWarning=d.onWarning||null,this.legacy=d.legacy||!1,this.json=d.json||!1,this.listener=d.listener||null,this.maxDepth=typeof d.maxDepth=="number"?d.maxDepth:100,this.maxTotalMergeKeys=typeof d.maxTotalMergeKeys=="number"?d.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function le(e,d){let y={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return y.snippet=i(y),new t(d,y)}function E(e,d){throw le(e,d)}function Z(e,d){e.onWarning&&e.onWarning.call(null,le(e,d))}function ie(e,d,y){let A=e.anchorMapTransactions;if(A.length!==0){let v=A[A.length-1];o.call(v,d)||(v[d]={existed:o.call(e.anchorMap,d),value:e.anchorMap[d]})}e.anchorMap[d]=y}function de(e){e.anchorMapTransactions.push(Object.create(null))}function b(e){let d=e.anchorMapTransactions.pop(),y=e.anchorMapTransactions;if(y.length===0)return;let A=y[y.length-1],v=Object.keys(d);for(let k=0,a=v.length;k<a;k+=1){let h=v[k];o.call(A,h)||(A[h]=d[h])}}function I(e){let d=e.anchorMapTransactions.pop(),y=Object.keys(d);for(let A=y.length-1;A>=0;A-=1){let v=d[y[A]];v.existed?e.anchorMap[y[A]]=v.value:delete e.anchorMap[y[A]]}}function O(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function P(e,d){e.position=d.position,e.line=d.line,e.lineStart=d.lineStart,e.lineIndent=d.lineIndent,e.firstTabInLine=d.firstTabInLine,e.tag=d.tag,e.anchor=d.anchor,e.kind=d.kind,e.result=d.result}let B={YAML:function(d,y,A){d.version!==null&&E(d,"duplication of %YAML directive"),A.length!==1&&E(d,"YAML directive accepts exactly one argument");let v=/^([0-9]+)\.([0-9]+)$/.exec(A[0]);v===null&&E(d,"ill-formed argument of the YAML directive");let k=parseInt(v[1],10),a=parseInt(v[2],10);k!==1&&E(d,"unacceptable YAML version of the document"),d.version=A[0],d.checkLineBreaks=a<2,a!==1&&a!==2&&Z(d,"unsupported YAML version of the document")},TAG:function(d,y,A){let v;A.length!==2&&E(d,"TAG directive accepts exactly two arguments");let k=A[0];v=A[1],R.test(k)||E(d,"ill-formed tag handle (first argument) of the TAG directive"),o.call(d.tagMap,k)&&E(d,'there is a previously declared suffix for "'+k+'" tag handle'),q.test(v)||E(d,"ill-formed tag prefix (second argument) of the TAG directive");try{v=decodeURIComponent(v)}catch{E(d,"tag prefix is malformed: "+v)}d.tagMap[k]=v}};function L(e,d,y,A){if(d<y){let v=e.input.slice(d,y);if(A)for(let k=0,a=v.length;k<a;k+=1){let h=v.charCodeAt(k);h===9||h>=32&&h<=1114111||E(e,"expected valid JSON character")}else g.test(v)&&E(e,"the stream contains non-printable characters");e.result+=v}}function Q(e,d,y,A){n.isObject(y)||E(e,"cannot merge mappings; the provided source object is unacceptable");let v=Object.keys(y);for(let k=0,a=v.length;k<a;k+=1){let h=v[k];e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&E(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")"),o.call(d,h)||(me(d,h,y[h]),A[h]=!0)}}function j(e,d,y,A,v,k,a,h,C){if(Array.isArray(v)){v=Array.prototype.slice.call(v);for(let w=0,x=v.length;w<x;w+=1)Array.isArray(v[w])&&E(e,"nested arrays are not supported inside keys"),typeof v=="object"&&ne(v[w])==="[object Object]"&&(v[w]="[object Object]")}if(typeof v=="object"&&ne(v)==="[object Object]"&&(v="[object Object]"),v=String(v),d===null&&(d={}),A==="tag:yaml.org,2002:merge")if(Array.isArray(k))for(let w=0,x=k.length;w<x;w+=1)Q(e,d,k[w],y);else Q(e,d,k,y);else!e.json&&!o.call(y,v)&&o.call(d,v)&&(e.line=a||e.line,e.lineStart=h||e.lineStart,e.position=C||e.position,E(e,"duplicated mapping key")),me(d,v,k),delete y[v];return d}function re(e){let d=e.input.charCodeAt(e.position);d===10?e.position++:d===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):E(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function J(e,d,y){let A=0,v=e.input.charCodeAt(e.position);for(;v!==0;){for(;V(v);)v===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),v=e.input.charCodeAt(++e.position);if(d&&v===35)do v=e.input.charCodeAt(++e.position);while(v!==10&&v!==13&&v!==0);if(W(v))for(re(e),v=e.input.charCodeAt(e.position),A++,e.lineIndent=0;v===32;)e.lineIndent++,v=e.input.charCodeAt(++e.position);else break}return y!==-1&&A!==0&&e.lineIndent<y&&Z(e,"deficient indentation"),A}function be(e){let d=e.position,y=e.input.charCodeAt(d);return!!((y===45||y===46)&&y===e.input.charCodeAt(d+1)&&y===e.input.charCodeAt(d+2)&&(d+=3,y=e.input.charCodeAt(d),y===0||z(y)))}function we(e,d){d===1?e.result+=" ":d>1&&(e.result+=n.repeat(`
|
|
11
|
+
`,d-1))}function Oe(e,d,y){let A,v,k,a,h,C,w=e.kind,x=e.result,_=e.input.charCodeAt(e.position);if(z(_)||X(_)||_===35||_===38||_===42||_===33||_===124||_===62||_===39||_===34||_===37||_===64||_===96)return!1;if(_===63||_===45){let S=e.input.charCodeAt(e.position+1);if(z(S)||y&&X(S))return!1}for(e.kind="scalar",e.result="",A=v=e.position,k=!1;_!==0;){if(_===58){let S=e.input.charCodeAt(e.position+1);if(z(S)||y&&X(S))break}else if(_===35){let S=e.input.charCodeAt(e.position-1);if(z(S))break}else{if(e.position===e.lineStart&&be(e)||y&&X(_))break;if(W(_))if(a=e.line,h=e.lineStart,C=e.lineIndent,J(e,!1,-1),e.lineIndent>=d){k=!0,_=e.input.charCodeAt(e.position);continue}else{e.position=v,e.line=a,e.lineStart=h,e.lineIndent=C;break}}k&&(L(e,A,v,!1),we(e,e.line-a),A=v=e.position,k=!1),V(_)||(v=e.position+1),_=e.input.charCodeAt(++e.position)}return L(e,A,v,!1),e.result?!0:(e.kind=w,e.result=x,!1)}function ke(e,d){let y,A,v=e.input.charCodeAt(e.position);if(v!==39)return!1;for(e.kind="scalar",e.result="",e.position++,y=A=e.position;(v=e.input.charCodeAt(e.position))!==0;)if(v===39)if(L(e,y,e.position,!0),v=e.input.charCodeAt(++e.position),v===39)y=e.position,e.position++,A=e.position;else return!0;else W(v)?(L(e,y,A,!0),we(e,J(e,!1,d)),y=A=e.position):e.position===e.lineStart&&be(e)?E(e,"unexpected end of the document within a single quoted scalar"):(e.position++,V(v)||(A=e.position));E(e,"unexpected end of the stream within a single quoted scalar")}function xe(e,d){let y,A,v,k=e.input.charCodeAt(e.position);if(k!==34)return!1;for(e.kind="scalar",e.result="",e.position++,y=A=e.position;(k=e.input.charCodeAt(e.position))!==0;){if(k===34)return L(e,y,e.position,!0),e.position++,!0;if(k===92){if(L(e,y,e.position,!0),k=e.input.charCodeAt(++e.position),W(k))J(e,!1,d);else if(k<256&&oe[k])e.result+=ge[k],e.position++;else if((v=te(k))>0){let a=v,h=0;for(;a>0;a--)k=e.input.charCodeAt(++e.position),(v=ae(k))>=0?h=(h<<4)+v:E(e,"expected hexadecimal character");e.result+=se(h),e.position++}else E(e,"unknown escape sequence");y=A=e.position}else W(k)?(L(e,y,A,!0),we(e,J(e,!1,d)),y=A=e.position):e.position===e.lineStart&&be(e)?E(e,"unexpected end of the document within a double quoted scalar"):(e.position++,V(k)||(A=e.position))}E(e,"unexpected end of the stream within a double quoted scalar")}function Ke(e,d){let y=!0,A,v,k,a=e.tag,h,C=e.anchor,w,x,_,S,$=Object.create(null),M,N,D,K=e.input.charCodeAt(e.position);if(K===91)w=93,S=!1,h=[];else if(K===123)w=125,S=!0,h={};else return!1;for(e.anchor!==null&&ie(e,e.anchor,h),K=e.input.charCodeAt(++e.position);K!==0;){if(J(e,!0,d),K=e.input.charCodeAt(e.position),K===w)return e.position++,e.tag=a,e.anchor=C,e.kind=S?"mapping":"sequence",e.result=h,!0;if(y?K===44&&E(e,"expected the node content, but found ','"):E(e,"missed comma between flow collection entries"),N=M=D=null,x=_=!1,K===63){let ee=e.input.charCodeAt(e.position+1);z(ee)&&(x=_=!0,e.position++,J(e,!0,d))}A=e.line,v=e.lineStart,k=e.position,Se(e,d,s,!1,!0),N=e.tag,M=e.result,J(e,!0,d),K=e.input.charCodeAt(e.position),(_||e.line===A)&&K===58&&(x=!0,K=e.input.charCodeAt(++e.position),J(e,!0,d),Se(e,d,s,!1,!0),D=e.result),S?j(e,h,$,N,M,D,A,v,k):x?h.push(j(e,null,$,N,M,D,A,v,k)):h.push(M),J(e,!0,d),K=e.input.charCodeAt(e.position),K===44?(y=!0,K=e.input.charCodeAt(++e.position)):y=!1}E(e,"unexpected end of the stream within a flow collection")}function He(e,d){let y,A=u,v=!1,k=!1,a=d,h=0,C=!1,w,x=e.input.charCodeAt(e.position);if(x===124)y=!1;else if(x===62)y=!0;else return!1;for(e.kind="scalar",e.result="";x!==0;)if(x=e.input.charCodeAt(++e.position),x===43||x===45)u===A?A=x===43?m:f:E(e,"repeat of a chomping mode identifier");else if((w=Y(x))>=0)w===0?E(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?E(e,"repeat of an indentation width identifier"):(a=d+w-1,k=!0);else break;if(V(x)){do x=e.input.charCodeAt(++e.position);while(V(x));if(x===35)do x=e.input.charCodeAt(++e.position);while(!W(x)&&x!==0)}for(;x!==0;){for(re(e),e.lineIndent=0,x=e.input.charCodeAt(e.position);(!k||e.lineIndent<a)&&x===32;)e.lineIndent++,x=e.input.charCodeAt(++e.position);if(!k&&e.lineIndent>a&&(a=e.lineIndent),W(x)){h++;continue}if(!k&&a===0&&E(e,"missing indentation for block scalar"),e.lineIndent<a){A===m?e.result+=n.repeat(`
|
|
12
|
+
`,v?1+h:h):A===u&&v&&(e.result+=`
|
|
13
|
+
`);break}y?V(x)?(C=!0,e.result+=n.repeat(`
|
|
14
14
|
`,v?1+h:h)):C?(C=!1,e.result+=n.repeat(`
|
|
15
15
|
`,h+1)):h===0?v&&(e.result+=" "):e.result+=n.repeat(`
|
|
16
16
|
`,h):e.result+=n.repeat(`
|
|
17
|
-
`,v?1+h:h),v=!0,
|
|
18
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let y=new H(e,d),
|
|
19
|
-
`,
|
|
20
|
-
`&&(
|
|
21
|
-
`+n.repeat(" ",a.indent*h)}function
|
|
22
|
-
`,_=
|
|
17
|
+
`,v?1+h:h),v=!0,k=!0,h=0;let _=e.position;for(;!W(x)&&x!==0;)x=e.input.charCodeAt(++e.position);L(e,_,e.position,!1)}return!0}function Ae(e,d){let y=e.tag,A=e.anchor,v=[],k=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&ie(e,e.anchor,v);let a=e.input.charCodeAt(e.position);for(;a!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation")),a===45);){let h=e.input.charCodeAt(e.position+1);if(!z(h))break;if(k=!0,e.position++,J(e,!0,-1)&&e.lineIndent<=d){v.push(null),a=e.input.charCodeAt(e.position);continue}let C=e.line;if(Se(e,d,c,!1,!0),v.push(e.result),J(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===C||e.lineIndent>d)&&a!==0)E(e,"bad indentation of a sequence entry");else if(e.lineIndent<d)break}return k?(e.tag=y,e.anchor=A,e.kind="sequence",e.result=v,!0):!1}function Ge(e,d,y){let A,v,k,a,h=e.tag,C=e.anchor,w={},x=Object.create(null),_=null,S=null,$=null,M=!1,N=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&ie(e,e.anchor,w);let D=e.input.charCodeAt(e.position);for(;D!==0;){!M&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation"));let K=e.input.charCodeAt(e.position+1),ee=e.line;if((D===63||D===58)&&z(K))D===63?(M&&(j(e,w,x,_,S,null,v,k,a),_=S=$=null),N=!0,M=!0,A=!0):M?(M=!1,A=!0):E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,D=K;else{if(v=e.line,k=e.lineStart,a=e.position,!Se(e,y,l,!1,!0))break;if(e.line===ee){for(D=e.input.charCodeAt(e.position);V(D);)D=e.input.charCodeAt(++e.position);if(D===58)D=e.input.charCodeAt(++e.position),z(D)||E(e,"a whitespace character is expected after the key-value separator within a block mapping"),M&&(j(e,w,x,_,S,null,v,k,a),_=S=$=null),N=!0,M=!1,A=!1,_=e.tag,S=e.result;else if(N)E(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=C,!0}else if(N)E(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=C,!0}if((e.line===ee||e.lineIndent>d)&&(M&&(v=e.line,k=e.lineStart,a=e.position),Se(e,d,p,!0,A)&&(M?S=e.result:$=e.result),M||(j(e,w,x,_,S,$,v,k,a),_=S=$=null),J(e,!0,-1),D=e.input.charCodeAt(e.position)),(e.line===ee||e.lineIndent>d)&&D!==0)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<d)break}return M&&j(e,w,x,_,S,null,v,k,a),N&&(e.tag=h,e.anchor=C,e.kind="mapping",e.result=w),N}function hn(e){let d=!1,y=!1,A,v,k=e.input.charCodeAt(e.position);if(k!==33)return!1;e.tag!==null&&E(e,"duplication of a tag property"),k=e.input.charCodeAt(++e.position),k===60?(d=!0,k=e.input.charCodeAt(++e.position)):k===33?(y=!0,A="!!",k=e.input.charCodeAt(++e.position)):A="!";let a=e.position;if(d){do k=e.input.charCodeAt(++e.position);while(k!==0&&k!==62);e.position<e.length?(v=e.input.slice(a,e.position),k=e.input.charCodeAt(++e.position)):E(e,"unexpected end of the stream within a verbatim tag")}else{for(;k!==0&&!z(k);)k===33&&(y?E(e,"tag suffix cannot contain exclamation marks"):(A=e.input.slice(a-1,e.position+1),R.test(A)||E(e,"named tag handle cannot contain such characters"),y=!0,a=e.position+1)),k=e.input.charCodeAt(++e.position);v=e.input.slice(a,e.position),F.test(v)&&E(e,"tag suffix cannot contain flow indicator characters")}v&&!q.test(v)&&E(e,"tag name cannot contain such characters: "+v);try{v=decodeURIComponent(v)}catch{E(e,"tag name is malformed: "+v)}return d?e.tag=v:o.call(e.tagMap,A)?e.tag=e.tagMap[A]+v:A==="!"?e.tag="!"+v:A==="!!"?e.tag="tag:yaml.org,2002:"+v:E(e,'undeclared tag handle "'+A+'"'),!0}function We(e){let d=e.input.charCodeAt(e.position);if(d!==38)return!1;e.anchor!==null&&E(e,"duplication of an anchor property"),d=e.input.charCodeAt(++e.position);let y=e.position;for(;d!==0&&!z(d)&&!X(d);)d=e.input.charCodeAt(++e.position);return e.position===y&&E(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(y,e.position),!0}function Qe(e){let d=e.input.charCodeAt(e.position);if(d!==42)return!1;d=e.input.charCodeAt(++e.position);let y=e.position;for(;d!==0&&!z(d)&&!X(d);)d=e.input.charCodeAt(++e.position);e.position===y&&E(e,"name of an alias node must contain at least one character");let A=e.input.slice(y,e.position);return o.call(e.anchorMap,A)||E(e,'unidentified alias "'+A+'"'),e.result=e.anchorMap[A],J(e,!0,-1),!0}function mn(e,d,y,A){let v=O(e);return de(e),P(e,d),e.tag=null,e.anchor=null,e.kind=null,e.result=null,Ge(e,y,A)&&e.kind==="mapping"?(b(e),!0):(I(e),P(e,v),!1)}function Se(e,d,y,A,v){let k,a,h=1,C=!1,w=!1,x=null,_,S,$;e.depth>=e.maxDepth&&E(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;let M=k=a=p===y||c===y;if(A&&J(e,!0,-1)&&(C=!0,e.lineIndent>d?h=1:e.lineIndent===d?h=0:e.lineIndent<d&&(h=-1)),h===1)for(;;){let N=e.input.charCodeAt(e.position),D=O(e);if(C&&(N===33&&e.tag!==null||N===38&&e.anchor!==null)||!hn(e)&&!We(e))break;x===null&&(x=D),J(e,!0,-1)?(C=!0,a=M,e.lineIndent>d?h=1:e.lineIndent===d?h=0:e.lineIndent<d&&(h=-1)):a=!1}if(a&&(a=C||v),h===1||p===y)if(s===y||l===y?S=d:S=d+1,$=e.position-e.lineStart,h===1)if(a&&(Ae(e,$)||Ge(e,$,S))||Ke(e,S))w=!0;else{let N=e.input.charCodeAt(e.position);x!==null&&M&&!a&&N!==124&&N!==62&&mn(e,x,x.position-x.lineStart,S)||k&&He(e,S)||ke(e,S)||xe(e,S)?w=!0:Qe(e)?(w=!0,(e.tag!==null||e.anchor!==null)&&E(e,"alias node should not have any properties")):Oe(e,S,s===y)&&(w=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&ie(e,e.anchor,e.result)}else h===0&&(w=a&&Ae(e,$));if(e.tag===null)e.anchor!==null&&ie(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&E(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let N=0,D=e.implicitTypes.length;N<D;N+=1)if(_=e.implicitTypes[N],_.resolve(e.result)){e.result=_.construct(e.result),e.tag=_.tag,e.anchor!==null&&ie(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(o.call(e.typeMap[e.kind||"fallback"],e.tag))_=e.typeMap[e.kind||"fallback"][e.tag];else{_=null;let N=e.typeMap.multi[e.kind||"fallback"];for(let D=0,K=N.length;D<K;D+=1)if(e.tag.slice(0,N[D].tag.length)===N[D].tag){_=N[D];break}}_||E(e,"unknown tag !<"+e.tag+">"),e.result!==null&&_.kind!==e.kind&&E(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+_.kind+'", not "'+e.kind+'"'),_.resolve(e.result,e.tag)?(e.result=_.construct(e.result,e.tag),e.anchor!==null&&ie(e,e.anchor,e.result)):E(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||w}function gn(e){let d=e.position,y=!1,A;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(A=e.input.charCodeAt(e.position))!==0&&(J(e,!0,-1),A=e.input.charCodeAt(e.position),!(e.lineIndent>0||A!==37));){y=!0,A=e.input.charCodeAt(++e.position);let v=e.position;for(;A!==0&&!z(A);)A=e.input.charCodeAt(++e.position);let k=e.input.slice(v,e.position),a=[];for(k.length<1&&E(e,"directive name must not be less than one character in length");A!==0;){for(;V(A);)A=e.input.charCodeAt(++e.position);if(A===35){do A=e.input.charCodeAt(++e.position);while(A!==0&&!W(A));break}if(W(A))break;for(v=e.position;A!==0&&!z(A);)A=e.input.charCodeAt(++e.position);a.push(e.input.slice(v,e.position))}A!==0&&re(e),o.call(B,k)?B[k](e,k,a):Z(e,'unknown document directive "'+k+'"')}if(J(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,J(e,!0,-1)):y&&E(e,"directives end mark is expected"),Se(e,e.lineIndent-1,p,!1,!0),J(e,!0,-1),e.checkLineBreaks&&T.test(e.input.slice(d,e.position))&&Z(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&be(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,J(e,!0,-1));return}e.position<e.length-1&&E(e,"end of the stream or a document separator is expected")}function Ve(e,d){e=String(e),d=d||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
18
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let y=new H(e,d),A=e.indexOf("\0");for(A!==-1&&(y.position=A,E(y,"null byte is not allowed in input")),y.input+="\0";y.input.charCodeAt(y.position)===32;)y.lineIndent+=1,y.position+=1;for(;y.position<y.length-1;)gn(y);return y.documents}function Je(e,d,y){d!==null&&typeof d=="object"&&typeof y>"u"&&(y=d,d=null);let A=Ve(e,y);if(typeof d!="function")return A;for(let v=0,k=A.length;v<k;v+=1)d(A[v])}function vn(e,d){let y=Ve(e,d);if(y.length!==0){if(y.length===1)return y[0];throw new t("expected a single document in the stream, but found more")}}return en.loadAll=Je,en.load=vn,en}var Wn={},li;function to(){if(li)return Wn;li=1;let n=Ue(),t=je(),i=Qn(),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=65279,l=9,c=10,p=13,u=32,f=33,m=34,g=35,T=37,F=38,R=39,q=42,ne=44,W=45,V=58,z=61,X=62,ae=63,te=64,Y=91,U=93,se=96,me=123,oe=124,ge=125,H={};H[0]="\\0",H[7]="\\a",H[8]="\\b",H[9]="\\t",H[10]="\\n",H[11]="\\v",H[12]="\\f",H[13]="\\r",H[27]="\\e",H[34]='\\"',H[92]="\\\\",H[133]="\\N",H[160]="\\_",H[8232]="\\L",H[8233]="\\P";let le=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],E=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Z(a,h){if(h===null)return{};let C={},w=Object.keys(h);for(let x=0,_=w.length;x<_;x+=1){let S=w[x],$=String(h[S]);S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2));let M=a.compiledTypeMap.fallback[S];M&&o.call(M.styleAliases,$)&&($=M.styleAliases[$]),C[S]=$}return C}function ie(a){let h,C,w=a.toString(16).toUpperCase();if(a<=255)h="x",C=2;else if(a<=65535)h="u",C=4;else if(a<=4294967295)h="U",C=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+h+n.repeat("0",C-w.length)+w}let de=1,b=2;function I(a){this.schema=a.schema||i,this.indent=Math.max(1,a.indent||2),this.noArrayIndent=a.noArrayIndent||!1,this.skipInvalid=a.skipInvalid||!1,this.flowLevel=n.isNothing(a.flowLevel)?-1:a.flowLevel,this.styleMap=Z(this.schema,a.styles||null),this.sortKeys=a.sortKeys||!1,this.lineWidth=a.lineWidth||80,this.noRefs=a.noRefs||!1,this.noCompatMode=a.noCompatMode||!1,this.condenseFlow=a.condenseFlow||!1,this.quotingType=a.quotingType==='"'?b:de,this.forceQuotes=a.forceQuotes||!1,this.replacer=typeof a.replacer=="function"?a.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function O(a,h){let C=n.repeat(" ",h),w=0,x="",_=a.length;for(;w<_;){let S,$=a.indexOf(`
|
|
19
|
+
`,w);$===-1?(S=a.slice(w),w=_):(S=a.slice(w,$+1),w=$+1),S.length&&S!==`
|
|
20
|
+
`&&(x+=C),x+=S}return x}function P(a,h){return`
|
|
21
|
+
`+n.repeat(" ",a.indent*h)}function B(a,h){for(let C=0,w=a.implicitTypes.length;C<w;C+=1)if(a.implicitTypes[C].resolve(h))return!0;return!1}function L(a){return a===u||a===l}function Q(a){return a>=32&&a<=126||a>=161&&a<=55295&&a!==8232&&a!==8233||a>=57344&&a<=65533&&a!==s||a>=65536&&a<=1114111}function j(a){return Q(a)&&a!==s&&a!==p&&a!==c}function re(a,h,C){let w=j(a),x=w&&!L(a);return(C?w:w&&a!==ne&&a!==Y&&a!==U&&a!==me&&a!==ge)&&a!==g&&!(h===V&&!x)||j(h)&&!L(h)&&a===g||h===V&&x}function J(a){return Q(a)&&a!==s&&!L(a)&&a!==W&&a!==ae&&a!==V&&a!==ne&&a!==Y&&a!==U&&a!==me&&a!==ge&&a!==g&&a!==F&&a!==q&&a!==f&&a!==oe&&a!==z&&a!==X&&a!==R&&a!==m&&a!==T&&a!==te&&a!==se}function be(a){return!L(a)&&a!==V}function we(a,h){let C=a.charCodeAt(h),w;return C>=55296&&C<=56319&&h+1<a.length&&(w=a.charCodeAt(h+1),w>=56320&&w<=57343)?(C-55296)*1024+w-56320+65536:C}function Oe(a){return/^\n* /.test(a)}let ke=1,xe=2,Ke=3,He=4,Ae=5;function Ge(a,h,C,w,x,_,S,$){let M,N=0,D=null,K=!1,ee=!1,St=w!==-1,Ne=-1,Fe=J(we(a,0))&&be(we(a,a.length-1));if(h||S)for(M=0;M<a.length;N>=65536?M+=2:M++){if(N=we(a,M),!Q(N))return Ae;Fe=Fe&&re(N,D,$),D=N}else{for(M=0;M<a.length;N>=65536?M+=2:M++){if(N=we(a,M),N===c)K=!0,St&&(ee=ee||M-Ne-1>w&&a[Ne+1]!==" ",Ne=M);else if(!Q(N))return Ae;Fe=Fe&&re(N,D,$),D=N}ee=ee||St&&M-Ne-1>w&&a[Ne+1]!==" "}return!K&&!ee?Fe&&!S&&!x(a)?ke:_===b?Ae:xe:C>9&&Oe(a)?Ae:S?_===b?Ae:xe:ee?He:Ke}function hn(a,h,C,w,x){a.dump=(function(){if(h.length===0)return a.quotingType===b?'""':"''";if(!a.noCompatMode&&(le.indexOf(h)!==-1||E.test(h)))return a.quotingType===b?'"'+h+'"':"'"+h+"'";let _=a.indent*Math.max(1,C),S=a.lineWidth===-1?-1:Math.max(Math.min(a.lineWidth,40),a.lineWidth-_),$=w||a.flowLevel>-1&&C>=a.flowLevel;function M(N){return B(a,N)}switch(Ge(h,$,a.indent,S,M,a.quotingType,a.forceQuotes&&!w,x)){case ke:return h;case xe:return"'"+h.replace(/'/g,"''")+"'";case Ke:return"|"+We(h,a.indent)+Qe(O(h,_));case He:return">"+We(h,a.indent)+Qe(O(mn(h,S),_));case Ae:return'"'+gn(h)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function We(a,h){let C=Oe(a)?String(h):"",w=a[a.length-1]===`
|
|
22
|
+
`,_=w&&(a[a.length-2]===`
|
|
23
23
|
`||a===`
|
|
24
|
-
`)?"+":
|
|
24
|
+
`)?"+":w?"":"-";return C+_+`
|
|
25
25
|
`}function Qe(a){return a[a.length-1]===`
|
|
26
|
-
`?a.slice(0,-1):a}function mn(a,h){let C=/(\n+)([^\n]*)/g,
|
|
27
|
-
`);return
|
|
28
|
-
`||a[0]===" ",_,S;for(;S=C.exec(a);){let
|
|
29
|
-
`:"")+Se(
|
|
30
|
-
`+a.slice(
|
|
31
|
-
`,a.length-
|
|
32
|
-
`+a.slice(S+1):
|
|
33
|
-
`:""}return Wn.dump=
|
|
34
|
-
`)}function
|
|
35
|
-
`);i.push("");for(let s of
|
|
36
|
-
`)}function
|
|
37
|
-
`);let r=
|
|
38
|
-
`)}function
|
|
39
|
-
`)}function
|
|
40
|
-
`)}var ot=new Set([".git","node_modules",".venv","venv","__pycache__","dist","build",".next",".idea",".turbo","coverage",".seldon"]),
|
|
41
|
-
`)[0]}`)}}async function
|
|
42
|
-
`).map(f=>f.trim()).filter(Boolean),s=t.maxFileBytes??
|
|
43
|
-
`,{encoding:"utf8",mode:384}),t}function
|
|
44
|
-
`),o;throw new Error("No baseline found here. Run `seldon baseline generate` first, or pass --id <baselineId>.")}function
|
|
26
|
+
`?a.slice(0,-1):a}function mn(a,h){let C=/(\n+)([^\n]*)/g,w=(function(){let $=a.indexOf(`
|
|
27
|
+
`);return $=$!==-1?$:a.length,C.lastIndex=$,Se(a.slice(0,$),h)})(),x=a[0]===`
|
|
28
|
+
`||a[0]===" ",_,S;for(;S=C.exec(a);){let $=S[1],M=S[2];_=M[0]===" ",w+=$+(!x&&!_&&M!==""?`
|
|
29
|
+
`:"")+Se(M,h),x=_}return w}function Se(a,h){if(a===""||a[0]===" ")return a;let C=/ [^ ]/g,w,x=0,_,S=0,$=0,M="";for(;w=C.exec(a);)$=w.index,$-x>h&&(_=S>x?S:$,M+=`
|
|
30
|
+
`+a.slice(x,_),x=_+1),S=$;return M+=`
|
|
31
|
+
`,a.length-x>h&&S>x?M+=a.slice(x,S)+`
|
|
32
|
+
`+a.slice(S+1):M+=a.slice(x),M.slice(1)}function gn(a){let h="",C=0;for(let w=0;w<a.length;C>=65536?w+=2:w++){C=we(a,w);let x=H[C];!x&&Q(C)?(h+=a[w],C>=65536&&(h+=a[w+1])):h+=x||ie(C)}return h}function Ve(a,h,C){let w="",x=a.tag;for(let _=0,S=C.length;_<S;_+=1){let $=C[_];a.replacer&&($=a.replacer.call(C,String(_),$)),(y(a,h,$,!1,!1)||typeof $>"u"&&y(a,h,null,!1,!1))&&(w!==""&&(w+=","+(a.condenseFlow?"":" ")),w+=a.dump)}a.tag=x,a.dump="["+w+"]"}function Je(a,h,C,w){let x="",_=a.tag;for(let S=0,$=C.length;S<$;S+=1){let M=C[S];a.replacer&&(M=a.replacer.call(C,String(S),M)),(y(a,h+1,M,!0,!0,!1,!0)||typeof M>"u"&&y(a,h+1,null,!0,!0,!1,!0))&&((!w||x!=="")&&(x+=P(a,h)),a.dump&&c===a.dump.charCodeAt(0)?x+="-":x+="- ",x+=a.dump)}a.tag=_,a.dump=x||"[]"}function vn(a,h,C){let w="",x=a.tag,_=Object.keys(C);for(let S=0,$=_.length;S<$;S+=1){let M="";w!==""&&(M+=", "),a.condenseFlow&&(M+='"');let N=_[S],D=C[N];a.replacer&&(D=a.replacer.call(C,N,D)),y(a,h,N,!1,!1)&&(a.dump.length>1024&&(M+="? "),M+=a.dump+(a.condenseFlow?'"':"")+":"+(a.condenseFlow?"":" "),y(a,h,D,!1,!1)&&(M+=a.dump,w+=M))}a.tag=x,a.dump="{"+w+"}"}function e(a,h,C,w){let x="",_=a.tag,S=Object.keys(C);if(a.sortKeys===!0)S.sort();else if(typeof a.sortKeys=="function")S.sort(a.sortKeys);else if(a.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let $=0,M=S.length;$<M;$+=1){let N="";(!w||x!=="")&&(N+=P(a,h));let D=S[$],K=C[D];if(a.replacer&&(K=a.replacer.call(C,D,K)),!y(a,h+1,D,!0,!0,!0))continue;let ee=a.tag!==null&&a.tag!=="?"||a.dump&&a.dump.length>1024;ee&&(a.dump&&c===a.dump.charCodeAt(0)?N+="?":N+="? "),N+=a.dump,ee&&(N+=P(a,h)),y(a,h+1,K,!0,ee)&&(a.dump&&c===a.dump.charCodeAt(0)?N+=":":N+=": ",N+=a.dump,x+=N)}a.tag=_,a.dump=x||"{}"}function d(a,h,C){let w=C?a.explicitTypes:a.implicitTypes;for(let x=0,_=w.length;x<_;x+=1){let S=w[x];if((S.instanceOf||S.predicate)&&(!S.instanceOf||typeof h=="object"&&h instanceof S.instanceOf)&&(!S.predicate||S.predicate(h))){if(C?S.multi&&S.representName?a.tag=S.representName(h):a.tag=S.tag:a.tag="?",S.represent){let $=a.styleMap[S.tag]||S.defaultStyle,M;if(r.call(S.represent)==="[object Function]")M=S.represent(h,$);else if(o.call(S.represent,$))M=S.represent[$](h,$);else throw new t("!<"+S.tag+'> tag resolver accepts not "'+$+'" style');a.dump=M}return!0}}return!1}function y(a,h,C,w,x,_,S){a.tag=null,a.dump=C,d(a,C,!1)||d(a,C,!0);let $=r.call(a.dump),M=w;w&&(w=a.flowLevel<0||a.flowLevel>h);let N=$==="[object Object]"||$==="[object Array]",D,K;if(N&&(D=a.duplicates.indexOf(C),K=D!==-1),(a.tag!==null&&a.tag!=="?"||K||a.indent!==2&&h>0)&&(x=!1),K&&a.usedDuplicates[D])a.dump="*ref_"+D;else{if(N&&K&&!a.usedDuplicates[D]&&(a.usedDuplicates[D]=!0),$==="[object Object]")w&&Object.keys(a.dump).length!==0?(e(a,h,a.dump,x),K&&(a.dump="&ref_"+D+a.dump)):(vn(a,h,a.dump),K&&(a.dump="&ref_"+D+" "+a.dump));else if($==="[object Array]")w&&a.dump.length!==0?(a.noArrayIndent&&!S&&h>0?Je(a,h-1,a.dump,x):Je(a,h,a.dump,x),K&&(a.dump="&ref_"+D+a.dump)):(Ve(a,h,a.dump),K&&(a.dump="&ref_"+D+" "+a.dump));else if($==="[object String]")a.tag!=="?"&&hn(a,a.dump,h,_,M);else{if($==="[object Undefined]")return!1;if(a.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+$)}if(a.tag!==null&&a.tag!=="?"){let ee=encodeURI(a.tag[0]==="!"?a.tag.slice(1):a.tag).replace(/!/g,"%21");a.tag[0]==="!"?ee="!"+ee:ee.slice(0,18)==="tag:yaml.org,2002:"?ee="!!"+ee.slice(18):ee="!<"+ee+">",a.dump=ee+" "+a.dump}}return!0}function A(a,h){let C=[],w=[];v(a,C,w);let x=w.length;for(let _=0;_<x;_+=1)h.duplicates.push(C[w[_]]);h.usedDuplicates=new Array(x)}function v(a,h,C){if(a!==null&&typeof a=="object"){let w=h.indexOf(a);if(w!==-1)C.indexOf(w)===-1&&C.push(w);else if(h.push(a),Array.isArray(a))for(let x=0,_=a.length;x<_;x+=1)v(a[x],h,C);else{let x=Object.keys(a);for(let _=0,S=x.length;_<S;_+=1)v(a[x[_]],h,C)}}}function k(a,h){h=h||{};let C=new I(h);C.noRefs||A(a,C);let w=a;return C.replacer&&(w=C.replacer.call({"":w},"",w)),y(C,0,w,!0,!0)?C.dump+`
|
|
33
|
+
`:""}return Wn.dump=k,Wn}var ci;function io(){if(ci)return pe;ci=1;let n=no(),t=to();function i(r,o){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return pe.Type=he(),pe.Schema=ui(),pe.FAILSAFE_SCHEMA=hi(),pe.JSON_SCHEMA=wi(),pe.CORE_SCHEMA=bi(),pe.DEFAULT_SCHEMA=Qn(),pe.load=n.load,pe.loadAll=n.loadAll,pe.dump=t.dump,pe.YAMLException=je(),pe.types={binary:Si(),float:yi(),map:di(),null:mi(),pairs:_i(),set:Ii(),timestamp:xi(),bool:gi(),int:vi(),merge:Ai(),omap:Ci(),seq:pi(),str:fi()},pe.safeLoad=i("safeLoad","load"),pe.safeLoadAll=i("safeLoadAll","loadAll"),pe.safeDump=i("safeDump","dump"),pe}var ro=io(),oo=Xr(ro),{Type:Ba,Schema:Ua,FAILSAFE_SCHEMA:ja,JSON_SCHEMA:qa,CORE_SCHEMA:Ya,DEFAULT_SCHEMA:za,load:ki,loadAll:Ka,dump:Ti,YAMLException:Ha,types:Ga,safeLoad:Wa,safeLoadAll:Qa,safeDump:Va}=oo;var ue=class extends Error{status;detail;requestId;constructor(n,t={}){super(n),this.name=new.target.name,this.status=t.status,this.detail=t.detail,this.requestId=t.requestId}},ao=class extends ue{},so=class extends ue{},lo=class extends ue{},Vn=class extends ue{};function nn(n,t){if(n&&typeof n=="object"&&"detail"in n){let i=n.detail;if(typeof i=="string")return i;if(i&&typeof i=="object"){let r=i;if(typeof r.message=="string")return r.message;if(typeof r.error=="string")return r.error;if(Array.isArray(i)){let o=i.map(s=>s&&typeof s=="object"&&typeof s.msg=="string"?s.msg:null).filter(Boolean);if(o.length)return o.join("; ")}}}return t}function tn(n,t,i){let r={status:n,detail:t,requestId:i};return n===401||n===403?new ao(nn(t,"Authentication failed"),r):n===404?new so(nn(t,"Not found"),r):n>=500?new lo(nn(t,"Server error"),r):new ue(nn(t,`Request failed with status ${n}`),r)}function rn(n){try{return JSON.parse(n)}catch{return n}}var co=class{constructor(n){this.config=n}config;async request(n,t,i={}){let r=new URL(t.startsWith("http")?t:`${this.config.baseUrl}${t}`);if(i.query)for(let[u,f]of Object.entries(i.query))f!=null&&r.searchParams.set(u,String(f));let o={accept:"application/json",...i.headers};this.config.apiKey&&(o["X-API-Key"]=this.config.apiKey);let s;i.body!==void 0&&(o["content-type"]="application/json",s=JSON.stringify(i.body));let l=await fetch(r,{method:n,headers:o,body:s,signal:AbortSignal.timeout(i.timeoutMs??this.config.timeoutMs),redirect:"manual"});if(l.status>=300&&l.status<400){let u=l.headers.get("location");if(u){let f=new URL(u,r),m=await fetch(f,{method:n,headers:o,body:s,signal:AbortSignal.timeout(i.timeoutMs??this.config.timeoutMs)}),g=await m.text(),T=g?rn(g):null;if(!m.ok)throw tn(m.status,T,m.headers.get("x-request-id")??void 0);return T}}let c=await l.text(),p=c?rn(c):null;if(!l.ok)throw tn(l.status,p,l.headers.get("x-request-id")??void 0);return p}async upload(n,t,i,r={}){let o=new URL(t.startsWith("http")?t:`${this.config.baseUrl}${t}`),s={accept:"application/json"};this.config.apiKey&&(s["X-API-Key"]=this.config.apiKey);let l=new FormData,c=new Blob([i.bytes],{type:i.contentType});l.append(i.field??"file",c,i.filename);let p=await fetch(o,{method:n,headers:s,body:l,signal:AbortSignal.timeout(r.timeoutMs??this.config.timeoutMs),redirect:"manual"});if(p.status>=300&&p.status<400){let m=p.headers.get("location");if(m){let g=new URL(m,o),T=await fetch(g,{method:n,headers:s,body:l,signal:AbortSignal.timeout(r.timeoutMs??this.config.timeoutMs)}),F=await T.text(),R=F?rn(F):null;if(!T.ok)throw tn(T.status,R,T.headers.get("x-request-id")??void 0);return R}}let u=await p.text(),f=u?rn(u):null;if(!p.ok)throw tn(p.status,f,p.headers.get("x-request-id")??void 0);return f}},uo=(()=>{try{return"https://api.joinblok.co"}catch{return"http://127.0.0.1:8001"}})(),fo=3e4,po=3e5;function ho(n){return n.endsWith("/")?n.slice(0,-1):n}function mo(n={}){let t=n.baseUrl??process.env.SELDON_BASE_URL??process.env.BLOK_BASE_URL??uo,i=n.apiKey??process.env.SELDON_API_KEY??process.env.BLOK_API_KEY??void 0,r=Number(process.env.SELDON_TIMEOUT_MS??process.env.BLOK_TIMEOUT_MS);return{baseUrl:ho(t),apiKey:i||void 0,timeoutMs:n.timeoutMs??(Number.isFinite(r)&&r>0?r:fo),specCacheTtlMs:n.specCacheTtlMs??po}}var go=new Set(["get","post","put","patch","delete"]),vo="_api_v1_";function yo(n){let t=n.indexOf(vo);return t>0?n.slice(0,t):n}function wo(n){let t=new Set,i=n.components?.securitySchemes??{};for(let[r,o]of Object.entries(i))o?.type==="apiKey"&&o?.in==="header"&&t.add(r);return t}function bo(n){let t=n.security;if(!Array.isArray(t))return[];let i=[];for(let r of t)r&&typeof r=="object"&&i.push(...Object.keys(r));return i}var xo=class Di{constructor(t,i){this.operations=t,this.apiKeySchemes=i}operations;apiKeySchemes;static fromSpec(t){let i=wo(t),r=[];for(let[o,s]of Object.entries(t.paths??{}))for(let[l,c]of Object.entries(s)){if(!go.has(l))continue;let p=c,u=String(p.operationId??`${l}_${o}`),f=Array.isArray(p.parameters)?p.parameters.map(g=>({name:String(g.name),in:g.in,required:!!g.required,description:typeof g.description=="string"?g.description:void 0,schema:g.schema})):[],m=p.tags;r.push({operationId:u,name:yo(u),method:l.toUpperCase(),path:o,tag:m?.[0],summary:typeof p.summary=="string"?p.summary:void 0,description:typeof p.description=="string"?p.description:void 0,params:f,requestBodySchema:Ao(p.requestBody),security:bo(p)})}return new Di(r,i)}apiKeyOps(){return this.apiKeySchemes.size===0?[]:this.operations.filter(t=>t.security.some(i=>this.apiKeySchemes.has(i)))}get(t){return this.apiKeyOps().find(i=>i.name===t||i.operationId===t)}};function Ao(n){if(!n||typeof n!="object")return;let t=n.content;if(t)return t["application/json"]?.schema??Object.values(t)[0]?.schema}function Bi(){if(process.env.BLOK_CACHE_DIR)return process.env.BLOK_CACHE_DIR;let n=Io()||ko();return Pi(n,".cache","blok")}function To(n){let t=So("sha256").update(n).digest("hex").slice(0,16);return Pi(Bi(),`openapi-${t}.json`)}var Ro=class{constructor(n,t=fetch){this.config=n,this.fetchImpl=t}config;fetchImpl;async load(n={}){let t=process.env.BLOK_SPEC_PATH;if(t)try{return JSON.parse(await Ri(t,"utf8"))}catch(r){throw new Vn(`Could not read BLOK_SPEC_PATH (${t}): ${String(r)}`)}let i=To(this.config.baseUrl);if(!n.refresh){let r=await this.readFreshCache(i);if(r)return r}return this.fetchAndCache(i)}async refresh(){return this.load({refresh:!0})}async readFreshCache(n){try{let t=await Ri(n,"utf8"),i=JSON.parse(t);return Date.now()-i.ts<=this.config.specCacheTtlMs?i.spec:null}catch{return null}}async fetchAndCache(n){let t=process.env.SELDON_OPENAPI_URL??process.env.BLOK_OPENAPI_URL??`${this.config.baseUrl}/`,i=t.endsWith(".json")?new URL(t):new URL("/openapi.json",t),r;try{r=await this.fetchImpl(i,{signal:AbortSignal.timeout(this.config.timeoutMs)})}catch(s){throw new Vn(`Could not fetch OpenAPI from ${i.toString()}: ${String(s)}`)}if(!r.ok)throw new Vn(`OpenAPI fetch failed (${r.status}) from ${i.toString()}`,{status:r.status});let o=await r.json();return await this.writeCache(n,o),o}async writeCache(n,t){try{await Co(Bi(),{recursive:!0});let i={ts:Date.now(),spec:t};await _o(n,JSON.stringify(i),"utf8")}catch{}}},Jn={upload_qa_package:["POST","/api/v1/code-tests/upload"],create_qa_baseline:["POST","/api/v1/code-tests/qa-experiment"],list_all_baselines:["GET","/api/v1/code-tests/baselines"],get_baseline_plan:["GET","/api/v1/code-tests/baselines/{baseline_id}/plan"],patch_baseline_plan:["PATCH","/api/v1/code-tests/baselines/{baseline_id}/plan"],run_baseline:["POST","/api/v1/code-tests/baselines/{baseline_id}/run"],update_baseline_from_package:["POST","/api/v1/code-tests/baselines/{baseline_id}/update"],delta_baseline:["POST","/api/v1/code-tests/baselines/{baseline_id}/delta"],list_baseline_versions:["GET","/api/v1/code-tests/baselines/{baseline_id}/versions"],promote_baseline:["POST","/api/v1/code-tests/baselines/{baseline_id}/promote"],get_qa_report:["GET","/api/v1/experiments/{experiment_id}/qa-report"],list_qa_experiments:["GET","/integrations/github/experiments"],stop_experiment:["POST","/api/v1/experiments/{experiment_id}/stop"]};function on(n,t={}){return n.replace(/\{([^}]+)\}/g,(i,r)=>{let o=t[r];if(o===void 0)throw new ue(`Missing path parameter: ${r}`);return encodeURIComponent(String(o))})}var Ui=class{config;client;loader;registry;constructor(n={}){this.config=mo(n),this.client=new co(this.config),this.loader=new Ro(this.config)}async operations(n={}){if(!this.registry||n.refresh){let t=await this.loader.load(n);this.registry=xo.fromSpec(t)}return this.registry}async apiKeyOps(){return(await this.operations()).apiKeyOps()}async hasOperation(n){return n in Jn?!0:(await this.operations()).get(n)!==void 0}async call(n,t={}){let i=Jn[n];if(i){let[s,l]=i,c=on(l,t.path);return this.client.request(s,c,{query:t.query,body:t.body,timeoutMs:t.timeoutMs})}let r=(await this.operations()).get(n);if(!r)throw new ue(`Unknown or non-API-key operation: ${n}`);let o=on(r.path,t.path);return this.client.request(r.method,o,{query:t.query,body:t.body,timeoutMs:t.timeoutMs})}async upload(n,t,i={}){let r=Jn[n];if(r){let[l,c]=r,p=on(c,i.path);return this.client.upload(l,p,t,{timeoutMs:i.timeoutMs})}let o=(await this.operations()).get(n);if(!o)throw new ue(`Unknown or non-API-key operation: ${n}`);let s=on(o.path,i.path);return this.client.upload(o.method,s,t,{timeoutMs:i.timeoutMs})}};function it(n,t){if(n.length===0)return"";let i=n.map(c=>t.map(p=>p.cell(c))),r=t.map((c,p)=>Math.max(c.header.length,...i.map(u=>u[p].length))),o=(c,p,u="left")=>u==="right"?c.padStart(p):c.padEnd(p),s=t.map((c,p)=>o(c.header,r[p],c.align)).join(" "),l=i.map(c=>c.map((p,u)=>o(p,r[u],t[u].align)).join(" "));return[s,...l].join(`
|
|
34
|
+
`)}function zi(n,t){return t<=0||n.length<=t?{shown:n,hiddenCount:0}:{shown:n.slice(0,t),hiddenCount:n.length-t}}var Oi={blocker:0,major:1,minor:2,cosmetic:3},Li={fail:0,blocked:1,timed_out:2},Mi={pass:"\u2705",fail:"\u274C",blocked:"\u{1F6AB}",timed_out:"\u231B"},Mo={pass:"PASS",fail:"FAIL",blocked:"BLOCKED",timed_out:"TIMED_OUT"};function $o(n){let t=n.toLowerCase();return t==="pass"?"pass":t==="fail"?"fail":t==="timed_out"||t==="timedout"?"timed_out":"blocked"}function No(n){return n?.evidence?.length?n.evidence.map(t=>{let i={file:t.source_path};return typeof t.start_line=="number"&&typeof t.end_line=="number"&&(i.lines={start:t.start_line,end:t.end_line}),t.chunk_hash&&(i.chunkHash=t.chunk_hash),t.note&&(i.note=t.note),i}):[]}function rt(n){return n.lines?`\`${n.file}\` (lines ${n.lines.start}-${n.lines.end})`:`\`${n.file}\``}function Fo(n,t,i){let r=[];if(n==="blocked"){let l=t.unmet_preconditions??[];l.length?r.push(`Blocked \u2014 unmet preconditions: ${l.join("; ")}.`):r.push("Blocked before the case could be evaluated.")}else n==="timed_out"&&r.push("The run stalled and never completed; re-run to confirm before triaging.");if(i.length){let l=i.slice(0,3).map(rt).join(", ");r.push(`Likely in ${l}.`)}let o=(t.expected??"").trim(),s=(t.actual??"").trim();return o&&s?r.push(`Expected: ${o} Observed: ${s}`):o?r.push(`Expected: ${o}`):s&&r.push(`Observed: ${s}`),r.length===0&&t.acceptance_criterion&&r.push(`Did not satisfy: ${t.acceptance_criterion}`),r.join(" ").trim()}function Do(n){if(n.total===0)return"No cases were executed.";let t=Math.round(n.passRate*100),i=[`${n.passed}/${n.total} passed (${t}%)`];return n.failed&&i.push(`${n.failed} failed`),n.blocked&&i.push(`${n.blocked} blocked`),n.timedOut&&i.push(`${n.timedOut} timed out`),i.join(", ")+"."}function Po(n){let t=n.test_plan??{title:"Untitled plan"},i=new Map;for(let g of t.test_cases??[])i.set(g.id,g);let r=n.experiment_id??"",o=n.report?.plan_title||t.title||"Untitled plan",s=t.open_questions??[];if(!n.report)return{experimentId:r,planTitle:o,status:"not_run",summary:{total:t.test_cases?.length??0,passed:0,failed:0,blocked:0,timedOut:0,passRate:0,headline:"Plan generated; not run yet."},failures:[],passed:[],coverage:{journeysExercised:[],unreachable:[],flakyCaseIds:[]},openQuestions:s};let l=n.report,c=l.case_results??[],p=[],u=[];for(let g of c){let T=$o(g.verdict);if(T==="pass"){u.push({id:g.test_case_id,title:g.title});continue}let F=No(i.get(g.test_case_id)),R=g.attempts??1,q=g.passes??0;p.push({id:g.test_case_id,title:g.title,area:i.get(g.test_case_id)?.area,verdict:T,severity:g.severity??void 0,acceptanceCriterion:g.acceptance_criterion,expected:g.expected??void 0,actual:g.actual??void 0,reproductionSteps:g.reproduction_steps??[],unmetPreconditions:g.unmet_preconditions??[],evidence:F,hint:Fo(T,g,F),screenshotUrls:g.screenshot_urls??[],recordingUrl:g.recording_url??void 0,attempts:R,passes:q,flaky:R>1&&q>0&&q<R})}p.sort((g,T)=>{let F=(Li[g.verdict]??9)-(Li[T.verdict]??9);if(F!==0)return F;let R=Oi[(g.severity??"").toLowerCase()]??9,q=Oi[(T.severity??"").toLowerCase()]??9;return R-q});let f=l.total_cases??c.length,m={total:f,passed:l.passed??0,failed:l.failed??0,blocked:l.blocked??0,timedOut:l.timed_out??0,passRate:f>0?(l.passed??0)/f:0};return{experimentId:r,planTitle:o,status:"complete",summary:{...m,headline:Do(m)},failures:p,passed:u,coverage:{journeysExercised:l.coverage?.journeys_exercised??[],unreachable:l.coverage?.unreachable??[],confidenceNote:l.coverage?.confidence_note??void 0,flakyCaseIds:l.coverage?.flaky_case_ids??[]},narrative:l.summary||void 0,openQuestions:s}}var Bo=8,Uo=8,$i=12,Ki=5;function Hi(n){let t=n.summary,i=[];t.failed&&i.push(`\u274C${t.failed}`),t.blocked&&i.push(`\u{1F6AB}${t.blocked}`),t.timedOut&&i.push(`\u231B${t.timedOut}`);let r=Math.round(t.passRate*100);return[`${t.passed}/${t.total} passed (${r}%)`,...i].join(" \xB7 ")}function Gi(n){let t=n.failures.map(r=>({verdict:r.verdict,severity:r.severity,id:r.id,title:r.title})),i=n.passed.map(r=>({verdict:"pass",id:r.id,title:r.title}));return[...t,...i]}function Wi(n,t={}){let i=[`Seldon QA \u2014 ${n.planTitle} \xB7 ${Hi(n)}`];if(n.narrative&&i.push("",n.narrative),n.status==="not_run")return i.push("",`Plan has ${n.summary.total} case(s); run it against a URL to produce results.`),i.join(`
|
|
35
|
+
`);i.push("");for(let s of Gi(n)){let l=Mo[s.verdict].padEnd(Bo),c=(s.severity?.toUpperCase()??"").padEnd(Uo);i.push(`${l} ${c} ${s.id} ${s.title}`)}let{shown:r,hiddenCount:o}=t.full?{shown:n.failures,hiddenCount:0}:zi(n.failures,t.compactLimit??Ki);for(let s of r){i.push("",`${s.id} ${s.title}${s.flaky?" (FLAKY)":""}`);let l=(c,p)=>` ${c.padEnd($i)}${p}`;s.acceptanceCriterion&&i.push(l("acceptance:",s.acceptanceCriterion)),s.expected&&i.push(l("expected:",s.expected)),s.actual&&i.push(l("observed:",s.actual)),s.evidence.length&&i.push(l("source:",s.evidence.map(rt).join(", "))),s.reproductionSteps.length&&(i.push(l("repro:",s.reproductionSteps[0])),s.reproductionSteps.slice(1).forEach(c=>i.push(" ".repeat(2+$i)+c))),s.screenshotUrls.length&&i.push(l("evidence:",s.screenshotUrls.join(", "))),s.recordingUrl&&i.push(l("recording:",s.recordingUrl)),!s.acceptanceCriterion&&!s.expected&&!s.actual&&!s.evidence.length&&i.push(l("hint:",s.hint))}return o>0&&i.push("",`\u2026 +${o} more \u2014 pass \`full\` to see every detail block.`),n.coverage.unreachable.length&&i.push("",`Not reached: ${n.coverage.unreachable.join("; ")}`),n.coverage.flakyCaseIds.length&&i.push(`Flaky cases: ${n.coverage.flakyCaseIds.join(", ")}`),i.join(`
|
|
36
|
+
`)}function Qi(n,t={}){let i=[`**Seldon QA \u2014 ${n.planTitle}** \xB7 ${Hi(n)}`];if(n.narrative&&i.push("",`> ${n.narrative}`),n.status==="not_run")return i.push("",`_Plan has ${n.summary.total} case(s); run it against a URL to produce results._`),i.join(`
|
|
37
|
+
`);let r=Gi(n);if(r.length){i.push("","| | Case |","|---|---|");for(let l of r){let c=l.severity?`${Mi[l.verdict]} \`${l.severity.toUpperCase()}\``:Mi[l.verdict];i.push(`| ${c} | \`${l.id}\` ${l.title} |`)}}let{shown:o,hiddenCount:s}=t.full?{shown:n.failures,hiddenCount:0}:zi(n.failures,t.compactLimit??Ki);for(let l of o)i.push("","---",`##### ${l.id} \u2014 ${l.title}${l.flaky?" _(flaky)_":""}`),l.acceptanceCriterion&&i.push(`acceptance: ${l.acceptanceCriterion}`),l.expected&&i.push(`expected: ${l.expected}`),l.actual&&i.push(`observed: ${l.actual}`),l.evidence.length&&i.push(`source: ${l.evidence.map(rt).join(", ")}`),l.reproductionSteps.length&&(i.push("repro:"),l.reproductionSteps.forEach((c,p)=>i.push(`${p+1}. ${c}`))),l.screenshotUrls.length&&i.push(`evidence: ${l.screenshotUrls.map((c,p)=>`[screenshot ${p+1}](${c})`).join(" ")}`),l.recordingUrl&&i.push(`recording: [gif](${l.recordingUrl})`),!l.acceptanceCriterion&&!l.expected&&!l.actual&&!l.evidence.length&&i.push(l.hint);return s>0&&i.push("",`_\u2026 +${s} more \u2014 pass \`full\` to see every detail block._`),(n.coverage.unreachable.length||n.coverage.flakyCaseIds.length)&&(i.push("","---"),n.coverage.unreachable.length&&i.push(`_Not reached: ${n.coverage.unreachable.join("; ")}_`),n.coverage.flakyCaseIds.length&&i.push(`_Flaky: ${n.coverage.flakyCaseIds.join(", ")}_`)),i.join(`
|
|
38
|
+
`)}function Ni(n){if(n&&!(typeof n.start!="number"||typeof n.end!="number"))return{start:n.start,end:n.end}}function jo(n,t){return{id:n.test_case_id,title:t.get(n.test_case_id),oldLines:Ni(n.old_lines),newLines:Ni(n.new_lines)}}function qo(n){return{id:n.test_case_id,title:n.title,reason:n.reason??void 0,snippet:n.snippet??void 0}}function Yo(n){return{id:n.test_case_id,verdict:n.verdict,reasoning:n.reasoning??void 0,snippet:n.snippet??void 0,decidedAt:n.decided_at??void 0}}function zo(n){let t=[`${n.kept} kept`];return n.reanchored&&t.push(`${n.reanchored} re-anchored`),n.added&&t.push(`${n.added} added`),n.nullified&&t.push(`${n.nullified} nullified`),`Baseline update: ${t.join(", ")}.`}function Vi(n,t){let i=[...new Set(n)],r=new Set((t.test_cases??[]).filter(l=>(l.status??"active")!=="nullified"&&(l.status??"active")!=="superseded").map(l=>l.id)),o=i.filter(l=>r.has(l)),s=i.filter(l=>!r.has(l));return{required:i,covered:o,missing:s,ok:s.length===0}}function Ji(n,t=[]){let i=n.test_plan??{title:"Untitled plan"},r=new Map;for(let g of i.test_cases??[])r.set(g.id,g.title);let o=t.length?t:(i.test_cases??[]).filter(g=>g.fixed).map(g=>g.id),s=n.diff??{},l=s.kept??[],c=(s.reanchored??[]).map(g=>jo(g,r)),p=(s.nullified??[]).map(qo),u=(s.added??[]).map(g=>({id:g.test_case_id,title:g.title})),f=(n.decisions??[]).map(Yo),m={total:i.test_cases?.length??0,kept:l.length,reanchored:c.length,nullified:p.length,added:u.length};return{experimentId:n.experiment_id??"",planTitle:i.title||"Untitled plan",summary:{...m,headline:zo(m)},kept:l,reanchored:c,nullified:p,added:u,decisions:f,fixedCoverage:Vi(o,i)}}function an(n){return n?`${n.start}-${n.end}`:"?"}function Zi(n){let t=[];t.push(`Seldon baseline update \u2014 ${n.planTitle}`),t.push(n.summary.headline);let i=n.fixedCoverage;if(i.required.length&&t.push(i.ok?`Fixed cases preserved: ${i.covered.length}/${i.required.length}.`:`WARNING: fixed cases NOT covered: ${i.missing.join(", ")}`),n.added.length){t.push("",`Added (${n.added.length}):`);for(let r of n.added)t.push(` + [${r.id}] ${r.title??""}`.trimEnd())}if(n.reanchored.length){t.push("",`Re-anchored (${n.reanchored.length}):`);for(let r of n.reanchored)t.push(` ~ [${r.id}] ${r.title??""}`.trimEnd()+` (lines ${an(r.oldLines)} -> ${an(r.newLines)})`)}if(n.nullified.length){t.push("",`Nullified (${n.nullified.length}):`);for(let r of n.nullified)t.push(` - [${r.id}] ${r.title??""}`.trimEnd()),r.reason&&t.push(` reason: ${r.reason}`)}return!n.added.length&&!n.reanchored.length&&!n.nullified.length&&t.push("","No changes \u2014 every case still covers its functionality."),t.join(`
|
|
39
|
+
`)}function Xi(n){let t=[];t.push(`# Seldon baseline update \u2014 ${n.planTitle}`,"",`**${n.summary.headline}**`);let i=n.fixedCoverage;if(i.required.length&&t.push("",i.ok?`Fixed cases preserved: **${i.covered.length}/${i.required.length}**.`:`> **WARNING:** fixed cases not covered: ${i.missing.join(", ")}`),n.added.length){t.push("",`## Added (${n.added.length})`);for(let r of n.added)t.push(`- \`${r.id}\` ${r.title??""}`.trimEnd())}if(n.reanchored.length){t.push("",`## Re-anchored (${n.reanchored.length})`);for(let r of n.reanchored)t.push(`- \`${r.id}\` ${r.title??""}`.trimEnd()+` \u2014 lines ${an(r.oldLines)} \u2192 ${an(r.newLines)}`)}if(n.nullified.length){t.push("",`## Nullified (${n.nullified.length})`);for(let r of n.nullified)t.push(`- \`${r.id}\` ${r.title??""}`.trimEnd()+(r.reason?` \u2014 ${r.reason}`:""))}return!n.added.length&&!n.reanchored.length&&!n.nullified.length&&t.push("","## No changes","","Every case still covers its functionality."),t.join(`
|
|
40
|
+
`)}var ot=new Set([".git","node_modules",".venv","venv","__pycache__","dist","build",".next",".idea",".turbo","coverage",".seldon"]),er=256*1024,Ko=8e3,Ho=50*1024*1024,Go=8192,at="application/zip",nr=new Date("2020-01-01T00:00:00Z"),st=new Set(["seldon.yml","seldon.yaml"]),Wo=/^(readme|contributing)(\.|$)/i;function nt(n){return n.startsWith(".")}function Qo(n){return st.has(n)||Wo.test(n)}function tr(n){return Ei==="/"?n:n.split(Ei).join("/")}function ir(n){let t=Math.min(n.length,Go);for(let i=0;i<t;i+=1)if(n[i]===0)return!0;return!1}async function sn(n,t={}){let i=new Set(ot);for(let m of t.ignoreDirs??[])i.add(m);let r=t.maxFileBytes??er,o=t.maxFiles??Ko,s=t.maxTotalBytes??Ho,l=[],c=[],p=0,u=null;async function f(m){if(u)return;let g;try{g=await Oo(m,{withFileTypes:!0})}catch{return}g.sort((T,F)=>T.name.localeCompare(F.name));for(let T of g){if(u)return;let F=Yi(m,T.name),R=tr(Lo(n,F));if(T.isSymbolicLink())continue;if(T.isDirectory()){if(nt(T.name)){c.push({path:R,reason:"hidden"});continue}if(i.has(T.name)){c.push({path:R,reason:"ignored-dir"});continue}await f(F);continue}if(!T.isFile())continue;if(nt(T.name)&&!st.has(T.name)){c.push({path:R,reason:"hidden"});continue}if(!R.includes("/")&&!Qo(T.name)){c.push({path:R,reason:"root-file"});continue}let q;try{q=(await qi(F)).size}catch{continue}if(q>r){c.push({path:R,reason:"too-large"});continue}if(l.length>=o){u="limit-files";return}if(p+q>s){u="limit-bytes";return}let ne;try{ne=new Uint8Array(await ji(F))}catch{continue}if(ir(ne)){c.push({path:R,reason:"binary"});continue}l.push({path:R,bytes:ne}),p+=q}}return await f(n),u&&c.push({path:"",reason:u}),{files:l,skipped:c,totalBytes:p}}async function ln(n,t={}){let{files:i,skipped:r}=await sn(n,t);if(i.length===0)throw new ue(`No analysable files found under ${n} (everything was empty, ignored, or binary).`);let o={};for(let s of i)o[s.path]=s.bytes;return{bytes:In(o,{level:6,mtime:nr}),filename:t.filename??"codebase.zip",fileCount:i.length,skipped:r}}function Fi(n,t){try{return Eo("git",["-C",n,...t],{encoding:"utf8",maxBuffer:64*1024*1024})}catch(i){throw new ue(`git ${t.join(" ")} failed (is '${n}' a git repository?): ${i.message.split(`
|
|
41
|
+
`)[0]}`)}}async function rr(n,t={}){let i=t.base?[`${t.base}...HEAD`]:["HEAD"],r=Fi(n,["diff",...i]);if(!r.trim())throw new ue(t.base?`No changes between ${t.base} and HEAD to reassess.`:"No uncommitted changes vs HEAD to reassess.");let o=Fi(n,["diff","--name-only","--diff-filter=d",...i]).split(`
|
|
42
|
+
`).map(f=>f.trim()).filter(Boolean),s=t.maxFileBytes??er,l=new Set(ot),c={"changes.patch":new TextEncoder().encode(r)},p=[],u=0;for(let f of o){let m=f.split("/"),g=m[m.length-1];if(nt(g)&&!st.has(g)){p.push({path:f,reason:"hidden"});continue}if(m.some(R=>l.has(R))){p.push({path:f,reason:"ignored-dir"});continue}let T=Yi(n,f),F;try{if((await qi(T)).size>s){p.push({path:f,reason:"too-large"});continue}F=new Uint8Array(await ji(T))}catch{continue}if(ir(F)){p.push({path:f,reason:"binary"});continue}c[tr(f)]=F,u+=1}return{bytes:In(c,{level:6,mtime:nr}),filename:t.filename??"changed.zip",fileCount:u,skipped:p,patch:r}}async function or(n,t,i={}){let r=await ln(t,i),o=await n.upload("upload_qa_package",{field:"file",filename:r.filename,contentType:at,bytes:r.bytes});return{lineageId:(await n.call("create_qa_baseline",{body:{package_gcs_url:o.package_gcs_url,filename:o.filename,url:"",...i.scope?{scope:i.scope}:{},...i.label?{label:i.label}:{}}})).lineage_id,filename:r.filename,packageGcsUrl:o.package_gcs_url,fileCount:r.fileCount,skipped:r.skipped}}function Vo(n){return{id:n.id,lineageId:n.lineage_id,displayName:n.display_name,status:n.status,createdVia:n.created_via,caseCount:n.case_count,targetUrl:n.target_url??void 0,repoFullName:n.repo_full_name??void 0,installationId:n.installation_id??void 0,createdAt:n.created_at??void 0}}async function lt(n){return{baselines:((await n.call("list_all_baselines")).baselines??[]).map(Vo)}}async function ar(n,t,i={}){let r=i.intervalMs??3e3,o=Date.now(),s=o+(i.timeoutMs??10*6e4);for(;;){i.onTick?.(Date.now()-o);let{baselines:l}=await lt(n),c=l.find(p=>p.lineageId===t&&p.status==="committed"&&p.caseCount>0);if(c)return c;if(Date.now()>=s)throw new ue(`Timed out waiting for the baseline plan for lineage ${t}.`);await new Promise(p=>setTimeout(p,r))}}async function qe(n,t){return n.call("get_baseline_plan",{path:{baseline_id:t}})}async function Jo(n,t,i){return n.call("patch_baseline_plan",{path:{baseline_id:t},body:{...i.targetUrl!==void 0?{target_url:i.targetUrl}:{},...i.credentials!==void 0?{credentials:i.credentials}:{},...i.clearCredentials?{clear_credentials:!0}:{}}})}async function sr(n,t){let i=await n.call("list_baseline_versions",{path:{baseline_id:t}});return{lineageId:i.lineage_id,committedHeadId:i.committed_head_id??void 0,versions:(i.versions??[]).map(r=>({id:r.id,lineageId:r.lineage_id,status:r.status,createdVia:r.created_via,title:r.title??void 0,caseCount:r.case_count,targetUrl:r.target_url??void 0,isHead:r.is_head,createdAt:r.created_at??void 0}))}}async function lr(n,t){return n.call("promote_baseline",{path:{baseline_id:t}})}async function cr(n,t,i={}){return i.credentials!==void 0&&await Jo(n,t,{credentials:i.credentials}),{experimentId:(await n.call("run_baseline",{path:{baseline_id:t},...i.url!==void 0?{body:{target_url:i.url}}:{}})).experiment_id}}async function ur(n,t){let i=await n.call("stop_experiment",{path:{experiment_id:t},body:{action:"cancel"}});return{status:i.status??"success",message:i.message??void 0}}async function fr(n,t){return n.call("get_experiment_qa_report",{path:{experiment_id:t}})}async function pr(n,t,i={}){let r=i.intervalMs??5e3,o=Date.now(),s=o+(i.timeoutMs??30*6e4);for(;;){i.onTick?.(Date.now()-o);let l=await fr(n,t);if(l.report!=null||Date.now()>=s)return l;await new Promise(c=>setTimeout(c,r))}}async function ct(n,t){let i=await fr(n,t);return Po({...i,experiment_id:i.experiment_id??t})}var dr=3e5,Zn="update_baseline_from_package";async function hr(n,t,i,r={}){let o=r.fixedCaseIds??[];if(!await n.hasOperation(Zn))throw new ue(`Baseline update isn't available on this API yet: the server must expose the '${Zn}' operation (POST /code-tests/baselines/{id}/update). Re-run 'seldon baseline generate' to rebuild from scratch, or upgrade the API.`);let s=await ln(t,r),l=await n.upload("upload_qa_package",{field:"file",filename:s.filename,contentType:at,bytes:s.bytes}),c=await n.call(Zn,{path:{baseline_id:i},timeoutMs:dr,body:{package_gcs_url:l.package_gcs_url,filename:l.filename,...r.fixedCaseIds!==void 0?{fixed_case_ids:o}:{},...r.seldonYaml!==void 0?{seldon_yaml:r.seldonYaml}:{}}}),p=c.test_plan??{title:""},u=o.length?o:(p.test_cases??[]).filter(m=>m.fixed).map(m=>m.id),f=Vi(u,p);if(!f.ok)throw new ue(`Baseline update dropped fixed case(s) that must always be covered: ${f.missing.join(", ")}. Refusing the result \u2014 the baseline's fixed cases are agreed-upon and cannot be nullified.`);return Ji({...c,experiment_id:c.experiment_id??i},o)}var Xn="delta_baseline";async function mr(n,t,i){if(!await n.hasOperation(Xn))throw new ue(`Baseline delta isn't available on this API yet: the server must expose the '${Xn}' operation (POST /code-tests/baselines/{id}/delta). Upgrade the API, or use 'seldon baseline update' for a whole-package re-map.`);let r=await n.upload("upload_qa_package",{field:"file",filename:i.filename??(i.full?"repo.zip":"changed.zip"),contentType:at,bytes:i.zipBytes}),o=await n.call(Xn,{path:{baseline_id:t},timeoutMs:dr,body:{package_gcs_url:r.package_gcs_url,filename:r.filename,...i.full?{full:!0}:{},...i.targetUrl!==void 0?{target_url:i.targetUrl}:{},...i.fixedCaseIds!==void 0?{fixed_case_ids:i.fixedCaseIds}:{},...i.seldonYaml!==void 0?{seldon_yaml:i.seldonYaml}:{},...i.autoRun!==void 0?{auto_run:i.autoRun}:{}}}),s=Ji({experiment_id:o.draft_baseline_id,test_plan:{title:""},diff:o.diff??void 0,decisions:o.decisions??void 0},i.fixedCaseIds??[]);return{draftBaselineId:o.draft_baseline_id,lineageId:o.lineage_id,experimentId:o.experiment_id??void 0,report:s}}function ut(n,t){let i=new Map;for(let o of n){let s=o.path.indexOf("/");if(s===-1){i.set(o.path,{name:o.path,type:"file",fileCount:1});continue}let l=o.path.slice(0,s),c=i.get(l);c?c.fileCount+=1:i.set(l,{name:l,type:"dir",fileCount:1})}let r=Array.from(i.values()).sort((o,s)=>o.name.localeCompare(s.name));return{totalFiles:n.length,totalBytes:t,rootEntries:r}}function ft(n){let t=new Set;for(let i of n){if(i.reason!=="ignored-dir"||!i.path)continue;let r=i.path.split("/").pop();r&&t.add(r)}return Array.from(t).sort()}function vr(n){if(n<1024)return`${n} B`;let t=["KB","MB","GB","TB"],i=n/1024,r=0;for(;i>=1024&&r<t.length-1;)i/=1024,r+=1;return`${i.toFixed(1)} ${t[r]}`}var tt="seldon.yml",na=Array.from(ot),ta="ALL";function Ye(){return{baseline:{baselineId:"",lineageId:"",generate:{scope:"",filename:"codebase.zip",ignoreDirs:[...na]},run:{url:""}},testCases:{skip:[],only:[],fixed:[]},cli:{wait:!0,reportFormat:"markdown"}}}function Re(n){return Xo(ea(n),tt)}function ve(n){let t;try{t=gr(Re(n),"utf8")}catch{return null}return ia(t)}function pt(n){try{return gr(Re(n),"utf8")}catch{return}}function ia(n){let t;try{t=ki(n)}catch(i){throw new ue(`Could not parse ${tt}: ${i.message}`)}if(t==null)return{};if(typeof t!="object"||Array.isArray(t))throw new ue(`${tt} must be a YAML mapping at the top level.`);return t}function ra(n){return Ti(n,{noRefs:!0,lineWidth:-1})}function Me(n,t){Zo(Re(n),ra(t),"utf8")}function et(n,t){return!n||n.length===0?[]:n.includes(ta)?[...t]:n}function yr(n,t,i){return et(t?.only,i).includes(n)?"only":et(t?.skip,i).includes(n)?"skip":et(t?.fixed,i).includes(n)?"fixed":"none"}function dt(n){let t={};for(let i of n)t[i.reason]=(t[i.reason]??0)+1;return t}async function wr(n){let t=Ye(),i=t.baseline?.generate?.ignoreDirs??[],{files:r,skipped:o,totalBytes:s}=await sn(n,{ignoreDirs:i});return{config:t,preview:ut(r,s),ignored:ft(o),skippedByReason:dt(o)}}function br(n){let t=n.slice(2);for(let i=0;i<t.length;i+=1){let r=t[i];if(r==="--base-url"||r==="--api-key"){i+=1;continue}if(!r.startsWith("-"))return r==="api"}return!1}import{readFileSync as Ra}from"fs";import{Command as Ea}from"commander";var oa="\x1B[0m",aa={bold:"1",dim:"2",inverse:"7",red:"31",green:"32",yellow:"33",blue:"34",magenta:"35",cyan:"36",gray:"90"};function sa(){return process.env.NO_COLOR!==void 0&&process.env.NO_COLOR!==""?!1:process.env.FORCE_COLOR!==void 0&&process.env.FORCE_COLOR!==""?!0:!!process.stdout.isTTY}function cn(n,...t){return!sa()||t.length===0?n:`${t.map(r=>`\x1B[${aa[r]}m`).join("")}${n}${oa}`}var ht=n=>cn(n,"bold"),xr=n=>cn(n,"dim");import{mkdirSync as la,readFileSync as ca,writeFileSync as ua}from"fs";import{homedir as fa}from"os";import{join as Ar}from"path";function Sr(){return process.env.SELDON_CONFIG_DIR??process.env.BLOK_CONFIG_DIR??Ar(fa(),".config","seldon")}function Cr(){return Ar(Sr(),"config.json")}function ze(){try{return JSON.parse(ca(Cr(),"utf8"))}catch{return{}}}function un(n){let t={...ze(),...n};return la(Sr(),{recursive:!0,mode:448}),ua(Cr(),`${JSON.stringify(t,null,2)}
|
|
43
|
+
`,{encoding:"utf8",mode:384}),t}function _r(n,t,i){return{baseUrl:n.baseUrl??i.SELDON_BASE_URL??i.BLOK_BASE_URL??t.baseUrl,apiKey:n.apiKey??i.SELDON_API_KEY??i.BLOK_API_KEY??t.apiKey}}function Ie(n,t){if(n.id)return n.id;let i=ve(t),r=i?.baseline?.baselineId;if(r)return r;let o=i?.baseline?.experimentId;if(o)return process.stderr.write(`note: seldon.yml uses the legacy 'baseline.experimentId' \u2014 rename it to 'baseline.baselineId'.
|
|
44
|
+
`),o;throw new Error("No baseline found here. Run `seldon baseline generate` first, or pass --id <baselineId>.")}function mt(n,t){if(n.id)return n.id;let i=ve(t),r=i?.baseline?.lastRunExperimentId;if(r)return r;let o=i?.baseline?.experimentId;if(o)return o;throw new Error("No run found here yet. Run `seldon baseline run` first, or pass --id <experimentId>.")}function Ee(n,t){let i=ve(n)??Ye(),r=t(i);return Me(n,r),r}var pa="Other",da=3,ha=3,ma=3,gt=["none","skip","only","fixed"],ga={none:" ",skip:"s",only:"o",fixed:"f"};function va(){return{get isTTY(){return!!process.stdin.isTTY},get columns(){return process.stdout.columns||80},get rows(){return process.stdout.rows||24},write:n=>process.stdout.write(n),onData:n=>process.stdin.on("data",n),offData:n=>process.stdin.removeListener("data",n),onResize:n=>process.stdout.on("resize",n),offResize:n=>process.stdout.removeListener("resize",n),setRawMode:n=>process.stdin.setRawMode?.(n),resume:()=>{process.stdin.setEncoding("utf8"),process.stdin.resume()},pause:()=>process.stdin.pause()}}function ya(n){let t=new Map;for(let r of n){let o=r.area?.trim()||pa;(t.get(o)??t.set(o,[]).get(o)).push(r)}let i=[];for(let[r,o]of t){i.push({kind:"header",text:`${r} (${o.length} case${o.length===1?"":"s"})`});for(let s of o)i.push({kind:"case",testCase:s})}return i}function wa(n,t){let i=(ve(t)??Ye()).testCases,r=new Set(n.map(s=>s.id)),o=new Map(n.map(s=>[s.id,"none"]));for(let s of i?.fixed??[])r.has(s)&&o.set(s,"fixed");for(let s of i?.skip??[])r.has(s)&&o.set(s,"skip");for(let s of i?.only??[])r.has(s)&&o.set(s,"only");return o}function ba(n,t){return t<=1||n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}\u2026`}var vt=class{constructor(t,i,r,o){this.planTitle=t;this.io=o;this.rows=ya(i),this.caseRowIndices=this.rows.reduce((s,l,c)=>l.kind==="case"?[...s,c]:s,[]),this.statuses=wa(i,r),this.cursor=0}planTitle;io;rows;caseRowIndices;statuses;cursor;linesWrittenLastRender=0;resolveFn;get columns(){return this.io.columns}get availableRows(){return Math.max(ma,this.io.rows-da-ha)}currentCase(){let t=this.rows[this.caseRowIndices[this.cursor]];if(t?.kind!=="case")throw new Error("cursor is not on a case row");return t.testCase}setStatus(t){let i=this.currentCase().id;this.statuses.set(i,this.statuses.get(i)===t?"none":t)}cycleStatus(){let t=this.currentCase().id,i=this.statuses.get(t)??"none",r=gt[(gt.indexOf(i)+1)%gt.length];this.statuses.set(t,r)}moveCursor(t){let i=this.caseRowIndices.length;this.cursor=((this.cursor+t)%i+i)%i}counts(){let t={none:0,skip:0,only:0,fixed:0};for(let i of this.statuses.values())t[i]+=1;return t}viewportRange(){let t=this.rows.length,i=this.availableRows;if(t<=i)return[0,t];let r=this.caseRowIndices[this.cursor],o=Math.max(0,r-Math.floor(i/2));return o=Math.min(o,t-i),[o,o+i]}render(){let t=this.columns,i=[],r=(c,...p)=>{i.push({text:c,colors:p.length?p:void 0})};r(`Configure test cases \u2014 ${this.planTitle}`,"bold"),r("\u2191/\u2193 move \xB7 s/o/f set \xB7 space cycle \xB7 enter save \xB7 esc/q cancel","dim"),r("");let[o,s]=this.viewportRange();o>0&&r(` \u2191 ${o} more above`,"dim");for(let c=o;c<s;c+=1){let p=this.rows[c];if(p.kind==="header"){r(p.text,"bold");continue}let u=this.caseRowIndices[this.cursor]===c,f=this.statuses.get(p.testCase.id)??"none",g=`${u?"\u276F":" "} [${ga[f]}] ${p.testCase.id}: ${p.testCase.title}`;u?r(g,"cyan","bold"):f==="skip"?r(g,"yellow"):f==="only"?r(g,"cyan"):f==="fixed"?r(g,"green"):r(g)}s<this.rows.length&&r(` \u2193 ${this.rows.length-s} more below`,"dim");let l=this.counts();r(""),r("Legend: [s]=skip [o]=only [f]=fixed [ ]=normal","dim"),r(`skip: ${l.skip} only: ${l.only} fixed: ${l.fixed}`,"dim"),this.linesWrittenLastRender>0&&this.io.write(`\x1B[${this.linesWrittenLastRender}A`);for(let{text:c,colors:p}of i){let u=ba(c,t);this.io.write(`\r\x1B[2K${p?cn(u,...p):u}
|
|
45
45
|
`)}this.linesWrittenLastRender=i.length}finish(t){this.io.write(`
|
|
46
46
|
`),this.cleanup(),this.resolveFn?.(t)}onData=t=>{if(t===""||t==="q"||t==="\x1B")return this.finish(!1);if(t==="\r"||t===`
|
|
47
|
-
`)return this.finish(!0);if(t==="\x1B[A"||t==="k")return this.rerenderAfter(()=>this.moveCursor(-1));if(t==="\x1B[B"||t==="j")return this.rerenderAfter(()=>this.moveCursor(1));if(t===" ")return this.rerenderAfter(()=>this.cycleStatus());if(t==="s")return this.rerenderAfter(()=>this.setStatus("skip"));if(t==="o")return this.rerenderAfter(()=>this.setStatus("only"));if(t==="f")return this.rerenderAfter(()=>this.setStatus("fixed"))};rerenderAfter(t){t(),this.render()}onResize=()=>{this.linesWrittenLastRender=0,this.render()};cleanup(){this.io.setRawMode(!1),this.io.pause(),this.io.offData(this.onData),this.io.offResize(this.onResize),this.io.write("\x1B[?25h")}async run(){if(!this.io.isTTY)throw new Error("`seldon baseline configure` needs an interactive terminal (TTY). Run it directly in a shell.");return this.io.write("\x1B[?25l"),this.render(),this.io.setRawMode(!0),this.io.resume(),this.io.onData(this.onData),this.io.onResize(this.onResize),new Promise(t=>{this.resolveFn=t})}result(){let t=[],i=[],r=[];for(let[o,s]of this.statuses)s==="skip"?t.push(o):s==="only"?i.push(o):s==="fixed"&&r.push(o);return{skip:t,only:i,fixed:r}}};async function
|
|
48
|
-
`))}import{spinner as
|
|
49
|
-
`)),r=n.status??(
|
|
50
|
-
`)),o=new
|
|
47
|
+
`)return this.finish(!0);if(t==="\x1B[A"||t==="k")return this.rerenderAfter(()=>this.moveCursor(-1));if(t==="\x1B[B"||t==="j")return this.rerenderAfter(()=>this.moveCursor(1));if(t===" ")return this.rerenderAfter(()=>this.cycleStatus());if(t==="s")return this.rerenderAfter(()=>this.setStatus("skip"));if(t==="o")return this.rerenderAfter(()=>this.setStatus("only"));if(t==="f")return this.rerenderAfter(()=>this.setStatus("fixed"))};rerenderAfter(t){t(),this.render()}onResize=()=>{this.linesWrittenLastRender=0,this.render()};cleanup(){this.io.setRawMode(!1),this.io.pause(),this.io.offData(this.onData),this.io.offResize(this.onResize),this.io.write("\x1B[?25h")}async run(){if(!this.io.isTTY)throw new Error("`seldon baseline configure` needs an interactive terminal (TTY). Run it directly in a shell.");return this.io.write("\x1B[?25l"),this.render(),this.io.setRawMode(!0),this.io.resume(),this.io.onData(this.onData),this.io.onResize(this.onResize),new Promise(t=>{this.resolveFn=t})}result(){let t=[],i=[],r=[];for(let[o,s]of this.statuses)s==="skip"?t.push(o):s==="only"?i.push(o):s==="fixed"&&r.push(o);return{skip:t,only:i,fixed:r}}};async function Ir(n,t,i,r){let{status:o}=r,s=await qe(n,i),l=s.cases??[];if(l.length===0){o("This baseline has no test cases yet \u2014 wait for generation to finish, then try again.");return}let c=new vt(s.title??"Baseline",l,t,r.io??va());if(!await c.run()){o("Aborted \u2014 no changes saved.");return}let{skip:u,only:f,fixed:m}=c.result();Ee(t,g=>({...g,testCases:{skip:u,only:f,fixed:m}})),o(`Saved to seldon.yml \u2014 skip: ${u.length}, only: ${f.length}, fixed: ${m.length}`)}import{existsSync as xa}from"fs";import{cancel as yt,confirm as Aa,intro as Sa,isCancel as fn,outro as kr,text as wt}from"@clack/prompts";var bt=12,Tr=48,xt=8;function Rr(n){if(n.length<=Tr)return n;let t=Tr-1,i=Math.ceil(t/2),r=Math.floor(t/2);return`${n.slice(0,i)}\u2026${n.slice(n.length-r)}`}function Ca(n,t){let i=[];n["too-large"]&&i.push(`${n["too-large"]} too large`),n.binary&&i.push(`${n.binary} binary`),n.hidden&&i.push(`${n.hidden} hidden`),n["root-file"]&&i.push(`${n["root-file"]} root file(s)`),i.length&&t(`Excluded from upload: ${i.join(", ")}`)}function Er(n,t,i,r){r(""),r(`Files that will be included: ${n.totalFiles} file(s), ${vr(n.totalBytes)}`);for(let o of n.rootEntries.slice(0,bt)){let s=Rr(o.name);r(o.type==="dir"?` ${s}/ (${o.fileCount} file${o.fileCount===1?"":"s"})`:` ${s}`)}if(n.rootEntries.length>bt&&r(` \u2026 and ${n.rootEntries.length-bt} more`),t.length>0){let o=t.slice(0,xt).map(Rr).join(", "),s=t.length>xt?` (+${t.length-xt} more)`:"";r(`Automatically ignoring: ${o}${s}`)}Ca(i,r)}function _a(n){let t=n.split(",").map(i=>i.trim().replace(/^\/+|\/+$/g,"")).filter(Boolean);return Array.from(new Set(t))}async function Ia(n,t,i){let{files:r,skipped:o,totalBytes:s}=await sn(n,{ignoreDirs:t});Er(ut(r,s),ft(o),dt(o),i)}async function Or(n,t){let{status:i}=t;if(Sa("Welcome to Seldon!"),xa(Re(n))){let p=await Aa({message:"seldon.yml already exists here. Reset it to defaults?",initialValue:!1});if(fn(p)||!p){kr("Keeping the existing seldon.yml. Nothing changed.");return}}let r=await wr(n),o=r.config;Me(n,o),i("Created seldon.yml with smart defaults."),i("Analyzing your repository..."),Er(r.preview,r.ignored,r.skippedByReason,i);let s=await wt({message:"Add more folders to ignore? (folder names, comma-separated \u2014 files aren't excluded here)",placeholder:"e.g. vendor, tmp (leave empty to skip)"});if(fn(s)){yt("Stopped \u2014 seldon.yml has the smart defaults saved above.");return}if(s.trim()){let p=_a(s);o={...o,baseline:{...o.baseline,generate:{...o.baseline?.generate,ignoreDirs:Array.from(new Set([...o.baseline?.generate?.ignoreDirs??[],...p]))}}},Me(n,o),i(""),i("Updated \u2014 here's what will be included now:"),await Ia(n,o.baseline?.generate?.ignoreDirs??[],i)}let l=await wt({message:"Default staging URL? (optional)",placeholder:"https://staging.example.com"});if(fn(l)){yt("Stopped \u2014 seldon.yml has been saved with what you've entered so far.");return}l.trim()&&(o={...o,baseline:{...o.baseline,run:{...o.baseline?.run,url:l.trim()}}});let c=await wt({message:"Scope for baseline generation? (optional, e.g. 'checkout flow')",placeholder:"leave empty for full codebase analysis"});if(fn(c)){yt("Stopped \u2014 seldon.yml has been saved with what you've entered so far."),Me(n,o);return}c.trim()&&(o={...o,baseline:{...o.baseline,generate:{...o.baseline?.generate,scope:c.trim()}}}),Me(n,o),kr(["Configuration complete!","",`Saved to: ${Re(n)}`,"","Next steps:"," 1. Generate your baseline: seldon baseline generate"," 2. Configure test cases: seldon baseline configure"," 3. Run against staging: seldon baseline run"," 4. After code changes: seldon baseline update"].join(`
|
|
48
|
+
`))}import{spinner as ka}from"@clack/prompts";var Lr=["Still working","Reticulating splines","Reading through the codebase","Thinking it through","Almost there","Hang tight"];function Ta(n){let t=Math.floor(n/1e3),i=Math.floor(t/60),r=t%60;return i>0?`${i}m ${r}s`:`${r}s`}function pn(n){let t=ka(),i=0;return t.start(n),{onTick:o=>{let s=Lr[i%Lr.length];i+=1,t.message(`${n} (${Ta(o)}) \u2014 ${s}...`)},stop:o=>t.stop(o)}}async function At(n,t){let i=pn(n),r=Date.now(),o=setInterval(()=>i.onTick(Date.now()-r),2e3);try{return await t()}finally{clearInterval(o),i.stop("")}}function dn(n,t){return n.json?"json":n.md?"markdown":t?.cli?.reportFormat??"text"}var Oa={only:"o",skip:"s",fixed:"f",none:" "};function La(n,t,i){return Oa[yr(n,t?.testCases,i)]}function Mr(n){let t={};for(let i of n??[]){let r=i.indexOf("=");r>0&&(t[i.slice(0,r)]=i.slice(r+1))}return t}function $r(n,t=[]){let i=n.out??(b=>process.stdout.write(`${b}
|
|
49
|
+
`)),r=n.status??(b=>process.stderr.write(`${b}
|
|
50
|
+
`)),o=new Ea("seldon");o.description(["Seldon \u2014 generate QA baselines from any codebase and run them from your terminal or CI.","","Authenticate once:"," seldon login seldon_<your-key> (or: seldon config set-key <key>)","","Typical flow, from inside a project (one baseline per project):"," seldon init # create seldon.yml, preview what will be analyzed"," seldon generate # read this codebase, build a QA baseline"," seldon cases # review / mark test cases (skip / only / fixed)"," seldon run --url https://staging.example.com"," seldon report --md # clean, actionable results"," seldon cancel # stop a run mid-flight (the baseline is untouched)","","When the code changes, re-evaluate the baseline (fixed cases are always kept):"," seldon update # whole-repo re-eval, moves the committed head"," seldon review # PR-style: stage a DRAFT from your changes + auto-run","","Inspect and manage versions:"," seldon list # every baseline your key can see (all sources)"," seldon versions # this lineage's committed head + draft proposals"," seldon promote <versionId> # make a draft the committed head runs resolve to","","Configuration lives in seldon.yml at the project root (config-as-code, no server copy).","","Everything else is reachable via: seldon api <operation> [--path k=v] [--query k=v] [--data '{json}']"].join(`
|
|
51
51
|
`)).option("--base-url <url>","Seldon API base URL (overrides SELDON_BASE_URL / config)").option("--api-key <key>","API key (overrides SELDON_API_KEY / config)").addHelpText("after",["","Environment variables:"," SELDON_API_KEY Your API key. Set this and you're good to go (BLOK_API_KEY also accepted)."," SELDON_BASE_URL Override the API base URL (defaults to the baked-in production URL).","","Get an API key: Settings \u2192 API keys in the Seldon product."].join(`
|
|
52
|
-
`));let s=()=>{let
|
|
53
|
-
`),i(it(
|
|
54
|
-
`),i(it(
|
|
55
|
-
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon promote <id>`))},H=(
|
|
52
|
+
`));let s=()=>{let b=o.opts();return n.makeSdk({baseUrl:b.baseUrl,apiKey:b.apiKey})},l=b=>i(JSON.stringify(b,null,2)),c=(b,I,O)=>{I==="json"?l(b):i(I==="markdown"?Qi(b,{full:O}):Wi(b,{full:O}))},p=(b,I)=>{I==="json"?l(b):i(I==="markdown"?Xi(b):Zi(b))},u=async b=>{let I=b.path??process.cwd(),O=Ie(b,I),P=ve(I),B=b.url||P?.baseline?.run?.url||void 0;r(`Launching QA run for baseline ${O} ...`);let{experimentId:L}=await cr(s(),O,{url:B,credentials:b.credentials});if(Ee(I,j=>({...j,baseline:{...j.baseline,lastRunExperimentId:L,...b.url?{run:{...j.baseline?.run,url:b.url}}:{}}})),r(`Run started \u2014 experiment ${L}. View it in the app under QA, or: seldon baseline report`),!b.wait)return;let Q=pn("Running test cases");await pr(s(),L,{onTick:Q.onTick}),Q.stop(""),r("Test run complete."),c(await ct(s(),L),dn(b,P),b.full)},f=b=>b.option("--url <url>","Live product URL to test against (default: seldon.yml baseline.run.url)").option("--path <dir>","Project directory (default: current directory)").option("--id <baselineId>","Run a specific baseline instead of the saved one").option("--credentials <creds>","Inline login, e.g. 'username: a@b.com, password: secret'").option("--no-wait","Submit the run without waiting for results").option("--md","Render the report as Markdown").option("--json","Render the report as JSON").option("--full","Show every failure/blocked case's full detail block (default: capped at 5, ledger always lists every case)"),m=async b=>{let I=b.path??process.cwd(),O=mt(b,I),P=ve(I);c(await ct(s(),O),dn(b,P),b.full)},g=b=>b.option("--path <dir>","Project directory (default: current directory)").option("--id <experimentId>","Report on a specific run instead of the last one").option("--md","Render as Markdown (great for PRs / agents)").option("--json","Render as JSON (stable schema for agents)").option("--full","Show every failure/blocked case's full detail block (default: capped at 5, ledger always lists every case)"),T=o.command("config").description("Manage local CLI configuration.");T.command("show").description("Print the saved config (api key redacted).").action(()=>{let b=ze();l({baseUrl:b.baseUrl,apiKey:b.apiKey?"****":void 0})}),T.command("set-key <key>").description("Save an API key to the config file.").action(b=>{un({apiKey:b}),r("Saved API key.")}),T.command("set-url <url>").description("Save the API base URL to the config file.").action(b=>{un({baseUrl:b}),r("Saved base URL.")}),o.command("login <key>").description("Save your API key (alias for `config set-key`).").action(b=>{un({apiKey:b}),r("Saved API key. You're ready to go.")}),o.command("init [path]").description("Create seldon.yml for this project and preview what a baseline would include.").action(async b=>{let I=b??process.cwd();await Or(I,{status:r})});let F=o.command("baseline",{hidden:!0}).description("Grouped aliases of the top-level baseline verbs (back-compat)."),R=b=>b?{hidden:!0}:{},q=async b=>{let{baselines:I}=await lt(s());if(b.json){l({baselines:I});return}if(I.length===0){i("No baselines found for this API key. Generate one with: seldon generate");return}i(ht(`${I.length} baseline${I.length===1?"":"s"}`)+`
|
|
53
|
+
`),i(it(I,[{header:"ID",cell:O=>O.id},{header:"NAME",cell:O=>O.displayName},{header:"SOURCE",cell:O=>O.createdVia},{header:"CASES",align:"right",cell:O=>String(O.caseCount)},{header:"STATUS",cell:O=>O.status},{header:"UPDATED",cell:O=>O.createdAt?new Date(O.createdAt).toISOString().slice(0,10):"?"}]))},ne=(b,I=!1)=>b.command("list",R(I)).description("List every baseline your API key can see (across every source), not just the one saved locally.").option("--json","Output as JSON").action(q),W=async(b,I)=>{let O=b??process.cwd(),B=ve(O)?.baseline?.generate;r(`Reading codebase at ${O} ...`);let L=await or(s(),O,{scope:I.scope??B?.scope,label:I.name,filename:B?.filename,ignoreDirs:B?.ignoreDirs});Ee(O,j=>({...j,baseline:{...j.baseline,lineageId:L.lineageId}})),r(`Uploaded ${L.fileCount} file(s); baseline created (lineage ${L.lineageId}).`);let Q={lineageId:L.lineageId};if(I.wait){let j=pn("Generating test plan (this can take a few minutes)"),re=await ar(s(),L.lineageId,{onTick:j.onTick});j.stop(""),Ee(O,J=>({...J,baseline:{...J.baseline,baselineId:re.id}})),Q={lineageId:L.lineageId,baselineId:re.id,caseCount:re.caseCount},r(`Baseline ready: ${re.caseCount} test case(s). It now appears in the app under QA Baselines.`),r("Run it with: seldon run --url <url>")}I.json?l({...L,...Q}):r(`Saved baseline id to ${Re(O)}`)},V=(b,I=!1)=>b.command("generate [path]",R(I)).description("Read a local codebase, build a QA baseline (test plan), and tie it to this folder.").option("--scope <text>","Free-text emphasis for the analysis (e.g. 'focus on checkout')").option("--name <name>","Baseline name shown in the app (unique per tenant)").option("--no-wait","Return immediately without waiting for the plan to finish generating").option("--json","Output the baseline handle as JSON").action(W),z=async b=>{let I=b.path??process.cwd(),O=Ie(b,I),P=await qe(s(),O),B=ve(I);l({baselineId:P.baseline_id??O,lineageId:P.lineage_id,planTitle:P.title,caseCount:P.case_count??P.cases?.length??0,status:P.status,targetUrl:P.target_url||void 0,lastRunExperimentId:B?.baseline?.lastRunExperimentId||void 0,defaultUrl:B?.baseline?.run?.url||void 0})},X=(b,I=!1)=>b.command("show",R(I)).description("Show the baseline tied to this folder and its status.").option("--path <dir>","Project directory (default: current directory)").option("--id <baselineId>","Inspect a specific baseline instead of the saved one").action(z),ae=async b=>{let I=b.path??process.cwd(),O=Ie(b,I),P=await qe(s(),O),B=P.cases??[];if(b.json){l(B);return}let L=ve(I),Q=B.map(j=>j.id);i(`${P.title??"Baseline"} \u2014 ${B.length} case(s)`);for(let j of B)i(` [${La(j.id,L,Q)}] [${j.id}] ${j.title} (${j.priority??"?"} \xB7 ${j.area??"general"})`),j.acceptance_criterion&&i(` ${j.acceptance_criterion}`);i(""),i("Legend: [s]=skip [o]=only [f]=fixed [ ]=run normally \xB7 edit interactively: seldon cases")},te=async b=>{if(!b.json&&!b.list&&process.stdin.isTTY){let I=b.path??process.cwd(),O=Ie(b,I);await Ir(s(),I,O,{status:r});return}await ae(b)},Y=(b,I=!1)=>b.command("cases",R(I)).description("Browse and edit test-case selection \u2014 skip / only / fixed (interactive in a terminal; --list/--json for a static dump).").option("--path <dir>","Project directory (default: current directory)").option("--id <baselineId>","Inspect a specific baseline instead of the saved one").option("--json","Output full case objects as JSON (always static, never interactive)").option("--list","Force the static text listing even in an interactive terminal").action(te),U=async(b,I)=>{let O=b??process.cwd(),P=Ie(I,O),B=ve(O),L=await At(`Re-evaluating baseline against ${O}`,()=>hr(s(),O,P,{seldonYaml:pt(O),filename:I.name??B?.baseline?.generate?.filename,ignoreDirs:B?.baseline?.generate?.ignoreDirs}));r(`Update complete: ${L.summary.headline}`),p(L,dn(I,B))},se=(b,I=!1)=>b.command("update [path]",R(I)).description("Re-evaluate the WHOLE repo and move the committed head. Fixed cases are always kept.").option("--id <baselineId>","Update a specific baseline instead of the saved one").option("--name <filename>","Archive name reported to the API").option("--md","Render the diff as Markdown").option("--json","Render the diff as JSON").action(U),me=async(b,I)=>{let O=b??process.cwd(),P=Ie(I,O),B=ve(O),L,Q=!!I.full;if(I.zip)L=new Uint8Array(Ra(I.zip));else if(I.full)L=(await ln(O,{ignoreDirs:B?.baseline?.generate?.ignoreDirs})).bytes,Q=!0;else{let re=await rr(O,{base:I.base});r(`Reassessing ${re.fileCount} changed file(s) against the baseline ...`),L=re.bytes}let j=await At("Reassessing baseline against the changes",()=>mr(s(),P,{zipBytes:L,full:Q,targetUrl:I.url,seldonYaml:pt(O),autoRun:I.autoRun}));r(`Review complete: ${j.report.summary.headline}`),Ee(O,re=>({...re,baseline:{...re.baseline,...j.experimentId?{lastRunExperimentId:j.experimentId}:{}}})),j.experimentId?r(`Draft ${j.draftBaselineId} \u2014 running affected cases as experiment ${j.experimentId} (view under QA).`):r(`Draft ${j.draftBaselineId} \u2014 no affected cases ran (nothing affected, or no target URL).`),p(j.report,dn(I,B))},oe=(b,I=!1)=>b.command("review [path]",R(I)).alias("delta").description("PR-style: reassess from your code changes into a DRAFT and auto-run the affected cases (does NOT move the head).").option("--id <baselineId>","Reassess a specific baseline instead of the saved one").option("--zip <file>","Use a prebuilt zip (scoped changed-files, or a repo zip with --full) instead of building from git").option("--full","Re-map the whole repo (adds cases for new files) instead of only the changed area").option("--base <ref>","Scoped mode: diff <base>...HEAD instead of the working tree vs HEAD").option("--url <url>","Target URL for the auto-run of the affected cases").option("--no-auto-run","Write the draft without running the affected cases").option("--md","Render the diff as Markdown").option("--json","Render the diff as JSON").action(me),ge=async b=>{let I=b.path??process.cwd(),O=Ie(b,I),{versions:P,committedHeadId:B}=await sr(s(),O);if(b.json){l({committedHeadId:B,versions:P});return}if(P.length===0){i("No versions found for this baseline.");return}i(ht(`${P.length} version${P.length===1?"":"s"} \u2014 committed head: ${B??"none"}`)+`
|
|
54
|
+
`),i(it(P,[{header:"",cell:L=>L.isHead?"*":L.status==="draft"?"d":" "},{header:"ID",cell:L=>L.id},{header:"STATUS",cell:L=>L.status},{header:"SOURCE",cell:L=>L.createdVia},{header:"CASES",align:"right",cell:L=>String(L.caseCount)},{header:"UPDATED",cell:L=>L.createdAt?new Date(L.createdAt).toISOString().slice(0,10):"?"}])),i(xr(`
|
|
55
|
+
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon promote <id>`))},H=(b,I=!1)=>b.command("versions",R(I)).description("List every version of this baseline's lineage \u2014 the committed head and any draft proposals.").option("--path <dir>","Project directory (default: current directory)").option("--id <baselineId>","Inspect a specific lineage (any version id) instead of the saved one").option("--json","Output as JSON").action(ge),le=async(b,I)=>{let O=I.path??process.cwd(),P=b??Ie(I,O),B=await lr(s(),P),L=B.baseline_id??P;Ee(O,Q=>({...Q,baseline:{...Q.baseline,baselineId:L}})),r(`Promoted to committed head ${L} (${B.case_count??B.cases?.length??0} case(s)). Runs now resolve to it.`)},Z=[ne,V,X,Y,se,oe,H,(b,I=!1)=>b.command("promote [versionId]",R(I)).description("Promote a draft version to the committed head (the version runs resolve to).").option("--path <dir>","Project directory (default: current directory)").option("--id <versionId>","Promote a specific draft version instead of the positional arg / saved one").action(le)];for(let b of Z)b(o,!1),b(F,!0);f(o.command("run").description("Run the current baseline against a live URL and print the report.")).action(u),g(o.command("report").description("Show the latest QA report for the current baseline (clean and actionable).")).action(m),f(F.command("run",{hidden:!0})).action(u),g(F.command("report",{hidden:!0})).action(m);let ie=async b=>{let I=b.path??process.cwd(),O=mt(b,I),P=await ur(s(),O);r(`Run ${O} \u2014 ${P.status}${P.message?`: ${P.message}`:" (cancelled)"}.`)},de=(b,I=!1)=>b.command("cancel",R(I)).description("Terminate the current QA run mid-flight (stops the run's experiment; the baseline is untouched).").option("--path <dir>","Project directory (default: current directory)").option("--id <experimentId>","Cancel a specific run instead of the last one").action(ie);if(de(o),de(F,!0),t.length>0){let b=o.command("api").description("Call any API operation directly by name (auto-generated from the live OpenAPI spec).\n seldon api <operation> [--path key=value] [--query key=value] [--data '{json}']\n Run `seldon api --help` to see all available operations.");for(let I of t)b.command(I.name).description(I.summary??`${I.method} ${I.path}`).option("--path <pairs...>","Path params as key=value").option("--query <pairs...>","Query params as key=value").option("--data <json>","JSON request body").action(async O=>{l(await s().call(I.name,{path:Mr(O.path),query:Mr(O.query),body:O.data?JSON.parse(O.data):void 0}))})}return o}function Nr(n){let t=_r(n,ze(),process.env);return new Ui(t)}async function Ma(){try{return await Nr({}).apiKeyOps()}catch{return[]}}function $a(){let n=()=>{process.stderr.write(`
|
|
56
|
+
\x1B[?25h`),process.stderr.write("Interrupted. In-flight work may still complete server-side \u2014 check `seldon list` / `seldon report`.\n"),process.exit(130)};process.on("SIGINT",n),process.on("SIGTERM",n)}async function Na(){$a();let n=br(process.argv)?await Ma():[];await $r({makeSdk:Nr},n).parseAsync(process.argv)}Na().catch(n=>{process.stderr.write(`${n.message}
|
|
56
57
|
`),process.exit(1)});
|