@seldonqa/cli 0.4.0 → 0.5.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/README.md +93 -0
- package/dist/bin.js +46 -46
- package/package.json +14 -2
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Seldon QA
|
|
2
|
+
|
|
3
|
+
**Generate a QA test plan from any codebase, then run AI agents that use your product like a real user — from your terminal or CI.**
|
|
4
|
+
|
|
5
|
+
`seldon` turns a repository into a **baseline** of prioritized, user-facing test cases, runs those cases against a live URL with autonomous agents, and returns a clean, actionable report for you or your coding agent to act on.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @seldonqa/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
AI is shipping more code than any team can test by hand. Seldon closes the gap: point it at your repo and it proposes the tests that matter; point it at a URL and agents actually exercise them like users — click, type, navigate, verify — then tell you exactly what broke and where.
|
|
14
|
+
|
|
15
|
+
## Get started
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @seldonqa/cli
|
|
19
|
+
seldon login seldon_your_api_key # or: seldon config set-key <key>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
From inside a project (one baseline per project):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
seldon init # create seldon.yml, preview what will be analyzed
|
|
26
|
+
seldon generate # build a QA baseline from this codebase
|
|
27
|
+
seldon cases # review / scope test cases
|
|
28
|
+
seldon run --url https://staging.example.com
|
|
29
|
+
seldon logs --follow # watch the agents test, live
|
|
30
|
+
seldon report --md # clean, actionable results
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Highlights
|
|
34
|
+
|
|
35
|
+
- **Baselines from your code.** `seldon generate` reads the project and produces a prioritized plan of real user journeys — no scripts to write.
|
|
36
|
+
- **Agents that behave like users.** `seldon run` drives your live app and judges each case pass / fail / blocked.
|
|
37
|
+
- **Watch it think.** `seldon logs --follow` streams the agent's reasoning, framed by test case and step.
|
|
38
|
+
- **Reports built for action.** `--md` for pull requests, `--json` for coding agents, plain text for the terminal.
|
|
39
|
+
- **Re-evaluate as code changes.** `seldon update` refreshes the plan when the code moves; pinned cases are always preserved.
|
|
40
|
+
- **CI-native gate.** `seldon run --fail-on fail` exits non-zero so a red QA run can block a merge.
|
|
41
|
+
|
|
42
|
+
## Configuration — `seldon.yml`
|
|
43
|
+
|
|
44
|
+
Configuration lives in a single committed file at your project root (config-as-code). With no file, every command still works with sensible defaults.
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
baseline:
|
|
48
|
+
run:
|
|
49
|
+
url: https://staging.example.com # where runs target by default
|
|
50
|
+
testCases:
|
|
51
|
+
only: [] # run ONLY these case ids (wins over skip)
|
|
52
|
+
skip: [] # never run these
|
|
53
|
+
fixed: [] # always keep these when the plan is updated (accepts: [ALL])
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## In CI
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
seldon run --url "$PREVIEW_URL" --fail-on fail
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--fail-on fail` returns a non-zero exit code when any case fails; use `--fail-on any` to also gate on blocked or timed-out cases. With `--json` the report is stable, machine-readable output you can post to a pull request or hand to a coding agent for an automated fix loop.
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
| Command | What it does |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `seldon init` | Create `seldon.yml` and preview what will be analyzed |
|
|
69
|
+
| `seldon generate` | Build a QA baseline (test plan) from the current codebase |
|
|
70
|
+
| `seldon cases` | Review and scope test cases — only / skip / fixed |
|
|
71
|
+
| `seldon run --url <url>` | Run the baseline against a live URL |
|
|
72
|
+
| `seldon logs --follow` | Stream the agent's live reasoning (thinking only) |
|
|
73
|
+
| `seldon report [--md \| --json]` | Show the latest report |
|
|
74
|
+
| `seldon runs` | List QA runs with color-coded status |
|
|
75
|
+
| `seldon cancel --id <run>` | Stop a run mid-flight |
|
|
76
|
+
| `seldon update` | Re-evaluate the baseline after code changes |
|
|
77
|
+
| `seldon review` | PR-style: evaluate your changes and run the affected cases |
|
|
78
|
+
| `seldon list` · `versions` · `promote` | Manage baselines and versions |
|
|
79
|
+
|
|
80
|
+
Run `seldon --help` or `seldon <command> --help` for the full reference.
|
|
81
|
+
|
|
82
|
+
## Coding agents (MCP)
|
|
83
|
+
|
|
84
|
+
Seldon is also available as an MCP server, so coding agents can generate baselines, run them, and read reports directly — enabling a closed test-and-fix loop.
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
|
|
88
|
+
- Node.js 20 or newer
|
|
89
|
+
- A Seldon API key
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
Run `seldon --help` to get started.
|
package/dist/bin.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createHash as Eo}from"crypto";import{mkdir as Oo,readFile as Oi,writeFile as Lo}from"fs/promises";import{homedir as $o,tmpdir as Mo}from"os";import{join as ji}from"path";import{execFileSync as Po}from"child_process";import{readdir as Do,readFile as zi,stat as Ki}from"fs/promises";import{join as Hi,relative as Uo,sep as Li}from"path";import{createRequire as Yr}from"module";var zr=Yr("/"),Be,Kr,Hr;try{Be=zr("worker_threads"),Kr=Be.Worker,Hr=Be.isMarkedAsUntransferable}catch{}var de=Uint8Array,Ce=Uint16Array,En=Int32Array,On=new de([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]),Ln=new de([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]),It=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$t=function(n,t){for(var i=new Ce(31),r=0;r<31;++r)i[r]=t+=1<<n[r-1];for(var o=new En(i[30]),r=1;r<30;++r)for(var a=i[r];a<i[r+1];++a)o[a]=a-i[r]<<5|r;return{b:i,r:o}},Be=$t(On,2),Gr=Be.b,In=Be.r;Gr[28]=258,In[258]=28;var Mt=$t(Ln,0),Zs=Mt.b,kt=Mt.r,kn=new Ce(32768);for(G=0;G<32768;++G)Re=(G&43690)>>1|(G&21845)<<1,Re=(Re&52428)>>2|(Re&13107)<<2,Re=(Re&61680)>>4|(Re&3855)<<4,kn[G]=((Re&65280)>>8|(Re&255)<<8)>>1;var Re,G,Ke=(function(n,t,i){for(var r=n.length,o=0,a=new Ce(t);o<r;++o)n[o]&&++a[n[o]-1];var l=new Ce(t);for(o=1;o<t;++o)l[o]=l[o-1]+a[o-1]<<1;var c;if(i){c=new Ce(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,v=m|(1<<f)-1;m<=v;++m)c[kn[m]>>p]=u}else for(c=new Ce(r),o=0;o<r;++o)n[o]&&(c[o]=kn[l[n[o]-1]++]>>15-n[o]);return c}),Fe=new de(288);for(G=0;G<144;++G)Fe[G]=8;var G;for(G=144;G<256;++G)Fe[G]=9;var G;for(G=256;G<280;++G)Fe[G]=7;var G;for(G=280;G<288;++G)Fe[G]=8;var G,tn=new de(32);for(G=0;G<32;++G)tn[G]=5;var G,Wr=Ke(Fe,9,0);var Qr=Ke(tn,5,0);var Nt=function(n){return(n+7)/8|0},Ft=function(n,t,i){return(t==null||t<0)&&(t=0),(i==null||i>n.length)&&(i=n.length),new de(n.subarray(t,i))};var Vr=["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"],rn=function(n,t,i){var r=new Error(t||Vr[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,rn),!i)throw r;return r};var Ee=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8},Ye=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},_n=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,a=i.slice();if(!o)return{t:Dt,l:0};if(o==1){var l=new de(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function(Z,se){return Z.f-se.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 v=a[0].s,r=1;r<o;++r)a[r].s>v&&(v=a[r].s);var T=new Ce(v+1),F=Tn(i[f-1],T,0);if(F>t){var r=0,E=0,j=F-t,ee=1<<j;for(a.sort(function(se,ne){return T[ne.s]-T[se.s]||se.f-ne.f});r<o;++r){var W=a[r].s;if(T[W]>t)E+=ee-(1<<F-T[W]),T[W]=t;else break}for(E>>=j;E>0;){var V=a[r].s;T[V]<t?E-=1<<t-T[V]++-1:++r}for(;r>=0&&E;--r){var z=a[r].s;T[z]==t&&(--T[z],++E)}F=t}return{t:new de(T),l:F}},Tn=function(n,t,i){return n.s==-1?Math.max(Tn(n.l,t,i+1),Tn(n.r,t,i+1)):t[n.s]=i},Tt=function(n){for(var t=n.length;t&&!n[--t];);for(var i=new Ce(++t),r=0,o=n[0],a=1,l=function(p){i[r++]=p},c=1;c<=t;++c)if(n[c]==o&&c!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)l(32754);a>2&&(l(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(l(o),--a;a>6;a-=6)l(8304);a>2&&(l(a-3<<5|8208),a=0)}for(;a--;)l(o);a=1,o=n[c]}return{c:i.subarray(0,r),n:t}},ze=function(n,t){for(var i=0,r=0;r<t.length;++r)i+=n[r]*t[r];return i},Pt=function(n,t,i){var r=i.length,o=Nt(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 a=0;a<r;++a)n[o+a+4]=i[a];return(o+4+r)*8},Rt=function(n,t,i,r,o,a,l,c,p,u,f){Ee(t,f++,i),++o[256];for(var m=_n(o,15),v=m.t,T=m.l,F=_n(a,15),E=F.t,j=F.l,ee=Tt(v),W=ee.c,V=ee.n,z=Tt(E),Z=z.c,se=z.n,ne=new Ce(19),Y=0;Y<W.length;++Y)++ne[W[Y]&31];for(var Y=0;Y<Z.length;++Y)++ne[Z[Y]&31];for(var B=_n(ne,7),ae=B.t,ye=B.l,oe=19;oe>4&&!ae[It[oe-1]];--oe);var we=u+5<<3,H=ze(o,Fe)+ze(a,tn)+l,le=ze(o,v)+ze(a,E)+l+14+3*oe+ze(ne,ae)+2*ne[16]+3*ne[17]+7*ne[18];if(p>=0&&we<=H&&we<=le)return Pt(t,f,n.subarray(p,p+u));var O,J,te,me;if(Ee(t,f,1+(le<H)),f+=2,le<H){O=Ke(v,T,0),J=v,te=Ke(E,j,0),me=E;var be=Ke(ae,ye,0);Ee(t,f,V-257),Ee(t,f+5,se-1),Ee(t,f+10,oe-4),f+=14;for(var Y=0;Y<oe;++Y)Ee(t,f+3*Y,ae[It[Y]]);f+=3*oe;for(var pe=[W,Z],xe=0;xe<2;++xe)for(var ge=pe[xe],Y=0;Y<ge.length;++Y){var ce=ge[Y]&31;Ee(t,f,be[ce]),f+=ae[ce],ce>15&&(Ee(t,f,ge[Y]>>5&127),f+=ge[Y]>>12)}}else O=Wr,J=Fe,te=Qr,me=tn;for(var Y=0;Y<c;++Y){var g=r[Y];if(g>255){var ce=g>>18&31;Ye(t,f,O[ce+257]),f+=J[ce+257],ce>7&&(Ee(t,f,g>>23&31),f+=On[ce]);var A=g&31;Ye(t,f,te[A]),f+=me[A],A>3&&(Ye(t,f,g>>5&8191),f+=Ln[A])}else Ye(t,f,O[g]),f+=J[g]}return Ye(t,f,O[256]),f+J[256]},Jr=new En([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Dt=new de(0),Zr=function(n,t,i,r,o,a){var l=a.z||n.length,c=new de(r+l+5*(1+Math.ceil(l/7e3))+o),p=c.subarray(r,c.length-o),u=a.l,f=(a.r||0)&7;if(t){f&&(p[0]=a.r>>3);for(var m=Jr[t-1],v=m>>13,T=m&8191,F=(1<<i)-1,E=a.p||new Ce(32768),j=a.h||new Ce(F+1),ee=Math.ceil(i/3),W=2*ee,V=function(re){return(n[re]^n[re+1]<<ee^n[re+2]<<W)&F},z=new En(25e3),Z=new Ce(288),se=new Ce(32),ne=0,Y=0,B=a.i||0,ae=0,ye=a.w||0,oe=0;B+2<l;++B){var we=V(B),H=B&32767,le=j[we];if(E[H]=le,j[we]=H,ye<=B){var O=l-B;if((ne>7e3||ae>24576)&&(O>423||!u)){f=Rt(n,p,0,z,Z,se,Y,ae,oe,B-oe,f),ae=ne=Y=0,oe=B;for(var J=0;J<286;++J)Z[J]=0;for(var J=0;J<30;++J)se[J]=0}var te=2,me=0,be=T,pe=H-le&32767;if(O>2&&we==V(B-pe))for(var xe=Math.min(v,O)-1,ge=Math.min(32767,B),ce=Math.min(258,O);pe<=ge&&--be&&H!=le;){if(n[B+te]==n[B+te-pe]){for(var g=0;g<ce&&n[B+g]==n[B+g-pe];++g);if(g>te){if(te=g,me=pe,g>xe)break;for(var A=Math.min(pe,g-2),R=0,J=0;J<A;++J){var M=B-pe+J&32767,P=E[M],D=M-P&32767;D>R&&(R=D,le=M)}}}H=le,le=E[H],pe+=H-le&32767}if(me){z[ae++]=268435456|In[te]<<18|kt[me];var Q=In[te]&31,q=kt[me]&31;Y+=On[Q]+Ln[q],++Z[257+Q],++se[q],ye=B+te,++ne}else z[ae++]=n[B],++Z[n[B]]}}for(B=Math.max(B,ye);B<l;++B)z[ae++]=n[B],++Z[n[B]];f=Rt(n,p,u,z,Z,se,Y,ae,oe,B-oe,f),u||(a.r=f&7|p[f/8|0]<<3,f-=7,a.h=j,a.p=E,a.i=B,a.w=ye)}else{for(var B=a.w||0;B<l+u;B+=65535){var ie=B+65535;ie>=l&&(p[f/8|0]=u,ie=l),f=Pt(p,f+1,n.subarray(B,ie))}a.i=l}return Ft(c,0,r+Nt(f)+o)},Xr=(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})(),eo=function(){var n=-1;return{p:function(t){for(var i=n,r=0;r<t.length;++r)i=Xr[i&255^t[r]]^i>>>8;n=i},d:function(){return~n}}};var no=function(n,t,i,r,o){if(!o&&(o={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),l=new de(a.length+n.length);l.set(a),l.set(n,a.length),n=l,o.w=a.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)},Ut=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 ue=function(n,t,i){for(;i;++t)n[t]=i,i>>>=8};function to(n,t){return no(n,t||{},0,0)}var Bt=function(n,t,i,r){for(var o in n){var a=n[o],l=t+o,c=r;Array.isArray(a)&&(c=Ut(r,a[1]),a=a[0]),ArrayBuffer.isView(a)?i[l]=[a,c]:(i[l+="/"]=[new de(0),c],Bt(a,l,i,r))}},Et=typeof TextEncoder<"u"&&new TextEncoder,io=typeof TextDecoder<"u"&&new TextDecoder,ro=0;try{io.decode(Dt,{stream:!0}),ro=1}catch{}function Ot(n,t){if(t){for(var i=new de(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}if(Et)return Et.encode(n);for(var o=n.length,a=new de(n.length+(n.length>>1)),l=0,c=function(f){a[l++]=f},r=0;r<o;++r){if(l+5>a.length){var p=new de(l+8+(o-r<<1));p.set(a),a=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 Ft(a,0,l)}var Rn=function(n){var t=0;if(n)for(var i in n){var r=n[i].length;r>65535&&rn(9),t+=r+4}return t},Lt=function(n,t,i,r,o,a,l,c){var p=r.length,u=i.extra,f=c&&c.length,m=Rn(u);ue(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|(a<0&&8),n[t++]=o&&8,n[t++]=i.compression&255,n[t++]=i.compression>>8;var v=new Date(i.mtime==null?Date.now():i.mtime),T=v.getFullYear()-1980;if((T<0||T>119)&&rn(10),ue(n,t,T<<25|v.getMonth()+1<<21|v.getDate()<<16|v.getHours()<<11|v.getMinutes()<<5|v.getSeconds()>>1),t+=4,a!=-1&&(ue(n,t,i.crc),ue(n,t+4,a<0?-a-2:a),ue(n,t+8,i.size)),ue(n,t+12,p),ue(n,t+14,m),t+=16,l!=null&&(ue(n,t,f),ue(n,t+6,i.attrs),ue(n,t+10,l),t+=14),n.set(r,t),t+=p,m)for(var F in u){var E=u[F],j=E.length;ue(n,t,+F),ue(n,t+2,j),n.set(E,t+4),t+=4+j}return f&&(n.set(c,t),t+=f),t},oo=function(n,t,i,r,o){ue(n,t,101010256),ue(n,t+8,i),ue(n,t+10,i),ue(n,t+12,r),ue(n,t+16,o)};function $n(n,t){t||(t={});var i={},r=[];Bt(n,"",i,t);var o=0,a=0;for(var l in i){var c=i[l],p=c[0],u=c[1],f=u.level==0?0:8,m=Ot(l),v=m.length,T=u.comment,F=T&&Ot(T),E=F&&F.length,j=Rn(u.extra);v>65535&&rn(11);var ee=f?to(p,u):p,W=ee.length,V=eo();V.p(p),r.push(Ut(u,{size:p.length,crc:V.d(),c:ee,f:m,m:F,u:v!=l.length||F&&T.length!=E,o,compression:f})),o+=30+v+j+W,a+=76+2*(v+j)+(E||0)+W}for(var z=new de(a+22),Z=o,se=a-o,ne=0;ne<r.length;++ne){var m=r[ne];Lt(z,m.o,m,m.f,m.u,m.c.length);var Y=30+m.f.length+Rn(m.extra);z.set(m.c,m.o+Y),Lt(z,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+Y+(m.m?m.m.length:0)}return oo(z,o,r.length,se,Z),z}import{readFileSync as br,writeFileSync as ss}from"fs";import{join as as,resolve as ls}from"path";function so(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var he={},on={},Le={},jt;function He(){if(jt)return Le;jt=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 a(l){return l===0&&Number.NEGATIVE_INFINITY===1/l}return Le.isNothing=n,Le.isObject=t,Le.toArray=i,Le.repeat=o,Le.isNegativeZero=a,Le.extend=r,Le}var Mn,qt;function Ge(){if(qt)return Mn;qt=1;function n(i,r){let o="",a=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 $o}from"crypto";import{mkdir as Mo,readFile as Li,writeFile as No}from"fs/promises";import{homedir as Fo,tmpdir as Po}from"os";import{join as qi}from"path";import{execFileSync as Bo}from"child_process";import{readdir as jo,readFile as Ki,stat as Hi}from"fs/promises";import{join as Gi,relative as qo,sep as $i}from"path";import{createRequire as Hr}from"module";var Gr=Hr("/"),Be,Wr,Qr;try{Be=Gr("worker_threads"),Wr=Be.Worker,Qr=Be.isMarkedAsUntransferable}catch{}var de=Uint8Array,Ce=Uint16Array,En=Int32Array,On=new de([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]),Ln=new de([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]),kt=new de([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mt=function(n,t){for(var i=new Ce(31),r=0;r<31;++r)i[r]=t+=1<<n[r-1];for(var o=new En(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}},Be=Mt(On,2),Vr=Be.b,In=Be.r;Vr[28]=258,In[258]=28;var Nt=Mt(Ln,0),ns=Nt.b,Tt=Nt.r,kn=new Ce(32768);for(G=0;G<32768;++G)Re=(G&43690)>>1|(G&21845)<<1,Re=(Re&52428)>>2|(Re&13107)<<2,Re=(Re&61680)>>4|(Re&3855)<<4,kn[G]=((Re&65280)>>8|(Re&255)<<8)>>1;var Re,G,Ke=(function(n,t,i){for(var r=n.length,o=0,s=new Ce(t);o<r;++o)n[o]&&++s[n[o]-1];var l=new Ce(t);for(o=1;o<t;++o)l[o]=l[o-1]+s[o-1]<<1;var c;if(i){c=new Ce(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,v=m|(1<<f)-1;m<=v;++m)c[kn[m]>>p]=u}else for(c=new Ce(r),o=0;o<r;++o)n[o]&&(c[o]=kn[l[n[o]-1]++]>>15-n[o]);return c}),Fe=new de(288);for(G=0;G<144;++G)Fe[G]=8;var G;for(G=144;G<256;++G)Fe[G]=9;var G;for(G=256;G<280;++G)Fe[G]=7;var G;for(G=280;G<288;++G)Fe[G]=8;var G,tn=new de(32);for(G=0;G<32;++G)tn[G]=5;var G,Jr=Ke(Fe,9,0);var Zr=Ke(tn,5,0);var Ft=function(n){return(n+7)/8|0},Pt=function(n,t,i){return(t==null||t<0)&&(t=0),(i==null||i>n.length)&&(i=n.length),new de(n.subarray(t,i))};var Xr=["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"],rn=function(n,t,i){var r=new Error(t||Xr[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,rn),!i)throw r;return r};var Ee=function(n,t,i){i<<=t&7;var r=t/8|0;n[r]|=i,n[r+1]|=i>>8},Ye=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},_n=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:Ut,l:0};if(o==1){var l=new de(i[0].s+1);return l[i[0].s]=1,{t:l,l:1}}i.sort(function(X,ae){return X.f-ae.f}),i.push({s:-1,f:25001});var c=i[0],p=i[1],u=0,f=1,m=2;for(i[0]={s:-1,f:c.f+p.f,l:c,r:p};f!=o-1;)c=i[i[u].f<i[m].f?u++:m++],p=i[u!=f&&i[u].f<i[m].f?u++:m++],i[f++]={s:-1,f:c.f+p.f,l:c,r:p};for(var v=s[0].s,r=1;r<o;++r)s[r].s>v&&(v=s[r].s);var T=new Ce(v+1),N=Tn(i[f-1],T,0);if(N>t){var r=0,E=0,j=N-t,ne=1<<j;for(s.sort(function(ae,te){return T[te.s]-T[ae.s]||ae.f-te.f});r<o;++r){var W=s[r].s;if(T[W]>t)E+=ne-(1<<N-T[W]),T[W]=t;else break}for(E>>=j;E>0;){var V=s[r].s;T[V]<t?E-=1<<t-T[V]++-1:++r}for(;r>=0&&E;--r){var z=s[r].s;T[z]==t&&(--T[z],++E)}N=t}return{t:new de(T),l:N}},Tn=function(n,t,i){return n.s==-1?Math.max(Tn(n.l,t,i+1),Tn(n.r,t,i+1)):t[n.s]=i},Rt=function(n){for(var t=n.length;t&&!n[--t];);for(var i=new Ce(++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}},ze=function(n,t){for(var i=0,r=0;r<t.length;++r)i+=n[r]*t[r];return i},Dt=function(n,t,i){var r=i.length,o=Ft(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},Et=function(n,t,i,r,o,s,l,c,p,u,f){Ee(t,f++,i),++o[256];for(var m=_n(o,15),v=m.t,T=m.l,N=_n(s,15),E=N.t,j=N.l,ne=Rt(v),W=ne.c,V=ne.n,z=Rt(E),X=z.c,ae=z.n,te=new Ce(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 B=_n(te,7),se=B.t,ye=B.l,oe=19;oe>4&&!se[kt[oe-1]];--oe);var we=u+5<<3,H=ze(o,Fe)+ze(s,tn)+l,le=ze(o,v)+ze(s,E)+l+14+3*oe+ze(te,se)+2*te[16]+3*te[17]+7*te[18];if(p>=0&&we<=H&&we<=le)return Dt(t,f,n.subarray(p,p+u));var O,Z,ie,me;if(Ee(t,f,1+(le<H)),f+=2,le<H){O=Ke(v,T,0),Z=v,ie=Ke(E,j,0),me=E;var be=Ke(se,ye,0);Ee(t,f,V-257),Ee(t,f+5,ae-1),Ee(t,f+10,oe-4),f+=14;for(var Y=0;Y<oe;++Y)Ee(t,f+3*Y,se[kt[Y]]);f+=3*oe;for(var pe=[W,X],xe=0;xe<2;++xe)for(var ge=pe[xe],Y=0;Y<ge.length;++Y){var ce=ge[Y]&31;Ee(t,f,be[ce]),f+=se[ce],ce>15&&(Ee(t,f,ge[Y]>>5&127),f+=ge[Y]>>12)}}else O=Jr,Z=Fe,ie=Zr,me=tn;for(var Y=0;Y<c;++Y){var g=r[Y];if(g>255){var ce=g>>18&31;Ye(t,f,O[ce+257]),f+=Z[ce+257],ce>7&&(Ee(t,f,g>>23&31),f+=On[ce]);var A=g&31;Ye(t,f,ie[A]),f+=me[A],A>3&&(Ye(t,f,g>>5&8191),f+=Ln[A])}else Ye(t,f,O[g]),f+=Z[g]}return Ye(t,f,O[256]),f+Z[256]},eo=new En([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ut=new de(0),no=function(n,t,i,r,o,s){var l=s.z||n.length,c=new de(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=eo[t-1],v=m>>13,T=m&8191,N=(1<<i)-1,E=s.p||new Ce(32768),j=s.h||new Ce(N+1),ne=Math.ceil(i/3),W=2*ne,V=function(re){return(n[re]^n[re+1]<<ne^n[re+2]<<W)&N},z=new En(25e3),X=new Ce(288),ae=new Ce(32),te=0,Y=0,B=s.i||0,se=0,ye=s.w||0,oe=0;B+2<l;++B){var we=V(B),H=B&32767,le=j[we];if(E[H]=le,j[we]=H,ye<=B){var O=l-B;if((te>7e3||se>24576)&&(O>423||!u)){f=Et(n,p,0,z,X,ae,Y,se,oe,B-oe,f),se=te=Y=0,oe=B;for(var Z=0;Z<286;++Z)X[Z]=0;for(var Z=0;Z<30;++Z)ae[Z]=0}var ie=2,me=0,be=T,pe=H-le&32767;if(O>2&&we==V(B-pe))for(var xe=Math.min(v,O)-1,ge=Math.min(32767,B),ce=Math.min(258,O);pe<=ge&&--be&&H!=le;){if(n[B+ie]==n[B+ie-pe]){for(var g=0;g<ce&&n[B+g]==n[B+g-pe];++g);if(g>ie){if(ie=g,me=pe,g>xe)break;for(var A=Math.min(pe,g-2),R=0,Z=0;Z<A;++Z){var M=B-pe+Z&32767,F=E[M],D=M-F&32767;D>R&&(R=D,le=M)}}}H=le,le=E[H],pe+=H-le&32767}if(me){z[se++]=268435456|In[ie]<<18|Tt[me];var Q=In[ie]&31,q=Tt[me]&31;Y+=On[Q]+Ln[q],++X[257+Q],++ae[q],ye=B+ie,++te}else z[se++]=n[B],++X[n[B]]}}for(B=Math.max(B,ye);B<l;++B)z[se++]=n[B],++X[n[B]];f=Et(n,p,u,z,X,ae,Y,se,oe,B-oe,f),u||(s.r=f&7|p[f/8|0]<<3,f-=7,s.h=j,s.p=E,s.i=B,s.w=ye)}else{for(var B=s.w||0;B<l+u;B+=65535){var J=B+65535;J>=l&&(p[f/8|0]=u,J=l),f=Dt(p,f+1,n.subarray(B,J))}s.i=l}return Pt(c,0,r+Ft(f)+o)},to=(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})(),io=function(){var n=-1;return{p:function(t){for(var i=n,r=0;r<t.length;++r)i=to[i&255^t[r]]^i>>>8;n=i},d:function(){return~n}}};var ro=function(n,t,i,r,o){if(!o&&(o={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),l=new de(s.length+n.length);l.set(s),l.set(n,s.length),n=l,o.w=s.length}return no(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)},Bt=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 ue=function(n,t,i){for(;i;++t)n[t]=i,i>>>=8};function oo(n,t){return ro(n,t||{},0,0)}var jt=function(n,t,i,r){for(var o in n){var s=n[o],l=t+o,c=r;Array.isArray(s)&&(c=Bt(r,s[1]),s=s[0]),ArrayBuffer.isView(s)?i[l]=[s,c]:(i[l+="/"]=[new de(0),c],jt(s,l,i,r))}},Ot=typeof TextEncoder<"u"&&new TextEncoder,ao=typeof TextDecoder<"u"&&new TextDecoder,so=0;try{ao.decode(Ut,{stream:!0}),so=1}catch{}function Lt(n,t){if(t){for(var i=new de(n.length),r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}if(Ot)return Ot.encode(n);for(var o=n.length,s=new de(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 de(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 Pt(s,0,l)}var Rn=function(n){var t=0;if(n)for(var i in n){var r=n[i].length;r>65535&&rn(9),t+=r+4}return t},$t=function(n,t,i,r,o,s,l,c){var p=r.length,u=i.extra,f=c&&c.length,m=Rn(u);ue(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 v=new Date(i.mtime==null?Date.now():i.mtime),T=v.getFullYear()-1980;if((T<0||T>119)&&rn(10),ue(n,t,T<<25|v.getMonth()+1<<21|v.getDate()<<16|v.getHours()<<11|v.getMinutes()<<5|v.getSeconds()>>1),t+=4,s!=-1&&(ue(n,t,i.crc),ue(n,t+4,s<0?-s-2:s),ue(n,t+8,i.size)),ue(n,t+12,p),ue(n,t+14,m),t+=16,l!=null&&(ue(n,t,f),ue(n,t+6,i.attrs),ue(n,t+10,l),t+=14),n.set(r,t),t+=p,m)for(var N in u){var E=u[N],j=E.length;ue(n,t,+N),ue(n,t+2,j),n.set(E,t+4),t+=4+j}return f&&(n.set(c,t),t+=f),t},lo=function(n,t,i,r,o){ue(n,t,101010256),ue(n,t+8,i),ue(n,t+10,i),ue(n,t+12,r),ue(n,t+16,o)};function $n(n,t){t||(t={});var i={},r=[];jt(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=Lt(l),v=m.length,T=u.comment,N=T&&Lt(T),E=N&&N.length,j=Rn(u.extra);v>65535&&rn(11);var ne=f?oo(p,u):p,W=ne.length,V=io();V.p(p),r.push(Bt(u,{size:p.length,crc:V.d(),c:ne,f:m,m:N,u:v!=l.length||N&&T.length!=E,o,compression:f})),o+=30+v+j+W,s+=76+2*(v+j)+(E||0)+W}for(var z=new de(s+22),X=o,ae=s-o,te=0;te<r.length;++te){var m=r[te];$t(z,m.o,m,m.f,m.u,m.c.length);var Y=30+m.f.length+Rn(m.extra);z.set(m.c,m.o+Y),$t(z,o,m,m.f,m.u,m.c.length,m.o,m.m),o+=16+Y+(m.m?m.m.length:0)}return lo(z,o,r.length,ae,X),z}import{readFileSync as xr,writeFileSync as ca}from"fs";import{join as ua,resolve as fa}from"path";function co(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var he={},on={},Le={},qt;function He(){if(qt)return Le;qt=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 Le.isNothing=n,Le.isObject=t,Le.toArray=i,Le.repeat=o,Le.isNegativeZero=s,Le.extend=r,Le}var Mn,Yt;function Ge(){if(Yt)return Mn;Yt=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),
|
|
5
|
-
`+m}let
|
|
6
|
-
`,m+=n.repeat("-",
|
|
7
|
-
`;for(let E=1;E<=
|
|
8
|
-
`}return m.replace(/\n$/,"")}return Nn=r,Nn}var Fn,
|
|
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 v=p%4*6;return v===0?(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)):v===18?(m.push(f>>10&255),m.push(f>>2&255)):v===12&&m.push(f>>4&255),new Uint8Array(m)}function o(l){let c="",p=0,u=l.length,f=t;for(let v=0;v<u;v++)v%3===0&&v&&(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]),p=(p<<8)+l[v];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
|
|
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 q(e,d,w){let S,y,k,
|
|
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)},Mn=t,Mn}var Nn,zt;function uo(){if(zt)return Nn;zt=1;let n=He();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="",v=Math.min(o.line+s.linesAfter,p.length).toString().length,T=s.maxLength-(s.indent+v+3);for(let E=1;E<=s.linesBefore&&!(f-E<0);E++){let j=t(o.buffer,c[f-E],p[f-E],o.position-(c[f]-c[f-E]),T);m=n.repeat(" ",s.indent)+i((o.line-E+1).toString(),v)+" | "+j.str+`
|
|
5
|
+
`+m}let N=t(o.buffer,c[f],p[f],o.position,T);m+=n.repeat(" ",s.indent)+i((o.line+1).toString(),v)+" | "+N.str+`
|
|
6
|
+
`,m+=n.repeat("-",s.indent+v+3+N.pos)+`^
|
|
7
|
+
`;for(let E=1;E<=s.linesAfter&&!(f+E>=p.length);E++){let j=t(o.buffer,c[f+E],p[f+E],o.position-(c[f]-c[f+E]),T);m+=n.repeat(" ",s.indent)+i((o.line+E+1).toString(),v)+" | "+j.str+`
|
|
8
|
+
`}return m.replace(/\n$/,"")}return Nn=r,Nn}var Fn,Kt;function ve(){if(Kt)return Fn;Kt=1;let n=Ge(),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 Fn=o,Fn}var Pn,Ht;function di(){if(Ht)return Pn;Ht=1;let n=Ge(),t=ve();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},Pn=o,Pn}var Dn,Gt;function hi(){if(Gt)return Dn;Gt=1;let n=ve();return Dn=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Dn}var Un,Wt;function mi(){if(Wt)return Un;Wt=1;let n=ve();return Un=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Un}var Bn,Qt;function gi(){if(Qt)return Bn;Qt=1;let n=ve();return Bn=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Bn}var jn,Vt;function vi(){if(Vt)return jn;Vt=1;let n=di();return jn=new n({explicit:[hi(),mi(),gi()]}),jn}var qn,Jt;function yi(){if(Jt)return qn;Jt=1;let n=ve();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 qn=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"}),qn}var Yn,Zt;function wi(){if(Zt)return Yn;Zt=1;let n=ve();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 Yn=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"}),Yn}var zn,Xt;function bi(){if(Xt)return zn;Xt=1;let n=He(),t=ve();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,v=!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;v=!0}return v&&isFinite(l(u))}if(T==="x"){for(m++;m<f;m++){if(!i(u.charCodeAt(m)))return!1;v=!0}return v&&isFinite(l(u))}if(T==="o"){for(m++;m<f;m++){if(!r(u.charCodeAt(m)))return!1;v=!0}return v&&isFinite(l(u))}}for(;m<f;m++){if(!o(u.charCodeAt(m)))return!1;v=!0}return v?isFinite(l(u)):!1}function l(u){let f=u,m=1,v=f[0];if((v==="-"||v==="+")&&(v==="-"&&(m=-1),f=f.slice(1),v=f[0]),f==="0")return 0;if(v==="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 zn=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"]}}),zn}var Kn,ei;function xi(){if(ei)return Kn;ei=1;let n=He(),t=ve(),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 Kn=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:s,predicate:p,represent:c,defaultStyle:"lowercase"}),Kn}var Hn,ni;function Ai(){return ni||(ni=1,Hn=vi().extend({implicit:[yi(),wi(),bi(),xi()]})),Hn}var Gn,ti;function Si(){return ti||(ti=1,Gn=Ai()),Gn}var Wn,ii;function Ci(){if(ii)return Wn;ii=1;let n=ve(),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,v=+u[3];if(!u[4])return new Date(Date.UTC(f,m,v));let T=+u[4],N=+u[5],E=+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,v,T,N,E,c));return p&&j.setTime(j.getTime()-p),j}function s(l){return l.toISOString()}return Wn=new n("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:o,instanceOf:Date,represent:s}),Wn}var Qn,ri;function _i(){if(ri)return Qn;ri=1;let n=ve();function t(i){return i==="<<"||i===null}return Qn=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),Qn}var Vn,oi;function Ii(){if(oi)return Vn;oi=1;let n=ve(),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 v=p%4*6;return v===0?(m.push(f>>16&255),m.push(f>>8&255),m.push(f&255)):v===18?(m.push(f>>10&255),m.push(f>>2&255)):v===12&&m.push(f>>4&255),new Uint8Array(m)}function o(l){let c="",p=0,u=l.length,f=t;for(let v=0;v<u;v++)v%3===0&&v&&(c+=f[p>>18&63],c+=f[p>>12&63],c+=f[p>>6&63],c+=f[p&63]),p=(p<<8)+l[v];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 Vn=new n("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:r,predicate:s,represent:o}),Vn}var Jn,ai;function ki(){if(ai)return Jn;ai=1;let n=ve(),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 v;for(v in f)if(t.call(f,v))if(!m)m=!0;else return!1;if(!m)return!1;if(l.indexOf(v)===-1)l.push(v);else return!1}return!0}function o(s){return s!==null?s:[]}return Jn=new n("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:o}),Jn}var Zn,si;function Ti(){if(si)return Zn;si=1;let n=ve(),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 Zn=new n("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:r}),Zn}var Xn,li;function Ri(){if(li)return Xn;li=1;let n=ve(),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 Xn=new n("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:r}),Xn}var et,ci;function tt(){return ci||(ci=1,et=Si().extend({implicit:[Ci(),_i()],explicit:[Ii(),ki(),Ti(),Ri()]})),et}var ui;function fo(){if(ui)return on;ui=1;let n=He(),t=Ge(),i=uo(),r=tt(),o=Object.prototype.hasOwnProperty,s=1,l=2,c=3,p=4,u=1,f=2,m=3,v=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,T=/[\x85\u2028\u2029]/,N=/[,\[\]{}]/,E=/^(?:!|!!|![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 ae(e){if(e>=48&&e<=57)return e-48;let d=e|32;return d>=97&&d<=102?d-97+10:-1}function te(e){return e===120?2:e===117?4:e===85?8:0}function Y(e){return e>=48&&e<=57?e-48:-1}function B(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
10
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function se(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ye(e,d,w){d==="__proto__"?Object.defineProperty(e,d,{configurable:!0,enumerable:!0,writable:!0,value:w}):e[d]=w}let oe=new Array(256),we=new Array(256);for(let e=0;e<256;e++)oe[e]=B(e)?1:0,we[e]=B(e);function H(e,d){this.input=e,this.filename=d.filename||null,this.schema=d.schema||r,this.onWarning=d.onWarning||null,this.legacy=d.legacy||!1,this.json=d.json||!1,this.listener=d.listener||null,this.maxDepth=typeof d.maxDepth=="number"?d.maxDepth:100,this.maxTotalMergeKeys=typeof d.maxTotalMergeKeys=="number"?d.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function le(e,d){let w={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return w.snippet=i(w),new t(d,w)}function O(e,d){throw le(e,d)}function Z(e,d){e.onWarning&&e.onWarning.call(null,le(e,d))}function ie(e,d,w){let S=e.anchorMapTransactions;if(S.length!==0){let y=S[S.length-1];o.call(y,d)||(y[d]={existed:o.call(e.anchorMap,d),value:e.anchorMap[d]})}e.anchorMap[d]=w}function me(e){e.anchorMapTransactions.push(Object.create(null))}function be(e){let d=e.anchorMapTransactions.pop(),w=e.anchorMapTransactions;if(w.length===0)return;let S=w[w.length-1],y=Object.keys(d);for(let k=0,a=y.length;k<a;k+=1){let h=y[k];o.call(S,h)||(S[h]=d[h])}}function pe(e){let d=e.anchorMapTransactions.pop(),w=Object.keys(d);for(let S=w.length-1;S>=0;S-=1){let y=d[w[S]];y.existed?e.anchorMap[w[S]]=y.value:delete e.anchorMap[w[S]]}}function xe(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 ge(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 ce={YAML:function(d,w,S){d.version!==null&&O(d,"duplication of %YAML directive"),S.length!==1&&O(d,"YAML directive accepts exactly one argument");let y=/^([0-9]+)\.([0-9]+)$/.exec(S[0]);y===null&&O(d,"ill-formed argument of the YAML directive");let k=parseInt(y[1],10),a=parseInt(y[2],10);k!==1&&O(d,"unacceptable YAML version of the document"),d.version=S[0],d.checkLineBreaks=a<2,a!==1&&a!==2&&Z(d,"unsupported YAML version of the document")},TAG:function(d,w,S){let y;S.length!==2&&O(d,"TAG directive accepts exactly two arguments");let k=S[0];y=S[1],E.test(k)||O(d,"ill-formed tag handle (first argument) of the TAG directive"),o.call(d.tagMap,k)&&O(d,'there is a previously declared suffix for "'+k+'" tag handle'),j.test(y)||O(d,"ill-formed tag prefix (second argument) of the TAG directive");try{y=decodeURIComponent(y)}catch{O(d,"tag prefix is malformed: "+y)}d.tagMap[k]=y}};function g(e,d,w,S){if(d<w){let y=e.input.slice(d,w);if(S)for(let k=0,a=y.length;k<a;k+=1){let h=y.charCodeAt(k);h===9||h>=32&&h<=1114111||O(e,"expected valid JSON character")}else v.test(y)&&O(e,"the stream contains non-printable characters");e.result+=y}}function A(e,d,w,S){n.isObject(w)||O(e,"cannot merge mappings; the provided source object is unacceptable");let y=Object.keys(w);for(let k=0,a=y.length;k<a;k+=1){let h=y[k];e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&O(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")"),o.call(d,h)||(ye(d,h,w[h]),S[h]=!0)}}function R(e,d,w,S,y,k,a,h,_){if(Array.isArray(y)){y=Array.prototype.slice.call(y);for(let b=0,x=y.length;b<x;b+=1)Array.isArray(y[b])&&O(e,"nested arrays are not supported inside keys"),typeof y=="object"&&ne(y[b])==="[object Object]"&&(y[b]="[object Object]")}if(typeof y=="object"&&ne(y)==="[object Object]"&&(y="[object Object]"),y=String(y),d===null&&(d={}),S==="tag:yaml.org,2002:merge")if(Array.isArray(k))for(let b=0,x=k.length;b<x;b+=1)A(e,d,k[b],w);else A(e,d,k,w);else!e.json&&!o.call(w,y)&&o.call(d,y)&&(e.line=a||e.line,e.lineStart=h||e.lineStart,e.position=_||e.position,O(e,"duplicated mapping key")),ye(d,y,k),delete w[y];return d}function M(e){let d=e.input.charCodeAt(e.position);d===10?e.position++:d===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):O(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function F(e,d,w){let S=0,y=e.input.charCodeAt(e.position);for(;y!==0;){for(;V(y);)y===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),y=e.input.charCodeAt(++e.position);if(d&&y===35)do y=e.input.charCodeAt(++e.position);while(y!==10&&y!==13&&y!==0);if(W(y))for(M(e),y=e.input.charCodeAt(e.position),S++,e.lineIndent=0;y===32;)e.lineIndent++,y=e.input.charCodeAt(++e.position);else break}return w!==-1&&S!==0&&e.lineIndent<w&&Z(e,"deficient indentation"),S}function D(e){let d=e.position,w=e.input.charCodeAt(d);return!!((w===45||w===46)&&w===e.input.charCodeAt(d+1)&&w===e.input.charCodeAt(d+2)&&(d+=3,w=e.input.charCodeAt(d),w===0||z(w)))}function Q(e,d){d===1?e.result+=" ":d>1&&(e.result+=n.repeat(`
|
|
11
|
+
`,d-1))}function q(e,d,w){let S,y,k,a,h,_,b=e.kind,x=e.result,I=e.input.charCodeAt(e.position);if(z(I)||X(I)||I===35||I===38||I===42||I===33||I===124||I===62||I===39||I===34||I===37||I===64||I===96)return!1;if(I===63||I===45){let C=e.input.charCodeAt(e.position+1);if(z(C)||w&&X(C))return!1}for(e.kind="scalar",e.result="",S=y=e.position,k=!1;I!==0;){if(I===58){let C=e.input.charCodeAt(e.position+1);if(z(C)||w&&X(C))break}else if(I===35){let C=e.input.charCodeAt(e.position-1);if(z(C))break}else{if(e.position===e.lineStart&&D(e)||w&&X(I))break;if(W(I))if(a=e.line,h=e.lineStart,_=e.lineIndent,F(e,!1,-1),e.lineIndent>=d){k=!0,I=e.input.charCodeAt(e.position);continue}else{e.position=y,e.line=a,e.lineStart=h,e.lineIndent=_;break}}k&&(g(e,S,y,!1),Q(e,e.line-a),S=y=e.position,k=!1),V(I)||(y=e.position+1),I=e.input.charCodeAt(++e.position)}return g(e,S,y,!1),e.result?!0:(e.kind=b,e.result=x,!1)}function J(e,d){let w,S,y=e.input.charCodeAt(e.position);if(y!==39)return!1;for(e.kind="scalar",e.result="",e.position++,w=S=e.position;(y=e.input.charCodeAt(e.position))!==0;)if(y===39)if(g(e,w,e.position,!0),y=e.input.charCodeAt(++e.position),y===39)w=e.position,e.position++,S=e.position;else return!0;else W(y)?(g(e,w,S,!0),Q(e,F(e,!1,d)),w=S=e.position):e.position===e.lineStart&&D(e)?O(e,"unexpected end of the document within a single quoted scalar"):(e.position++,V(y)||(S=e.position));O(e,"unexpected end of the stream within a single quoted scalar")}function re(e,d){let w,S,y,k=e.input.charCodeAt(e.position);if(k!==34)return!1;for(e.kind="scalar",e.result="",e.position++,w=S=e.position;(k=e.input.charCodeAt(e.position))!==0;){if(k===34)return g(e,w,e.position,!0),e.position++,!0;if(k===92){if(g(e,w,e.position,!0),k=e.input.charCodeAt(++e.position),W(k))F(e,!1,d);else if(k<256&&oe[k])e.result+=we[k],e.position++;else if((y=te(k))>0){let a=y,h=0;for(;a>0;a--)k=e.input.charCodeAt(++e.position),(y=ae(k))>=0?h=(h<<4)+y:O(e,"expected hexadecimal character");e.result+=se(h),e.position++}else O(e,"unknown escape sequence");w=S=e.position}else W(k)?(g(e,w,S,!0),Q(e,F(e,!1,d)),w=S=e.position):e.position===e.lineStart&&D(e)?O(e,"unexpected end of the document within a double quoted scalar"):(e.position++,V(k)||(S=e.position))}O(e,"unexpected end of the stream within a double quoted scalar")}function Se(e,d){let w=!0,S,y,k,a=e.tag,h,_=e.anchor,b,x,I,C,$=Object.create(null),L,P,U,K=e.input.charCodeAt(e.position);if(K===91)b=93,C=!1,h=[];else if(K===123)b=125,C=!0,h={};else return!1;for(e.anchor!==null&&ie(e,e.anchor,h),K=e.input.charCodeAt(++e.position);K!==0;){if(F(e,!0,d),K=e.input.charCodeAt(e.position),K===b)return e.position++,e.tag=a,e.anchor=_,e.kind=C?"mapping":"sequence",e.result=h,!0;if(w?K===44&&O(e,"expected the node content, but found ','"):O(e,"missed comma between flow collection entries"),P=L=U=null,x=I=!1,K===63){let ee=e.input.charCodeAt(e.position+1);z(ee)&&(x=I=!0,e.position++,F(e,!0,d))}S=e.line,y=e.lineStart,k=e.position,Te(e,d,s,!1,!0),P=e.tag,L=e.result,F(e,!0,d),K=e.input.charCodeAt(e.position),(I||e.line===S)&&K===58&&(x=!0,K=e.input.charCodeAt(++e.position),F(e,!0,d),Te(e,d,s,!1,!0),U=e.result),C?R(e,h,$,P,L,U,S,y,k):x?h.push(R(e,null,$,P,L,U,S,y,k)):h.push(L),F(e,!0,d),K=e.input.charCodeAt(e.position),K===44?(w=!0,K=e.input.charCodeAt(++e.position)):w=!1}O(e,"unexpected end of the stream within a flow collection")}function ke(e,d){let w,S=u,y=!1,k=!1,a=d,h=0,_=!1,b,x=e.input.charCodeAt(e.position);if(x===124)w=!1;else if(x===62)w=!0;else return!1;for(e.kind="scalar",e.result="";x!==0;)if(x=e.input.charCodeAt(++e.position),x===43||x===45)u===S?S=x===43?m:f:O(e,"repeat of a chomping mode identifier");else if((b=Y(x))>=0)b===0?O(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):k?O(e,"repeat of an indentation width identifier"):(a=d+b-1,k=!0);else break;if(V(x)){do x=e.input.charCodeAt(++e.position);while(V(x));if(x===35)do x=e.input.charCodeAt(++e.position);while(!W(x)&&x!==0)}for(;x!==0;){for(M(e),e.lineIndent=0,x=e.input.charCodeAt(e.position);(!k||e.lineIndent<a)&&x===32;)e.lineIndent++,x=e.input.charCodeAt(++e.position);if(!k&&e.lineIndent>a&&(a=e.lineIndent),W(x)){h++;continue}if(!k&&a===0&&O(e,"missing indentation for block scalar"),e.lineIndent<a){S===m?e.result+=n.repeat(`
|
|
12
12
|
`,y?1+h:h):S===u&&y&&(e.result+=`
|
|
13
13
|
`);break}w?V(x)?(_=!0,e.result+=n.repeat(`
|
|
14
14
|
`,y?1+h:h)):_?(_=!1,e.result+=n.repeat(`
|
|
15
15
|
`,h+1)):h===0?y&&(e.result+=" "):e.result+=n.repeat(`
|
|
16
16
|
`,h):e.result+=n.repeat(`
|
|
17
|
-
`,y?1+h:h),y=!0,k=!0,h=0;let I=e.position;for(;!W(x)&&x!==0;)x=e.input.charCodeAt(++e.position);g(e,I,e.position,!1)}return!0}function _e(e,d){let w=e.tag,S=e.anchor,y=[],k=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&
|
|
18
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));let w=new H(e,d),S=e.indexOf("\0");for(S!==-1&&(w.position=S,O(w,"null byte is not allowed in input")),w.input+="\0";w.input.charCodeAt(w.position)===32;)w.lineIndent+=1,w.position+=1;for(;w.position<w.length-1;)Sn(w);return w.documents}function nn(e,d,w){d!==null&&typeof d=="object"&&typeof w>"u"&&(w=d,d=null);let S=en(e,w);if(typeof d!="function")return S;for(let y=0,k=S.length;y<k;y+=1)d(S[y])}function Cn(e,d){let w=en(e,d);if(w.length!==0){if(w.length===1)return w[0];throw new t("expected a single document in the stream, but found more")}}return on.loadAll=nn,on.load=Cn,on}var nt={},
|
|
19
|
-
`,b);$===-1?(C=
|
|
20
|
-
`&&(x+=_),x+=C}return x}function ge(
|
|
21
|
-
`+n.repeat(" ",
|
|
22
|
-
`,I=b&&(
|
|
23
|
-
`||
|
|
17
|
+
`,y?1+h:h),y=!0,k=!0,h=0;let I=e.position;for(;!W(x)&&x!==0;)x=e.input.charCodeAt(++e.position);g(e,I,e.position,!1)}return!0}function _e(e,d){let w=e.tag,S=e.anchor,y=[],k=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&ie(e,e.anchor,y);let a=e.input.charCodeAt(e.position);for(;a!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,O(e,"tab characters must not be used in indentation")),a===45);){let h=e.input.charCodeAt(e.position+1);if(!z(h))break;if(k=!0,e.position++,F(e,!0,-1)&&e.lineIndent<=d){y.push(null),a=e.input.charCodeAt(e.position);continue}let _=e.line;if(Te(e,d,c,!1,!0),y.push(e.result),F(e,!0,-1),a=e.input.charCodeAt(e.position),(e.line===_||e.lineIndent>d)&&a!==0)O(e,"bad indentation of a sequence entry");else if(e.lineIndent<d)break}return k?(e.tag=w,e.anchor=S,e.kind="sequence",e.result=y,!0):!1}function Ue(e,d,w){let S,y,k,a,h=e.tag,_=e.anchor,b={},x=Object.create(null),I=null,C=null,$=null,L=!1,P=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&ie(e,e.anchor,b);let U=e.input.charCodeAt(e.position);for(;U!==0;){!L&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,O(e,"tab characters must not be used in indentation"));let K=e.input.charCodeAt(e.position+1),ee=e.line;if((U===63||U===58)&&z(K))U===63?(L&&(R(e,b,x,I,C,null,y,k,a),I=C=$=null),P=!0,L=!0,S=!0):L?(L=!1,S=!0):O(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,U=K;else{if(y=e.line,k=e.lineStart,a=e.position,!Te(e,w,l,!1,!0))break;if(e.line===ee){for(U=e.input.charCodeAt(e.position);V(U);)U=e.input.charCodeAt(++e.position);if(U===58)U=e.input.charCodeAt(++e.position),z(U)||O(e,"a whitespace character is expected after the key-value separator within a block mapping"),L&&(R(e,b,x,I,C,null,y,k,a),I=C=$=null),P=!0,L=!1,S=!1,I=e.tag,C=e.result;else if(P)O(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=h,e.anchor=_,!0}else if(P)O(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=h,e.anchor=_,!0}if((e.line===ee||e.lineIndent>d)&&(L&&(y=e.line,k=e.lineStart,a=e.position),Te(e,d,p,!0,S)&&(L?C=e.result:$=e.result),L||(R(e,b,x,I,C,$,y,k,a),I=C=$=null),F(e,!0,-1),U=e.input.charCodeAt(e.position)),(e.line===ee||e.lineIndent>d)&&U!==0)O(e,"bad indentation of a mapping entry");else if(e.lineIndent<d)break}return L&&R(e,b,x,I,C,null,y,k,a),P&&(e.tag=h,e.anchor=_,e.kind="mapping",e.result=b),P}function xn(e){let d=!1,w=!1,S,y,k=e.input.charCodeAt(e.position);if(k!==33)return!1;e.tag!==null&&O(e,"duplication of a tag property"),k=e.input.charCodeAt(++e.position),k===60?(d=!0,k=e.input.charCodeAt(++e.position)):k===33?(w=!0,S="!!",k=e.input.charCodeAt(++e.position)):S="!";let a=e.position;if(d){do k=e.input.charCodeAt(++e.position);while(k!==0&&k!==62);e.position<e.length?(y=e.input.slice(a,e.position),k=e.input.charCodeAt(++e.position)):O(e,"unexpected end of the stream within a verbatim tag")}else{for(;k!==0&&!z(k);)k===33&&(w?O(e,"tag suffix cannot contain exclamation marks"):(S=e.input.slice(a-1,e.position+1),E.test(S)||O(e,"named tag handle cannot contain such characters"),w=!0,a=e.position+1)),k=e.input.charCodeAt(++e.position);y=e.input.slice(a,e.position),N.test(y)&&O(e,"tag suffix cannot contain flow indicator characters")}y&&!j.test(y)&&O(e,"tag name cannot contain such characters: "+y);try{y=decodeURIComponent(y)}catch{O(e,"tag name is malformed: "+y)}return d?e.tag=y:o.call(e.tagMap,S)?e.tag=e.tagMap[S]+y:S==="!"?e.tag="!"+y:S==="!!"?e.tag="tag:yaml.org,2002:"+y:O(e,'undeclared tag handle "'+S+'"'),!0}function Ze(e){let d=e.input.charCodeAt(e.position);if(d!==38)return!1;e.anchor!==null&&O(e,"duplication of an anchor property"),d=e.input.charCodeAt(++e.position);let w=e.position;for(;d!==0&&!z(d)&&!X(d);)d=e.input.charCodeAt(++e.position);return e.position===w&&O(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(w,e.position),!0}function Xe(e){let d=e.input.charCodeAt(e.position);if(d!==42)return!1;d=e.input.charCodeAt(++e.position);let w=e.position;for(;d!==0&&!z(d)&&!X(d);)d=e.input.charCodeAt(++e.position);e.position===w&&O(e,"name of an alias node must contain at least one character");let S=e.input.slice(w,e.position);return o.call(e.anchorMap,S)||O(e,'unidentified alias "'+S+'"'),e.result=e.anchorMap[S],F(e,!0,-1),!0}function An(e,d,w,S){let y=xe(e);return me(e),ge(e,d),e.tag=null,e.anchor=null,e.kind=null,e.result=null,Ue(e,w,S)&&e.kind==="mapping"?(be(e),!0):(pe(e),ge(e,y),!1)}function Te(e,d,w,S,y){let k,a,h=1,_=!1,b=!1,x=null,I,C,$;e.depth>=e.maxDepth&&O(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 L=k=a=p===w||c===w;if(S&&F(e,!0,-1)&&(_=!0,e.lineIndent>d?h=1:e.lineIndent===d?h=0:e.lineIndent<d&&(h=-1)),h===1)for(;;){let P=e.input.charCodeAt(e.position),U=xe(e);if(_&&(P===33&&e.tag!==null||P===38&&e.anchor!==null)||!xn(e)&&!Ze(e))break;x===null&&(x=U),F(e,!0,-1)?(_=!0,a=L,e.lineIndent>d?h=1:e.lineIndent===d?h=0:e.lineIndent<d&&(h=-1)):a=!1}if(a&&(a=_||y),h===1||p===w)if(s===w||l===w?C=d:C=d+1,$=e.position-e.lineStart,h===1)if(a&&(_e(e,$)||Ue(e,$,C))||Se(e,C))b=!0;else{let P=e.input.charCodeAt(e.position);x!==null&&L&&!a&&P!==124&&P!==62&&An(e,x,x.position-x.lineStart,C)||k&&ke(e,C)||J(e,C)||re(e,C)?b=!0:Xe(e)?(b=!0,(e.tag!==null||e.anchor!==null)&&O(e,"alias node should not have any properties")):q(e,C,s===w)&&(b=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&ie(e,e.anchor,e.result)}else h===0&&(b=a&&_e(e,$));if(e.tag===null)e.anchor!==null&&ie(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&O(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let P=0,U=e.implicitTypes.length;P<U;P+=1)if(I=e.implicitTypes[P],I.resolve(e.result)){e.result=I.construct(e.result),e.tag=I.tag,e.anchor!==null&&ie(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(o.call(e.typeMap[e.kind||"fallback"],e.tag))I=e.typeMap[e.kind||"fallback"][e.tag];else{I=null;let P=e.typeMap.multi[e.kind||"fallback"];for(let U=0,K=P.length;U<K;U+=1)if(e.tag.slice(0,P[U].tag.length)===P[U].tag){I=P[U];break}}I||O(e,"unknown tag !<"+e.tag+">"),e.result!==null&&I.kind!==e.kind&&O(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+I.kind+'", not "'+e.kind+'"'),I.resolve(e.result,e.tag)?(e.result=I.construct(e.result,e.tag),e.anchor!==null&&ie(e,e.anchor,e.result)):O(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 Sn(e){let d=e.position,w=!1,S;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(S=e.input.charCodeAt(e.position))!==0&&(F(e,!0,-1),S=e.input.charCodeAt(e.position),!(e.lineIndent>0||S!==37));){w=!0,S=e.input.charCodeAt(++e.position);let y=e.position;for(;S!==0&&!z(S);)S=e.input.charCodeAt(++e.position);let k=e.input.slice(y,e.position),a=[];for(k.length<1&&O(e,"directive name must not be less than one character in length");S!==0;){for(;V(S);)S=e.input.charCodeAt(++e.position);if(S===35){do S=e.input.charCodeAt(++e.position);while(S!==0&&!W(S));break}if(W(S))break;for(y=e.position;S!==0&&!z(S);)S=e.input.charCodeAt(++e.position);a.push(e.input.slice(y,e.position))}S!==0&&M(e),o.call(ce,k)?ce[k](e,k,a):Z(e,'unknown document directive "'+k+'"')}if(F(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,F(e,!0,-1)):w&&O(e,"directives end mark is expected"),Te(e,e.lineIndent-1,p,!1,!0),F(e,!0,-1),e.checkLineBreaks&&T.test(e.input.slice(d,e.position))&&Z(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&D(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,F(e,!0,-1));return}e.position<e.length-1&&O(e,"end of the stream or a document separator is expected")}function en(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 w=new H(e,d),S=e.indexOf("\0");for(S!==-1&&(w.position=S,O(w,"null byte is not allowed in input")),w.input+="\0";w.input.charCodeAt(w.position)===32;)w.lineIndent+=1,w.position+=1;for(;w.position<w.length-1;)Sn(w);return w.documents}function nn(e,d,w){d!==null&&typeof d=="object"&&typeof w>"u"&&(w=d,d=null);let S=en(e,w);if(typeof d!="function")return S;for(let y=0,k=S.length;y<k;y+=1)d(S[y])}function Cn(e,d){let w=en(e,d);if(w.length!==0){if(w.length===1)return w[0];throw new t("expected a single document in the stream, but found more")}}return on.loadAll=nn,on.load=Cn,on}var nt={},fi;function po(){if(fi)return nt;fi=1;let n=He(),t=Ge(),i=tt(),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=65279,l=9,c=10,p=13,u=32,f=33,m=34,v=35,T=37,N=38,E=39,j=42,ne=44,W=45,V=58,z=61,X=62,ae=63,te=64,Y=91,B=93,se=96,ye=123,oe=124,we=125,H={};H[0]="\\0",H[7]="\\a",H[8]="\\b",H[9]="\\t",H[10]="\\n",H[11]="\\v",H[12]="\\f",H[13]="\\r",H[27]="\\e",H[34]='\\"',H[92]="\\\\",H[133]="\\N",H[160]="\\_",H[8232]="\\L",H[8233]="\\P";let le=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],O=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Z(a,h){if(h===null)return{};let _={},b=Object.keys(h);for(let x=0,I=b.length;x<I;x+=1){let C=b[x],$=String(h[C]);C.slice(0,2)==="!!"&&(C="tag:yaml.org,2002:"+C.slice(2));let L=a.compiledTypeMap.fallback[C];L&&o.call(L.styleAliases,$)&&($=L.styleAliases[$]),_[C]=$}return _}function ie(a){let h,_,b=a.toString(16).toUpperCase();if(a<=255)h="x",_=2;else if(a<=65535)h="u",_=4;else if(a<=4294967295)h="U",_=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+h+n.repeat("0",_-b.length)+b}let me=1,be=2;function pe(a){this.schema=a.schema||i,this.indent=Math.max(1,a.indent||2),this.noArrayIndent=a.noArrayIndent||!1,this.skipInvalid=a.skipInvalid||!1,this.flowLevel=n.isNothing(a.flowLevel)?-1:a.flowLevel,this.styleMap=Z(this.schema,a.styles||null),this.sortKeys=a.sortKeys||!1,this.lineWidth=a.lineWidth||80,this.noRefs=a.noRefs||!1,this.noCompatMode=a.noCompatMode||!1,this.condenseFlow=a.condenseFlow||!1,this.quotingType=a.quotingType==='"'?be:me,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 xe(a,h){let _=n.repeat(" ",h),b=0,x="",I=a.length;for(;b<I;){let C,$=a.indexOf(`
|
|
19
|
+
`,b);$===-1?(C=a.slice(b),b=I):(C=a.slice(b,$+1),b=$+1),C.length&&C!==`
|
|
20
|
+
`&&(x+=_),x+=C}return x}function ge(a,h){return`
|
|
21
|
+
`+n.repeat(" ",a.indent*h)}function ce(a,h){for(let _=0,b=a.implicitTypes.length;_<b;_+=1)if(a.implicitTypes[_].resolve(h))return!0;return!1}function g(a){return a===u||a===l}function A(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 R(a){return A(a)&&a!==s&&a!==p&&a!==c}function M(a,h,_){let b=R(a),x=b&&!g(a);return(_?b:b&&a!==ne&&a!==Y&&a!==B&&a!==ye&&a!==we)&&a!==v&&!(h===V&&!x)||R(h)&&!g(h)&&a===v||h===V&&x}function F(a){return A(a)&&a!==s&&!g(a)&&a!==W&&a!==ae&&a!==V&&a!==ne&&a!==Y&&a!==B&&a!==ye&&a!==we&&a!==v&&a!==N&&a!==j&&a!==f&&a!==oe&&a!==z&&a!==X&&a!==E&&a!==m&&a!==T&&a!==te&&a!==se}function D(a){return!g(a)&&a!==V}function Q(a,h){let _=a.charCodeAt(h),b;return _>=55296&&_<=56319&&h+1<a.length&&(b=a.charCodeAt(h+1),b>=56320&&b<=57343)?(_-55296)*1024+b-56320+65536:_}function q(a){return/^\n* /.test(a)}let J=1,re=2,Se=3,ke=4,_e=5;function Ue(a,h,_,b,x,I,C,$){let L,P=0,U=null,K=!1,ee=!1,It=b!==-1,je=-1,qe=F(Q(a,0))&&D(Q(a,a.length-1));if(h||C)for(L=0;L<a.length;P>=65536?L+=2:L++){if(P=Q(a,L),!A(P))return _e;qe=qe&&M(P,U,$),U=P}else{for(L=0;L<a.length;P>=65536?L+=2:L++){if(P=Q(a,L),P===c)K=!0,It&&(ee=ee||L-je-1>b&&a[je+1]!==" ",je=L);else if(!A(P))return _e;qe=qe&&M(P,U,$),U=P}ee=ee||It&&L-je-1>b&&a[je+1]!==" "}return!K&&!ee?qe&&!C&&!x(a)?J:I===be?_e:re:_>9&&q(a)?_e:C?I===be?_e:re:ee?ke:Se}function xn(a,h,_,b,x){a.dump=(function(){if(h.length===0)return a.quotingType===be?'""':"''";if(!a.noCompatMode&&(le.indexOf(h)!==-1||O.test(h)))return a.quotingType===be?'"'+h+'"':"'"+h+"'";let I=a.indent*Math.max(1,_),C=a.lineWidth===-1?-1:Math.max(Math.min(a.lineWidth,40),a.lineWidth-I),$=b||a.flowLevel>-1&&_>=a.flowLevel;function L(P){return ce(a,P)}switch(Ue(h,$,a.indent,C,L,a.quotingType,a.forceQuotes&&!b,x)){case J:return h;case re:return"'"+h.replace(/'/g,"''")+"'";case Se:return"|"+Ze(h,a.indent)+Xe(xe(h,I));case ke:return">"+Ze(h,a.indent)+Xe(xe(An(h,C),I));case _e:return'"'+Sn(h)+'"';default:throw new t("impossible error: invalid scalar style")}})()}function Ze(a,h){let _=q(a)?String(h):"",b=a[a.length-1]===`
|
|
22
|
+
`,I=b&&(a[a.length-2]===`
|
|
23
|
+
`||a===`
|
|
24
24
|
`)?"+":b?"":"-";return _+I+`
|
|
25
|
-
`}function Xe(
|
|
26
|
-
`?
|
|
27
|
-
`);return $=$!==-1?$:
|
|
28
|
-
`||
|
|
29
|
-
`:"")+Te(L,h),x=I}return b}function Te(
|
|
30
|
-
`+
|
|
31
|
-
`,
|
|
32
|
-
`+
|
|
33
|
-
`:""}return nt.dump=k,nt}var
|
|
34
|
-
`)}function
|
|
35
|
-
`);i.push("");for(let
|
|
36
|
-
`)}function
|
|
37
|
-
`);let r=
|
|
38
|
-
`)}function
|
|
39
|
-
`)}function
|
|
40
|
-
`)}var ft=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),
|
|
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 vn(n,t){if(n.id)return n.id;let i=Ae(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 Ne(n,t){let i=Ae(n)??Ve(),r=t(i);return Pe(n,r),r}var
|
|
25
|
+
`}function Xe(a){return a[a.length-1]===`
|
|
26
|
+
`?a.slice(0,-1):a}function An(a,h){let _=/(\n+)([^\n]*)/g,b=(function(){let $=a.indexOf(`
|
|
27
|
+
`);return $=$!==-1?$:a.length,_.lastIndex=$,Te(a.slice(0,$),h)})(),x=a[0]===`
|
|
28
|
+
`||a[0]===" ",I,C;for(;C=_.exec(a);){let $=C[1],L=C[2];I=L[0]===" ",b+=$+(!x&&!I&&L!==""?`
|
|
29
|
+
`:"")+Te(L,h),x=I}return b}function Te(a,h){if(a===""||a[0]===" ")return a;let _=/ [^ ]/g,b,x=0,I,C=0,$=0,L="";for(;b=_.exec(a);)$=b.index,$-x>h&&(I=C>x?C:$,L+=`
|
|
30
|
+
`+a.slice(x,I),x=I+1),C=$;return L+=`
|
|
31
|
+
`,a.length-x>h&&C>x?L+=a.slice(x,C)+`
|
|
32
|
+
`+a.slice(C+1):L+=a.slice(x),L.slice(1)}function Sn(a){let h="",_=0;for(let b=0;b<a.length;_>=65536?b+=2:b++){_=Q(a,b);let x=H[_];!x&&A(_)?(h+=a[b],_>=65536&&(h+=a[b+1])):h+=x||ie(_)}return h}function en(a,h,_){let b="",x=a.tag;for(let I=0,C=_.length;I<C;I+=1){let $=_[I];a.replacer&&($=a.replacer.call(_,String(I),$)),(w(a,h,$,!1,!1)||typeof $>"u"&&w(a,h,null,!1,!1))&&(b!==""&&(b+=","+(a.condenseFlow?"":" ")),b+=a.dump)}a.tag=x,a.dump="["+b+"]"}function nn(a,h,_,b){let x="",I=a.tag;for(let C=0,$=_.length;C<$;C+=1){let L=_[C];a.replacer&&(L=a.replacer.call(_,String(C),L)),(w(a,h+1,L,!0,!0,!1,!0)||typeof L>"u"&&w(a,h+1,null,!0,!0,!1,!0))&&((!b||x!=="")&&(x+=ge(a,h)),a.dump&&c===a.dump.charCodeAt(0)?x+="-":x+="- ",x+=a.dump)}a.tag=I,a.dump=x||"[]"}function Cn(a,h,_){let b="",x=a.tag,I=Object.keys(_);for(let C=0,$=I.length;C<$;C+=1){let L="";b!==""&&(L+=", "),a.condenseFlow&&(L+='"');let P=I[C],U=_[P];a.replacer&&(U=a.replacer.call(_,P,U)),w(a,h,P,!1,!1)&&(a.dump.length>1024&&(L+="? "),L+=a.dump+(a.condenseFlow?'"':"")+":"+(a.condenseFlow?"":" "),w(a,h,U,!1,!1)&&(L+=a.dump,b+=L))}a.tag=x,a.dump="{"+b+"}"}function e(a,h,_,b){let x="",I=a.tag,C=Object.keys(_);if(a.sortKeys===!0)C.sort();else if(typeof a.sortKeys=="function")C.sort(a.sortKeys);else if(a.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let $=0,L=C.length;$<L;$+=1){let P="";(!b||x!=="")&&(P+=ge(a,h));let U=C[$],K=_[U];if(a.replacer&&(K=a.replacer.call(_,U,K)),!w(a,h+1,U,!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)?P+="?":P+="? "),P+=a.dump,ee&&(P+=ge(a,h)),w(a,h+1,K,!0,ee)&&(a.dump&&c===a.dump.charCodeAt(0)?P+=":":P+=": ",P+=a.dump,x+=P)}a.tag=I,a.dump=x||"{}"}function d(a,h,_){let b=_?a.explicitTypes:a.implicitTypes;for(let x=0,I=b.length;x<I;x+=1){let C=b[x];if((C.instanceOf||C.predicate)&&(!C.instanceOf||typeof h=="object"&&h instanceof C.instanceOf)&&(!C.predicate||C.predicate(h))){if(_?C.multi&&C.representName?a.tag=C.representName(h):a.tag=C.tag:a.tag="?",C.represent){let $=a.styleMap[C.tag]||C.defaultStyle,L;if(r.call(C.represent)==="[object Function]")L=C.represent(h,$);else if(o.call(C.represent,$))L=C.represent[$](h,$);else throw new t("!<"+C.tag+'> tag resolver accepts not "'+$+'" style');a.dump=L}return!0}}return!1}function w(a,h,_,b,x,I,C){a.tag=null,a.dump=_,d(a,_,!1)||d(a,_,!0);let $=r.call(a.dump),L=b;b&&(b=a.flowLevel<0||a.flowLevel>h);let P=$==="[object Object]"||$==="[object Array]",U,K;if(P&&(U=a.duplicates.indexOf(_),K=U!==-1),(a.tag!==null&&a.tag!=="?"||K||a.indent!==2&&h>0)&&(x=!1),K&&a.usedDuplicates[U])a.dump="*ref_"+U;else{if(P&&K&&!a.usedDuplicates[U]&&(a.usedDuplicates[U]=!0),$==="[object Object]")b&&Object.keys(a.dump).length!==0?(e(a,h,a.dump,x),K&&(a.dump="&ref_"+U+a.dump)):(Cn(a,h,a.dump),K&&(a.dump="&ref_"+U+" "+a.dump));else if($==="[object Array]")b&&a.dump.length!==0?(a.noArrayIndent&&!C&&h>0?nn(a,h-1,a.dump,x):nn(a,h,a.dump,x),K&&(a.dump="&ref_"+U+a.dump)):(en(a,h,a.dump),K&&(a.dump="&ref_"+U+" "+a.dump));else if($==="[object String]")a.tag!=="?"&&xn(a,a.dump,h,I,L);else{if($==="[object Undefined]")return!1;if(a.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+$)}if(a.tag!==null&&a.tag!=="?"){let ee=encodeURI(a.tag[0]==="!"?a.tag.slice(1):a.tag).replace(/!/g,"%21");a.tag[0]==="!"?ee="!"+ee:ee.slice(0,18)==="tag:yaml.org,2002:"?ee="!!"+ee.slice(18):ee="!<"+ee+">",a.dump=ee+" "+a.dump}}return!0}function S(a,h){let _=[],b=[];y(a,_,b);let x=b.length;for(let I=0;I<x;I+=1)h.duplicates.push(_[b[I]]);h.usedDuplicates=new Array(x)}function y(a,h,_){if(a!==null&&typeof a=="object"){let b=h.indexOf(a);if(b!==-1)_.indexOf(b)===-1&&_.push(b);else if(h.push(a),Array.isArray(a))for(let x=0,I=a.length;x<I;x+=1)y(a[x],h,_);else{let x=Object.keys(a);for(let I=0,C=x.length;I<C;I+=1)y(a[x[I]],h,_)}}}function k(a,h){h=h||{};let _=new pe(h);_.noRefs||S(a,_);let b=a;return _.replacer&&(b=_.replacer.call({"":b},"",b)),w(_,0,b,!0,!0)?_.dump+`
|
|
33
|
+
`:""}return nt.dump=k,nt}var pi;function ho(){if(pi)return he;pi=1;let n=fo(),t=po();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 he.Type=ve(),he.Schema=di(),he.FAILSAFE_SCHEMA=vi(),he.JSON_SCHEMA=Ai(),he.CORE_SCHEMA=Si(),he.DEFAULT_SCHEMA=tt(),he.load=n.load,he.loadAll=n.loadAll,he.dump=t.dump,he.YAMLException=Ge(),he.types={binary:Ii(),float:xi(),map:gi(),null:yi(),pairs:Ti(),set:Ri(),timestamp:Ci(),bool:wi(),int:bi(),merge:_i(),omap:ki(),seq:mi(),str:hi()},he.safeLoad=i("safeLoad","load"),he.safeLoadAll=i("safeLoadAll","loadAll"),he.safeDump=i("safeDump","dump"),he}var mo=ho(),go=co(mo),{Type:is,Schema:rs,FAILSAFE_SCHEMA:os,JSON_SCHEMA:as,CORE_SCHEMA:ss,DEFAULT_SCHEMA:ls,load:Ei,loadAll:cs,dump:Oi,YAMLException:us,types:fs,safeLoad:ps,safeLoadAll:ds,safeDump:hs}=go;var fe=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}},vo=class extends fe{},yo=class extends fe{},wo=class extends fe{},it=class extends fe{};function an(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 sn(n,t,i){let r={status:n,detail:t,requestId:i};return n===401||n===403?new vo(an(t,"Authentication failed"),r):n===404?new yo(an(t,"Not found"),r):n>=500?new wo(an(t,"Server error"),r):new fe(an(t,`Request failed with status ${n}`),r)}function ln(n){try{return JSON.parse(n)}catch{return n}}var bo=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)}),v=await m.text(),T=v?ln(v):null;if(!m.ok)throw sn(m.status,T,m.headers.get("x-request-id")??void 0);return T}}let c=await l.text(),p=c?ln(c):null;if(!l.ok)throw sn(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 v=new URL(m,o),T=await fetch(v,{method:n,headers:s,body:l,signal:AbortSignal.timeout(r.timeoutMs??this.config.timeoutMs)}),N=await T.text(),E=N?ln(N):null;if(!T.ok)throw sn(T.status,E,T.headers.get("x-request-id")??void 0);return E}}let u=await p.text(),f=u?ln(u):null;if(!p.ok)throw sn(p.status,f,p.headers.get("x-request-id")??void 0);return f}},xo=(()=>{try{return"https://api.joinblok.co"}catch{return"http://127.0.0.1:8001"}})(),Ao=3e4,So=3e5;function Co(n){return n.endsWith("/")?n.slice(0,-1):n}function _o(n={}){let t=n.baseUrl??process.env.SELDON_BASE_URL??process.env.BLOK_BASE_URL??xo,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:Co(t),apiKey:i||void 0,timeoutMs:n.timeoutMs??(Number.isFinite(r)&&r>0?r:Ao),specCacheTtlMs:n.specCacheTtlMs??So}}var Io=new Set(["get","post","put","patch","delete"]),ko="_api_v1_";function To(n){let t=n.indexOf(ko);return t>0?n.slice(0,t):n}function Ro(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 Eo(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 Oo=class ji{constructor(t,i){this.operations=t,this.apiKeySchemes=i}operations;apiKeySchemes;static fromSpec(t){let i=Ro(t),r=[];for(let[o,s]of Object.entries(t.paths??{}))for(let[l,c]of Object.entries(s)){if(!Io.has(l))continue;let p=c,u=String(p.operationId??`${l}_${o}`),f=Array.isArray(p.parameters)?p.parameters.map(v=>({name:String(v.name),in:v.in,required:!!v.required,description:typeof v.description=="string"?v.description:void 0,schema:v.schema})):[],m=p.tags;r.push({operationId:u,name:To(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:Lo(p.requestBody),security:Eo(p)})}return new ji(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 Lo(n){if(!n||typeof n!="object")return;let t=n.content;if(t)return t["application/json"]?.schema??Object.values(t)[0]?.schema}function Yi(){if(process.env.BLOK_CACHE_DIR)return process.env.BLOK_CACHE_DIR;let n=Fo()||Po();return qi(n,".cache","blok")}function Do(n){let t=$o("sha256").update(n).digest("hex").slice(0,16);return qi(Yi(),`openapi-${t}.json`)}var Uo=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 Li(t,"utf8"))}catch(r){throw new it(`Could not read BLOK_SPEC_PATH (${t}): ${String(r)}`)}let i=Do(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 Li(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 it(`Could not fetch OpenAPI from ${i.toString()}: ${String(s)}`)}if(!r.ok)throw new it(`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 Mo(Yi(),{recursive:!0});let i={ts:Date.now(),spec:t};await No(n,JSON.stringify(i),"utf8")}catch{}}},rt={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"],get_experiment_logs:["GET","/api/v1/experiments/{experiment_id}/logs"],list_qa_experiments:["GET","/api/v1/integrations/github/experiments"],stop_experiment:["POST","/api/v1/experiments/{experiment_id}/stop"]};function cn(n,t={}){return n.replace(/\{([^}]+)\}/g,(i,r)=>{let o=t[r];if(o===void 0)throw new fe(`Missing path parameter: ${r}`);return encodeURIComponent(String(o))})}var zi=class{config;client;loader;registry;constructor(n={}){this.config=_o(n),this.client=new bo(this.config),this.loader=new Uo(this.config)}async operations(n={}){if(!this.registry||n.refresh){let t=await this.loader.load(n);this.registry=Oo.fromSpec(t)}return this.registry}async apiKeyOps(){return(await this.operations()).apiKeyOps()}async hasOperation(n){return n in rt?!0:(await this.operations()).get(n)!==void 0}async call(n,t={}){let i=rt[n];if(i){let[s,l]=i,c=cn(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 fe(`Unknown or non-API-key operation: ${n}`);let o=cn(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=rt[n];if(r){let[l,c]=r,p=cn(c,i.path);return this.client.upload(l,p,t,{timeoutMs:i.timeoutMs})}let o=(await this.operations()).get(n);if(!o)throw new fe(`Unknown or non-API-key operation: ${n}`);let s=cn(o.path,i.path);return this.client.upload(o.method,s,t,{timeoutMs:i.timeoutMs})}};var Yo=/\x1b\[[0-9;]*m/g,Mi=n=>n.replace(Yo,"").length;function fn(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=>Mi(u[p])))),o=(c,p,u="left")=>{let f=" ".repeat(Math.max(0,p-Mi(c)));return u==="right"?f+c:c+f},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 Wi(n,t){return t<=0||n.length<=t?{shown:n,hiddenCount:0}:{shown:n.slice(0,t),hiddenCount:n.length-t}}var Ni={blocker:0,major:1,minor:2,cosmetic:3},Fi={fail:0,blocked:1,timed_out:2},Pi={pass:"\u2705",fail:"\u274C",blocked:"\u{1F6AB}",timed_out:"\u231B"},zo={pass:"PASS",fail:"FAIL",blocked:"BLOCKED",timed_out:"TIMED_OUT"};function Ko(n){let t=n.toLowerCase();return t==="pass"?"pass":t==="fail"?"fail":t==="timed_out"||t==="timedout"?"timed_out":"blocked"}function Ho(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 ut(n){return n.lines?`\`${n.file}\` (lines ${n.lines.start}-${n.lines.end})`:`\`${n.file}\``}function Go(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(ut).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 Wo(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 Qo(n){let t=n.test_plan??{title:"Untitled plan"},i=new Map;for(let v of t.test_cases??[])i.set(v.id,v);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 v of c){let T=Ko(v.verdict);if(T==="pass"){u.push({id:v.test_case_id,title:v.title});continue}let N=Ho(i.get(v.test_case_id)),E=v.attempts??1,j=v.passes??0;p.push({id:v.test_case_id,title:v.title,area:i.get(v.test_case_id)?.area,verdict:T,severity:v.severity??void 0,acceptanceCriterion:v.acceptance_criterion,expected:v.expected??void 0,actual:v.actual??void 0,reproductionSteps:v.reproduction_steps??[],unmetPreconditions:v.unmet_preconditions??[],evidence:N,hint:Go(T,v,N),screenshotUrls:v.screenshot_urls??[],recordingUrl:v.recording_url??void 0,attempts:E,passes:j,flaky:E>1&&j>0&&j<E})}p.sort((v,T)=>{let N=(Fi[v.verdict]??9)-(Fi[T.verdict]??9);if(N!==0)return N;let E=Ni[(v.severity??"").toLowerCase()]??9,j=Ni[(T.severity??"").toLowerCase()]??9;return E-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:Wo(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 Vo=8,Jo=8,Di=12,Qi=5;function Vi(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 Ji(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 Zi(n,t={}){let i=[`Seldon QA \u2014 ${n.planTitle} \xB7 ${Vi(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 Ji(n)){let l=zo[s.verdict].padEnd(Vo),c=(s.severity?.toUpperCase()??"").padEnd(Jo);i.push(`${l} ${c} ${s.id} ${s.title}`)}let{shown:r,hiddenCount:o}=t.full?{shown:n.failures,hiddenCount:0}:Wi(n.failures,t.compactLimit??Qi);for(let s of r){i.push("",`${s.id} ${s.title}${s.flaky?" (FLAKY)":""}`);let l=(c,p)=>` ${c.padEnd(Di)}${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(ut).join(", "))),s.reproductionSteps.length&&(i.push(l("repro:",s.reproductionSteps[0])),s.reproductionSteps.slice(1).forEach(c=>i.push(" ".repeat(2+Di)+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 Xi(n,t={}){let i=[`**Seldon QA \u2014 ${n.planTitle}** \xB7 ${Vi(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=Ji(n);if(r.length){i.push("","| | Case |","|---|---|");for(let l of r){let c=l.severity?`${Pi[l.verdict]} \`${l.severity.toUpperCase()}\``:Pi[l.verdict];i.push(`| ${c} | \`${l.id}\` ${l.title} |`)}}let{shown:o,hiddenCount:s}=t.full?{shown:n.failures,hiddenCount:0}:Wi(n.failures,t.compactLimit??Qi);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(ut).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 Ui(n){if(n&&!(typeof n.start!="number"||typeof n.end!="number"))return{start:n.start,end:n.end}}function Zo(n,t){return{id:n.test_case_id,title:t.get(n.test_case_id),oldLines:Ui(n.old_lines),newLines:Ui(n.new_lines)}}function Xo(n){return{id:n.test_case_id,title:n.title,reason:n.reason??void 0,snippet:n.snippet??void 0}}function ea(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 na(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 er(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 nr(n,t=[]){let i=n.test_plan??{title:"Untitled plan"},r=new Map;for(let v of i.test_cases??[])r.set(v.id,v.title);let o=t.length?t:(i.test_cases??[]).filter(v=>v.fixed).map(v=>v.id),s=n.diff??{},l=s.kept??[],c=(s.reanchored??[]).map(v=>Zo(v,r)),p=(s.nullified??[]).map(Xo),u=(s.added??[]).map(v=>{let T=typeof v=="string"?v:v.test_case_id??v.id??"",N=typeof v=="string"?void 0:v.title;return{id:T,title:N??r.get(T)}}),f=(n.decisions??[]).map(ea),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:na(m)},kept:l,reanchored:c,nullified:p,added:u,decisions:f,fixedCoverage:er(o,i)}}function un(n){return n?`${n.start}-${n.end}`:"?"}function tr(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){let o=r.oldLines||r.newLines?` (lines ${un(r.oldLines)} -> ${un(r.newLines)})`:"";t.push(` ~ [${r.id}] ${r.title??""}`.trimEnd()+o)}}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 ir(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){let o=r.oldLines||r.newLines?` \u2014 lines ${un(r.oldLines)} \u2192 ${un(r.newLines)}`:"";t.push(`- \`${r.id}\` ${r.title??""}`.trimEnd()+o)}}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 ft=new Set([".git","node_modules",".venv","venv","__pycache__","dist","build",".next",".idea",".turbo","coverage",".seldon"]),rr=256*1024,ta=8e3,ia=50*1024*1024,ra=8192,pt="application/zip",or=new Date("2020-01-01T00:00:00Z"),dt=new Set(["seldon.yml","seldon.yaml"]),oa=/^(readme|contributing)(\.|$)/i;function lt(n){return n.startsWith(".")}function aa(n){return dt.has(n)||oa.test(n)}function ar(n){return $i==="/"?n:n.split($i).join("/")}function sr(n){let t=Math.min(n.length,ra);for(let i=0;i<t;i+=1)if(n[i]===0)return!0;return!1}async function pn(n,t={}){let i=new Set(ft);for(let m of t.ignoreDirs??[])i.add(m);let r=t.maxFileBytes??rr,o=t.maxFiles??ta,s=t.maxTotalBytes??ia,l=[],c=[],p=0,u=null;async function f(m){if(u)return;let v;try{v=await jo(m,{withFileTypes:!0})}catch{return}v.sort((T,N)=>T.name.localeCompare(N.name));for(let T of v){if(u)return;let N=Gi(m,T.name),E=ar(qo(n,N));if(T.isSymbolicLink())continue;if(T.isDirectory()){if(lt(T.name)){c.push({path:E,reason:"hidden"});continue}if(i.has(T.name)){c.push({path:E,reason:"ignored-dir"});continue}await f(N);continue}if(!T.isFile())continue;if(lt(T.name)&&!dt.has(T.name)){c.push({path:E,reason:"hidden"});continue}if(!E.includes("/")&&!aa(T.name)){c.push({path:E,reason:"root-file"});continue}let j;try{j=(await Hi(N)).size}catch{continue}if(j>r){c.push({path:E,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 Ki(N))}catch{continue}if(sr(ne)){c.push({path:E,reason:"binary"});continue}l.push({path:E,bytes:ne}),p+=j}}return await f(n),u&&c.push({path:"",reason:u}),{files:l,skipped:c,totalBytes:p}}async function dn(n,t={}){let{files:i,skipped:r}=await pn(n,t);if(i.length===0)throw new fe(`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:$n(o,{level:6,mtime:or}),filename:t.filename??"codebase.zip",fileCount:i.length,skipped:r}}function Bi(n,t){try{return Bo("git",["-C",n,...t],{encoding:"utf8",maxBuffer:64*1024*1024})}catch(i){throw new fe(`git ${t.join(" ")} failed (is '${n}' a git repository?): ${i.message.split(`
|
|
41
|
+
`)[0]}`)}}async function lr(n,t={}){let i=t.base?[`${t.base}...HEAD`]:["HEAD"],r=Bi(n,["diff",...i]);if(!r.trim())throw new fe(t.base?`No changes between ${t.base} and HEAD to reassess.`:"No uncommitted changes vs HEAD to reassess.");let o=Bi(n,["diff","--name-only","--diff-filter=d",...i]).split(`
|
|
42
|
+
`).map(f=>f.trim()).filter(Boolean),s=t.maxFileBytes??rr,l=new Set(ft),c={"changes.patch":new TextEncoder().encode(r)},p=[],u=0;for(let f of o){let m=f.split("/"),v=m[m.length-1];if(lt(v)&&!dt.has(v)){p.push({path:f,reason:"hidden"});continue}if(m.some(E=>l.has(E))){p.push({path:f,reason:"ignored-dir"});continue}let T=Gi(n,f),N;try{if((await Hi(T)).size>s){p.push({path:f,reason:"too-large"});continue}N=new Uint8Array(await Ki(T))}catch{continue}if(sr(N)){p.push({path:f,reason:"binary"});continue}c[ar(f)]=N,u+=1}return{bytes:$n(c,{level:6,mtime:or}),filename:t.filename??"changed.zip",fileCount:u,skipped:p,patch:r}}async function cr(n,t,i={}){let r=await dn(t,i),o=await n.upload("upload_qa_package",{field:"file",filename:r.filename,contentType:pt,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 sa(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 ht(n){return{baselines:((await n.call("list_all_baselines")).baselines??[]).map(sa)}}async function ur(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 ht(n),c=l.find(p=>p.lineageId===t&&p.status==="committed"&&p.caseCount>0);if(c)return c;if(Date.now()>=s)throw new fe(`Timed out waiting for the baseline plan for lineage ${t}.`);await new Promise(p=>setTimeout(p,r))}}async function We(n,t){return n.call("get_baseline_plan",{path:{baseline_id:t}})}async function la(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 fr(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 pr(n,t){return n.call("promote_baseline",{path:{baseline_id:t}})}async function dr(n,t,i={}){i.credentials!==void 0&&await la(n,t,{credentials:i.credentials});let r={};return i.url!==void 0&&(r.target_url=i.url),i.runCaseIds!==void 0&&(r.run_case_ids=i.runCaseIds),i.seldonYaml!==void 0&&(r.seldon_yaml=i.seldonYaml),{experimentId:(await n.call("run_baseline",{path:{baseline_id:t},...Object.keys(r).length?{body:r}:{}})).experiment_id}}async function hr(n,t){let i=await n.call("stop_experiment",{path:{experiment_id:t},body:{action:"cancel"}});return{status:i.status??"success",message:i.message??void 0}}async function mr(n){return{runs:((await n.call("list_qa_experiments")).runs??[]).map(t=>({experimentId:t.experiment_id,title:t.title??void 0,status:t.status??"unknown",url:t.url??void 0,createdAt:t.created_at??void 0}))}}async function gr(n,t){return n.call("get_experiment_qa_report",{path:{experiment_id:t}})}async function vr(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 gr(n,t);if(l.report!=null||Date.now()>=s)return l;await new Promise(c=>setTimeout(c,r))}}async function Qe(n,t){let i=await gr(n,t);return Qo({...i,experiment_id:i.experiment_id??t})}var yr=3e5,ot="update_baseline_from_package";async function wr(n,t,i,r={}){let o=r.fixedCaseIds??[];if(!await n.hasOperation(ot))throw new fe(`Baseline update isn't available on this API yet: the server must expose the '${ot}' operation (POST /code-tests/baselines/{id}/update). Re-run 'seldon baseline generate' to rebuild from scratch, or upgrade the API.`);let s=await dn(t,r),l=await n.upload("upload_qa_package",{field:"file",filename:s.filename,contentType:pt,bytes:s.bytes}),c=await n.call(ot,{path:{baseline_id:i},timeoutMs:yr,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=er(u,p);if(!f.ok)throw new fe(`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 nr({...c,experiment_id:c.experiment_id??i},o)}var at="delta_baseline";async function br(n,t,i){if(!await n.hasOperation(at))throw new fe(`Baseline delta isn't available on this API yet: the server must expose the '${at}' 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:pt,bytes:i.zipBytes}),o=await n.call(at,{path:{baseline_id:t},timeoutMs:yr,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=nr({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 mt(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 gt(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 Ar(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 ct="seldon.yml",pa=Array.from(ft),da="ALL";function Ve(){return{baseline:{baselineId:"",lineageId:"",generate:{scope:"",filename:"codebase.zip",ignoreDirs:[...pa]},run:{url:""}},testCases:{skip:[],only:[],fixed:[]},cli:{wait:!0,reportFormat:"markdown"}}}function $e(n){return ua(fa(n),ct)}function Ae(n){let t;try{t=xr($e(n),"utf8")}catch{return null}return ha(t)}function hn(n){try{return xr($e(n),"utf8")}catch{return}}function ha(n){let t;try{t=Ei(n)}catch(i){throw new fe(`Could not parse ${ct}: ${i.message}`)}if(t==null)return{};if(typeof t!="object"||Array.isArray(t))throw new fe(`${ct} must be a YAML mapping at the top level.`);return t}function ma(n){return Oi(n,{noRefs:!0,lineWidth:-1})}function Pe(n,t){ca($e(n),ma(t),"utf8")}function st(n,t){return!n||n.length===0?[]:n.includes(da)?[...t]:n}function Sr(n,t,i){return st(t?.only,i).includes(n)?"only":st(t?.skip,i).includes(n)?"skip":st(t?.fixed,i).includes(n)?"fixed":"none"}function vt(n){let t={};for(let i of n)t[i.reason]=(t[i.reason]??0)+1;return t}async function Cr(n){let t=Ve(),i=t.baseline?.generate?.ignoreDirs??[],{files:r,skipped:o,totalBytes:s}=await pn(n,{ignoreDirs:i});return{config:t,preview:mt(r,s),ignored:gt(o),skippedByReason:vt(o)}}function ga(n){return{id:n.id,timestamp:n.timestamp,phase:n.phase??"step2",runNumber:n.run_number??null,step:n.step??null,source:n.source??"",type:n.type??"",content:n.content??"",metadata:n.metadata??{}}}async function _r(n,t,i={}){let r={};i.since!==void 0&&(r.since=i.since),i.type!==void 0&&(r.type=i.type),i.source!==void 0&&(r.source=i.source),i.limit!==void 0&&(r.limit=i.limit),i.cursor!==void 0&&(r.cursor=i.cursor);let o=await n.call("get_experiment_logs",{path:{experiment_id:t},...Object.keys(r).length?{query:r}:{}});return{logs:(o.logs??[]).map(ga),nextCursor:o.pagination?.nextCursor??null}}function Ir(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 Ga}from"fs";import{Command as Wa}from"commander";var va="\x1B[0m",ya={bold:"1",dim:"2",inverse:"7",red:"31",green:"32",yellow:"33",blue:"34",magenta:"35",cyan:"36",gray:"90"};function wa(){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 Me(n,...t){return!wa()||t.length===0?n:`${t.map(r=>`\x1B[${ya[r]}m`).join("")}${n}${va}`}var De=n=>Me(n,"bold"),Ie=n=>Me(n,"dim"),mn=n=>Me(n,"cyan"),ba=n=>Me(n,"green"),xa=n=>Me(n,"yellow"),Aa=n=>Me(n,"red");function kr(n){let t=n.toLowerCase();return/(run|queue|pending|progress|start|dispatch)/.test(t)?xa(n):/(complet|passed|success|done|ready)/.test(t)?ba(n):/(fail|error)/.test(t)?Aa(n):/(cancel|stop|not.?run|draft|abort|skip)/.test(t)?Ie(n):n}import{mkdirSync as Sa,readFileSync as Ca,writeFileSync as _a}from"fs";import{homedir as Ia}from"os";import{join as Tr}from"path";function Rr(){return process.env.SELDON_CONFIG_DIR??process.env.BLOK_CONFIG_DIR??Tr(Ia(),".config","seldon")}function Er(){return Tr(Rr(),"config.json")}function Je(){try{return JSON.parse(Ca(Er(),"utf8"))}catch{return{}}}function gn(n){let t={...Je(),...n};return Sa(Rr(),{recursive:!0,mode:448}),_a(Er(),`${JSON.stringify(t,null,2)}
|
|
43
|
+
`,{encoding:"utf8",mode:384}),t}function Or(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 Oe(n,t){if(n.id)return n.id;let i=Ae(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 vn(n,t){if(n.id)return n.id;let i=Ae(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 Ne(n,t){let i=Ae(n)??Ve(),r=t(i);return Pe(n,r),r}var ka="Other",Ta=3,Ra=3,Ea=3,yt=["none","skip","only","fixed"],Oa={none:" ",skip:"s",only:"o",fixed:"f"};function La(){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 $a(n){let t=new Map;for(let r of n){let o=r.area?.trim()||ka;(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 Ma(n,t){let i=(Ae(t)??Ve()).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 Na(n,t){return t<=1||n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}\u2026`}var wt=class{constructor(t,i,r,o){this.planTitle=t;this.io=o;this.rows=$a(i),this.caseRowIndices=this.rows.reduce((s,l,c)=>l.kind==="case"?[...s,c]:s,[]),this.statuses=Ma(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(Ea,this.io.rows-Ta-Ra)}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=yt[(yt.indexOf(i)+1)%yt.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",v=`${u?"\u276F":" "} [${Oa[f]}] ${p.testCase.id}: ${p.testCase.title}`;u?r(v,"cyan","bold"):f==="skip"?r(v,"yellow"):f==="only"?r(v,"cyan"):f==="fixed"?r(v,"green"):r(v)}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=Na(c,t);this.io.write(`\r\x1B[2K${p?Me(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,
|
|
48
|
-
`))}var
|
|
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 Lr(n,t,i,r){let{status:o}=r,s=await We(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 wt(s.title??"Baseline",l,t,r.io??La());if(!await c.run()){o("Aborted \u2014 no changes saved.");return}let{skip:u,only:f,fixed:m}=c.result();Ne(t,v=>({...v,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 Fa}from"fs";import{cancel as bt,confirm as Pa,intro as Da,isCancel as yn,outro as $r,text as xt}from"@clack/prompts";var At=12,Mr=48,St=8;function Nr(n){if(n.length<=Mr)return n;let t=Mr-1,i=Math.ceil(t/2),r=Math.floor(t/2);return`${n.slice(0,i)}\u2026${n.slice(n.length-r)}`}function Ua(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 Fr(n,t,i,r){r(""),r(`Files that will be included: ${n.totalFiles} file(s), ${Ar(n.totalBytes)}`);for(let o of n.rootEntries.slice(0,At)){let s=Nr(o.name);r(o.type==="dir"?` ${s}/ (${o.fileCount} file${o.fileCount===1?"":"s"})`:` ${s}`)}if(n.rootEntries.length>At&&r(` \u2026 and ${n.rootEntries.length-At} more`),t.length>0){let o=t.slice(0,St).map(Nr).join(", "),s=t.length>St?` (+${t.length-St} more)`:"";r(`Automatically ignoring: ${o}${s}`)}Ua(i,r)}function Ba(n){let t=n.split(",").map(i=>i.trim().replace(/^\/+|\/+$/g,"")).filter(Boolean);return Array.from(new Set(t))}async function ja(n,t,i){let{files:r,skipped:o,totalBytes:s}=await pn(n,{ignoreDirs:t});Fr(mt(r,s),gt(o),vt(o),i)}async function Pr(n,t){let{status:i}=t;if(Da("Welcome to Seldon!"),Fa($e(n))){let p=await Pa({message:"seldon.yml already exists here. Reset it to defaults?",initialValue:!1});if(yn(p)||!p){$r("Keeping the existing seldon.yml. Nothing changed.");return}}let r=await Cr(n),o=r.config;Pe(n,o),i("Created seldon.yml with smart defaults."),i("Analyzing your repository..."),Fr(r.preview,r.ignored,r.skippedByReason,i);let s=await xt({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(yn(s)){bt("Stopped \u2014 seldon.yml has the smart defaults saved above.");return}if(s.trim()){let p=Ba(s);o={...o,baseline:{...o.baseline,generate:{...o.baseline?.generate,ignoreDirs:Array.from(new Set([...o.baseline?.generate?.ignoreDirs??[],...p]))}}},Pe(n,o),i(""),i("Updated \u2014 here's what will be included now:"),await ja(n,o.baseline?.generate?.ignoreDirs??[],i)}let l=await xt({message:"Default staging URL? (optional)",placeholder:"https://staging.example.com"});if(yn(l)){bt("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 xt({message:"Scope for baseline generation? (optional, e.g. 'checkout flow')",placeholder:"leave empty for full codebase analysis"});if(yn(c)){bt("Stopped \u2014 seldon.yml has been saved with what you've entered so far."),Pe(n,o);return}c.trim()&&(o={...o,baseline:{...o.baseline,generate:{...o.baseline?.generate,scope:c.trim()}}}),Pe(n,o),$r(["Configuration complete!","",`Saved to: ${$e(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
|
+
`))}var qa="\u{1F916}";function Dr(){return{runKey:null,pageUrl:null}}function Ya(n){return(n.source||"").replace(/^Persona:\s*/i,"").trim()||"agent"}function za(n){return n.replace(/\s+/g," ").trim()}function Ur(n,t){let i=[],r=`${n.runNumber??"-"}|${n.source}`,o=t.pageUrl;if(r!==t.runKey){let c=n.runNumber!=null?`case ${n.runNumber}`:"case";i.push(""),i.push(`${Ie("\u2500\u2500")} ${De(Ya(n))} ${Ie(`\xB7 ${c}`)}`),o=null}let s=typeof n.metadata.page_url=="string"?n.metadata.page_url:null;s&&s!==o&&(i.push(` ${Ie(`\u21B3 ${s}`)}`),o=s);let l=n.step!=null?`step ${n.step}`:"step";return i.push(`${qa} ${mn(l)} ${za(n.content)}`),{lines:i,state:{runKey:r,pageUrl:o}}}import{spinner as Ka}from"@clack/prompts";var Br=["Still working","Reticulating splines","Reading through the codebase","Thinking it through","Almost there","Hang tight"];function Ha(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 wn(n){let t=Ka(),i=0;return t.start(n),{onTick:o=>{let s=Br[i%Br.length];i+=1,t.message(`${n} (${Ha(o)}) \u2014 ${s}...`)},stop:o=>t.stop(o)}}async function Ct(n,t){let i=wn(n),r=Date.now(),o=setInterval(()=>i.onTick(Date.now()-r),2e3);try{return await t()}finally{clearInterval(o),i.stop("")}}function bn(n,t){return n.json?"json":n.md?"markdown":t?.cli?.reportFormat??"text"}var jr=["never","fail","any"];function _t(n){if(n&&!jr.includes(n))throw new Error(`Invalid --fail-on value '${n}'. Use one of: ${jr.join(", ")}.`)}function qr(n,t,i){if(!t||t==="never")return;_t(t);let r=n.summary,o=t==="any"?r.failed+r.blocked+r.timedOut:r.failed;o>0&&(process.exitCode=1,i(`QA gate (--fail-on ${t}): ${o} case(s) not passing \u2014 exiting 1.`))}var Qa={only:"o",skip:"s",fixed:"f",none:" "};function Va(n,t,i){return Qa[Sr(n,t?.testCases,i)]}function Yr(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 zr(n,t=[]){let i=n.out??(g=>process.stdout.write(`${g}
|
|
49
49
|
`)),r=n.status??(g=>process.stderr.write(`${g}
|
|
50
|
-
`)),o=new
|
|
50
|
+
`)),o=new Wa("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 logs --follow # watch the agent think, live (thinking only)"," seldon report --md # clean, actionable results"," seldon runs # list QA runs with color-coded status (find in-flight ones)"," seldon cancel --id <runId> # stop a run mid-flight (the baseline is untouched)","","When the code changes, re-evaluate the baseline (fixed cases are always kept):"," seldon update # whole-repo re-eval, moves the committed head"," seldon review # PR-style: stage a DRAFT from your changes + auto-run","","Inspect and manage versions:"," seldon list # every baseline your key can see (all sources)"," seldon versions # this lineage's committed head + draft proposals"," seldon promote <versionId> # make a draft the committed head runs resolve to","","Configuration lives in seldon.yml at the project root (config-as-code, no server copy).","","Everything else is reachable via: seldon api <operation> [--path k=v] [--query k=v] [--data '{json}']"].join(`
|
|
51
51
|
`)).option("--base-url <url>","Seldon API base URL (overrides SELDON_BASE_URL / config)").option("--api-key <key>","API key (overrides SELDON_API_KEY / config)").addHelpText("after",["","Environment variables:"," SELDON_API_KEY Your API key. Set this and you're good to go (BLOK_API_KEY also accepted)."," SELDON_BASE_URL Override the API base URL (defaults to the baked-in production URL).","","Get an API key: Settings \u2192 API keys in the Seldon product."].join(`
|
|
52
|
-
`));let
|
|
53
|
-
`),i(fn(A,[{header:"ID",cell:R=>R.id},{header:"NAME",cell:R=>R.displayName},{header:"SOURCE",cell:R=>R.createdVia},{header:"CASES",align:"right",cell:R=>String(R.caseCount)},{header:"STATUS",cell:R=>R.status},{header:"UPDATED",cell:R=>R.createdAt?new Date(R.createdAt).toISOString().slice(0,10):"?"}]))},
|
|
52
|
+
`));let s=()=>{let g=o.opts();return n.makeSdk({baseUrl:g.baseUrl,apiKey:g.apiKey})},l=g=>i(JSON.stringify(g,null,2)),c=(g,A,R)=>{A==="json"?l(g):i(A==="markdown"?Xi(g,{full:R}):Zi(g,{full:R}))},p=(g,A)=>{A==="json"?l(g):i(A==="markdown"?ir(g):tr(g))},u=async g=>{_t(g.failOn);let A=g.path??process.cwd(),R=Oe(g,A),M=Ae(A),F=g.url||M?.baseline?.run?.url||void 0;r(`Launching QA run for baseline ${R} ...`);let{experimentId:D}=await dr(s(),R,{url:F,credentials:g.credentials,seldonYaml:hn(A)});if(Ne(A,J=>({...J,baseline:{...J.baseline,lastRunExperimentId:D,...g.url?{run:{...J.baseline?.run,url:g.url}}:{}}})),r(`Run started \u2014 experiment ${D}. View it in the app under QA, or: seldon baseline report`),!g.wait)return;let Q=wn("Running test cases");await vr(s(),D,{onTick:Q.onTick}),Q.stop(""),r("Test run complete.");let q=await Qe(s(),D);c(q,bn(g,M),g.full),qr(q,g.failOn,r)},f=g=>g.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("--fail-on <level>","CI gate: exit non-zero when cases don't pass \u2014 'fail' (any failed) or 'any' (failed/blocked/timed-out). Default: never").option("--full","Show every failure/blocked case's full detail block (default: capped at 5, ledger always lists every case)"),m=async g=>{_t(g.failOn);let A=g.path??process.cwd(),R=vn(g,A),M=Ae(A),F=await Qe(s(),R);c(F,bn(g,M),g.full),qr(F,g.failOn,r)},v=g=>g.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("--fail-on <level>","CI gate: exit non-zero when cases don't pass \u2014 'fail' (any failed) or 'any' (failed/blocked/timed-out). Default: never").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 g=Je();l({baseUrl:g.baseUrl,apiKey:g.apiKey?"****":void 0})}),T.command("set-key <key>").description("Save an API key to the config file.").action(g=>{gn({apiKey:g}),r("Saved API key.")}),T.command("set-url <url>").description("Save the API base URL to the config file.").action(g=>{gn({baseUrl:g}),r("Saved base URL.")}),o.command("login <key>").description("Save your API key (alias for `config set-key`).").action(g=>{gn({apiKey:g}),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 g=>{let A=g??process.cwd();await Pr(A,{status:r})});let N=o.command("baseline",{hidden:!0}).description("Grouped aliases of the top-level baseline verbs (back-compat)."),E=g=>g?{hidden:!0}:{},j=async g=>{let{baselines:A}=await ht(s());if(g.json){l({baselines:A});return}if(A.length===0){i("No baselines found for this API key. Generate one with: seldon generate");return}i(De(`${A.length} baseline${A.length===1?"":"s"}`)+`
|
|
53
|
+
`),i(fn(A,[{header:"ID",cell:R=>R.id},{header:"NAME",cell:R=>R.displayName},{header:"SOURCE",cell:R=>R.createdVia},{header:"CASES",align:"right",cell:R=>String(R.caseCount)},{header:"STATUS",cell:R=>R.status},{header:"UPDATED",cell:R=>R.createdAt?new Date(R.createdAt).toISOString().slice(0,10):"?"}]))},ne=(g,A=!1)=>g.command("list",E(A)).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(g,A)=>{let R=g??process.cwd(),F=Ae(R)?.baseline?.generate;r(`Reading codebase at ${R} ...`);let D=await cr(s(),R,{scope:A.scope??F?.scope,label:A.name,filename:F?.filename,ignoreDirs:F?.ignoreDirs});Ne(R,q=>({...q,baseline:{...q.baseline,lineageId:D.lineageId}})),r(`Uploaded ${D.fileCount} file(s); baseline created (lineage ${D.lineageId}).`);let Q={lineageId:D.lineageId};if(A.wait){let q=wn("Generating test plan (this can take a few minutes)"),J=await ur(s(),D.lineageId,{onTick:q.onTick});q.stop(""),Ne(R,re=>({...re,baseline:{...re.baseline,baselineId:J.id}})),Q={lineageId:D.lineageId,baselineId:J.id,caseCount:J.caseCount},r(`Baseline ready: ${J.caseCount} test case(s). It now appears in the app under QA Baselines.`),r("Run it with: seldon run --url <url>")}A.json?l({...D,...Q}):r(`Saved baseline id to ${$e(R)}`)},V=(g,A=!1)=>g.command("generate [path]",E(A)).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 g=>{let A=g.path??process.cwd(),R=Oe(g,A),M=await We(s(),R),F=Ae(A);l({baselineId:M.baseline_id??R,lineageId:M.lineage_id,planTitle:M.title,caseCount:M.case_count??M.cases?.length??0,status:M.status,targetUrl:M.target_url||void 0,lastRunExperimentId:F?.baseline?.lastRunExperimentId||void 0,defaultUrl:F?.baseline?.run?.url||void 0})},X=(g,A=!1)=>g.command("show",E(A)).description("Show the baseline tied to this folder and its status.").option("--path <dir>","Project directory (default: current directory)").option("--id <baselineId>","Inspect a specific baseline instead of the saved one").action(z),ae=async g=>{let A=g.path??process.cwd(),R=Oe(g,A),M=await We(s(),R),F=M.cases??[];if(g.json){l(F);return}let D=Ae(A),Q=F.map(q=>q.id);i(`${M.title??"Baseline"} \u2014 ${F.length} case(s)`);for(let q of F)i(` [${Va(q.id,D,Q)}] [${q.id}] ${q.title} (${q.priority??"?"} \xB7 ${q.area??"general"})`),q.acceptance_criterion&&i(` ${q.acceptance_criterion}`);i(""),i("Legend: [s]=skip [o]=only [f]=fixed [ ]=run normally \xB7 edit interactively: seldon cases")},te=async g=>{if(!g.json&&!g.list&&process.stdin.isTTY){let A=g.path??process.cwd(),R=Oe(g,A);await Lr(s(),A,R,{status:r});return}await ae(g)},Y=(g,A=!1)=>g.command("cases",E(A)).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),B=async(g,A)=>{let R=g??process.cwd(),M=Oe(A,R),F=Ae(R),D=await Ct(`Re-evaluating baseline against ${R}`,()=>wr(s(),R,M,{seldonYaml:hn(R),filename:A.name??F?.baseline?.generate?.filename,ignoreDirs:F?.baseline?.generate?.ignoreDirs}));r(`Update complete: ${D.summary.headline}`),p(D,bn(A,F))},se=(g,A=!1)=>g.command("update [path]",E(A)).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(B),ye=async(g,A)=>{let R=g??process.cwd(),M=Oe(A,R),F=Ae(R),D,Q=!!A.full;if(A.zip)D=new Uint8Array(Ga(A.zip));else if(A.full)D=(await dn(R,{ignoreDirs:F?.baseline?.generate?.ignoreDirs})).bytes,Q=!0;else{let J=await lr(R,{base:A.base});r(`Reassessing ${J.fileCount} changed file(s) against the baseline ...`),D=J.bytes}let q=await Ct("Reassessing baseline against the changes",()=>br(s(),M,{zipBytes:D,full:Q,targetUrl:A.url,seldonYaml:hn(R),autoRun:A.autoRun}));r(`Review complete: ${q.report.summary.headline}`),Ne(R,J=>({...J,baseline:{...J.baseline,...q.experimentId?{lastRunExperimentId:q.experimentId}:{}}})),q.experimentId?r(`Draft ${q.draftBaselineId} \u2014 running affected cases as experiment ${q.experimentId} (view under QA).`):r(`Draft ${q.draftBaselineId} \u2014 no affected cases ran (nothing affected, or no target URL).`),p(q.report,bn(A,F))},oe=(g,A=!1)=>g.command("review [path]",E(A)).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(ye),we=async g=>{let A=g.path??process.cwd(),R=Oe(g,A),{versions:M,committedHeadId:F}=await fr(s(),R);if(g.json){l({committedHeadId:F,versions:M});return}if(M.length===0){i("No versions found for this baseline.");return}i(De(`${M.length} version${M.length===1?"":"s"} \u2014 committed head: ${F??"none"}`)+`
|
|
54
54
|
`),i(fn(M,[{header:"",cell:D=>D.isHead?"*":D.status==="draft"?"d":" "},{header:"ID",cell:D=>D.id},{header:"STATUS",cell:D=>D.status},{header:"SOURCE",cell:D=>D.createdVia},{header:"CASES",align:"right",cell:D=>String(D.caseCount)},{header:"UPDATED",cell:D=>D.createdAt?new Date(D.createdAt).toISOString().slice(0,10):"?"}])),i(Ie(`
|
|
55
|
-
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon promote <id>`))},H=(g,A=!1)=>g.command("versions",E(A)).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(we),le=async(g,A)=>{let R=A.path??process.cwd(),M=g??Oe(A,R),
|
|
56
|
-
`),i(fn(A,[{header:"STATUS",cell:M=>
|
|
57
|
-
cancel an in-flight run: seldon cancel --id <run id>`))},xe=(g,A=!1)=>g.command("runs",E(A)).description("List QA runs your API key can see, with color-coded status (find in-flight runs to cancel).").option("--running","Show only in-flight runs").option("--json","Output as JSON").action(pe);xe(o),xe(
|
|
58
|
-
\u2713 run complete`))},ce=(g,A=!1)=>g.command("logs",E(A)).description("Stream the agent's live thinking for a QA run \u2014 framed by case and step (thinking only).").option("--path <dir>","Project directory (default: current directory)").option("--id <experimentId>","Stream a specific run instead of the last one").option("-f, --follow","Keep streaming until the run finishes").option("--interval <seconds>","Poll interval while following (default: 2.5)").action(ge);if(ce(o),ce(
|
|
59
|
-
\x1B[?25h`),process.stderr.write("Interrupted. In-flight work may still complete server-side \u2014 check `seldon list` / `seldon report`.\n"),process.exit(130)};process.on("SIGINT",n),process.on("SIGTERM",n)}async function
|
|
55
|
+
* = committed head (what runs use) \xB7 d = draft \xB7 promote a draft: seldon promote <id>`))},H=(g,A=!1)=>g.command("versions",E(A)).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(we),le=async(g,A)=>{let R=A.path??process.cwd(),M=g??Oe(A,R),F=await pr(s(),M),D=F.baseline_id??M;Ne(R,Q=>({...Q,baseline:{...Q.baseline,baselineId:D}})),r(`Promoted to committed head ${D} (${F.case_count??F.cases?.length??0} case(s)). Runs now resolve to it.`)},Z=[ne,V,X,Y,se,oe,H,(g,A=!1)=>g.command("promote [versionId]",E(A)).description("Promote a draft version to the committed head (the version runs resolve to).").option("--path <dir>","Project directory (default: current directory)").option("--id <versionId>","Promote a specific draft version instead of the positional arg / saved one").action(le)];for(let g of Z)g(o,!1),g(N,!0);f(o.command("run").description("Run the current baseline against a live URL and print the report.")).action(u),v(o.command("report").description("Show the latest QA report for the current baseline (clean and actionable).")).action(m),f(N.command("run",{hidden:!0})).action(u),v(N.command("report",{hidden:!0})).action(m);let ie=async g=>{let A=g.path??process.cwd(),R=vn(g,A),M=await hr(s(),R);r(`Run ${R} \u2014 ${M.status}${M.message?`: ${M.message}`:" (cancelled)"}.`)},me=(g,A=!1)=>g.command("cancel",E(A)).description("Terminate the current QA run mid-flight (stops the run's experiment; the baseline is untouched).").option("--path <dir>","Project directory (default: current directory)").option("--id <experimentId>","Cancel a specific run instead of the last one").action(ie);me(o),me(N,!0);let be=/(run|queue|pending|progress|start|dispatch)/i,pe=async g=>{let{runs:A}=await mr(s());if(g.running&&(A=A.filter(M=>be.test(M.status))),g.json){l({runs:A});return}if(A.length===0){i(g.running?"No runs in flight right now.":"No QA runs found for this API key. Start one with: seldon run --url <url>");return}let R=A.filter(M=>be.test(M.status)).length;i(De(`${A.length} run${A.length===1?"":"s"}${R?` \xB7 ${R} in flight`:""}`)+`
|
|
56
|
+
`),i(fn(A,[{header:"STATUS",cell:M=>kr(M.status)},{header:"RUN ID",cell:M=>M.experimentId},{header:"NAME",cell:M=>M.title??""},{header:"URL",cell:M=>M.url??""},{header:"STARTED",cell:M=>M.createdAt?new Date(M.createdAt).toISOString().slice(0,16).replace("T"," "):"?"}])),R&&i(Ie(`
|
|
57
|
+
cancel an in-flight run: seldon cancel --id <run id>`))},xe=(g,A=!1)=>g.command("runs",E(A)).description("List QA runs your API key can see, with color-coded status (find in-flight runs to cancel).").option("--running","Show only in-flight runs").option("--json","Output as JSON").action(pe);xe(o),xe(N,!0);let ge=async g=>{let A=g.path??process.cwd(),R=vn(g,A),M=s(),F=Math.max(1e3,Math.round((Number(g.interval)||2.5)*1e3));r(`${De("\u{1F916} Seldon \u2014 agent thinking")} ${Ie(R)}`);try{let re=await Qe(M,R),Se=re.summary.total;r(Ie(` ${re.planTitle}${Se?` \xB7 ${Se} case${Se===1?"":"s"}`:""}`))}catch{}let D=Dr(),Q,q=new Set,J=async()=>{let{logs:re}=await _r(M,R,{type:"thinking",since:Q,limit:500}),Se=0;for(let ke of re){if(q.has(ke.id))continue;q.add(ke.id);let _e=Ur(ke,D);D=_e.state;for(let Ue of _e.lines)i(Ue);Q=ke.timestamp,Se+=1}return Se};if(!g.follow){await J()===0&&r(Ie("No thinking logs yet. Add --follow to stream them as the run produces them."));return}for(;;){await J();let re=!1;try{re=(await Qe(M,R)).status==="complete"}catch{}if(re){await J();break}await new Promise(Se=>setTimeout(Se,F))}r(mn(`
|
|
58
|
+
\u2713 run complete`))},ce=(g,A=!1)=>g.command("logs",E(A)).description("Stream the agent's live thinking for a QA run \u2014 framed by case and step (thinking only).").option("--path <dir>","Project directory (default: current directory)").option("--id <experimentId>","Stream a specific run instead of the last one").option("-f, --follow","Keep streaming until the run finishes").option("--interval <seconds>","Poll interval while following (default: 2.5)").action(ge);if(ce(o),ce(N,!0),t.length>0){let g=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 A of t)g.command(A.name).description(A.summary??`${A.method} ${A.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 R=>{l(await s().call(A.name,{path:Yr(R.path),query:Yr(R.query),body:R.data?JSON.parse(R.data):void 0}))})}return o}function Kr(n){let t=Or(n,Je(),process.env);return new zi(t)}async function Ja(){try{return await Kr({}).apiKeyOps()}catch{return[]}}function Za(){let n=()=>{process.stderr.write(`
|
|
59
|
+
\x1B[?25h`),process.stderr.write("Interrupted. In-flight work may still complete server-side \u2014 check `seldon list` / `seldon report`.\n"),process.exit(130)};process.on("SIGINT",n),process.on("SIGTERM",n)}async function Xa(){Za();let n=Ir(process.argv)?await Ja():[];await zr({makeSdk:Kr},n).parseAsync(process.argv)}Xa().catch(n=>{process.stderr.write(`${n.message}
|
|
60
60
|
`),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seldonqa/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Seldon - generate QA
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Seldon QA - generate a QA test plan from any codebase and run AI agents against your live app, from your terminal or CI.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"qa",
|
|
8
|
+
"testing",
|
|
9
|
+
"test-automation",
|
|
10
|
+
"e2e",
|
|
11
|
+
"end-to-end-testing",
|
|
12
|
+
"ai",
|
|
13
|
+
"agents",
|
|
14
|
+
"ai-testing",
|
|
15
|
+
"ci",
|
|
16
|
+
"seldon"
|
|
17
|
+
],
|
|
6
18
|
"bin": {
|
|
7
19
|
"seldon": "./dist/bin.js"
|
|
8
20
|
},
|