@seldonqa/cli 0.1.5 → 0.2.1
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 +37 -37
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createHash as xo}from"crypto";import{mkdir as So,readFile as Ri,writeFile as Co}from"fs/promises";import{homedir as _o,tmpdir as Io}from"os";import{join as Pi}from"path";import{execFileSync as Ro}from"child_process";import{readdir as Eo,readFile as ji,stat as qi}from"fs/promises";import{join as Yi,relative as Oo,sep as Ei}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 ie=Uint8Array,fe=Uint16Array,Sn=Int32Array,Cn=new ie([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 ie([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 ie([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 fe(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),Br=$e.b,wn=$e.r;Br[28]=258,wn[258]=28;var Lt=Ot(_n,0),Na=Lt.b,_t=Lt.r,bn=new fe(32768);for(K=0;K<32768;++K)_e=(K&43690)>>1|(K&21845)<<1,_e=(_e&52428)>>2|(_e&13107)<<2,_e=(_e&61680)>>4|(_e&3855)<<4,bn[K]=((_e&65280)>>8|(_e&255)<<8)>>1;var _e,K,Be=(function(n,t,i){for(var r=n.length,o=0,s=new fe(t);o<r;++o)n[o]&&++s[n[o]-1];var l=new fe(t);for(o=1;o<t;++o)l[o]=l[o-1]+s[o-1]<<1;var c;if(i){c=new fe(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],g=l[n[o]-1]++<<f,m=g|(1<<f)-1;g<=m;++g)c[bn[g]>>p]=u}else for(c=new fe(r),o=0;o<r;++o)n[o]&&(c[o]=bn[l[n[o]-1]++]>>15-n[o]);return c}),Le=new ie(288);for(K=0;K<144;++K)Le[K]=8;var K;for(K=144;K<256;++K)Le[K]=9;var K;for(K=256;K<280;++K)Le[K]=7;var K;for(K=280;K<288;++K)Le[K]=8;var K,Ze=new ie(32);for(K=0;K<32;++K)Ze[K]=5;var K,Ur=Be(Le,9,0);var jr=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 ie(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 Ie=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 ie(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function($,z){return $.f-z.f}),i.push({s:-1,f:25001});var c=i[0],p=i[1],u=0,f=1,g=2;for(i[0]={s:-1,f:c.f+p.f,l:c,r:p};f!=o-1;)c=i[i[u].f<i[g].f?u++:g++],p=i[u!=f&&i[u].f<i[g].f?u++:g++],i[f++]={s:-1,f:c.f+p.f,l:c,r:p};for(var m=s[0].s,r=1;r<o;++r)s[r].s>m&&(m=s[r].s);var T=new fe(m+1),F=An(i[f-1],T,0);if(F>t){var r=0,L=0,w=F-t,R=1<<w;for(s.sort(function(z,U){return T[U.s]-T[z.s]||z.f-U.f});r<o;++r){var k=s[r].s;if(T[k]>t)L+=R-(1<<F-T[k]),T[k]=t;else break}for(L>>=w;L>0;){var P=s[r].s;T[P]<t?L-=1<<t-T[P]++-1:++r}for(;r>=0&&L;--r){var N=s[r].s;T[N]==t&&(--T[N],++L)}F=t}return{t:new ie(T),l:F}},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},It=function(n){for(var t=n.length;t&&!n[--t];);for(var i=new fe(++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){Ie(t,f++,i),++o[256];for(var g=yn(o,15),m=g.t,T=g.l,F=yn(s,15),L=F.t,w=F.l,R=It(m),k=R.c,P=R.n,N=It(L),$=N.c,z=N.n,U=new fe(19),j=0;j<k.length;++j)++U[k[j]&31];for(var j=0;j<$.length;++j)++U[$[j]&31];for(var q=yn(U,7),X=q.t,pe=q.l,Z=19;Z>4&&!X[Ct[Z-1]];--Z);var de=u+5<<3,H=Pe(o,Le)+Pe(s,Ze)+l,te=Pe(o,m)+Pe(s,L)+l+14+3*Z+Pe(U,X)+2*U[16]+3*U[17]+7*U[18];if(p>=0&&de<=H&&de<=te)return Nt(t,f,n.subarray(p,p+u));var E,Q,J,he;if(Ie(t,f,1+(te<H)),f+=2,te<H){E=Be(m,T,0),Q=m,J=Be(L,w,0),he=L;var ve=Be(X,pe,0);Ie(t,f,P-257),Ie(t,f+5,z-1),Ie(t,f+10,Z-4),f+=14;for(var j=0;j<Z;++j)Ie(t,f+3*j,X[Ct[j]]);f+=3*Z;for(var le=[k,$],ye=0;ye<2;++ye)for(var ue=le[ye],j=0;j<ue.length;++j){var oe=ue[j]&31;Ie(t,f,ve[oe]),f+=X[oe],oe>15&&(Ie(t,f,ue[j]>>5&127),f+=ue[j]>>12)}}else E=Ur,Q=Le,J=jr,he=Ze;for(var j=0;j<c;++j){var G=r[j];if(G>255){var oe=G>>18&31;De(t,f,E[oe+257]),f+=Q[oe+257],oe>7&&(Ie(t,f,G>>23&31),f+=Cn[oe]);var ae=G&31;De(t,f,J[ae]),f+=he[ae],ae>3&&(De(t,f,G>>5&8191),f+=_n[ae])}else De(t,f,E[G]),f+=Q[G]}return De(t,f,E[256]),f+Q[256]},Yr=new Sn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ft=new ie(0),zr=function(n,t,i,r,o,s){var l=s.z||n.length,c=new ie(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 g=Yr[t-1],m=g>>13,T=g&8191,F=(1<<i)-1,L=s.p||new fe(32768),w=s.h||new fe(F+1),R=Math.ceil(i/3),k=2*R,P=function(xe){return(n[xe]^n[xe+1]<<R^n[xe+2]<<k)&F},N=new Sn(25e3),$=new fe(288),z=new fe(32),U=0,j=0,q=s.i||0,X=0,pe=s.w||0,Z=0;q+2<l;++q){var de=P(q),H=q&32767,te=w[de];if(L[H]=te,w[de]=H,pe<=q){var E=l-q;if((U>7e3||X>24576)&&(E>423||!u)){f=kt(n,p,0,N,$,z,j,X,Z,q-Z,f),X=U=j=0,Z=q;for(var Q=0;Q<286;++Q)$[Q]=0;for(var Q=0;Q<30;++Q)z[Q]=0}var J=2,he=0,ve=T,le=H-te&32767;if(E>2&&de==P(q-le))for(var ye=Math.min(m,E)-1,ue=Math.min(32767,q),oe=Math.min(258,E);le<=ue&&--ve&&H!=te;){if(n[q+J]==n[q+J-le]){for(var G=0;G<oe&&n[q+G]==n[q+G-le];++G);if(G>J){if(J=G,he=le,G>ye)break;for(var ae=Math.min(le,G-2),ge=0,Q=0;Q<ae;++Q){var we=q-le+Q&32767,V=L[we],Ae=we-V&32767;Ae>ge&&(ge=Ae,te=we)}}}H=te,te=L[H],le+=H-te&32767}if(he){N[X++]=268435456|wn[J]<<18|_t[he];var me=wn[J]&31,Oe=_t[he]&31;j+=Cn[me]+_n[Oe],++$[257+me],++z[Oe],pe=q+J,++U}else N[X++]=n[q],++$[n[q]]}}for(q=Math.max(q,pe);q<l;++q)N[X++]=n[q],++$[n[q]];f=kt(n,p,u,N,$,z,j,X,Z,q-Z,f),u||(s.r=f&7|p[f/8|0]<<3,f-=7,s.h=w,s.p=L,s.i=q,s.w=pe)}else{for(var q=s.w||0;q<l+u;q+=65535){var ke=q+65535;ke>=l&&(p[f/8|0]=u,ke=l),f=Nt(p,f+1,n.subarray(q,ke))}s.i=l}return $t(c,0,r+Mt(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 ie(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)},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 ee=function(n,t,i){for(;i;++t)n[t]=i,i>>>=8};function Wr(n,t){return Gr(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 ie(0),c],Pt(s,l,i,r))}},Tt=typeof TextEncoder<"u"&&new TextEncoder,Qr=typeof TextDecoder<"u"&&new TextDecoder,Vr=0;try{Qr.decode(Ft,{stream:!0}),Vr=1}catch{}function Rt(n,t){if(t){for(var i=new ie(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 ie(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 ie(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 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},Et=function(n,t,i,r,o,s,l,c){var p=r.length,u=i.extra,f=c&&c.length,g=xn(u);ee(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 m=new Date(i.mtime==null?Date.now():i.mtime),T=m.getFullYear()-1980;if((T<0||T>119)&&Xe(10),ee(n,t,T<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),t+=4,s!=-1&&(ee(n,t,i.crc),ee(n,t+4,s<0?-s-2:s),ee(n,t+8,i.size)),ee(n,t+12,p),ee(n,t+14,g),t+=16,l!=null&&(ee(n,t,f),ee(n,t+6,i.attrs),ee(n,t+10,l),t+=14),n.set(r,t),t+=p,g)for(var F in u){var L=u[F],w=L.length;ee(n,t,+F),ee(n,t+2,w),n.set(L,t+4),t+=4+w}return f&&(n.set(c,t),t+=f),t},Jr=function(n,t,i,r,o){ee(n,t,101010256),ee(n,t+8,i),ee(n,t+10,i),ee(n,t+12,r),ee(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,g=Rt(l),m=g.length,T=u.comment,F=T&&Rt(T),L=F&&F.length,w=xn(u.extra);m>65535&&Xe(11);var R=f?Wr(p,u):p,k=R.length,P=Hr();P.p(p),r.push(Dt(u,{size:p.length,crc:P.d(),c:R,f:g,m:F,u:m!=l.length||F&&T.length!=L,o,compression:f})),o+=30+m+w+k,s+=76+2*(m+w)+(L||0)+k}for(var N=new ie(s+22),$=o,z=s-o,U=0;U<r.length;++U){var g=r[U];Et(N,g.o,g,g.f,g.u,g.c.length);var j=30+g.f.length+xn(g.extra);N.set(g.c,g.o+j),Et(N,o,g,g.f,g.u,g.c.length,g.o,g.m),o+=16+j+(g.m?g.m.length:0)}return Jr(N,o,r.length,z,$),N}import{readFileSync as gr,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 re={},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 g=p[u];l[g]=c[g]}}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+=`
|
|
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+=`
|
|
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
|
-
`+
|
|
6
|
-
`,
|
|
7
|
-
`;for(let
|
|
8
|
-
`}return
|
|
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
|
|
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 x,v,I,a,h,C,b=e.kind,A=e.result,_=e.input.charCodeAt(e.position);if(
|
|
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,Ut;function Xr(){if(Ut)return Tn;Ut=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 j=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)+" | "+j.str+`
|
|
5
|
+
`+m}let D=t(o.buffer,c[f],p[f],o.position,T);m+=n.repeat(" ",s.indent)+i((o.line+1).toString(),g)+" | "+D.str+`
|
|
6
|
+
`,m+=n.repeat("-",s.indent+g+3+D.pos)+`^
|
|
7
|
+
`;for(let R=1;R<=s.linesAfter&&!(f+R>=p.length);R++){let j=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)+" | "+j.str+`
|
|
8
|
+
`}return m.replace(/\n$/,"")}return Tn=r,Tn}var Rn,jt;function de(){if(jt)return Rn;jt=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,qt;function ci(){if(qt)return En;qt=1;let n=je(),t=de();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,Yt;function ui(){if(Yt)return On;Yt=1;let n=de();return On=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),On}var Ln,zt;function fi(){if(zt)return Ln;zt=1;let n=de();return Ln=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Ln}var Mn,Kt;function pi(){if(Kt)return Mn;Kt=1;let n=de();return Mn=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Mn}var $n,Ht;function di(){if(Ht)return $n;Ht=1;let n=ci();return $n=new n({explicit:[ui(),fi(),pi()]}),$n}var Nn,Gt;function hi(){if(Gt)return Nn;Gt=1;let n=de();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,Wt;function mi(){if(Wt)return Fn;Wt=1;let n=de();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,Qt;function gi(){if(Qt)return Dn;Qt=1;let n=Ue(),t=de();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,Vt;function vi(){if(Vt)return Pn;Vt=1;let n=Ue(),t=de(),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,Jt;function yi(){return Jt||(Jt=1,Bn=di().extend({implicit:[hi(),mi(),gi(),vi()]})),Bn}var Un,Zt;function wi(){return Zt||(Zt=1,Un=yi()),Un}var jn,Xt;function bi(){if(Xt)return jn;Xt=1;let n=de(),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],D=+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 j=new Date(Date.UTC(f,m,g,T,D,R,c));return p&&j.setTime(j.getTime()-p),j}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,ei;function Ai(){if(ei)return qn;ei=1;let n=de();function t(i){return i==="<<"||i===null}return qn=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),qn}var Yn,ni;function xi(){if(ni)return Yn;ni=1;let n=de(),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,ti;function Si(){if(ti)return zn;ti=1;let n=de(),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,ii;function Ci(){if(ii)return Kn;ii=1;let n=de(),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,ri;function _i(){if(ri)return Hn;ri=1;let n=de(),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,oi;function Qn(){return oi||(oi=1,Gn=wi().extend({implicit:[bi(),Ai()],explicit:[xi(),Si(),Ci(),_i()]})),Gn}var ai;function eo(){if(ai)return en;ai=1;let n=Ue(),t=je(),i=Xr(),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]/,D=/[,\[\]{}]/,R=/^(?:!|!!|![0-9A-Za-z-]+!)$/,j=/^(?:!|[^,\[\]{}])(?:%[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 oe(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 ae(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function he(e,d,y){d==="__proto__"?Object.defineProperty(e,d,{configurable:!0,enumerable:!0,writable:!0,value:y}):e[d]=y}let re=new Array(256),me=new Array(256);for(let e=0;e<256;e++)re[e]=U(e)?1:0,me[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 se(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 se(e,d)}function J(e,d){e.onWarning&&e.onWarning.call(null,se(e,d))}function w(e,d,y){let x=e.anchorMapTransactions;if(x.length!==0){let v=x[x.length-1];o.call(v,d)||(v[d]={existed:o.call(e.anchorMap,d),value:e.anchorMap[d]})}e.anchorMap[d]=y}function k(e){e.anchorMapTransactions.push(Object.create(null))}function L(e){let d=e.anchorMapTransactions.pop(),y=e.anchorMapTransactions;if(y.length===0)return;let x=y[y.length-1],v=Object.keys(d);for(let I=0,a=v.length;I<a;I+=1){let h=v[I];o.call(x,h)||(x[h]=d[h])}}function B(e){let d=e.anchorMapTransactions.pop(),y=Object.keys(d);for(let x=y.length-1;x>=0;x-=1){let v=d[y[x]];v.existed?e.anchorMap[y[x]]=v.value:delete e.anchorMap[y[x]]}}function q(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 F(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 Q={YAML:function(d,y,x){d.version!==null&&E(d,"duplication of %YAML directive"),x.length!==1&&E(d,"YAML directive accepts exactly one argument");let v=/^([0-9]+)\.([0-9]+)$/.exec(x[0]);v===null&&E(d,"ill-formed argument of the YAML directive");let I=parseInt(v[1],10),a=parseInt(v[2],10);I!==1&&E(d,"unacceptable YAML version of the document"),d.version=x[0],d.checkLineBreaks=a<2,a!==1&&a!==2&&J(d,"unsupported YAML version of the document")},TAG:function(d,y,x){let v;x.length!==2&&E(d,"TAG directive accepts exactly two arguments");let I=x[0];v=x[1],R.test(I)||E(d,"ill-formed tag handle (first argument) of the TAG directive"),o.call(d.tagMap,I)&&E(d,'there is a previously declared suffix for "'+I+'" tag handle'),j.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[I]=v}};function $(e,d,y,x){if(d<y){let v=e.input.slice(d,y);if(x)for(let I=0,a=v.length;I<a;I+=1){let h=v.charCodeAt(I);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 Z(e,d,y,x){n.isObject(y)||E(e,"cannot merge mappings; the provided source object is unacceptable");let v=Object.keys(y);for(let I=0,a=v.length;I<a;I+=1){let h=v[I];e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&E(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")"),o.call(d,h)||(he(d,h,y[h]),x[h]=!0)}}function pe(e,d,y,x,v,I,a,h,C){if(Array.isArray(v)){v=Array.prototype.slice.call(v);for(let b=0,A=v.length;b<A;b+=1)Array.isArray(v[b])&&E(e,"nested arrays are not supported inside keys"),typeof v=="object"&&ne(v[b])==="[object Object]"&&(v[b]="[object Object]")}if(typeof v=="object"&&ne(v)==="[object Object]"&&(v="[object Object]"),v=String(v),d===null&&(d={}),x==="tag:yaml.org,2002:merge")if(Array.isArray(I))for(let b=0,A=I.length;b<A;b+=1)Z(e,d,I[b],y);else Z(e,d,I,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")),he(d,v,I),delete y[v];return d}function we(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 ie(e,d,y){let x=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(we(e),v=e.input.charCodeAt(e.position),x++,e.lineIndent=0;v===32;)e.lineIndent++,v=e.input.charCodeAt(++e.position);else break}return y!==-1&&x!==0&&e.lineIndent<y&&J(e,"deficient indentation"),x}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 ye(e,d){d===1?e.result+=" ":d>1&&(e.result+=n.repeat(`
|
|
11
|
+
`,d-1))}function Oe(e,d,y){let x,v,I,a,h,C,b=e.kind,A=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="",x=v=e.position,I=!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,ie(e,!1,-1),e.lineIndent>=d){I=!0,_=e.input.charCodeAt(e.position);continue}else{e.position=v,e.line=a,e.lineStart=h,e.lineIndent=C;break}}I&&($(e,x,v,!1),ye(e,e.line-a),x=v=e.position,I=!1),V(_)||(v=e.position+1),_=e.input.charCodeAt(++e.position)}return $(e,x,v,!1),e.result?!0:(e.kind=b,e.result=A,!1)}function ke(e,d){let y,x,v=e.input.charCodeAt(e.position);if(v!==39)return!1;for(e.kind="scalar",e.result="",e.position++,y=x=e.position;(v=e.input.charCodeAt(e.position))!==0;)if(v===39)if($(e,y,e.position,!0),v=e.input.charCodeAt(++e.position),v===39)y=e.position,e.position++,x=e.position;else return!0;else W(v)?($(e,y,x,!0),ye(e,ie(e,!1,d)),y=x=e.position):e.position===e.lineStart&&be(e)?E(e,"unexpected end of the document within a single quoted scalar"):(e.position++,V(v)||(x=e.position));E(e,"unexpected end of the stream within a single quoted scalar")}function Ae(e,d){let y,x,v,I=e.input.charCodeAt(e.position);if(I!==34)return!1;for(e.kind="scalar",e.result="",e.position++,y=x=e.position;(I=e.input.charCodeAt(e.position))!==0;){if(I===34)return $(e,y,e.position,!0),e.position++,!0;if(I===92){if($(e,y,e.position,!0),I=e.input.charCodeAt(++e.position),W(I))ie(e,!1,d);else if(I<256&&re[I])e.result+=me[I],e.position++;else if((v=te(I))>0){let a=v,h=0;for(;a>0;a--)I=e.input.charCodeAt(++e.position),(v=oe(I))>=0?h=(h<<4)+v:E(e,"expected hexadecimal character");e.result+=ae(h),e.position++}else E(e,"unknown escape sequence");y=x=e.position}else W(I)?($(e,y,x,!0),ye(e,ie(e,!1,d)),y=x=e.position):e.position===e.lineStart&&be(e)?E(e,"unexpected end of the document within a double quoted scalar"):(e.position++,V(I)||(x=e.position))}E(e,"unexpected end of the stream within a double quoted scalar")}function Ke(e,d){let y=!0,x,v,I,a=e.tag,h,C=e.anchor,b,A,_,S,M=Object.create(null),O,N,P,K=e.input.charCodeAt(e.position);if(K===91)b=93,S=!1,h=[];else if(K===123)b=125,S=!0,h={};else return!1;for(e.anchor!==null&&w(e,e.anchor,h),K=e.input.charCodeAt(++e.position);K!==0;){if(ie(e,!0,d),K=e.input.charCodeAt(e.position),K===b)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=O=P=null,A=_=!1,K===63){let ee=e.input.charCodeAt(e.position+1);z(ee)&&(A=_=!0,e.position++,ie(e,!0,d))}x=e.line,v=e.lineStart,I=e.position,Se(e,d,s,!1,!0),N=e.tag,O=e.result,ie(e,!0,d),K=e.input.charCodeAt(e.position),(_||e.line===x)&&K===58&&(A=!0,K=e.input.charCodeAt(++e.position),ie(e,!0,d),Se(e,d,s,!1,!0),P=e.result),S?pe(e,h,M,N,O,P,x,v,I):A?h.push(pe(e,null,M,N,O,P,x,v,I)):h.push(O),ie(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,x=u,v=!1,I=!1,a=d,h=0,C=!1,b,A=e.input.charCodeAt(e.position);if(A===124)y=!1;else if(A===62)y=!0;else return!1;for(e.kind="scalar",e.result="";A!==0;)if(A=e.input.charCodeAt(++e.position),A===43||A===45)u===x?x=A===43?m:f:E(e,"repeat of a chomping mode identifier");else if((b=Y(A))>=0)b===0?E(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):I?E(e,"repeat of an indentation width identifier"):(a=d+b-1,I=!0);else break;if(V(A)){do A=e.input.charCodeAt(++e.position);while(V(A));if(A===35)do A=e.input.charCodeAt(++e.position);while(!W(A)&&A!==0)}for(;A!==0;){for(we(e),e.lineIndent=0,A=e.input.charCodeAt(e.position);(!I||e.lineIndent<a)&&A===32;)e.lineIndent++,A=e.input.charCodeAt(++e.position);if(!I&&e.lineIndent>a&&(a=e.lineIndent),W(A)){h++;continue}if(!I&&a===0&&E(e,"missing indentation for block scalar"),e.lineIndent<a){x===m?e.result+=n.repeat(`
|
|
12
12
|
`,v?1+h:h):x===u&&v&&(e.result+=`
|
|
13
|
-
`);break}y?
|
|
13
|
+
`);break}y?V(A)?(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,I=!0,h=0;let _=e.position;for(;!
|
|
18
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let y=new H(e,d),x=e.indexOf("\0");for(x!==-1&&(y.position=x,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;)
|
|
17
|
+
`,v?1+h:h),v=!0,I=!0,h=0;let _=e.position;for(;!W(A)&&A!==0;)A=e.input.charCodeAt(++e.position);$(e,_,e.position,!1)}return!0}function xe(e,d){let y=e.tag,x=e.anchor,v=[],I=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&w(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(I=!0,e.position++,ie(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),ie(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 I?(e.tag=y,e.anchor=x,e.kind="sequence",e.result=v,!0):!1}function Ge(e,d,y){let x,v,I,a,h=e.tag,C=e.anchor,b={},A=Object.create(null),_=null,S=null,M=null,O=!1,N=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&w(e,e.anchor,b);let P=e.input.charCodeAt(e.position);for(;P!==0;){!O&&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((P===63||P===58)&&z(K))P===63?(O&&(pe(e,b,A,_,S,null,v,I,a),_=S=M=null),N=!0,O=!0,x=!0):O?(O=!1,x=!0):E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,P=K;else{if(v=e.line,I=e.lineStart,a=e.position,!Se(e,y,l,!1,!0))break;if(e.line===ee){for(P=e.input.charCodeAt(e.position);V(P);)P=e.input.charCodeAt(++e.position);if(P===58)P=e.input.charCodeAt(++e.position),z(P)||E(e,"a whitespace character is expected after the key-value separator within a block mapping"),O&&(pe(e,b,A,_,S,null,v,I,a),_=S=M=null),N=!0,O=!1,x=!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)&&(O&&(v=e.line,I=e.lineStart,a=e.position),Se(e,d,p,!0,x)&&(O?S=e.result:M=e.result),O||(pe(e,b,A,_,S,M,v,I,a),_=S=M=null),ie(e,!0,-1),P=e.input.charCodeAt(e.position)),(e.line===ee||e.lineIndent>d)&&P!==0)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<d)break}return O&&pe(e,b,A,_,S,null,v,I,a),N&&(e.tag=h,e.anchor=C,e.kind="mapping",e.result=b),N}function hn(e){let d=!1,y=!1,x,v,I=e.input.charCodeAt(e.position);if(I!==33)return!1;e.tag!==null&&E(e,"duplication of a tag property"),I=e.input.charCodeAt(++e.position),I===60?(d=!0,I=e.input.charCodeAt(++e.position)):I===33?(y=!0,x="!!",I=e.input.charCodeAt(++e.position)):x="!";let a=e.position;if(d){do I=e.input.charCodeAt(++e.position);while(I!==0&&I!==62);e.position<e.length?(v=e.input.slice(a,e.position),I=e.input.charCodeAt(++e.position)):E(e,"unexpected end of the stream within a verbatim tag")}else{for(;I!==0&&!z(I);)I===33&&(y?E(e,"tag suffix cannot contain exclamation marks"):(x=e.input.slice(a-1,e.position+1),R.test(x)||E(e,"named tag handle cannot contain such characters"),y=!0,a=e.position+1)),I=e.input.charCodeAt(++e.position);v=e.input.slice(a,e.position),D.test(v)&&E(e,"tag suffix cannot contain flow indicator characters")}v&&!j.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,x)?e.tag=e.tagMap[x]+v:x==="!"?e.tag="!"+v:x==="!!"?e.tag="tag:yaml.org,2002:"+v:E(e,'undeclared tag handle "'+x+'"'),!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 x=e.input.slice(y,e.position);return o.call(e.anchorMap,x)||E(e,'unidentified alias "'+x+'"'),e.result=e.anchorMap[x],ie(e,!0,-1),!0}function mn(e,d,y,x){let v=q(e);return k(e),F(e,d),e.tag=null,e.anchor=null,e.kind=null,e.result=null,Ge(e,y,x)&&e.kind==="mapping"?(L(e),!0):(B(e),F(e,v),!1)}function Se(e,d,y,x,v){let I,a,h=1,C=!1,b=!1,A=null,_,S,M;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 O=I=a=p===y||c===y;if(x&&ie(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),P=q(e);if(C&&(N===33&&e.tag!==null||N===38&&e.anchor!==null)||!hn(e)&&!We(e))break;A===null&&(A=P),ie(e,!0,-1)?(C=!0,a=O,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,M=e.position-e.lineStart,h===1)if(a&&(xe(e,M)||Ge(e,M,S))||Ke(e,S))b=!0;else{let N=e.input.charCodeAt(e.position);A!==null&&O&&!a&&N!==124&&N!==62&&mn(e,A,A.position-A.lineStart,S)||I&&He(e,S)||ke(e,S)||Ae(e,S)?b=!0:Qe(e)?(b=!0,(e.tag!==null||e.anchor!==null)&&E(e,"alias node should not have any properties")):Oe(e,S,s===y)&&(b=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&w(e,e.anchor,e.result)}else h===0&&(b=a&&xe(e,M));if(e.tag===null)e.anchor!==null&&w(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,P=e.implicitTypes.length;N<P;N+=1)if(_=e.implicitTypes[N],_.resolve(e.result)){e.result=_.construct(e.result),e.tag=_.tag,e.anchor!==null&&w(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 P=0,K=N.length;P<K;P+=1)if(e.tag.slice(0,N[P].tag.length)===N[P].tag){_=N[P];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&&w(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||b}function gn(e){let d=e.position,y=!1,x;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(x=e.input.charCodeAt(e.position))!==0&&(ie(e,!0,-1),x=e.input.charCodeAt(e.position),!(e.lineIndent>0||x!==37));){y=!0,x=e.input.charCodeAt(++e.position);let v=e.position;for(;x!==0&&!z(x);)x=e.input.charCodeAt(++e.position);let I=e.input.slice(v,e.position),a=[];for(I.length<1&&E(e,"directive name must not be less than one character in length");x!==0;){for(;V(x);)x=e.input.charCodeAt(++e.position);if(x===35){do x=e.input.charCodeAt(++e.position);while(x!==0&&!W(x));break}if(W(x))break;for(v=e.position;x!==0&&!z(x);)x=e.input.charCodeAt(++e.position);a.push(e.input.slice(v,e.position))}x!==0&&we(e),o.call(Q,I)?Q[I](e,I,a):J(e,'unknown document directive "'+I+'"')}if(ie(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,ie(e,!0,-1)):y&&E(e,"directives end mark is expected"),Se(e,e.lineIndent-1,p,!1,!0),ie(e,!0,-1),e.checkLineBreaks&&T.test(e.input.slice(d,e.position))&&J(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,ie(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),x=e.indexOf("\0");for(x!==-1&&(y.position=x,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 x=Ve(e,y);if(typeof d!="function")return x;for(let v=0,I=x.length;v<I;v+=1)d(x[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={},si;function no(){if(si)return Wn;si=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,D=38,R=39,j=42,ne=44,W=45,V=58,z=61,X=62,oe=63,te=64,Y=91,U=93,ae=96,he=123,re=124,me=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 se=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],E=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function J(a,h){if(h===null)return{};let C={},b=Object.keys(h);for(let A=0,_=b.length;A<_;A+=1){let S=b[A],M=String(h[S]);S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2));let O=a.compiledTypeMap.fallback[S];O&&o.call(O.styleAliases,M)&&(M=O.styleAliases[M]),C[S]=M}return C}function w(a){let h,C,b=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-b.length)+b}let k=1,L=2;function B(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=J(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==='"'?L:k,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 q(a,h){let C=n.repeat(" ",h),b=0,A="",_=a.length;for(;b<_;){let S,M=a.indexOf(`
|
|
19
19
|
`,b);M===-1?(S=a.slice(b),b=_):(S=a.slice(b,M+1),b=M+1),S.length&&S!==`
|
|
20
|
-
`&&(A+=C),A+=S}return A}function
|
|
21
|
-
`+n.repeat(" ",a.indent*h)}function
|
|
20
|
+
`&&(A+=C),A+=S}return A}function F(a,h){return`
|
|
21
|
+
`+n.repeat(" ",a.indent*h)}function Q(a,h){for(let C=0,b=a.implicitTypes.length;C<b;C+=1)if(a.implicitTypes[C].resolve(h))return!0;return!1}function $(a){return a===u||a===l}function Z(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 pe(a){return Z(a)&&a!==s&&a!==p&&a!==c}function we(a,h,C){let b=pe(a),A=b&&!$(a);return(C?b:b&&a!==ne&&a!==Y&&a!==U&&a!==he&&a!==me)&&a!==g&&!(h===V&&!A)||pe(h)&&!$(h)&&a===g||h===V&&A}function ie(a){return Z(a)&&a!==s&&!$(a)&&a!==W&&a!==oe&&a!==V&&a!==ne&&a!==Y&&a!==U&&a!==he&&a!==me&&a!==g&&a!==D&&a!==j&&a!==f&&a!==re&&a!==z&&a!==X&&a!==R&&a!==m&&a!==T&&a!==te&&a!==ae}function be(a){return!$(a)&&a!==V}function ye(a,h){let C=a.charCodeAt(h),b;return C>=55296&&C<=56319&&h+1<a.length&&(b=a.charCodeAt(h+1),b>=56320&&b<=57343)?(C-55296)*1024+b-56320+65536:C}function Oe(a){return/^\n* /.test(a)}let ke=1,Ae=2,Ke=3,He=4,xe=5;function Ge(a,h,C,b,A,_,S,M){let O,N=0,P=null,K=!1,ee=!1,xt=b!==-1,Ne=-1,Fe=ie(ye(a,0))&&be(ye(a,a.length-1));if(h||S)for(O=0;O<a.length;N>=65536?O+=2:O++){if(N=ye(a,O),!Z(N))return xe;Fe=Fe&&we(N,P,M),P=N}else{for(O=0;O<a.length;N>=65536?O+=2:O++){if(N=ye(a,O),N===c)K=!0,xt&&(ee=ee||O-Ne-1>b&&a[Ne+1]!==" ",Ne=O);else if(!Z(N))return xe;Fe=Fe&&we(N,P,M),P=N}ee=ee||xt&&O-Ne-1>b&&a[Ne+1]!==" "}return!K&&!ee?Fe&&!S&&!A(a)?ke:_===L?xe:Ae:C>9&&Oe(a)?xe:S?_===L?xe:Ae:ee?He:Ke}function hn(a,h,C,b,A){a.dump=(function(){if(h.length===0)return a.quotingType===L?'""':"''";if(!a.noCompatMode&&(se.indexOf(h)!==-1||E.test(h)))return a.quotingType===L?'"'+h+'"':"'"+h+"'";let _=a.indent*Math.max(1,C),S=a.lineWidth===-1?-1:Math.max(Math.min(a.lineWidth,40),a.lineWidth-_),M=b||a.flowLevel>-1&&C>=a.flowLevel;function O(N){return Q(a,N)}switch(Ge(h,M,a.indent,S,O,a.quotingType,a.forceQuotes&&!b,A)){case ke:return h;case Ae:return"'"+h.replace(/'/g,"''")+"'";case Ke:return"|"+We(h,a.indent)+Qe(q(h,_));case He:return">"+We(h,a.indent)+Qe(q(mn(h,S),_));case xe:return'"'+gn(h)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function We(a,h){let C=Oe(a)?String(h):"",b=a[a.length-1]===`
|
|
22
22
|
`,_=b&&(a[a.length-2]===`
|
|
23
23
|
`||a===`
|
|
24
24
|
`)?"+":b?"":"-";return C+_+`
|
|
25
25
|
`}function Qe(a){return a[a.length-1]===`
|
|
26
|
-
`?a.slice(0,-1):a}function
|
|
27
|
-
`);return M=M!==-1?M:a.length,C.lastIndex=M,
|
|
26
|
+
`?a.slice(0,-1):a}function mn(a,h){let C=/(\n+)([^\n]*)/g,b=(function(){let M=a.indexOf(`
|
|
27
|
+
`);return M=M!==-1?M:a.length,C.lastIndex=M,Se(a.slice(0,M),h)})(),A=a[0]===`
|
|
28
28
|
`||a[0]===" ",_,S;for(;S=C.exec(a);){let M=S[1],O=S[2];_=O[0]===" ",b+=M+(!A&&!_&&O!==""?`
|
|
29
|
-
`:"")+
|
|
29
|
+
`:"")+Se(O,h),A=_}return b}function Se(a,h){if(a===""||a[0]===" ")return a;let C=/ [^ ]/g,b,A=0,_,S=0,M=0,O="";for(;b=C.exec(a);)M=b.index,M-A>h&&(_=S>A?S:M,O+=`
|
|
30
30
|
`+a.slice(A,_),A=_+1),S=M;return O+=`
|
|
31
31
|
`,a.length-A>h&&S>A?O+=a.slice(A,S)+`
|
|
32
|
-
`+a.slice(S+1):O+=a.slice(A),O.slice(1)}function
|
|
33
|
-
`:""}return Wn.dump=I,Wn}var
|
|
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
|
|
32
|
+
`+a.slice(S+1):O+=a.slice(A),O.slice(1)}function gn(a){let h="",C=0;for(let b=0;b<a.length;C>=65536?b+=2:b++){C=ye(a,b);let A=H[C];!A&&Z(C)?(h+=a[b],C>=65536&&(h+=a[b+1])):h+=A||w(C)}return h}function Ve(a,h,C){let b="",A=a.tag;for(let _=0,S=C.length;_<S;_+=1){let M=C[_];a.replacer&&(M=a.replacer.call(C,String(_),M)),(y(a,h,M,!1,!1)||typeof M>"u"&&y(a,h,null,!1,!1))&&(b!==""&&(b+=","+(a.condenseFlow?"":" ")),b+=a.dump)}a.tag=A,a.dump="["+b+"]"}function Je(a,h,C,b){let A="",_=a.tag;for(let S=0,M=C.length;S<M;S+=1){let O=C[S];a.replacer&&(O=a.replacer.call(C,String(S),O)),(y(a,h+1,O,!0,!0,!1,!0)||typeof O>"u"&&y(a,h+1,null,!0,!0,!1,!0))&&((!b||A!=="")&&(A+=F(a,h)),a.dump&&c===a.dump.charCodeAt(0)?A+="-":A+="- ",A+=a.dump)}a.tag=_,a.dump=A||"[]"}function vn(a,h,C){let b="",A=a.tag,_=Object.keys(C);for(let S=0,M=_.length;S<M;S+=1){let O="";b!==""&&(O+=", "),a.condenseFlow&&(O+='"');let N=_[S],P=C[N];a.replacer&&(P=a.replacer.call(C,N,P)),y(a,h,N,!1,!1)&&(a.dump.length>1024&&(O+="? "),O+=a.dump+(a.condenseFlow?'"':"")+":"+(a.condenseFlow?"":" "),y(a,h,P,!1,!1)&&(O+=a.dump,b+=O))}a.tag=A,a.dump="{"+b+"}"}function e(a,h,C,b){let A="",_=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 M=0,O=S.length;M<O;M+=1){let N="";(!b||A!=="")&&(N+=F(a,h));let P=S[M],K=C[P];if(a.replacer&&(K=a.replacer.call(C,P,K)),!y(a,h+1,P,!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+=F(a,h)),y(a,h+1,K,!0,ee)&&(a.dump&&c===a.dump.charCodeAt(0)?N+=":":N+=": ",N+=a.dump,A+=N)}a.tag=_,a.dump=A||"{}"}function d(a,h,C){let b=C?a.explicitTypes:a.implicitTypes;for(let A=0,_=b.length;A<_;A+=1){let S=b[A];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 M=a.styleMap[S.tag]||S.defaultStyle,O;if(r.call(S.represent)==="[object Function]")O=S.represent(h,M);else if(o.call(S.represent,M))O=S.represent[M](h,M);else throw new t("!<"+S.tag+'> tag resolver accepts not "'+M+'" style');a.dump=O}return!0}}return!1}function y(a,h,C,b,A,_,S){a.tag=null,a.dump=C,d(a,C,!1)||d(a,C,!0);let M=r.call(a.dump),O=b;b&&(b=a.flowLevel<0||a.flowLevel>h);let N=M==="[object Object]"||M==="[object Array]",P,K;if(N&&(P=a.duplicates.indexOf(C),K=P!==-1),(a.tag!==null&&a.tag!=="?"||K||a.indent!==2&&h>0)&&(A=!1),K&&a.usedDuplicates[P])a.dump="*ref_"+P;else{if(N&&K&&!a.usedDuplicates[P]&&(a.usedDuplicates[P]=!0),M==="[object Object]")b&&Object.keys(a.dump).length!==0?(e(a,h,a.dump,A),K&&(a.dump="&ref_"+P+a.dump)):(vn(a,h,a.dump),K&&(a.dump="&ref_"+P+" "+a.dump));else if(M==="[object Array]")b&&a.dump.length!==0?(a.noArrayIndent&&!S&&h>0?Je(a,h-1,a.dump,A):Je(a,h,a.dump,A),K&&(a.dump="&ref_"+P+a.dump)):(Ve(a,h,a.dump),K&&(a.dump="&ref_"+P+" "+a.dump));else if(M==="[object String]")a.tag!=="?"&&hn(a,a.dump,h,_,O);else{if(M==="[object Undefined]")return!1;if(a.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+M)}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 x(a,h){let C=[],b=[];v(a,C,b);let A=b.length;for(let _=0;_<A;_+=1)h.duplicates.push(C[b[_]]);h.usedDuplicates=new Array(A)}function v(a,h,C){if(a!==null&&typeof a=="object"){let b=h.indexOf(a);if(b!==-1)C.indexOf(b)===-1&&C.push(b);else if(h.push(a),Array.isArray(a))for(let A=0,_=a.length;A<_;A+=1)v(a[A],h,C);else{let A=Object.keys(a);for(let _=0,S=A.length;_<S;_+=1)v(a[A[_]],h,C)}}}function I(a,h){h=h||{};let C=new B(h);C.noRefs||x(a,C);let b=a;return C.replacer&&(b=C.replacer.call({"":b},"",b)),y(C,0,b,!0,!0)?C.dump+`
|
|
33
|
+
`:""}return Wn.dump=I,Wn}var li;function to(){if(li)return fe;li=1;let n=eo(),t=no();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 fe.Type=de(),fe.Schema=ci(),fe.FAILSAFE_SCHEMA=di(),fe.JSON_SCHEMA=yi(),fe.CORE_SCHEMA=wi(),fe.DEFAULT_SCHEMA=Qn(),fe.load=n.load,fe.loadAll=n.loadAll,fe.dump=t.dump,fe.YAMLException=je(),fe.types={binary:xi(),float:vi(),map:pi(),null:hi(),pairs:Ci(),set:_i(),timestamp:bi(),bool:mi(),int:gi(),merge:Ai(),omap:Si(),seq:fi(),str:ui()},fe.safeLoad=i("safeLoad","load"),fe.safeLoadAll=i("safeLoadAll","loadAll"),fe.safeDump=i("safeDump","dump"),fe}var io=to(),ro=Zr(io),{Type:Da,Schema:Pa,FAILSAFE_SCHEMA:Ba,JSON_SCHEMA:Ua,CORE_SCHEMA:ja,DEFAULT_SCHEMA:qa,load:Ii,loadAll:Ya,dump:ki,YAMLException:za,types:Ka,safeLoad:Ha,safeLoadAll:Ga,safeDump:Wa}=ro;var ce=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}},oo=class extends ce{},ao=class extends ce{},so=class extends ce{},Vn=class extends ce{};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 oo(nn(t,"Authentication failed"),r):n===404?new ao(nn(t,"Not found"),r):n>=500?new so(nn(t,"Server error"),r):new ce(nn(t,`Request failed with status ${n}`),r)}function rn(n){try{return JSON.parse(n)}catch{return n}}var lo=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)}),D=await T.text(),R=D?rn(D):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}},co=(()=>{try{return"https://api.joinblok.co"}catch{return"http://127.0.0.1:8001"}})(),uo=3e4,fo=3e5;function po(n){return n.endsWith("/")?n.slice(0,-1):n}function ho(n={}){let t=n.baseUrl??process.env.SELDON_BASE_URL??process.env.BLOK_BASE_URL??co,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:po(t),apiKey:i||void 0,timeoutMs:n.timeoutMs??(Number.isFinite(r)&&r>0?r:uo),specCacheTtlMs:n.specCacheTtlMs??fo}}var mo=new Set(["get","post","put","patch","delete"]),go="_api_v1_";function vo(n){let t=n.indexOf(go);return t>0?n.slice(0,t):n}function yo(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 wo(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 bo=class Fi{constructor(t,i){this.operations=t,this.apiKeySchemes=i}operations;apiKeySchemes;static fromSpec(t){let i=yo(t),r=[];for(let[o,s]of Object.entries(t.paths??{}))for(let[l,c]of Object.entries(s)){if(!mo.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:vo(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:wo(p)})}return new Fi(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 Pi(){if(process.env.BLOK_CACHE_DIR)return process.env.BLOK_CACHE_DIR;let n=_o()||Io();return Di(n,".cache","blok")}function ko(n){let t=xo("sha256").update(n).digest("hex").slice(0,16);return Di(Pi(),`openapi-${t}.json`)}var To=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 Ti(t,"utf8"))}catch(r){throw new Vn(`Could not read BLOK_SPEC_PATH (${t}): ${String(r)}`)}let i=ko(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 Ti(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 So(Pi(),{recursive:!0});let i={ts:Date.now(),spec:t};await Co(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"]};function on(n,t={}){return n.replace(/\{([^}]+)\}/g,(i,r)=>{let o=t[r];if(o===void 0)throw new ce(`Missing path parameter: ${r}`);return encodeURIComponent(String(o))})}var Bi=class{config;client;loader;registry;constructor(n={}){this.config=ho(n),this.client=new lo(this.config),this.loader=new To(this.config)}async operations(n={}){if(!this.registry||n.refresh){let t=await this.loader.load(n);this.registry=bo.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 ce(`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 ce(`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 Yi(n,t){return t<=0||n.length<=t?{shown:n,hiddenCount:0}:{shown:n.slice(0,t),hiddenCount:n.length-t}}var Ei={blocker:0,major:1,minor:2,cosmetic:3},Oi={fail:0,blocked:1,timed_out:2},Li={pass:"\u2705",fail:"\u274C",blocked:"\u{1F6AB}",timed_out:"\u231B"},Lo={pass:"PASS",fail:"FAIL",blocked:"BLOCKED",timed_out:"TIMED_OUT"};function Mo(n){let t=n.toLowerCase();return t==="pass"?"pass":t==="fail"?"fail":t==="timed_out"||t==="timedout"?"timed_out":"blocked"}function $o(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 No(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 Fo(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 Do(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=Mo(g.verdict);if(T==="pass"){u.push({id:g.test_case_id,title:g.title});continue}let D=$o(i.get(g.test_case_id)),R=g.attempts??1,j=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:D,hint:No(T,g,D),screenshotUrls:g.screenshot_urls??[],recordingUrl:g.recording_url??void 0,attempts:R,passes:j,flaky:R>1&&j>0&&j<R})}p.sort((g,T)=>{let D=(Oi[g.verdict]??9)-(Oi[T.verdict]??9);if(D!==0)return D;let R=Ei[(g.severity??"").toLowerCase()]??9,j=Ei[(T.severity??"").toLowerCase()]??9;return R-j});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:Fo(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 Po=8,Bo=8,Mi=12,zi=5;function Ki(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 Hi(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 Gi(n,t={}){let i=[`Seldon QA \u2014 ${n.planTitle} \xB7 ${Ki(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 Hi(n)){let l=Lo[s.verdict].padEnd(Po),c=(s.severity?.toUpperCase()??"").padEnd(Bo);i.push(`${l} ${c} ${s.id} ${s.title}`)}let{shown:r,hiddenCount:o}=t.full?{shown:n.failures,hiddenCount:0}:Yi(n.failures,t.compactLimit??zi);for(let s of r){i.push("",`${s.id} ${s.title}${s.flaky?" (FLAKY)":""}`);let l=(c,p)=>` ${c.padEnd(Mi)}${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+Mi)+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 Wi(n,t={}){let i=[`**Seldon QA \u2014 ${n.planTitle}** \xB7 ${Ki(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=Hi(n);if(r.length){i.push("","| | Case |","|---|---|");for(let l of r){let c=l.severity?`${Li[l.verdict]} \`${l.severity.toUpperCase()}\``:Li[l.verdict];i.push(`| ${c} | \`${l.id}\` ${l.title} |`)}}let{shown:o,hiddenCount:s}=t.full?{shown:n.failures,hiddenCount:0}:Yi(n.failures,t.compactLimit??zi);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 $i(n){if(n&&!(typeof n.start!="number"||typeof n.end!="number"))return{start:n.start,end:n.end}}function Uo(n,t){return{id:n.test_case_id,title:t.get(n.test_case_id),oldLines:$i(n.old_lines),newLines:$i(n.new_lines)}}function jo(n){return{id:n.test_case_id,title:n.title,reason:n.reason??void 0,snippet:n.snippet??void 0}}function qo(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 Yo(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 Qi(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 Vi(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=>Uo(g,r)),p=(s.nullified??[]).map(jo),u=(s.added??[]).map(g=>({id:g.test_case_id,title:g.title})),f=(n.decisions??[]).map(qo),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:Yo(m)},kept:l,reanchored:c,nullified:p,added:u,decisions:f,fixedCoverage:Qi(o,i)}}function an(n){return n?`${n.start}-${n.end}`:"?"}function Ji(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 Zi(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"]),Xi=256*1024,zo=8e3,Ko=50*1024*1024,Ho=8192,at="application/zip",er=new Date("2020-01-01T00:00:00Z"),st=new Set(["seldon.yml","seldon.yaml"]),Go=/^(readme|contributing)(\.|$)/i;function nt(n){return n.startsWith(".")}function Wo(n){return st.has(n)||Go.test(n)}function nr(n){return Ri==="/"?n:n.split(Ri).join("/")}function tr(n){let t=Math.min(n.length,Ho);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??Xi,o=t.maxFiles??zo,s=t.maxTotalBytes??Ko,l=[],c=[],p=0,u=null;async function f(m){if(u)return;let g;try{g=await Eo(m,{withFileTypes:!0})}catch{return}g.sort((T,D)=>T.name.localeCompare(D.name));for(let T of g){if(u)return;let D=qi(m,T.name),R=nr(Oo(n,D));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(D);continue}if(!T.isFile())continue;if(nt(T.name)&&!st.has(T.name)){c.push({path:R,reason:"hidden"});continue}if(!R.includes("/")&&!Wo(T.name)){c.push({path:R,reason:"root-file"});continue}let j;try{j=(await ji(D)).size}catch{continue}if(j>r){c.push({path:R,reason:"too-large"});continue}if(l.length>=o){u="limit-files";return}if(p+j>s){u="limit-bytes";return}let ne;try{ne=new Uint8Array(await Ui(D))}catch{continue}if(tr(ne)){c.push({path:R,reason:"binary"});continue}l.push({path:R,bytes:ne}),p+=j}}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 ce(`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:er}),filename:t.filename??"codebase.zip",fileCount:i.length,skipped:r}}function Ni(n,t){try{return Ro("git",["-C",n,...t],{encoding:"utf8",maxBuffer:64*1024*1024})}catch(i){throw new ce(`git ${t.join(" ")} failed (is '${n}' a git repository?): ${i.message.split(`
|
|
41
|
+
`)[0]}`)}}async function ir(n,t={}){let i=t.base?[`${t.base}...HEAD`]:["HEAD"],r=Ni(n,["diff",...i]);if(!r.trim())throw new ce(t.base?`No changes between ${t.base} and HEAD to reassess.`:"No uncommitted changes vs HEAD to reassess.");let o=Ni(n,["diff","--name-only","--diff-filter=d",...i]).split(`
|
|
42
|
+
`).map(f=>f.trim()).filter(Boolean),s=t.maxFileBytes??Xi,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=qi(n,f),D;try{if((await ji(T)).size>s){p.push({path:f,reason:"too-large"});continue}D=new Uint8Array(await Ui(T))}catch{continue}if(tr(D)){p.push({path:f,reason:"binary"});continue}c[nr(f)]=D,u+=1}return{bytes:In(c,{level:6,mtime:er}),filename:t.filename??"changed.zip",fileCount:u,skipped:p,patch:r}}async function rr(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 Qo(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(Qo)}}async function or(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 ce(`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 Vo(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 ar(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 sr(n,t){return n.call("promote_baseline",{path:{baseline_id:t}})}async function lr(n,t,i={}){return i.credentials!==void 0&&await Vo(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 cr(n,t){return n.call("get_experiment_qa_report",{path:{experiment_id:t}})}async function ur(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 cr(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 cr(n,t);return Do({...i,experiment_id:i.experiment_id??t})}var fr=3e5,Zn="update_baseline_from_package";async function pr(n,t,i,r={}){let o=r.fixedCaseIds??[];if(!await n.hasOperation(Zn))throw new ce(`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:fr,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=Qi(u,p);if(!f.ok)throw new ce(`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 Vi({...c,experiment_id:c.experiment_id??i},o)}var Xn="delta_baseline";async function dr(n,t,i){if(!await n.hasOperation(Xn))throw new ce(`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:fr,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=Vi({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 mr(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",ea=Array.from(ot),na="ALL";function Ye(){return{baseline:{baselineId:"",lineageId:"",generate:{scope:"",filename:"codebase.zip",ignoreDirs:[...ea]},run:{url:""}},testCases:{skip:[],only:[],fixed:[]},cli:{wait:!0,reportFormat:"markdown"}}}function Re(n){return Zo(Xo(n),tt)}function ge(n){let t;try{t=hr(Re(n),"utf8")}catch{return null}return ta(t)}function pt(n){try{return hr(Re(n),"utf8")}catch{return}}function ta(n){let t;try{t=Ii(n)}catch(i){throw new ce(`Could not parse ${tt}: ${i.message}`)}if(t==null)return{};if(typeof t!="object"||Array.isArray(t))throw new ce(`${tt} must be a YAML mapping at the top level.`);return t}function ia(n){return ki(n,{noRefs:!0,lineWidth:-1})}function Me(n,t){Jo(Re(n),ia(t),"utf8")}function et(n,t){return!n||n.length===0?[]:n.includes(na)?[...t]:n}function gr(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 vr(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 yr(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 Ta}from"fs";import{Command as Ra}from"commander";var ra="\x1B[0m",oa={bold:"1",dim:"2",inverse:"7",red:"31",green:"32",yellow:"33",blue:"34",magenta:"35",cyan:"36",gray:"90"};function aa(){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!aa()||t.length===0?n:`${t.map(r=>`\x1B[${oa[r]}m`).join("")}${n}${ra}`}var ht=n=>cn(n,"bold"),wr=n=>cn(n,"dim");import{mkdirSync as sa,readFileSync as la,writeFileSync as ca}from"fs";import{homedir as ua}from"os";import{join as br}from"path";function Ar(){return process.env.SELDON_CONFIG_DIR??process.env.BLOK_CONFIG_DIR??br(ua(),".config","seldon")}function xr(){return br(Ar(),"config.json")}function ze(){try{return JSON.parse(la(xr(),"utf8"))}catch{return{}}}function un(n){let t={...ze(),...n};return sa(Ar(),{recursive:!0,mode:448}),ca(xr(),`${JSON.stringify(t,null,2)}
|
|
43
|
+
`,{encoding:"utf8",mode:384}),t}function Sr(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=ge(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 Cr(n,t){if(n.id)return n.id;let i=ge(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=ge(n)??Ye(),r=t(i);return Me(n,r),r}var fa="Other",pa=3,da=3,ha=3,mt=["none","skip","only","fixed"],ma={none:" ",skip:"s",only:"o",fixed:"f"};function ga(){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 va(n){let t=new Map;for(let r of n){let o=r.area?.trim()||fa;(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 ya(n,t){let i=(ge(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 wa(n,t){return t<=1||n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}\u2026`}var gt=class{constructor(t,i,r,o){this.planTitle=t;this.io=o;this.rows=va(i),this.caseRowIndices=this.rows.reduce((s,l,c)=>l.kind==="case"?[...s,c]:s,[]),this.statuses=ya(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(ha,this.io.rows-pa-da)}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=mt[(mt.indexOf(i)+1)%mt.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":" "} [${ma[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=wa(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 Ia}from"@clack/prompts";var Or=["Still working","Reticulating splines","Reading through the codebase","Thinking it through","Almost there","Hang tight"];function ka(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=Ia(),i=0;return t.start(n),{onTick:o=>{let s=Or[i%Or.length];i+=1,t.message(`${n} (${ka(o)}) \u2014 ${s}...`)},stop:o=>t.stop(o)}}async function
|
|
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 _r(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 gt(s.title??"Baseline",l,t,r.io??ga());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 ba}from"fs";import{cancel as vt,confirm as Aa,intro as xa,isCancel as fn,outro as Ir,text as yt}from"@clack/prompts";var wt=12,kr=48,bt=8;function Tr(n){if(n.length<=kr)return n;let t=kr-1,i=Math.ceil(t/2),r=Math.floor(t/2);return`${n.slice(0,i)}\u2026${n.slice(n.length-r)}`}function Sa(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 Rr(n,t,i,r){r(""),r(`Files that will be included: ${n.totalFiles} file(s), ${mr(n.totalBytes)}`);for(let o of n.rootEntries.slice(0,wt)){let s=Tr(o.name);r(o.type==="dir"?` ${s}/ (${o.fileCount} file${o.fileCount===1?"":"s"})`:` ${s}`)}if(n.rootEntries.length>wt&&r(` \u2026 and ${n.rootEntries.length-wt} more`),t.length>0){let o=t.slice(0,bt).map(Tr).join(", "),s=t.length>bt?` (+${t.length-bt} more)`:"";r(`Automatically ignoring: ${o}${s}`)}Sa(i,r)}function Ca(n){let t=n.split(",").map(i=>i.trim().replace(/^\/+|\/+$/g,"")).filter(Boolean);return Array.from(new Set(t))}async function _a(n,t,i){let{files:r,skipped:o,totalBytes:s}=await sn(n,{ignoreDirs:t});Rr(ut(r,s),ft(o),dt(o),i)}async function Er(n,t){let{status:i}=t;if(xa("Welcome to Seldon!"),ba(Re(n))){let p=await Aa({message:"seldon.yml already exists here. Reset it to defaults?",initialValue:!1});if(fn(p)||!p){Ir("Keeping the existing seldon.yml. Nothing changed.");return}}let r=await vr(n),o=r.config;Me(n,o),i("Created seldon.yml with smart defaults."),i("Analyzing your repository..."),Rr(r.preview,r.ignored,r.skippedByReason,i);let s=await yt({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)){vt("Stopped \u2014 seldon.yml has the smart defaults saved above.");return}if(s.trim()){let p=Ca(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 _a(n,o.baseline?.generate?.ignoreDirs??[],i)}let l=await yt({message:"Default staging URL? (optional)",placeholder:"https://staging.example.com"});if(fn(l)){vt("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 yt({message:"Scope for baseline generation? (optional, e.g. 'checkout flow')",placeholder:"leave empty for full codebase analysis"});if(fn(c)){vt("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),Ir(["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 Ia}from"@clack/prompts";var Or=["Still working","Reticulating splines","Reading through the codebase","Thinking it through","Almost there","Hang tight"];function ka(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=Ia(),i=0;return t.start(n),{onTick:o=>{let s=Or[i%Or.length];i+=1,t.message(`${n} (${ka(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 Ea={only:"o",skip:"s",fixed:"f",none:" "};function Oa(n,t,i){return Ea[gr(n,t?.testCases,i)]}function Lr(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 Mr(n,t=[]){let i=n.out??(w=>process.stdout.write(`${w}
|
|
49
49
|
`)),r=n.status??(w=>process.stderr.write(`${w}
|
|
50
|
-
`)),o=new Ra("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:"," seldon init # create seldon.yml, preview what will be analyzed"," seldon
|
|
50
|
+
`)),o=new Ra("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","","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 w=o.opts();return n.makeSdk({baseUrl:w.baseUrl,apiKey:w.apiKey})},l=w=>i(JSON.stringify(w,null,2)),c=(w,
|
|
53
|
-
`),i(it(
|
|
54
|
-
`),i(it(
|
|
55
|
-
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon
|
|
52
|
+
`));let s=()=>{let w=o.opts();return n.makeSdk({baseUrl:w.baseUrl,apiKey:w.apiKey})},l=w=>i(JSON.stringify(w,null,2)),c=(w,k,L)=>{k==="json"?l(w):i(k==="markdown"?Wi(w,{full:L}):Gi(w,{full:L}))},p=(w,k)=>{k==="json"?l(w):i(k==="markdown"?Zi(w):Ji(w))},u=async w=>{let k=w.path??process.cwd(),L=Ie(w,k),B=ge(k),q=w.url||B?.baseline?.run?.url||void 0;r(`Launching QA run for baseline ${L} ...`);let{experimentId:F}=await lr(s(),L,{url:q,credentials:w.credentials});if(Ee(k,$=>({...$,baseline:{...$.baseline,lastRunExperimentId:F,...w.url?{run:{...$.baseline?.run,url:w.url}}:{}}})),r(`Run started \u2014 experiment ${F}. View it in the app under QA, or: seldon baseline report`),!w.wait)return;let Q=pn("Running test cases");await ur(s(),F,{onTick:Q.onTick}),Q.stop(""),r("Test run complete."),c(await ct(s(),F),dn(w,B),w.full)},f=w=>w.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 w=>{let k=w.path??process.cwd(),L=Cr(w,k),B=ge(k);c(await ct(s(),L),dn(w,B),w.full)},g=w=>w.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 w=ze();l({baseUrl:w.baseUrl,apiKey:w.apiKey?"****":void 0})}),T.command("set-key <key>").description("Save an API key to the config file.").action(w=>{un({apiKey:w}),r("Saved API key.")}),T.command("set-url <url>").description("Save the API base URL to the config file.").action(w=>{un({baseUrl:w}),r("Saved base URL.")}),o.command("login <key>").description("Save your API key (alias for `config set-key`).").action(w=>{un({apiKey:w}),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 w=>{let k=w??process.cwd();await Er(k,{status:r})});let D=o.command("baseline",{hidden:!0}).description("Grouped aliases of the top-level baseline verbs (back-compat)."),R=w=>w?{hidden:!0}:{},j=async w=>{let{baselines:k}=await lt(s());if(w.json){l({baselines:k});return}if(k.length===0){i("No baselines found for this API key. Generate one with: seldon generate");return}i(ht(`${k.length} baseline${k.length===1?"":"s"}`)+`
|
|
53
|
+
`),i(it(k,[{header:"ID",cell:L=>L.id},{header:"NAME",cell:L=>L.displayName},{header:"SOURCE",cell:L=>L.createdVia},{header:"CASES",align:"right",cell:L=>String(L.caseCount)},{header:"STATUS",cell:L=>L.status},{header:"UPDATED",cell:L=>L.createdAt?new Date(L.createdAt).toISOString().slice(0,10):"?"}]))},ne=(w,k=!1)=>w.command("list",R(k)).description("List every baseline your API key can see (across every source), not just the one saved locally.").option("--json","Output as JSON").action(j),W=async(w,k)=>{let L=w??process.cwd(),q=ge(L)?.baseline?.generate;r(`Reading codebase at ${L} ...`);let F=await rr(s(),L,{scope:k.scope??q?.scope,label:k.name,filename:q?.filename,ignoreDirs:q?.ignoreDirs});Ee(L,$=>({...$,baseline:{...$.baseline,lineageId:F.lineageId}})),r(`Uploaded ${F.fileCount} file(s); baseline created (lineage ${F.lineageId}).`);let Q={lineageId:F.lineageId};if(k.wait){let $=pn("Generating test plan (this can take a few minutes)"),Z=await or(s(),F.lineageId,{onTick:$.onTick});$.stop(""),Ee(L,pe=>({...pe,baseline:{...pe.baseline,baselineId:Z.id}})),Q={lineageId:F.lineageId,baselineId:Z.id,caseCount:Z.caseCount},r(`Baseline ready: ${Z.caseCount} test case(s). It now appears in the app under QA Baselines.`),r("Run it with: seldon run --url <url>")}k.json?l({...F,...Q}):r(`Saved baseline id to ${Re(L)}`)},V=(w,k=!1)=>w.command("generate [path]",R(k)).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 w=>{let k=w.path??process.cwd(),L=Ie(w,k),B=await qe(s(),L),q=ge(k);l({baselineId:B.baseline_id??L,lineageId:B.lineage_id,planTitle:B.title,caseCount:B.case_count??B.cases?.length??0,status:B.status,targetUrl:B.target_url||void 0,lastRunExperimentId:q?.baseline?.lastRunExperimentId||void 0,defaultUrl:q?.baseline?.run?.url||void 0})},X=(w,k=!1)=>w.command("show",R(k)).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),oe=async w=>{let k=w.path??process.cwd(),L=Ie(w,k),B=await qe(s(),L),q=B.cases??[];if(w.json){l(q);return}let F=ge(k),Q=q.map($=>$.id);i(`${B.title??"Baseline"} \u2014 ${q.length} case(s)`);for(let $ of q)i(` [${Oa($.id,F,Q)}] [${$.id}] ${$.title} (${$.priority??"?"} \xB7 ${$.area??"general"})`),$.acceptance_criterion&&i(` ${$.acceptance_criterion}`);i(""),i("Legend: [s]=skip [o]=only [f]=fixed [ ]=run normally \xB7 edit interactively: seldon cases")},te=async w=>{if(!w.json&&!w.list&&process.stdin.isTTY){let k=w.path??process.cwd(),L=Ie(w,k);await _r(s(),k,L,{status:r});return}await oe(w)},Y=(w,k=!1)=>w.command("cases",R(k)).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(w,k)=>{let L=w??process.cwd(),B=Ie(k,L),q=ge(L),F=await At(`Re-evaluating baseline against ${L}`,()=>pr(s(),L,B,{seldonYaml:pt(L),filename:k.name??q?.baseline?.generate?.filename,ignoreDirs:q?.baseline?.generate?.ignoreDirs}));r(`Update complete: ${F.summary.headline}`),p(F,dn(k,q))},ae=(w,k=!1)=>w.command("update [path]",R(k)).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),he=async(w,k)=>{let L=w??process.cwd(),B=Ie(k,L),q=ge(L),F,Q=!!k.full;if(k.zip)F=new Uint8Array(Ta(k.zip));else if(k.full)F=(await ln(L,{ignoreDirs:q?.baseline?.generate?.ignoreDirs})).bytes,Q=!0;else{let Z=await ir(L,{base:k.base});r(`Reassessing ${Z.fileCount} changed file(s) against the baseline ...`),F=Z.bytes}let $=await At("Reassessing baseline against the changes",()=>dr(s(),B,{zipBytes:F,full:Q,targetUrl:k.url,seldonYaml:pt(L),autoRun:k.autoRun}));r(`Review complete: ${$.report.summary.headline}`),Ee(L,Z=>({...Z,baseline:{...Z.baseline,...$.experimentId?{lastRunExperimentId:$.experimentId}:{}}})),$.experimentId?r(`Draft ${$.draftBaselineId} \u2014 running affected cases as experiment ${$.experimentId} (view under QA).`):r(`Draft ${$.draftBaselineId} \u2014 no affected cases ran (nothing affected, or no target URL).`),p($.report,dn(k,q))},re=(w,k=!1)=>w.command("review [path]",R(k)).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(he),me=async w=>{let k=w.path??process.cwd(),L=Ie(w,k),{versions:B,committedHeadId:q}=await ar(s(),L);if(w.json){l({committedHeadId:q,versions:B});return}if(B.length===0){i("No versions found for this baseline.");return}i(ht(`${B.length} version${B.length===1?"":"s"} \u2014 committed head: ${q??"none"}`)+`
|
|
54
|
+
`),i(it(B,[{header:"",cell:F=>F.isHead?"*":F.status==="draft"?"d":" "},{header:"ID",cell:F=>F.id},{header:"STATUS",cell:F=>F.status},{header:"SOURCE",cell:F=>F.createdVia},{header:"CASES",align:"right",cell:F=>String(F.caseCount)},{header:"UPDATED",cell:F=>F.createdAt?new Date(F.createdAt).toISOString().slice(0,10):"?"}])),i(wr(`
|
|
55
|
+
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon promote <id>`))},H=(w,k=!1)=>w.command("versions",R(k)).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(me),se=async(w,k)=>{let L=k.path??process.cwd(),B=w??Ie(k,L),q=await sr(s(),B),F=q.baseline_id??B;Ee(L,Q=>({...Q,baseline:{...Q.baseline,baselineId:F}})),r(`Promoted to committed head ${F} (${q.case_count??q.cases?.length??0} case(s)). Runs now resolve to it.`)},J=[ne,V,X,Y,ae,re,H,(w,k=!1)=>w.command("promote [versionId]",R(k)).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(se)];for(let w of J)w(o,!1),w(D,!0);if(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(D.command("run",{hidden:!0})).action(u),g(D.command("report",{hidden:!0})).action(m),t.length>0){let w=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 k of t)w.command(k.name).description(k.summary??`${k.method} ${k.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 L=>{l(await s().call(k.name,{path:Lr(L.path),query:Lr(L.query),body:L.data?JSON.parse(L.data):void 0}))})}return o}function $r(n){let t=Sr(n,ze(),process.env);return new Bi(t)}async function La(){try{return await $r({}).apiKeyOps()}catch{return[]}}async function Ma(){let n=yr(process.argv)?await La():[];await Mr({makeSdk:$r},n).parseAsync(process.argv)}Ma().catch(n=>{process.stderr.write(`${n.message}
|
|
56
56
|
`),process.exit(1)});
|