From 147e83fe6006aabe5cc1585f0187c15c8bdc99e6 Mon Sep 17 00:00:00 2001 From: sungju Yun Date: Mon, 29 Jun 2026 21:17:23 +0900 Subject: [PATCH 1/2] =?UTF-8?q?perf(gate):=20incremental=20TS=20gate=20?= =?UTF-8?q?=E2=80=94=20tsc=20--incremental=20+=20eslint=20--cache=20(F-bfe?= =?UTF-8?q?14aac)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TypeScript type and lint gates re-ran from scratch every gate. They now reuse a build cache: `tsc --noEmit --incremental` (build-info file) and `eslint --cache`, both under `.cladding/cache/` (already gitignored, so a managed project's tree stays clean). Measured on cladding's own repo (unchanged re-run — the local pre-commit/ pre-push loop): tsc 2.7s → 1.1s, eslint 2.5s → 0.6s (~3.4s saved). SOUND, not a shortcut: with a stale build-info present, a newly-introduced type error in an included file is STILL caught (verified — tsc rebuilds the affected program slice; eslint --cache keys on file+config hash). Cold runs (fresh CI checkout) just rebuild the cache — no regression. Test execution is deliberately NOT scoped: a gate must certify the whole tree, so changed-files / test-selection (unsound for a gate) was avoided. The dominant test cost (~20s) and the unit+coverage double-run (~9.5s) are noted as separate follow-ups. Existing toolchain arg-pins updated; blind-authored test (incremental-gate.test.ts, 5). Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 15 ++++ plugins/claude-code/dist/clad.js | 2 +- spec.yaml | 6 +- spec/attestation.yaml | 23 +++--- .../incremental-ts-gate-bfe14aac.yaml | 33 ++++++++ spec/index.yaml | 1 + src/stages/toolchain/detect.ts | 11 ++- tests/stages/incremental-gate.test.ts | 77 +++++++++++++++++++ tests/stages/toolchain.test.ts | 6 +- 9 files changed, 154 insertions(+), 20 deletions(-) create mode 100644 spec/features/incremental-ts-gate-bfe14aac.yaml create mode 100644 tests/stages/incremental-gate.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index de079971..9de56161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,21 @@ Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- **Incremental TS gate — tsc `--incremental` + eslint `--cache`** (`F-bfe14aac`) — the + TypeScript type and lint gates re-ran from scratch every time. They now reuse a build + cache: `tsc --noEmit --incremental` (build-info file) and `eslint --cache`, both written + under `.cladding/cache/` (already gitignored, so the managed project's tree stays clean). + On an unchanged re-run — the local pre-commit/pre-push loop — measured on cladding's own + repo: **tsc 2.7s → 1.1s, eslint 2.5s → 0.6s (~3.4s saved)**. **Sound, not a shortcut:** a + newly-introduced type error is still caught with a stale build-info present (verified — + `tsc --incremental` rebuilds the affected program slice; `eslint --cache` keys on + file+config hash). Cold runs (fresh CI checkout) just rebuild the cache — no regression. + Test execution is deliberately **not** scoped — a gate must run the whole suite, so + changed-files/test-selection (unsound for a gate) was intentionally avoided. + + ## [0.7.0] — 2026-07-01 — Knowledge Graph ### Knowledge graph (spec↔code↔doc) diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 52afbb20..5a97191a 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -232,7 +232,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu `,LF:` `,concatBytes:cO},g_e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},y_e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:g_e}});import{Buffer as __e}from"node:buffer";var RG,v_e,CG,b_e,S_e,DG,NG=y(()=>{Br();RG=(t,e)=>t?void 0:v_e.bind(void 0,e),v_e=function*(t,e){if(typeof e!="string"&&!Mt(e)&&!__e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},CG=(t,e)=>t?b_e.bind(void 0,e):S_e.bind(void 0,e),b_e=function*(t,e){DG(t,e),yield e},S_e=function*(t,e){if(DG(t,e),typeof e!="string"&&!Mt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},DG=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as w_e}from"node:buffer";import{StringDecoder as x_e}from"node:string_decoder";var y_,$_e,k_e,E_e,uO=y(()=>{Br();y_=(t,e,r)=>{if(r)return;if(t)return{transform:$_e.bind(void 0,new TextEncoder)};let n=new x_e(e);return{transform:k_e.bind(void 0,n),final:E_e.bind(void 0,n)}},$_e=function*(t,e){w_e.isBuffer(e)?yield Vi(e):typeof e=="string"?yield t.encode(e):yield e},k_e=function*(t,e){yield Mt(e)?t.write(e):e},E_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as jG}from"node:util";var dO,__,MG,A_e,FG,T_e,zG=y(()=>{dO=jG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),__=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=T_e}=e[r];for await(let i of n(t))yield*__(i,e,r+1)},MG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*A_e(r,Number(e),t)},A_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*__(n,r,e+1)},FG=jG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),T_e=function*(t){yield t}});var fO,LG,ea,Jd,O_e,I_e,pO=y(()=>{fO=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},LG=(t,e)=>[...e.flatMap(r=>[...ea(r,t,0)]),...Jd(t)],ea=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=I_e}=e[r];for(let i of n(t))yield*ea(i,e,r+1)},Jd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*O_e(r,Number(e),t)},O_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ea(n,r,e+1)},I_e=function*(t){yield t}});import{Transform as P_e,getDefaultHighWaterMark as UG}from"node:stream";var mO,v_,qG,b_=y(()=>{dr();g_();NG();uO();zG();pO();mO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=qG(t,s,o),l=Qs(e),u=Qs(r),d=l?dO.bind(void 0,__,a):fO.bind(void 0,ea),f=l||u?dO.bind(void 0,MG,a):fO.bind(void 0,Jd),p=l||u?FG.bind(void 0,a):void 0;return{stream:new P_e({writableObjectMode:n,writableHighWaterMark:UG(n),readableObjectMode:i,readableHighWaterMark:UG(i),transform(h,g,v){d([h,c,0],this,v)},flush(h){f([c],this,h)},destroy:p})}},v_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=qG(s,r,a);t=LG(c,t)}return t},qG=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:RG(n,a)},y_(r,s,n),h_(r,o,n,c),{transform:t,final:e},{transform:CG(i,a)},PG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var BG,R_e,C_e,D_e,N_e,HG=y(()=>{b_();Br();dr();BG=(t,e)=>{for(let r of R_e(t))C_e(t,r,e)},R_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),C_e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Lo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>D_e(a,n));r.input=Dd(s)},D_e=(t,e)=>{let r=v_(t,e,"utf8",!0);return N_e(r),Dd(r)},N_e=t=>{let e=t.find(r=>typeof r!="string"&&!Mt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var S_,j_e,M_e,ZG,GG,F_e,VG,hO=y(()=>{Ks();dr();Sc();jo();S_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&bc(r,n)&&!Hr.has(e)&&j_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&M_e.has(o))||t.every(({type:i})=>pn.has(i))),j_e=t=>t===1||t===2,M_e=new Set(["pipe","overlapped"]),ZG=async(t,e,r,n)=>{for await(let i of t)F_e(e)||VG(i,r,n)},GG=(t,e,r)=>{for(let n of t)VG(n,e,r)},F_e=t=>t._readableState.pipes.length>0,VG=(t,e,r)=>{let n=by(t);li({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as z_e,appendFileSync as L_e}from"node:fs";var WG,U_e,q_e,B_e,H_e,Z_e,KG=y(()=>{hO();b_();g_();Br();dr();Xs();WG=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>U_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},U_e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=CZ(t,o,d),p=Vi(f),{stdioItems:m,objectMode:h}=e[r],g=q_e([p],m,c,n),{serializedResult:v,finalResult:_=v}=B_e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});H_e({serializedResult:v,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&Z_e(v,m,i),S}catch(w){return n.error=w,S}},q_e=(t,e,r,n)=>{try{return v_(t,e,r,!1)}catch(i){return n.error=i,t}},B_e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Dd(t)};let s=x6(t,r);return n[o]?{serializedResult:s,finalResult:lO(s,!i[o],e)}:{serializedResult:s}},H_e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!S_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=lO(t,!1,s);try{GG(a,e,n)}catch(c){r.error??=c}},Z_e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>f_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?L_e(n,t):(r.add(o),z_e(n,t))}}});var JG,YG=y(()=>{Br();Kd();JG=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Xi(e,r,"all")]:Array.isArray(e)?[Xi(t,r,"all"),...e]:Mt(t)&&Mt(e)?iT([t,e]):`${t}${e}`}});import{once as gO}from"node:events";var XG,G_e,QG,e9,V_e,yO,_O=y(()=>{Vs();XG=async(t,e)=>{let[r,n]=await G_e(t);return e.isForcefullyTerminated??=!1,[r,n]},G_e=async t=>{let[e,r]=await Promise.allSettled([gO(t,"spawn"),gO(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?QG(t):r.value},QG=async t=>{try{return await gO(t,"exit")}catch{return QG(t)}},e9=async t=>{let[e,r]=await t;if(!V_e(e,r)&&yO(e,r))throw new Mn;return[e,r]},V_e=(t,e)=>t===void 0&&e===void 0,yO=(t,e)=>t!==0||e!==null});var t9,W_e,r9=y(()=>{Vs();Xs();_O();t9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=W_e(t,e,r),s=o?.code==="ETIMEDOUT",a=RZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},W_e=(t,e,r)=>t!==void 0?t:yO(e,r)?new Mn:void 0});import{spawnSync as K_e}from"node:child_process";var n9,J_e,Y_e,X_e,w_,Q_e,eve,tve,rve,i9=y(()=>{pT();UT();qT();Wd();l_();TG();Kd();HG();KG();Xs();YG();r9();n9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=J_e(t,e,r),d=Q_e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Rc(d,c,l)},J_e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),a=Y_e(r),{file:c,commandArguments:l,options:u}=Jy(t,e,a);X_e(u);let d=EG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Y_e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,X_e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&w_("ipcInput"),t&&w_("ipc: true"),r&&w_("detached: true"),n&&w_("cancelSignal")},w_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Q_e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=eve({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=t9(c,r),{output:m,error:h=l}=WG({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>Xi(_,r,S)),v=Xi(JG(m,r),r,"all");return rve({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:v,options:r,command:n,escapedCommand:i,startTime:a})},eve=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{BG(o,r);let a=tve(r);return K_e(...Yy(t,e,a))}catch(a){return Pc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},tve=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:a_(e)}),rve=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?c_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Vd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as vO,on as nve}from"node:events";var o9,ive,ove,sve,ave,s9=y(()=>{Ec();qd();Ud();o9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>($c({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),ive({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),ive=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{jy(e,i);let o=zo(t,e,r),s=new AbortController;try{return await Promise.race([ove(o,n,s),sve(o,r,s),ave(o,r,s)])}catch(a){throw kc(t),a}finally{s.abort(),My(e,i)}},ove=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await vO(t,"message",{signal:r});return n}for await(let[n]of nve(t,"message",{signal:r}))if(e(n))return n},sve=async(t,e,{signal:r})=>{await vO(t,"disconnect",{signal:r}),yH(e)},ave=async(t,e,{signal:r})=>{let[n]=await vO(t,"strict:error",{signal:r});throw Ry(n,e)}});import{once as c9,on as cve}from"node:events";var l9,bO,lve,uve,dve,a9,SO=y(()=>{Ec();qd();Ud();l9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>bO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),bO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{$c({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),jy(e,o);let s=zo(t,e,r),a=new AbortController,c={};return lve(t,s,a),uve({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),dve({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},lve=async(t,e,r)=>{try{await c9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},uve=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await c9(t,"strict:error",{signal:r.signal});n.error=Ry(i,e),r.abort()}catch{}},dve=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of cve(r,"message",{signal:o.signal}))a9(s),yield c}catch{a9(s)}finally{o.abort(),My(e,a),n||kc(t),i&&await t}},a9=({error:t})=>{if(t)throw t}});import u9 from"node:process";var d9,f9,p9,wO=y(()=>{Wy();s9();SO();Uy();d9=(t,{ipc:e})=>{Object.assign(t,p9(t,!1,e))},f9=()=>{let t=u9,e=!0,r=u9.channel!==void 0;return{...p9(t,e,r),getCancelSignal:ZH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},p9=(t,e,r)=>({sendMessage:Vy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:o9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:l9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as fve}from"node:child_process";import{PassThrough as pve,Readable as mve,Writable as hve,Duplex as gve}from"node:stream";var m9,yve,Yd,_ve,vve,bve,Sve,h9=y(()=>{m_();Wd();l_();m9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{sO(n);let a=new fve;yve(a,n),Object.assign(a,{readable:_ve,writable:vve,duplex:bve});let c=Pc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Sve(c,s,i);return{subprocess:a,promise:l}},yve=(t,e)=>{let r=Yd(),n=Yd(),i=Yd(),o=Array.from({length:e.length-3},Yd),s=Yd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Yd=()=>{let t=new pve;return t.end(),t},_ve=()=>new mve({read(){}}),vve=()=>new hve({write(){}}),bve=()=>new gve({read(){},write(){}}),Sve=async(t,e,r)=>Rc(t,e,r)});import{createReadStream as g9,createWriteStream as y9}from"node:fs";import{Buffer as wve}from"node:buffer";import{Readable as Xd,Writable as xve,Duplex as $ve}from"node:stream";var v9,Qd,_9,kve,b9=y(()=>{b_();m_();dr();v9=(t,e)=>p_(kve,t,e,!1),Qd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Lo[t]}.`)},_9={fileNumber:Qd,generator:mO,asyncGenerator:mO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:$ve.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},kve={input:{..._9,fileUrl:({value:t})=>({stream:g9(t)}),filePath:({value:{file:t}})=>({stream:g9(t)}),webStream:({value:t})=>({stream:Xd.fromWeb(t)}),iterable:({value:t})=>({stream:Xd.from(t)}),asyncIterable:({value:t})=>({stream:Xd.from(t)}),string:({value:t})=>({stream:Xd.from(t)}),uint8Array:({value:t})=>({stream:Xd.from(wve.from(t))})},output:{..._9,fileUrl:({value:t})=>({stream:y9(t)}),filePath:({value:{file:t,append:e}})=>({stream:y9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:xve.fromWeb(t)}),iterable:Qd,asyncIterable:Qd,string:Qd,uint8Array:Qd}}});import{on as Eve,once as S9}from"node:events";import{PassThrough as Ave,getDefaultHighWaterMark as Tve}from"node:stream";import{finished as $9}from"node:stream/promises";function ta(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)$O(i);let e=t.some(({readableObjectMode:i})=>i),r=Ove(t,e),n=new xO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Ove,xO,Ive,Pve,Rve,$O,Cve,Dve,Nve,jve,Mve,k9,E9,kO,A9,Fve,x_,w9,x9,$_=y(()=>{Ove=(t,e)=>{if(t.length===0)return Tve(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},xO=class extends Ave{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if($O(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Ive(this,this.#t,this.#o);let r=Cve({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if($O(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},Ive=async(t,e,r)=>{x_(t,w9);let n=new AbortController;try{await Promise.race([Pve(t,n),Rve(t,e,r,n)])}finally{n.abort(),x_(t,-w9)}},Pve=async(t,{signal:e})=>{try{await $9(t,{signal:e,cleanup:!0})}catch(r){throw k9(t,r),r}},Rve=async(t,e,r,{signal:n})=>{for await(let[i]of Eve(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},$O=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Cve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{x_(t,x9);let a=new AbortController;try{await Promise.race([Dve(o,e,a),Nve({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),jve({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),x_(t,-x9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?kO(t):Mve(t))},Dve=async(t,e,{signal:r})=>{try{await t,r.aborted||kO(e)}catch(n){r.aborted||k9(e,n)}},Nve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await $9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;E9(s)?i.add(e):A9(t,s)}},jve=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await S9(t,i,{signal:o}),!t.readable)return S9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},Mve=t=>{t.writable&&t.end()},k9=(t,e)=>{E9(e)?kO(t):A9(t,e)},E9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",kO=t=>{(t.readable||t.writable)&&t.destroy()},A9=(t,e)=>{t.destroyed||(t.once("error",Fve),t.destroy(e))},Fve=()=>{},x_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},w9=2,x9=1});import{finished as T9}from"node:stream/promises";var Dc,zve,EO,Lve,AO,k_=y(()=>{Wi();Dc=(t,e)=>{t.pipe(e),zve(t,e),Lve(t,e)},zve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}EO(e)}},EO=t=>{t.writable&&t.end()},Lve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}AO(t)}},AO=t=>{t.readable&&t.destroy()}});var O9,Uve,qve,Bve,Hve,Zve,I9=y(()=>{$_();Wi();Ny();dr();k_();O9=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>pn.has(c)))Uve(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!pn.has(c)))Bve({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:ta(o);Dc(s,i)}},Uve=(t,e,r,n)=>{r==="output"?Dc(t.stdio[n],e):Dc(e,t.stdio[n]);let i=qve[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},qve=["stdin","stdout","stderr"],Bve=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;Hve(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},Hve=(t,{signal:e})=>{jn(t)&&Ws(t,Zve,e)},Zve=2});var ra,P9=y(()=>{ra=[];ra.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ra.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ra.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var E_,TO,OO,Gve,IO,A_,Vve,PO,RO,CO,R9,ZXe,GXe,C9=y(()=>{P9();E_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",TO=Symbol.for("signal-exit emitter"),OO=globalThis,Gve=Object.defineProperty.bind(Object),IO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(OO[TO])return OO[TO];Gve(OO,TO,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},A_=class{},Vve=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),PO=class extends A_{onExit(){return()=>{}}load(){}unload(){}},RO=class extends A_{#t=CO.platform==="win32"?"SIGINT":"SIGHUP";#r=new IO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of ra)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!E_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of ra)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,ra.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return E_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&E_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},CO=globalThis.process,{onExit:R9,load:ZXe,unload:GXe}=Vve(E_(CO)?new RO(CO):new PO)});import{addAbortListener as Wve}from"node:events";var D9,N9=y(()=>{C9();D9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=R9(()=>{t.kill()});Wve(n,()=>{i()})}});var M9,Kve,Jve,j9,Yve,F9=y(()=>{nT();wy();Fo();_c();M9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=Sy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=Kve(r,n,i),{sourceStream:d,sourceError:f}=Yve(t,l),{options:p,fileDescriptors:m}=di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},Kve=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=Jve(t,e,...r),a=Dy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},Jve=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(j9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||tT(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=uy(r,...n);return{destination:e(j9)(i,o,s),pipeOptions:s}}if(di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},j9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Yve=(t,e)=>{try{return{sourceStream:Tc(t,e)}}catch(r){return{sourceError:r}}}});var L9,Xve,DO,z9,NO=y(()=>{Wd();k_();L9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=Xve({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw DO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},Xve=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return AO(t),n;if(e!==void 0)return EO(r),e},DO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pc({error:t,command:z9,escapedCommand:z9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),z9="source.pipe(destination)"});var U9,q9=y(()=>{U9=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as Qve}from"node:stream/promises";var B9,ebe,tbe,rbe,T_,nbe,ibe,H9=y(()=>{$_();Ny();k_();B9=(t,e,r)=>{let n=T_.has(e)?tbe(t,e):ebe(t,e);return Ws(t,nbe,r.signal),Ws(e,ibe,r.signal),rbe(e),n},ebe=(t,e)=>{let r=ta([t]);return Dc(r,e),T_.set(e,r),r},tbe=(t,e)=>{let r=T_.get(e);return r.add(t),r},rbe=async t=>{try{await Qve(t,{cleanup:!0,readable:!1,writable:!0})}catch{}T_.delete(t)},T_=new WeakMap,nbe=2,ibe=1});import{aborted as obe}from"node:util";var Z9,sbe,G9=y(()=>{NO();Z9=(t,e)=>t===void 0?[]:[sbe(t,e)],sbe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await obe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw DO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var O_,abe,cbe,V9=y(()=>{Gi();F9();NO();q9();H9();G9();O_=(t,...e)=>{if(kt(e[0]))return O_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=M9(t,...e),i=abe({...n,destination:r});return i.pipe=O_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},abe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=cbe(t,i);L9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=B9(e,o,d);return await Promise.race([U9(u),...Z9(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},cbe=(t,e)=>Promise.allSettled([t,e])});import{on as lbe}from"node:events";import{getDefaultHighWaterMark as ube}from"node:stream";var I_,dbe,jO,fbe,K9,MO,W9,pbe,mbe,P_=y(()=>{uO();g_();pO();I_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return dbe(e,s),K9({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},dbe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},jO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;fbe(e,s,t);let a=t.readableObjectMode&&!o;return K9({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},fbe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},K9=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=lbe(t,"data",{signal:e.signal,highWaterMark:W9,highWatermark:W9});return pbe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},MO=ube(!0),W9=MO,pbe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=mbe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ea(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*Jd(a)}},mbe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[y_(t,r,!e),h_(t,i,!n,{})].filter(Boolean)});import{setImmediate as hbe}from"node:timers/promises";var J9,gbe,ybe,_be,FO,Y9,zO=y(()=>{s_();Br();hO();P_();Xs();Kd();J9=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=gbe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([ybe(t),d]);return}let f=aO(c,r),p=jO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([_be({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},gbe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!S_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=jO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await ZG(a,t,r,o)},ybe=async t=>{await hbe(),t.readableFlowing===null&&t.resume()},_be=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await r_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await n_(r,{maxBuffer:o})):await o_(r,{maxBuffer:o})}catch(a){return Y9(OZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},FO=async t=>{try{return await t}catch(e){return Y9(e)}},Y9=({bufferedData:t})=>S6(t)?new Uint8Array(t):t});import{finished as vbe}from"node:stream/promises";var ef,bbe,Sbe,wbe,xbe,$be,LO,R_,X9,C_=y(()=>{ef=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=bbe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],vbe(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||xbe(a,e,r,n)}finally{s.abort()}},bbe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Sbe(t,r,n),n},Sbe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{wbe(e,r),n.call(t,...i)}},wbe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},xbe=(t,e,r,n)=>{if(!$be(t,e,r,n))throw t},$be=(t,e,r,n=!0)=>r.propagating?X9(t)||R_(t):(r.propagating=!0,LO(r,e)===n?X9(t):R_(t)),LO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",R_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",X9=t=>t?.code==="EPIPE"});var Q9,UO,qO=y(()=>{zO();C_();Q9=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>UO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),UO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=ef(t,e,l);if(LO(l,e)){await u;return}let[d]=await Promise.all([J9({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var eV,tV,kbe,Ebe,BO=y(()=>{$_();qO();eV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?ta([t,e].filter(Boolean)):void 0,tV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>UO({...kbe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Ebe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),kbe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Ebe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var rV,nV,iV=y(()=>{Sc();jo();rV=t=>bc(t,"ipc"),nV=(t,e)=>{let r=by(t);li({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var oV,sV,aV=y(()=>{Xs();iV();Ji();SO();oV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=rV(o),a=Ki(e,"ipc"),c=Ki(r,"ipc");for await(let l of bO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(IZ(t,i,c),i.push(l)),s&&nV(l,o);return i},sV=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Abe}from"node:events";var cV,Tbe,Obe,Ibe,lV=y(()=>{Ys();jT();AT();NT();Wi();dr();zO();aV();FT();BO();qO();_O();C_();cV=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:v})=>{let _=XG(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},w=Q9({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),x=tV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),I=[],T=oV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:I,verboseInfo:p}),k=Tbe(h,t,S),C=Obe(m,S);try{return await Promise.race([Promise.all([{},e9(_),Promise.all(w),x,T,tZ(t,d),...k,...C]),g,Ibe(t,v),...JH(t,o,f,v),...gH({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:v}),...WH({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:v})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(w.map(Z=>FO(Z))),FO(x),sV(T,I),Promise.allSettled(k),Promise.allSettled(C)])}},Tbe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:ef(n,i,r)),Obe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>zn(o,{checkOpen:!1})&&!jn(o)).map(({type:i,value:o,stream:s=o})=>ef(s,n,e,{isSameDirection:pn.has(i),stopOnExit:i==="native"}))),Ibe=async(t,{signal:e})=>{let[r]=await Abe(t,"error",{signal:e});throw r}});var uV,tf,Nc,D_=y(()=>{Ac();uV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),tf=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ui();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Nc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as dV}from"node:stream/promises";var HO,fV,ZO,GO,N_,j_,VO=y(()=>{C_();HO=async t=>{if(t!==void 0)try{await ZO(t)}catch{}},fV=async t=>{if(t!==void 0)try{await GO(t)}catch{}},ZO=async t=>{await dV(t,{cleanup:!0,readable:!1,writable:!0})},GO=async t=>{await dV(t,{cleanup:!0,readable:!0,writable:!1})},N_=async(t,e)=>{if(await t,e)throw e},j_=(t,e,r)=>{r&&!R_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Pbe}from"node:stream";import{callbackify as Rbe}from"node:util";var pV,WO,KO,JO,Cbe,YO,XO,mV,QO=y(()=>{Ks();Fo();P_();Ac();D_();VO();pV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Hr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=WO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=KO(a,s),{read:f,onStdoutDataDone:p}=JO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Pbe({read:f,destroy:Rbe(XO.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return YO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},WO=(t,e,r)=>{let n=Tc(t,e),i=tf(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},KO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:MO},JO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ui(),s=I_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Cbe(this,s,o)},onStdoutDataDone:o}},Cbe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},YO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await GO(t),await n,await HO(i),await e,r.readable&&r.push(null)}catch(o){await HO(i),mV(r,o)}},XO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Nc(r,e)&&(mV(t,n),await N_(e,n))},mV=(t,e)=>{j_(t,t.readable,e)}});import{Writable as Dbe}from"node:stream";import{callbackify as hV}from"node:util";var gV,eI,tI,Nbe,jbe,rI,nI,yV,iI=y(()=>{Fo();D_();VO();gV=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=eI(t,r,e),s=new Dbe({...tI(n,t,i),destroy:hV(nI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return rI(n,s),s},eI=(t,e,r)=>{let n=Dy(t,e),i=tf(r,n,"writableFinal"),o=tf(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},tI=(t,e,r)=>({write:Nbe.bind(void 0,t),final:hV(jbe.bind(void 0,t,e,r))}),Nbe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},jbe=async(t,e,r)=>{await Nc(r,e)&&(t.writable&&t.end(),await e)},rI=async(t,e,r)=>{try{await ZO(t),e.writable&&e.end()}catch(n){await fV(r),yV(e,n)}},nI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Nc(r,e),await Nc(n,e)&&(yV(t,i),await N_(e,i))},yV=(t,e)=>{j_(t,t.writable,e)}});import{Duplex as Mbe}from"node:stream";import{callbackify as Fbe}from"node:util";var _V,zbe,vV=y(()=>{Ks();QO();iI();_V=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Hr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=WO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=eI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=KO(c,a),{read:g,onStdoutDataDone:v}=JO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Mbe({read:g,...tI(u,t,d),destroy:Fbe(zbe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return YO({subprocessStdout:c,onStdoutDataDone:v,readable:_,subprocess:t,subprocessStdin:u}),rI(u,_,c),_},zbe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([XO({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),nI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var oI,Lbe,bV=y(()=>{Ks();Fo();P_();oI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Hr.has(e),s=Tc(t,r),a=I_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Lbe(a,s,t)},Lbe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var SV,wV=y(()=>{D_();QO();iI();vV();bV();SV=(t,{encoding:e})=>{let r=uV();t.readable=pV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=gV.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=_V.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=oI.bind(void 0,t,e),t[Symbol.asyncIterator]=oI.bind(void 0,t,e,{})}});var xV,Ube,qbe,$V=y(()=>{xV=(t,e)=>{for(let[r,n]of qbe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Ube=(async()=>{})().constructor.prototype,qbe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Ube,t)])});import{setMaxListeners as Bbe}from"node:events";import{spawn as Hbe}from"node:child_process";var kV,Zbe,Gbe,Vbe,Wbe,Kbe,EV=y(()=>{s_();pT();UT();Fo();qT();wO();Wd();l_();h9();b9();Kd();I9();Iy();N9();V9();BO();lV();wV();Ac();$V();kV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Zbe(t,e,r),{subprocess:f,promise:p}=Vbe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=O_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),xV(f,p),di.set(f,{options:u,fileDescriptors:d}),f},Zbe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),{file:a,commandArguments:c,options:l}=Jy(t,e,r),u=Gbe(l),d=v9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Gbe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},Vbe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Hbe(...Yy(t,e,r))}catch(m){return m9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Bbe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];O9(c,a,l),D9(c,r,l);let d={},f=ui();c.kill=mH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=eV(c,r),SV(c,r),d9(c,r);let p=Wbe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Wbe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await cV({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let v=m.map((w,x)=>Xi(w,e,x)),_=Xi(h,e,"all"),S=Kbe({errorInfo:d,exitCode:f,signal:p,stdio:v,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Rc(S,n,e)},Kbe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Vd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof fi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):c_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var M_,Jbe,Ybe,AV=y(()=>{Gi();Ji();M_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Jbe(n,t[n],i)]));return{...t,...r}},Jbe=(t,e,r)=>Ybe.has(t)&&kt(e)&&kt(r)?{...e,...r}:r,Ybe=new Set(["env",...cT])});var Uo,Xbe,Qbe,TV=y(()=>{Gi();nT();O6();i9();EV();AV();Uo=(t,e,r,n)=>{let i=(s,a,c)=>Uo(s,a,r,c),o=(...s)=>Xbe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},Xbe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(kt(o))return i(t,M_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=Qbe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?n9(a,c,l):kV(a,c,l,i)},Qbe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=A6(e)?T6(e,r):[e,...r],[s,a,c]=uy(...o),l=M_(M_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var OV,IV,PV,eSe,tSe,RV=y(()=>{OV=({file:t,commandArguments:e})=>PV(t,e),IV=({file:t,commandArguments:e})=>({...PV(t,e),isSync:!0}),PV=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=eSe(t);return{file:r,commandArguments:n}},eSe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(tSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},tSe=/ +/g});var CV,DV,rSe,NV,nSe,jV,MV=y(()=>{CV=(t,e,r)=>{t.sync=e(rSe,r),t.s=t.sync},DV=({options:t})=>NV(t),rSe=({options:t})=>({...NV(t),isSync:!0}),NV=t=>({options:{...nSe(t),...t}}),nSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},jV={preferLocal:!0}});var Met,Qe,Fet,zet,Let,Uet,qet,Bet,Het,Zet,Ar=y(()=>{TV();RV();MT();MV();wO();Met=Uo(()=>({})),Qe=Uo(()=>({isSync:!0})),Fet=Uo(OV),zet=Uo(IV),Let=Uo(XH),Uet=Uo(DV,{},jV,CV),{sendMessage:qet,getOneMessage:Bet,getEachMessage:Het,getCancelSignal:Zet}=f9()});import{existsSync as F_,statSync as iSe}from"node:fs";import{dirname as sI,extname as oSe,isAbsolute as FV,join as aI,relative as cI,resolve as z_,sep as sSe}from"node:path";function L_(t){return t==="./gradlew"||t==="gradle"}function aSe(t){return(F_(aI(t,"build.gradle.kts"))||F_(aI(t,"build.gradle")))&&F_(aI(t,"gradle.properties"))}function cSe(t,e){let n=cI(t,e).split(sSe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function qo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function lSe(t,e){let r=z_(t,e),n=r;F_(r)?iSe(r).isFile()&&(n=sI(r)):oSe(r)!==""&&(n=sI(r));let i=cI(t,n);if(i.startsWith("..")||FV(i))return null;let o=n;for(;;){if(aSe(o))return o;if(z_(o)===z_(t))return null;let s=sI(o);if(s===o)return null;let a=cI(t,s);if(a.startsWith("..")||FV(a))return null;o=s}}function U_(t,e){let r=z_(t),n=new Map,i=[];for(let o of e){let s=lSe(r,o);if(!s){i.push(o);continue}let a=cSe(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var q_=y(()=>{"use strict"});import{existsSync as uSe,readFileSync as dSe}from"node:fs";import{join as fSe}from"node:path";function jc(t="."){let e=fSe(t,".cladding","config.yaml");if(!uSe(e))return lI;try{let n=(0,zV.parse)(dSe(e,"utf8"))?.gate;if(!n)return lI;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of pSe){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return lI}}function LV(t,e){let r=[],n=!1;for(let i of t){let o=mSe.exec(i);if(o){n=!0;for(let s of e)r.push(qo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var zV,pSe,lI,mSe,B_=y(()=>{"use strict";zV=$t(rr(),1);q_();pSe=["type","lint","test","coverage"],lI={scope:"feature"};mSe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as dI,readFileSync as UV,readdirSync as hSe,statSync as gSe}from"node:fs";import{join as H_}from"node:path";function mI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=H_(t,e);if(dI(r))try{if(qV.test(UV(r,"utf8")))return!0}catch{}}return!1}function BV(t){try{return dI(t)&&qV.test(UV(t,"utf8"))}catch{return!1}}function HV(t,e=0){if(e>4||!dI(t))return!1;let r;try{r=hSe(t)}catch{return!1}for(let n of r){let i=H_(t,n),o=!1;try{o=gSe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(HV(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&BV(i))return!0}return!1}function vSe(t){if(mI(t))return!0;for(let e of ySe)if(BV(H_(t,e)))return!0;for(let e of _Se)if(HV(H_(t,e)))return!0;return!1}function ZV(t="."){let e=jc(t).coverage;return e||(vSe(t)?"kover":"jacoco")}function GV(t="."){return fI[ZV(t)]}function VV(t="."){return uI[ZV(t)]}var fI,uI,pI,qV,ySe,_Se,Z_=y(()=>{"use strict";B_();fI={kover:"koverXmlReport",jacoco:"jacocoTestReport"},uI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},pI=[uI.kover,uI.jacoco],qV=/kover/i;ySe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],_Se=["buildSrc","build-logic"]});import{existsSync as hI,readdirSync as WV}from"node:fs";import{join as G_}from"node:path";function gI(t){return hI(G_(t,"gradlew"))?"./gradlew":"gradle"}function bSe(t){let e=gI(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[GV(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function wSe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function kSe(t,e){for(let r of e)if(hI(G_(t,r)))return r}function ESe(t,e){try{return WV(t).find(n=>n.endsWith(e))}catch{return}}function TSe(t,e){for(let r of ASe)if(r.configs.some(n=>hI(G_(t,n))))return r.gate;return e}function pt(t="."){for(let e of xSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=ESe(t,o):r=kSe(t,[o]),r)break;if(!r||e.requiresSource&&!wSe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:TSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return $Se}var SSe,xSe,$Se,ASe,mn=y(()=>{"use strict";Z_();SSe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);xSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit"]},lint:{cmd:"npx",args:["--no-install","eslint","."]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:bSe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],$Se={language:"unknown",manifest:"",gates:{}};ASe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as OSe,readFileSync as ISe}from"node:fs";import{join as PSe}from"node:path";function rf(t){return t.code==="ENOENT"}function V_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return KV.test(o)||KV.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Ft(t,e,r){return rf(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function nr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Mc(t,e){let r=PSe(t,"package.json");if(!OSe(r))return!1;try{return!!JSON.parse(ISe(r,"utf8")).scripts?.[e]}catch{return!1}}var KV,hn=y(()=>{"use strict";KV=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function RSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;if(!n)return[{detector:W_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Qe(n.cmd,[...n.args],{cwd:e,reject:!1});return rf(i)?[{detector:W_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:V_(i,W_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var W_,K_,yI=y(()=>{"use strict";Ar();mn();hn();W_="ARCHITECTURE_VIOLATION";K_={name:W_,run:RSe}});import JV from"node:process";function na(t={}){let r=K_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:CSe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` + if (condition) { yield value; }`)}});import{Buffer as w_e}from"node:buffer";import{StringDecoder as x_e}from"node:string_decoder";var y_,$_e,k_e,E_e,uO=y(()=>{Br();y_=(t,e,r)=>{if(r)return;if(t)return{transform:$_e.bind(void 0,new TextEncoder)};let n=new x_e(e);return{transform:k_e.bind(void 0,n),final:E_e.bind(void 0,n)}},$_e=function*(t,e){w_e.isBuffer(e)?yield Vi(e):typeof e=="string"?yield t.encode(e):yield e},k_e=function*(t,e){yield Mt(e)?t.write(e):e},E_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as jG}from"node:util";var dO,__,MG,A_e,FG,T_e,zG=y(()=>{dO=jG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),__=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=T_e}=e[r];for await(let i of n(t))yield*__(i,e,r+1)},MG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*A_e(r,Number(e),t)},A_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*__(n,r,e+1)},FG=jG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),T_e=function*(t){yield t}});var fO,LG,ea,Jd,O_e,I_e,pO=y(()=>{fO=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},LG=(t,e)=>[...e.flatMap(r=>[...ea(r,t,0)]),...Jd(t)],ea=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=I_e}=e[r];for(let i of n(t))yield*ea(i,e,r+1)},Jd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*O_e(r,Number(e),t)},O_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ea(n,r,e+1)},I_e=function*(t){yield t}});import{Transform as P_e,getDefaultHighWaterMark as UG}from"node:stream";var mO,v_,qG,b_=y(()=>{dr();g_();NG();uO();zG();pO();mO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=qG(t,s,o),l=Qs(e),u=Qs(r),d=l?dO.bind(void 0,__,a):fO.bind(void 0,ea),f=l||u?dO.bind(void 0,MG,a):fO.bind(void 0,Jd),p=l||u?FG.bind(void 0,a):void 0;return{stream:new P_e({writableObjectMode:n,writableHighWaterMark:UG(n),readableObjectMode:i,readableHighWaterMark:UG(i),transform(h,g,v){d([h,c,0],this,v)},flush(h){f([c],this,h)},destroy:p})}},v_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=qG(s,r,a);t=LG(c,t)}return t},qG=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:RG(n,a)},y_(r,s,n),h_(r,o,n,c),{transform:t,final:e},{transform:CG(i,a)},PG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var BG,R_e,C_e,D_e,N_e,HG=y(()=>{b_();Br();dr();BG=(t,e)=>{for(let r of R_e(t))C_e(t,r,e)},R_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),C_e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Lo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>D_e(a,n));r.input=Dd(s)},D_e=(t,e)=>{let r=v_(t,e,"utf8",!0);return N_e(r),Dd(r)},N_e=t=>{let e=t.find(r=>typeof r!="string"&&!Mt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var S_,j_e,M_e,ZG,GG,F_e,VG,hO=y(()=>{Ks();dr();Sc();jo();S_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&bc(r,n)&&!Hr.has(e)&&j_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&M_e.has(o))||t.every(({type:i})=>pn.has(i))),j_e=t=>t===1||t===2,M_e=new Set(["pipe","overlapped"]),ZG=async(t,e,r,n)=>{for await(let i of t)F_e(e)||VG(i,r,n)},GG=(t,e,r)=>{for(let n of t)VG(n,e,r)},F_e=t=>t._readableState.pipes.length>0,VG=(t,e,r)=>{let n=by(t);li({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as z_e,appendFileSync as L_e}from"node:fs";var WG,U_e,q_e,B_e,H_e,Z_e,KG=y(()=>{hO();b_();g_();Br();dr();Xs();WG=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>U_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},U_e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=CZ(t,o,d),p=Vi(f),{stdioItems:m,objectMode:h}=e[r],g=q_e([p],m,c,n),{serializedResult:v,finalResult:_=v}=B_e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});H_e({serializedResult:v,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&Z_e(v,m,i),S}catch(w){return n.error=w,S}},q_e=(t,e,r,n)=>{try{return v_(t,e,r,!1)}catch(i){return n.error=i,t}},B_e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Dd(t)};let s=x6(t,r);return n[o]?{serializedResult:s,finalResult:lO(s,!i[o],e)}:{serializedResult:s}},H_e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!S_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=lO(t,!1,s);try{GG(a,e,n)}catch(c){r.error??=c}},Z_e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>f_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?L_e(n,t):(r.add(o),z_e(n,t))}}});var JG,YG=y(()=>{Br();Kd();JG=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Xi(e,r,"all")]:Array.isArray(e)?[Xi(t,r,"all"),...e]:Mt(t)&&Mt(e)?iT([t,e]):`${t}${e}`}});import{once as gO}from"node:events";var XG,G_e,QG,e9,V_e,yO,_O=y(()=>{Vs();XG=async(t,e)=>{let[r,n]=await G_e(t);return e.isForcefullyTerminated??=!1,[r,n]},G_e=async t=>{let[e,r]=await Promise.allSettled([gO(t,"spawn"),gO(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?QG(t):r.value},QG=async t=>{try{return await gO(t,"exit")}catch{return QG(t)}},e9=async t=>{let[e,r]=await t;if(!V_e(e,r)&&yO(e,r))throw new Mn;return[e,r]},V_e=(t,e)=>t===void 0&&e===void 0,yO=(t,e)=>t!==0||e!==null});var t9,W_e,r9=y(()=>{Vs();Xs();_O();t9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=W_e(t,e,r),s=o?.code==="ETIMEDOUT",a=RZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},W_e=(t,e,r)=>t!==void 0?t:yO(e,r)?new Mn:void 0});import{spawnSync as K_e}from"node:child_process";var n9,J_e,Y_e,X_e,w_,Q_e,eve,tve,rve,i9=y(()=>{pT();UT();qT();Wd();l_();TG();Kd();HG();KG();Xs();YG();r9();n9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=J_e(t,e,r),d=Q_e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Rc(d,c,l)},J_e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),a=Y_e(r),{file:c,commandArguments:l,options:u}=Jy(t,e,a);X_e(u);let d=EG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Y_e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,X_e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&w_("ipcInput"),t&&w_("ipc: true"),r&&w_("detached: true"),n&&w_("cancelSignal")},w_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Q_e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=eve({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=t9(c,r),{output:m,error:h=l}=WG({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>Xi(_,r,S)),v=Xi(JG(m,r),r,"all");return rve({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:v,options:r,command:n,escapedCommand:i,startTime:a})},eve=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{BG(o,r);let a=tve(r);return K_e(...Yy(t,e,a))}catch(a){return Pc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},tve=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:a_(e)}),rve=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?c_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Vd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as vO,on as nve}from"node:events";var o9,ive,ove,sve,ave,s9=y(()=>{Ec();qd();Ud();o9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>($c({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),ive({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),ive=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{jy(e,i);let o=zo(t,e,r),s=new AbortController;try{return await Promise.race([ove(o,n,s),sve(o,r,s),ave(o,r,s)])}catch(a){throw kc(t),a}finally{s.abort(),My(e,i)}},ove=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await vO(t,"message",{signal:r});return n}for await(let[n]of nve(t,"message",{signal:r}))if(e(n))return n},sve=async(t,e,{signal:r})=>{await vO(t,"disconnect",{signal:r}),yH(e)},ave=async(t,e,{signal:r})=>{let[n]=await vO(t,"strict:error",{signal:r});throw Ry(n,e)}});import{once as c9,on as cve}from"node:events";var l9,bO,lve,uve,dve,a9,SO=y(()=>{Ec();qd();Ud();l9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>bO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),bO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{$c({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),jy(e,o);let s=zo(t,e,r),a=new AbortController,c={};return lve(t,s,a),uve({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),dve({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},lve=async(t,e,r)=>{try{await c9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},uve=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await c9(t,"strict:error",{signal:r.signal});n.error=Ry(i,e),r.abort()}catch{}},dve=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of cve(r,"message",{signal:o.signal}))a9(s),yield c}catch{a9(s)}finally{o.abort(),My(e,a),n||kc(t),i&&await t}},a9=({error:t})=>{if(t)throw t}});import u9 from"node:process";var d9,f9,p9,wO=y(()=>{Wy();s9();SO();Uy();d9=(t,{ipc:e})=>{Object.assign(t,p9(t,!1,e))},f9=()=>{let t=u9,e=!0,r=u9.channel!==void 0;return{...p9(t,e,r),getCancelSignal:ZH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},p9=(t,e,r)=>({sendMessage:Vy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:o9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:l9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as fve}from"node:child_process";import{PassThrough as pve,Readable as mve,Writable as hve,Duplex as gve}from"node:stream";var m9,yve,Yd,_ve,vve,bve,Sve,h9=y(()=>{m_();Wd();l_();m9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{sO(n);let a=new fve;yve(a,n),Object.assign(a,{readable:_ve,writable:vve,duplex:bve});let c=Pc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Sve(c,s,i);return{subprocess:a,promise:l}},yve=(t,e)=>{let r=Yd(),n=Yd(),i=Yd(),o=Array.from({length:e.length-3},Yd),s=Yd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Yd=()=>{let t=new pve;return t.end(),t},_ve=()=>new mve({read(){}}),vve=()=>new hve({write(){}}),bve=()=>new gve({read(){},write(){}}),Sve=async(t,e,r)=>Rc(t,e,r)});import{createReadStream as g9,createWriteStream as y9}from"node:fs";import{Buffer as wve}from"node:buffer";import{Readable as Xd,Writable as xve,Duplex as $ve}from"node:stream";var v9,Qd,_9,kve,b9=y(()=>{b_();m_();dr();v9=(t,e)=>p_(kve,t,e,!1),Qd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Lo[t]}.`)},_9={fileNumber:Qd,generator:mO,asyncGenerator:mO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:$ve.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},kve={input:{..._9,fileUrl:({value:t})=>({stream:g9(t)}),filePath:({value:{file:t}})=>({stream:g9(t)}),webStream:({value:t})=>({stream:Xd.fromWeb(t)}),iterable:({value:t})=>({stream:Xd.from(t)}),asyncIterable:({value:t})=>({stream:Xd.from(t)}),string:({value:t})=>({stream:Xd.from(t)}),uint8Array:({value:t})=>({stream:Xd.from(wve.from(t))})},output:{..._9,fileUrl:({value:t})=>({stream:y9(t)}),filePath:({value:{file:t,append:e}})=>({stream:y9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:xve.fromWeb(t)}),iterable:Qd,asyncIterable:Qd,string:Qd,uint8Array:Qd}}});import{on as Eve,once as S9}from"node:events";import{PassThrough as Ave,getDefaultHighWaterMark as Tve}from"node:stream";import{finished as $9}from"node:stream/promises";function ta(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)$O(i);let e=t.some(({readableObjectMode:i})=>i),r=Ove(t,e),n=new xO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Ove,xO,Ive,Pve,Rve,$O,Cve,Dve,Nve,jve,Mve,k9,E9,kO,A9,Fve,x_,w9,x9,$_=y(()=>{Ove=(t,e)=>{if(t.length===0)return Tve(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},xO=class extends Ave{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if($O(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Ive(this,this.#t,this.#o);let r=Cve({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if($O(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},Ive=async(t,e,r)=>{x_(t,w9);let n=new AbortController;try{await Promise.race([Pve(t,n),Rve(t,e,r,n)])}finally{n.abort(),x_(t,-w9)}},Pve=async(t,{signal:e})=>{try{await $9(t,{signal:e,cleanup:!0})}catch(r){throw k9(t,r),r}},Rve=async(t,e,r,{signal:n})=>{for await(let[i]of Eve(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},$O=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Cve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{x_(t,x9);let a=new AbortController;try{await Promise.race([Dve(o,e,a),Nve({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),jve({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),x_(t,-x9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?kO(t):Mve(t))},Dve=async(t,e,{signal:r})=>{try{await t,r.aborted||kO(e)}catch(n){r.aborted||k9(e,n)}},Nve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await $9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;E9(s)?i.add(e):A9(t,s)}},jve=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await S9(t,i,{signal:o}),!t.readable)return S9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},Mve=t=>{t.writable&&t.end()},k9=(t,e)=>{E9(e)?kO(t):A9(t,e)},E9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",kO=t=>{(t.readable||t.writable)&&t.destroy()},A9=(t,e)=>{t.destroyed||(t.once("error",Fve),t.destroy(e))},Fve=()=>{},x_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},w9=2,x9=1});import{finished as T9}from"node:stream/promises";var Dc,zve,EO,Lve,AO,k_=y(()=>{Wi();Dc=(t,e)=>{t.pipe(e),zve(t,e),Lve(t,e)},zve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}EO(e)}},EO=t=>{t.writable&&t.end()},Lve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}AO(t)}},AO=t=>{t.readable&&t.destroy()}});var O9,Uve,qve,Bve,Hve,Zve,I9=y(()=>{$_();Wi();Ny();dr();k_();O9=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>pn.has(c)))Uve(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!pn.has(c)))Bve({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:ta(o);Dc(s,i)}},Uve=(t,e,r,n)=>{r==="output"?Dc(t.stdio[n],e):Dc(e,t.stdio[n]);let i=qve[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},qve=["stdin","stdout","stderr"],Bve=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;Hve(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},Hve=(t,{signal:e})=>{jn(t)&&Ws(t,Zve,e)},Zve=2});var ra,P9=y(()=>{ra=[];ra.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ra.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ra.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var E_,TO,OO,Gve,IO,A_,Vve,PO,RO,CO,R9,ZXe,GXe,C9=y(()=>{P9();E_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",TO=Symbol.for("signal-exit emitter"),OO=globalThis,Gve=Object.defineProperty.bind(Object),IO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(OO[TO])return OO[TO];Gve(OO,TO,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},A_=class{},Vve=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),PO=class extends A_{onExit(){return()=>{}}load(){}unload(){}},RO=class extends A_{#t=CO.platform==="win32"?"SIGINT":"SIGHUP";#r=new IO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of ra)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!E_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of ra)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,ra.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return E_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&E_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},CO=globalThis.process,{onExit:R9,load:ZXe,unload:GXe}=Vve(E_(CO)?new RO(CO):new PO)});import{addAbortListener as Wve}from"node:events";var D9,N9=y(()=>{C9();D9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=R9(()=>{t.kill()});Wve(n,()=>{i()})}});var M9,Kve,Jve,j9,Yve,F9=y(()=>{nT();wy();Fo();_c();M9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=Sy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=Kve(r,n,i),{sourceStream:d,sourceError:f}=Yve(t,l),{options:p,fileDescriptors:m}=di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},Kve=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=Jve(t,e,...r),a=Dy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},Jve=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(j9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||tT(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=uy(r,...n);return{destination:e(j9)(i,o,s),pipeOptions:s}}if(di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},j9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Yve=(t,e)=>{try{return{sourceStream:Tc(t,e)}}catch(r){return{sourceError:r}}}});var L9,Xve,DO,z9,NO=y(()=>{Wd();k_();L9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=Xve({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw DO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},Xve=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return AO(t),n;if(e!==void 0)return EO(r),e},DO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pc({error:t,command:z9,escapedCommand:z9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),z9="source.pipe(destination)"});var U9,q9=y(()=>{U9=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as Qve}from"node:stream/promises";var B9,ebe,tbe,rbe,T_,nbe,ibe,H9=y(()=>{$_();Ny();k_();B9=(t,e,r)=>{let n=T_.has(e)?tbe(t,e):ebe(t,e);return Ws(t,nbe,r.signal),Ws(e,ibe,r.signal),rbe(e),n},ebe=(t,e)=>{let r=ta([t]);return Dc(r,e),T_.set(e,r),r},tbe=(t,e)=>{let r=T_.get(e);return r.add(t),r},rbe=async t=>{try{await Qve(t,{cleanup:!0,readable:!1,writable:!0})}catch{}T_.delete(t)},T_=new WeakMap,nbe=2,ibe=1});import{aborted as obe}from"node:util";var Z9,sbe,G9=y(()=>{NO();Z9=(t,e)=>t===void 0?[]:[sbe(t,e)],sbe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await obe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw DO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var O_,abe,cbe,V9=y(()=>{Gi();F9();NO();q9();H9();G9();O_=(t,...e)=>{if(kt(e[0]))return O_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=M9(t,...e),i=abe({...n,destination:r});return i.pipe=O_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},abe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=cbe(t,i);L9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=B9(e,o,d);return await Promise.race([U9(u),...Z9(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},cbe=(t,e)=>Promise.allSettled([t,e])});import{on as lbe}from"node:events";import{getDefaultHighWaterMark as ube}from"node:stream";var I_,dbe,jO,fbe,K9,MO,W9,pbe,mbe,P_=y(()=>{uO();g_();pO();I_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return dbe(e,s),K9({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},dbe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},jO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;fbe(e,s,t);let a=t.readableObjectMode&&!o;return K9({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},fbe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},K9=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=lbe(t,"data",{signal:e.signal,highWaterMark:W9,highWatermark:W9});return pbe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},MO=ube(!0),W9=MO,pbe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=mbe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ea(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*Jd(a)}},mbe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[y_(t,r,!e),h_(t,i,!n,{})].filter(Boolean)});import{setImmediate as hbe}from"node:timers/promises";var J9,gbe,ybe,_be,FO,Y9,zO=y(()=>{s_();Br();hO();P_();Xs();Kd();J9=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=gbe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([ybe(t),d]);return}let f=aO(c,r),p=jO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([_be({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},gbe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!S_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=jO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await ZG(a,t,r,o)},ybe=async t=>{await hbe(),t.readableFlowing===null&&t.resume()},_be=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await r_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await n_(r,{maxBuffer:o})):await o_(r,{maxBuffer:o})}catch(a){return Y9(OZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},FO=async t=>{try{return await t}catch(e){return Y9(e)}},Y9=({bufferedData:t})=>S6(t)?new Uint8Array(t):t});import{finished as vbe}from"node:stream/promises";var ef,bbe,Sbe,wbe,xbe,$be,LO,R_,X9,C_=y(()=>{ef=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=bbe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],vbe(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||xbe(a,e,r,n)}finally{s.abort()}},bbe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Sbe(t,r,n),n},Sbe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{wbe(e,r),n.call(t,...i)}},wbe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},xbe=(t,e,r,n)=>{if(!$be(t,e,r,n))throw t},$be=(t,e,r,n=!0)=>r.propagating?X9(t)||R_(t):(r.propagating=!0,LO(r,e)===n?X9(t):R_(t)),LO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",R_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",X9=t=>t?.code==="EPIPE"});var Q9,UO,qO=y(()=>{zO();C_();Q9=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>UO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),UO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=ef(t,e,l);if(LO(l,e)){await u;return}let[d]=await Promise.all([J9({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var eV,tV,kbe,Ebe,BO=y(()=>{$_();qO();eV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?ta([t,e].filter(Boolean)):void 0,tV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>UO({...kbe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Ebe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),kbe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Ebe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var rV,nV,iV=y(()=>{Sc();jo();rV=t=>bc(t,"ipc"),nV=(t,e)=>{let r=by(t);li({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var oV,sV,aV=y(()=>{Xs();iV();Ji();SO();oV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=rV(o),a=Ki(e,"ipc"),c=Ki(r,"ipc");for await(let l of bO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(IZ(t,i,c),i.push(l)),s&&nV(l,o);return i},sV=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Abe}from"node:events";var cV,Tbe,Obe,Ibe,lV=y(()=>{Ys();jT();AT();NT();Wi();dr();zO();aV();FT();BO();qO();_O();C_();cV=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:v})=>{let _=XG(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},w=Q9({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),x=tV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),I=[],T=oV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:I,verboseInfo:p}),k=Tbe(h,t,S),C=Obe(m,S);try{return await Promise.race([Promise.all([{},e9(_),Promise.all(w),x,T,tZ(t,d),...k,...C]),g,Ibe(t,v),...JH(t,o,f,v),...gH({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:v}),...WH({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:v})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(w.map(Z=>FO(Z))),FO(x),sV(T,I),Promise.allSettled(k),Promise.allSettled(C)])}},Tbe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:ef(n,i,r)),Obe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>zn(o,{checkOpen:!1})&&!jn(o)).map(({type:i,value:o,stream:s=o})=>ef(s,n,e,{isSameDirection:pn.has(i),stopOnExit:i==="native"}))),Ibe=async(t,{signal:e})=>{let[r]=await Abe(t,"error",{signal:e});throw r}});var uV,tf,Nc,D_=y(()=>{Ac();uV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),tf=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ui();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Nc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as dV}from"node:stream/promises";var HO,fV,ZO,GO,N_,j_,VO=y(()=>{C_();HO=async t=>{if(t!==void 0)try{await ZO(t)}catch{}},fV=async t=>{if(t!==void 0)try{await GO(t)}catch{}},ZO=async t=>{await dV(t,{cleanup:!0,readable:!1,writable:!0})},GO=async t=>{await dV(t,{cleanup:!0,readable:!0,writable:!1})},N_=async(t,e)=>{if(await t,e)throw e},j_=(t,e,r)=>{r&&!R_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Pbe}from"node:stream";import{callbackify as Rbe}from"node:util";var pV,WO,KO,JO,Cbe,YO,XO,mV,QO=y(()=>{Ks();Fo();P_();Ac();D_();VO();pV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Hr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=WO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=KO(a,s),{read:f,onStdoutDataDone:p}=JO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Pbe({read:f,destroy:Rbe(XO.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return YO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},WO=(t,e,r)=>{let n=Tc(t,e),i=tf(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},KO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:MO},JO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ui(),s=I_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Cbe(this,s,o)},onStdoutDataDone:o}},Cbe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},YO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await GO(t),await n,await HO(i),await e,r.readable&&r.push(null)}catch(o){await HO(i),mV(r,o)}},XO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Nc(r,e)&&(mV(t,n),await N_(e,n))},mV=(t,e)=>{j_(t,t.readable,e)}});import{Writable as Dbe}from"node:stream";import{callbackify as hV}from"node:util";var gV,eI,tI,Nbe,jbe,rI,nI,yV,iI=y(()=>{Fo();D_();VO();gV=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=eI(t,r,e),s=new Dbe({...tI(n,t,i),destroy:hV(nI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return rI(n,s),s},eI=(t,e,r)=>{let n=Dy(t,e),i=tf(r,n,"writableFinal"),o=tf(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},tI=(t,e,r)=>({write:Nbe.bind(void 0,t),final:hV(jbe.bind(void 0,t,e,r))}),Nbe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},jbe=async(t,e,r)=>{await Nc(r,e)&&(t.writable&&t.end(),await e)},rI=async(t,e,r)=>{try{await ZO(t),e.writable&&e.end()}catch(n){await fV(r),yV(e,n)}},nI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Nc(r,e),await Nc(n,e)&&(yV(t,i),await N_(e,i))},yV=(t,e)=>{j_(t,t.writable,e)}});import{Duplex as Mbe}from"node:stream";import{callbackify as Fbe}from"node:util";var _V,zbe,vV=y(()=>{Ks();QO();iI();_V=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Hr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=WO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=eI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=KO(c,a),{read:g,onStdoutDataDone:v}=JO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Mbe({read:g,...tI(u,t,d),destroy:Fbe(zbe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return YO({subprocessStdout:c,onStdoutDataDone:v,readable:_,subprocess:t,subprocessStdin:u}),rI(u,_,c),_},zbe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([XO({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),nI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var oI,Lbe,bV=y(()=>{Ks();Fo();P_();oI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Hr.has(e),s=Tc(t,r),a=I_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Lbe(a,s,t)},Lbe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var SV,wV=y(()=>{D_();QO();iI();vV();bV();SV=(t,{encoding:e})=>{let r=uV();t.readable=pV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=gV.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=_V.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=oI.bind(void 0,t,e),t[Symbol.asyncIterator]=oI.bind(void 0,t,e,{})}});var xV,Ube,qbe,$V=y(()=>{xV=(t,e)=>{for(let[r,n]of qbe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Ube=(async()=>{})().constructor.prototype,qbe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Ube,t)])});import{setMaxListeners as Bbe}from"node:events";import{spawn as Hbe}from"node:child_process";var kV,Zbe,Gbe,Vbe,Wbe,Kbe,EV=y(()=>{s_();pT();UT();Fo();qT();wO();Wd();l_();h9();b9();Kd();I9();Iy();N9();V9();BO();lV();wV();Ac();$V();kV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Zbe(t,e,r),{subprocess:f,promise:p}=Vbe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=O_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),xV(f,p),di.set(f,{options:u,fileDescriptors:d}),f},Zbe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),{file:a,commandArguments:c,options:l}=Jy(t,e,r),u=Gbe(l),d=v9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Gbe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},Vbe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Hbe(...Yy(t,e,r))}catch(m){return m9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Bbe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];O9(c,a,l),D9(c,r,l);let d={},f=ui();c.kill=mH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=eV(c,r),SV(c,r),d9(c,r);let p=Wbe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Wbe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await cV({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let v=m.map((w,x)=>Xi(w,e,x)),_=Xi(h,e,"all"),S=Kbe({errorInfo:d,exitCode:f,signal:p,stdio:v,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Rc(S,n,e)},Kbe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Vd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof fi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):c_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var M_,Jbe,Ybe,AV=y(()=>{Gi();Ji();M_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Jbe(n,t[n],i)]));return{...t,...r}},Jbe=(t,e,r)=>Ybe.has(t)&&kt(e)&&kt(r)?{...e,...r}:r,Ybe=new Set(["env",...cT])});var Uo,Xbe,Qbe,TV=y(()=>{Gi();nT();O6();i9();EV();AV();Uo=(t,e,r,n)=>{let i=(s,a,c)=>Uo(s,a,r,c),o=(...s)=>Xbe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},Xbe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(kt(o))return i(t,M_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=Qbe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?n9(a,c,l):kV(a,c,l,i)},Qbe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=A6(e)?T6(e,r):[e,...r],[s,a,c]=uy(...o),l=M_(M_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var OV,IV,PV,eSe,tSe,RV=y(()=>{OV=({file:t,commandArguments:e})=>PV(t,e),IV=({file:t,commandArguments:e})=>({...PV(t,e),isSync:!0}),PV=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=eSe(t);return{file:r,commandArguments:n}},eSe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(tSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},tSe=/ +/g});var CV,DV,rSe,NV,nSe,jV,MV=y(()=>{CV=(t,e,r)=>{t.sync=e(rSe,r),t.s=t.sync},DV=({options:t})=>NV(t),rSe=({options:t})=>({...NV(t),isSync:!0}),NV=t=>({options:{...nSe(t),...t}}),nSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},jV={preferLocal:!0}});var Met,Qe,Fet,zet,Let,Uet,qet,Bet,Het,Zet,Ar=y(()=>{TV();RV();MT();MV();wO();Met=Uo(()=>({})),Qe=Uo(()=>({isSync:!0})),Fet=Uo(OV),zet=Uo(IV),Let=Uo(XH),Uet=Uo(DV,{},jV,CV),{sendMessage:qet,getOneMessage:Bet,getEachMessage:Het,getCancelSignal:Zet}=f9()});import{existsSync as F_,statSync as iSe}from"node:fs";import{dirname as sI,extname as oSe,isAbsolute as FV,join as aI,relative as cI,resolve as z_,sep as sSe}from"node:path";function L_(t){return t==="./gradlew"||t==="gradle"}function aSe(t){return(F_(aI(t,"build.gradle.kts"))||F_(aI(t,"build.gradle")))&&F_(aI(t,"gradle.properties"))}function cSe(t,e){let n=cI(t,e).split(sSe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function qo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function lSe(t,e){let r=z_(t,e),n=r;F_(r)?iSe(r).isFile()&&(n=sI(r)):oSe(r)!==""&&(n=sI(r));let i=cI(t,n);if(i.startsWith("..")||FV(i))return null;let o=n;for(;;){if(aSe(o))return o;if(z_(o)===z_(t))return null;let s=sI(o);if(s===o)return null;let a=cI(t,s);if(a.startsWith("..")||FV(a))return null;o=s}}function U_(t,e){let r=z_(t),n=new Map,i=[];for(let o of e){let s=lSe(r,o);if(!s){i.push(o);continue}let a=cSe(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var q_=y(()=>{"use strict"});import{existsSync as uSe,readFileSync as dSe}from"node:fs";import{join as fSe}from"node:path";function jc(t="."){let e=fSe(t,".cladding","config.yaml");if(!uSe(e))return lI;try{let n=(0,zV.parse)(dSe(e,"utf8"))?.gate;if(!n)return lI;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of pSe){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return lI}}function LV(t,e){let r=[],n=!1;for(let i of t){let o=mSe.exec(i);if(o){n=!0;for(let s of e)r.push(qo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var zV,pSe,lI,mSe,B_=y(()=>{"use strict";zV=$t(rr(),1);q_();pSe=["type","lint","test","coverage"],lI={scope:"feature"};mSe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as dI,readFileSync as UV,readdirSync as hSe,statSync as gSe}from"node:fs";import{join as H_}from"node:path";function mI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=H_(t,e);if(dI(r))try{if(qV.test(UV(r,"utf8")))return!0}catch{}}return!1}function BV(t){try{return dI(t)&&qV.test(UV(t,"utf8"))}catch{return!1}}function HV(t,e=0){if(e>4||!dI(t))return!1;let r;try{r=hSe(t)}catch{return!1}for(let n of r){let i=H_(t,n),o=!1;try{o=gSe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(HV(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&BV(i))return!0}return!1}function vSe(t){if(mI(t))return!0;for(let e of ySe)if(BV(H_(t,e)))return!0;for(let e of _Se)if(HV(H_(t,e)))return!0;return!1}function ZV(t="."){let e=jc(t).coverage;return e||(vSe(t)?"kover":"jacoco")}function GV(t="."){return fI[ZV(t)]}function VV(t="."){return uI[ZV(t)]}var fI,uI,pI,qV,ySe,_Se,Z_=y(()=>{"use strict";B_();fI={kover:"koverXmlReport",jacoco:"jacocoTestReport"},uI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},pI=[uI.kover,uI.jacoco],qV=/kover/i;ySe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],_Se=["buildSrc","build-logic"]});import{existsSync as hI,readdirSync as WV}from"node:fs";import{join as G_}from"node:path";function gI(t){return hI(G_(t,"gradlew"))?"./gradlew":"gradle"}function bSe(t){let e=gI(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[GV(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function wSe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function kSe(t,e){for(let r of e)if(hI(G_(t,r)))return r}function ESe(t,e){try{return WV(t).find(n=>n.endsWith(e))}catch{return}}function TSe(t,e){for(let r of ASe)if(r.configs.some(n=>hI(G_(t,n))))return r.gate;return e}function pt(t="."){for(let e of xSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=ESe(t,o):r=kSe(t,[o]),r)break;if(!r||e.requiresSource&&!wSe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:TSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return $Se}var SSe,xSe,$Se,ASe,mn=y(()=>{"use strict";Z_();SSe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);xSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit","--incremental","--tsBuildInfoFile",".cladding/cache/tsc.tsbuildinfo"]},lint:{cmd:"npx",args:["--no-install","eslint",".","--cache","--cache-location",".cladding/cache/eslint"]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:bSe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],$Se={language:"unknown",manifest:"",gates:{}};ASe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as OSe,readFileSync as ISe}from"node:fs";import{join as PSe}from"node:path";function rf(t){return t.code==="ENOENT"}function V_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return KV.test(o)||KV.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Ft(t,e,r){return rf(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function nr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Mc(t,e){let r=PSe(t,"package.json");if(!OSe(r))return!1;try{return!!JSON.parse(ISe(r,"utf8")).scripts?.[e]}catch{return!1}}var KV,hn=y(()=>{"use strict";KV=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function RSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;if(!n)return[{detector:W_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Qe(n.cmd,[...n.args],{cwd:e,reject:!1});return rf(i)?[{detector:W_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:V_(i,W_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var W_,K_,yI=y(()=>{"use strict";Ar();mn();hn();W_="ARCHITECTURE_VIOLATION";K_={name:W_,run:RSe}});import JV from"node:process";function na(t={}){let r=K_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:CSe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` `)}}var CSe,DSe,J_=y(()=>{"use strict";yI();CSe="stage_1.5";DSe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${JV.argv[1]}`;if(DSe){let t=na();console.log(JSON.stringify(t)),JV.exit(t.exitCode)}});import{existsSync as _I,readdirSync as YV}from"node:fs";import{join as Y_}from"node:path";function jSe(t,e){let r=Y_(t,e.path);if(!_I(r))return!0;if(e.isDirectory)try{return YV(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function MSe(t){let{cwd:e="."}=t,r=[];for(let i of NSe)jSe(e,i)&&r.push({detector:nf,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Y_(e,"spec.yaml");if(_I(n)){let i=LSe(n),o=i?null:FSe(e);if(i)r.push({detector:nf,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:nf,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=zSe(e);s&&r.push({detector:nf,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function FSe(t){for(let e of["spec/features","spec/scenarios"]){let r=Y_(t,e);if(!_I(r))continue;let n;try{n=YV(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{si(Y_(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function zSe(t){try{return J(t),null}catch(e){return e.message}}function LSe(t){let e;try{e=si(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var nf,NSe,XV,QV=y(()=>{"use strict";lt();iy();nf="ABSENCE_OF_GOVERNANCE",NSe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];XV={name:nf,run:MSe}});function X_(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function vI(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=X_(r)==="while",o=qSe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${X_(r)}'`}let n=USe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:X_(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${X_(r)}'`:null}function BSe(t,e){let r=vI(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function eW(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...BSe(r,n));return e}var USe,qSe,bI=y(()=>{"use strict";USe={event:"when",state:"while",optional:"where",unwanted:"if"},qSe=/\bwhen\b/i});function pe(t,e,r){let n;try{n=J(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var _t=y(()=>{"use strict";lt()});function HSe(t){let{cwd:e="."}=t;return pe(e,Q_,ZSe)}function ZSe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Q_,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of eW(t.features))e.push({detector:Q_,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Q_,tW,rW=y(()=>{"use strict";bI();_t();Q_="AC_DRIFT";tW={name:Q_,run:HSe}});function mi(t=".",e){let n=(e??"").trim().toLowerCase()||pt(t).language;return KSe[n]??nW}var GSe,VSe,nW,WSe,KSe,Fc=y(()=>{"use strict";mn();GSe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,VSe=/^[ \t]*import\s+([\w.]+)/gm,nW={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:GSe,importStyle:"relative"},WSe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:VSe,importStyle:"dotted"},KSe={typescript:nW,kotlin:WSe}});import{existsSync as JSe,readFileSync as YSe,readdirSync as XSe,statSync as QSe}from"node:fs";import{join as oW,relative as iW}from"node:path";function ewe(t,e){if(!JSe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=XSe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=oW(i,s),c;try{c=QSe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function twe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function nwe(t){return rwe.test(t)}function iwe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=mi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>ewe(oW(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=YSe(a,"utf8")}catch{continue}let l=c.split(` `);for(let u=0;u{"use strict";lt();Fc();sW="AI_HINTS_FORBIDDEN_PATTERN";rwe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;aW={name:sW,run:iwe}});function owe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:lW,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var lW,uW,dW=y(()=>{"use strict";lt();lW="AC_DUPLICATE_WITHIN_FEATURE";uW={name:lW,run:owe}});import{createRequire as swe}from"module";import{basename as awe,dirname as wI,normalize as cwe,relative as lwe,resolve as uwe,sep as mW}from"path";import*as dwe from"fs";function fwe(t){let e=cwe(t);return e.length>1&&e[e.length-1]===mW&&(e=e.substring(0,e.length-1)),e}function hW(t,e){return t.replace(pwe,e)}function hwe(t){return t==="/"||mwe.test(t)}function SI(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=uwe(t)),(n||o)&&(t=fwe(t)),t===".")return"";let s=t[t.length-1]!==i;return hW(s?t+i:t,i)}function gW(t,e){return e+t}function gwe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:hW(lwe(t,n),e.pathSeparator)+e.pathSeparator+r}}function ywe(t){return t}function _we(t,e,r){return e+t+r}function vwe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?gwe(t,e):n?gW:ywe}function bwe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function Swe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function kwe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?Swe(t):bwe(t):n&&n.length?xwe:wwe:$we}function Pwe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?Iwe:r&&r.length?n?Ewe:Awe:n?Twe:Owe}function Dwe(t){return t.group?Cwe:Rwe}function Mwe(t){return t.group?Nwe:jwe}function Lwe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?zwe:Fwe}function yW(t,e,r){if(r.options.useRealPaths)return Uwe(e,r);let n=wI(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=wI(n)}return r.symlinks.set(t,e),i>1}function Uwe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function ev(t,e,r,n){e(t&&!n?t:null,r)}function Jwe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?qwe:Gwe:n?e?Bwe:Kwe:i?e?Zwe:Wwe:e?Hwe:Vwe}function Qwe(t){return t?Xwe:Ywe}function nxe(t,e){return new Promise((r,n)=>{bW(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function bW(t,e,r){new vW(t,e,r).start()}function ixe(t,e){return new vW(t,e).start()}var fW,pwe,mwe,wwe,xwe,$we,Ewe,Awe,Twe,Owe,Iwe,Rwe,Cwe,Nwe,jwe,Fwe,zwe,qwe,Bwe,Hwe,Zwe,Gwe,Vwe,Wwe,Kwe,_W,Ywe,Xwe,exe,txe,rxe,vW,pW,SW,wW,xW=y(()=>{fW=swe(import.meta.url);pwe=/[\\/]/g;mwe=/^[a-z]:[\\/]$/i;wwe=(t,e)=>{e.push(t||".")},xwe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},$we=()=>{};Ewe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},Awe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},Twe=(t,e,r,n)=>{r.files++},Owe=(t,e)=>{e.push(t)},Iwe=()=>{};Rwe=t=>t,Cwe=()=>[""].slice(0,0);Nwe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},jwe=()=>{};Fwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&yW(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},zwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&yW(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};qwe=t=>t.counts,Bwe=t=>t.groups,Hwe=t=>t.paths,Zwe=t=>t.paths.slice(0,t.options.maxFiles),Gwe=(t,e,r)=>(ev(e,r,t.counts,t.options.suppressErrors),null),Vwe=(t,e,r)=>(ev(e,r,t.paths,t.options.suppressErrors),null),Wwe=(t,e,r)=>(ev(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Kwe=(t,e,r)=>(ev(e,r,t.groups,t.options.suppressErrors),null);_W={withFileTypes:!0},Ywe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",_W,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},Xwe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",_W)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};exe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},txe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},rxe=class{aborted=!1;abort(){this.aborted=!0}},vW=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=Jwe(e,this.isSynchronous),this.root=SI(t,e),this.state={root:hwe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new txe,options:e,queue:new exe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new rxe,fs:e.fs||dwe},this.joinPath=vwe(this.root,e),this.pushDirectory=kwe(this.root,e),this.pushFile=Pwe(e),this.getArray=Dwe(e),this.groupFiles=Mwe(e),this.resolveSymlink=Lwe(e,this.isSynchronous),this.walkDirectory=Qwe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(v.isDirectory()){if(_=SI(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=awe(_),w=SI(wI(_),this.state.options);_=this.joinPath(S,w),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};pW=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return nxe(this.root,this.options)}withCallback(t){bW(this.root,this.options,t)}sync(){return ixe(this.root,this.options)}},SW=null;try{fW.resolve("picomatch"),SW=fW("picomatch")}catch{}wW=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:mW,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new pW(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new pW(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||SW;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var of=b((Vtt,TW)=>{"use strict";var $W="[^\\\\/]",oxe="(?=.)",kW="[^/]",xI="(?:\\/|$)",EW="(?:^|\\/)",$I=`\\.{1,2}${xI}`,sxe="(?!\\.)",axe=`(?!${EW}${$I})`,cxe=`(?!\\.{0,1}${xI})`,lxe=`(?!${$I})`,uxe="[^.\\/]",dxe=`${kW}*?`,fxe="/",AW={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:oxe,QMARK:kW,END_ANCHOR:xI,DOTS_SLASH:$I,NO_DOT:sxe,NO_DOTS:axe,NO_DOT_SLASH:cxe,NO_DOTS_SLASH:lxe,QMARK_NO_DOT:uxe,STAR:dxe,START_ANCHOR:EW,SEP:fxe},pxe={...AW,SLASH_LITERAL:"[\\\\/]",QMARK:$W,STAR:`${$W}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},mxe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};TW.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:mxe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?pxe:AW}}});var sf=b(Tr=>{"use strict";var{REGEX_BACKSLASH:hxe,REGEX_REMOVE_BACKSLASH:gxe,REGEX_SPECIAL_CHARS:yxe,REGEX_SPECIAL_CHARS_GLOBAL:_xe}=of();Tr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Tr.hasRegexChars=t=>yxe.test(t);Tr.isRegexChar=t=>t.length===1&&Tr.hasRegexChars(t);Tr.escapeRegex=t=>t.replace(_xe,"\\$1");Tr.toPosixSlashes=t=>t.replace(hxe,"/");Tr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Tr.removeBackslashes=t=>t.replace(gxe,e=>e==="\\"?"":e);Tr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Tr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Tr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Tr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Tr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var jW=b((Ktt,NW)=>{"use strict";var OW=sf(),{CHAR_ASTERISK:kI,CHAR_AT:vxe,CHAR_BACKWARD_SLASH:af,CHAR_COMMA:bxe,CHAR_DOT:EI,CHAR_EXCLAMATION_MARK:AI,CHAR_FORWARD_SLASH:DW,CHAR_LEFT_CURLY_BRACE:TI,CHAR_LEFT_PARENTHESES:OI,CHAR_LEFT_SQUARE_BRACKET:Sxe,CHAR_PLUS:wxe,CHAR_QUESTION_MARK:IW,CHAR_RIGHT_CURLY_BRACE:xxe,CHAR_RIGHT_PARENTHESES:PW,CHAR_RIGHT_SQUARE_BRACKET:$xe}=of(),RW=t=>t===DW||t===af,CW=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},kxe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,v=!1,_=!1,S=!1,w=!1,x=!1,I=0,T,k,C={value:"",depth:0,isGlob:!1},E=()=>l>=n,Z=()=>c.charCodeAt(l+1),ie=()=>(T=k,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),R=c.slice(d)):m===!0?(xe="",R=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&RW(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(R&&(R=OW.removeBackslashes(R)),xe&&_===!0&&(xe=OW.removeBackslashes(xe)));let cn={prefix:P,input:t,start:u,base:xe,glob:R,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:w};if(r.tokens===!0&&(cn.maxDepth=0,RW(k)||s.push(C),cn.tokens=s),r.parts===!0||r.tokens===!0){let Ge;for(let ft=0;ft{"use strict";var cf=of(),Zr=sf(),{MAX_LENGTH:tv,POSIX_REGEX_SOURCE:Exe,REGEX_NON_SPECIAL_CHARS:Axe,REGEX_SPECIAL_CHARS_BACKREF:Txe,REPLACEMENTS:MW}=cf,Oxe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Zr.escapeRegex(i)).join("..")}return r},zc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,FW=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Ixe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},zW=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Ixe(e))return e.replace(/\\(.)/g,"$1")},Pxe=t=>{let e=t.map(zW).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},Rxe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=zW(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Zr.escapeRegex(r[0]):`[${r.map(i=>Zr.escapeRegex(i)).join("")}]`}*`},Cxe=t=>{let e=0,r=t.trim(),n=II(r);for(;n;)e++,r=n.body.trim(),n=II(r);return e},Dxe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:cf.DEFAULT_MAX_EXTGLOB_RECURSION,n=FW(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Pxe(n)))return{risky:!0};for(let i of n){let o=Rxe(i);if(o)return{risky:!0,safeOutput:o};if(Cxe(i)>r)return{risky:!0}}return{risky:!1}},PI=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=MW[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(tv,r.maxLength):tv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=cf.globChars(r.windows),l=cf.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:v,QMARK:_,QMARK_NO_DOT:S,STAR:w,START_ANCHOR:x}=c,I=U=>`(${a}(?:(?!${x}${U.dot?m:u}).)*?)`,T=r.dot?"":h,k=r.dot?_:S,C=r.bash===!0?I(r):w;r.capture&&(C=`(${C})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Zr.removePrefix(t,E),i=t.length;let Z=[],ie=[],xe=[],P=o,R,cn=()=>E.index===i-1,Ge=E.peek=(U=1)=>t[E.index+U],ft=E.advance=()=>t[++E.index]||"",zi=()=>t.slice(E.index+1),ln=(U="",ct=0)=>{E.consumed+=U,E.index+=ct},bo=U=>{E.output+=U.output!=null?U.output:U.value,ln(U.value)},xae=()=>{let U=1;for(;Ge()==="!"&&(Ge(2)!=="("||Ge(3)==="?");)ft(),E.start++,U++;return U%2===0?!1:(E.negated=!0,E.start++,!0)},Gh=U=>{E[U]++,xe.push(U)},So=U=>{E[U]--,xe.pop()},Ee=U=>{if(P.type==="globstar"){let ct=E.braces>0&&(U.type==="comma"||U.type==="brace"),L=U.extglob===!0||Z.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!ct&&!L&&(E.output=E.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=C,E.output+=P.output)}if(Z.length&&U.type!=="paren"&&(Z[Z.length-1].inner+=U.value),(U.value||U.output)&&bo(U),P&&P.type==="text"&&U.type==="text"){P.output=(P.output||P.value)+U.value,P.value+=U.value;return}U.prev=P,s.push(U),P=U},Vh=(U,ct)=>{let L={...l[ct],conditions:1,inner:""};L.prev=P,L.parens=E.parens,L.output=E.output,L.startIndex=E.index,L.tokensIndex=s.length;let Ae=(r.capture?"(":"")+L.open;Gh("parens"),Ee({type:U,value:ct,output:E.output?"":p}),Ee({type:"paren",extglob:!0,value:ft(),output:Ae}),Z.push(L)},$ae=U=>{let ct=t.slice(U.startIndex,E.index+1),L=t.slice(U.startIndex+2,E.index),Ae=Dxe(L,r);if((U.type==="plus"||U.type==="star")&&Ae.risky){let it=Ae.safeOutput?(U.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ri=s[U.tokensIndex];ri.type="text",ri.value=ct,ri.output=it||Zr.escapeRegex(ct);for(let ni=U.tokensIndex+1;ni1&&U.inner.includes("/")&&(it=I(r)),(it!==C||cn()||/^\)+$/.test(zi()))&&(ot=U.close=`)$))${it}`),U.inner.includes("*")&&(Nt=zi())&&/^\.[^\\/.]+$/.test(Nt)){let ri=PI(Nt,{...e,fastpaths:!1}).output;ot=U.close=`)${ri})${it})`}U.prev.type==="bos"&&(E.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:R,output:ot}),So("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let U=!1,ct=t.replace(Txe,(L,Ae,ot,Nt,it,ri)=>Nt==="\\"?(U=!0,L):Nt==="?"?Ae?Ae+Nt+(it?_.repeat(it.length):""):ri===0?k+(it?_.repeat(it.length):""):_.repeat(ot.length):Nt==="."?u.repeat(ot.length):Nt==="*"?Ae?Ae+Nt+(it?C:""):C:Ae?L:`\\${L}`);return U===!0&&(r.unescape===!0?ct=ct.replace(/\\/g,""):ct=ct.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),ct===t&&r.contains===!0?(E.output=t,E):(E.output=Zr.wrapOutput(ct,E,e),E)}for(;!cn();){if(R=ft(),R==="\0")continue;if(R==="\\"){let L=Ge();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){R+="\\",Ee({type:"text",value:R});continue}let Ae=/^\\+/.exec(zi()),ot=0;if(Ae&&Ae[0].length>2&&(ot=Ae[0].length,E.index+=ot,ot%2!==0&&(R+="\\")),r.unescape===!0?R=ft():R+=ft(),E.brackets===0){Ee({type:"text",value:R});continue}}if(E.brackets>0&&(R!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&R===":"){let L=P.value.slice(1);if(L.includes("[")&&(P.posix=!0,L.includes(":"))){let Ae=P.value.lastIndexOf("["),ot=P.value.slice(0,Ae),Nt=P.value.slice(Ae+2),it=Exe[Nt];if(it){P.value=ot+it,E.backtrack=!0,ft(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(R==="["&&Ge()!==":"||R==="-"&&Ge()==="]")&&(R=`\\${R}`),R==="]"&&(P.value==="["||P.value==="[^")&&(R=`\\${R}`),r.posix===!0&&R==="!"&&P.value==="["&&(R="^"),P.value+=R,bo({value:R});continue}if(E.quotes===1&&R!=='"'){R=Zr.escapeRegex(R),P.value+=R,bo({value:R});continue}if(R==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:R});continue}if(R==="("){Gh("parens"),Ee({type:"paren",value:R});continue}if(R===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zc("opening","("));let L=Z[Z.length-1];if(L&&E.parens===L.parens+1){$ae(Z.pop());continue}Ee({type:"paren",value:R,output:E.parens?")":"\\)"}),So("parens");continue}if(R==="["){if(r.nobracket===!0||!zi().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zc("closing","]"));R=`\\${R}`}else Gh("brackets");Ee({type:"bracket",value:R});continue}if(R==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Ee({type:"text",value:R,output:`\\${R}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zc("opening","["));Ee({type:"text",value:R,output:`\\${R}`});continue}So("brackets");let L=P.value.slice(1);if(P.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(R=`/${R}`),P.value+=R,bo({value:R}),r.literalBrackets===!1||Zr.hasRegexChars(L))continue;let Ae=Zr.escapeRegex(P.value);if(E.output=E.output.slice(0,-P.value.length),r.literalBrackets===!0){E.output+=Ae,P.value=Ae;continue}P.value=`(${a}${Ae}|${P.value})`,E.output+=P.value;continue}if(R==="{"&&r.nobrace!==!0){Gh("braces");let L={type:"brace",value:R,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};ie.push(L),Ee(L);continue}if(R==="}"){let L=ie[ie.length-1];if(r.nobrace===!0||!L){Ee({type:"text",value:R,output:R});continue}let Ae=")";if(L.dots===!0){let ot=s.slice(),Nt=[];for(let it=ot.length-1;it>=0&&(s.pop(),ot[it].type!=="brace");it--)ot[it].type!=="dots"&&Nt.unshift(ot[it].value);Ae=Oxe(Nt,r),E.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let ot=E.output.slice(0,L.outputIndex),Nt=E.tokens.slice(L.tokensIndex);L.value=L.output="\\{",R=Ae="\\}",E.output=ot;for(let it of Nt)E.output+=it.output||it.value}Ee({type:"brace",value:R,output:Ae}),So("braces"),ie.pop();continue}if(R==="|"){Z.length>0&&Z[Z.length-1].conditions++,Ee({type:"text",value:R});continue}if(R===","){let L=R,Ae=ie[ie.length-1];Ae&&xe[xe.length-1]==="braces"&&(Ae.comma=!0,L="|"),Ee({type:"comma",value:R,output:L});continue}if(R==="/"){if(P.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),P=o;continue}Ee({type:"slash",value:R,output:f});continue}if(R==="."){if(E.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let L=ie[ie.length-1];P.type="dots",P.output+=R,P.value+=R,L.dots=!0;continue}if(E.braces+E.parens===0&&P.type!=="bos"&&P.type!=="slash"){Ee({type:"text",value:R,output:u});continue}Ee({type:"dot",value:R,output:u});continue}if(R==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Vh("qmark",R);continue}if(P&&P.type==="paren"){let Ae=Ge(),ot=R;(P.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(zi()))&&(ot=`\\${R}`),Ee({type:"text",value:R,output:ot});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){Ee({type:"qmark",value:R,output:S});continue}Ee({type:"qmark",value:R,output:_});continue}if(R==="!"){if(r.noextglob!==!0&&Ge()==="("&&(Ge(2)!=="?"||!/[!=<:]/.test(Ge(3)))){Vh("negate",R);continue}if(r.nonegate!==!0&&E.index===0){xae();continue}}if(R==="+"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Vh("plus",R);continue}if(P&&P.value==="("||r.regex===!1){Ee({type:"plus",value:R,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||E.parens>0){Ee({type:"plus",value:R});continue}Ee({type:"plus",value:d});continue}if(R==="@"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Ee({type:"at",extglob:!0,value:R,output:""});continue}Ee({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);let L=Axe.exec(zi());L&&(R+=L[0],E.index+=L[0].length),Ee({type:"text",value:R});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=R,P.output=C,E.backtrack=!0,E.globstar=!0,ln(R);continue}let U=zi();if(r.noextglob!==!0&&/^\([^?]/.test(U)){Vh("star",R);continue}if(P.type==="star"){if(r.noglobstar===!0){ln(R);continue}let L=P.prev,Ae=L.prev,ot=L.type==="slash"||L.type==="bos",Nt=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!ot||U[0]&&U[0]!=="/")){Ee({type:"star",value:R,output:""});continue}let it=E.braces>0&&(L.type==="comma"||L.type==="brace"),ri=Z.length&&(L.type==="pipe"||L.type==="paren");if(!ot&&L.type!=="paren"&&!it&&!ri){Ee({type:"star",value:R,output:""});continue}for(;U.slice(0,3)==="/**";){let ni=t[E.index+4];if(ni&&ni!=="/")break;U=U.slice(3),ln("/**",3)}if(L.type==="bos"&&cn()){P.type="globstar",P.value+=R,P.output=I(r),E.output=P.output,E.globstar=!0,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Nt&&cn()){E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=I(r)+(r.strictSlashes?")":"|$)"),P.value+=R,E.globstar=!0,E.output+=L.output+P.output,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&U[0]==="/"){let ni=U[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=`${I(r)}${f}|${f}${ni})`,P.value+=R,E.output+=L.output+P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&U[0]==="/"){P.type="globstar",P.value+=R,P.output=`(?:^|${f}|${I(r)}${f})`,E.output=P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-P.output.length),P.type="globstar",P.output=I(r),P.value+=R,E.output+=P.output,E.globstar=!0,ln(R);continue}let ct={type:"star",value:R,output:C};if(r.bash===!0){ct.output=".*?",(P.type==="bos"||P.type==="slash")&&(ct.output=T+ct.output),Ee(ct);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){ct.output=R,Ee(ct);continue}(E.index===E.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(E.output+=g,P.output+=g):r.dot===!0?(E.output+=v,P.output+=v):(E.output+=T,P.output+=T),Ge()!=="*"&&(E.output+=p,P.output+=p)),Ee(ct)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing","]"));E.output=Zr.escapeLast(E.output,"["),So("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing",")"));E.output=Zr.escapeLast(E.output,"("),So("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing","}"));E.output=Zr.escapeLast(E.output,"{"),So("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),E.backtrack===!0){E.output="";for(let U of E.tokens)E.output+=U.output!=null?U.output:U.value,U.suffix&&(E.output+=U.suffix)}return E};PI.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(tv,r.maxLength):tv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=MW[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=cf.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",v={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,w=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let k=/^(.*?)\.(\w+)$/.exec(T);if(!k)return;let C=w(k[1]);return C?C+o+k[2]:void 0}}},x=Zr.removePrefix(t,v),I=w(x);return I&&r.strictSlashes!==!0&&(I+=`${s}?`),I};LW.exports=PI});var HW=b((Ytt,BW)=>{"use strict";var Nxe=jW(),RI=UW(),qW=sf(),jxe=of(),Mxe=t=>t&&typeof t=="object"&&!Array.isArray(t),Et=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Et(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=Mxe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Et.compileRe(t,e):Et.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Et(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Et.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Et.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?qW.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Et.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Et.matchBase=(t,e,r)=>(e instanceof RegExp?e:Et.makeRe(e,r)).test(qW.basename(t));Et.isMatch=(t,e,r)=>Et(e,r)(t);Et.parse=(t,e)=>Array.isArray(t)?t.map(r=>Et.parse(r,e)):RI(t,{...e,fastpaths:!1});Et.scan=(t,e)=>Nxe(t,e);Et.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Et.toRegex(a,e);return n===!0&&(c.state=t),c};Et.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=RI.fastpaths(t,e)),i.output||(i=RI(t,e)),Et.compileRe(i,e,r,n)};Et.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Et.constants=jxe;BW.exports=Et});var WW=b((Xtt,VW)=>{"use strict";var ZW=HW(),Fxe=sf();function GW(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Fxe.isWindows()}),ZW(t,e,r)}Object.assign(GW,ZW);VW.exports=GW});import{readdir as zxe,readdirSync as Lxe,realpath as Uxe,realpathSync as qxe,stat as Bxe,statSync as Hxe}from"fs";import{isAbsolute as Zxe,posix as ia,resolve as Gxe}from"path";import{fileURLToPath as Vxe}from"url";function Jxe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&Kxe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>ia.relative(t,n)||".":n=>ia.relative(t,`${e}/${n}`)||"."}function Qxe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=ia.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function XW(t){var e;let r=Lc.default.scan(t,e$e);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function s$e(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Lc.default.scan(t);return r.isGlob||r.negated}function lf(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function QW(t){return typeof t=="string"?[t]:t??[]}function CI(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=o$e(o);s=Zxe(s.replace(c$e,""))?ia.relative(a,s):ia.normalize(s);let c=(i=a$e.exec(s))===null||i===void 0?void 0:i[0],l=XW(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?ia.join(o,...d):o}return s}function l$e(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(CI(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(CI(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(CI(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function u$e(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=l$e(t,e,n);t.debug&&lf("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(JW,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Lc.default)(i.match,f),m=(0,Lc.default)(i.ignore,f),h=Jxe(i.match,f),g=KW(r,d,o),v=o?g:KW(r,d,!0),_=(x,I)=>{let T=v(I,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let w=new wW({filters:[a?(x,I)=>{let T=g(x,I),k=p(T)&&!m(T);return k&&lf(`matched ${T}`),k}:(x,I)=>{let T=g(x,I);return p(T)&&!m(T)}],exclude:a?(x,I)=>{let T=_(x,I);return lf(`${T?"skipped":"crawling"} ${I}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&lf("internal properties:",{...n,root:d}),[w,r!==d&&!o&&Qxe(r,d)]}function d$e(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function p$e(t){let e={...f$e,...t};return e.cwd=(e.cwd instanceof URL?Vxe(e.cwd):Gxe(e.cwd)).replace(JW,"/"),e.ignore=QW(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||zxe,readdirSync:e.fs.readdirSync||Lxe,realpath:e.fs.realpath||Uxe,realpathSync:e.fs.realpathSync||qxe,stat:e.fs.stat||Bxe,statSync:e.fs.statSync||Hxe}),e.debug&&lf("globbing with options:",e),e}function m$e(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Wxe(t)||typeof t=="string",i=QW((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=p$e(n?e:t);return i.length>0?u$e(o,i):[]}function Bo(t,e){let[r,n]=m$e(t,e);return r?d$e(r.sync(),n):[]}var Lc,Wxe,JW,YW,Kxe,Yxe,Xxe,e$e,t$e,r$e,n$e,i$e,o$e,a$e,c$e,f$e,uf=y(()=>{xW();Lc=$t(WW(),1),Wxe=Array.isArray,JW=/\\/g,YW=process.platform==="win32",Kxe=/^(\/?\.\.)+$/;Yxe=/^[A-Z]:\/$/i,Xxe=YW?t=>Yxe.test(t):t=>t==="/";e$e={parts:!0};t$e=/(?t.replace(t$e,"\\$&"),i$e=t=>t.replace(r$e,"\\$&"),o$e=YW?i$e:n$e;a$e=/^(\/?\.\.)+/,c$e=/\\(?=[()[\]{}!*+?@|])/g;f$e={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as rv,readFileSync as h$e,readdirSync as g$e,statSync as eK}from"node:fs";import{join as Uc}from"node:path";function y$e(t){let{cwd:e="."}=t,r,n;try{let c=J(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=mi(e,n),o=[],{layers:s,forbiddenImports:a}=DI(r);return s.size>0&&(_$e(e,i,s,o),v$e(e,i,s,o)),a.length>0&&b$e(e,i,a,o),o}function DI(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function _$e(t,e,r,n){let i=e.mainRoot,o=Uc(t,i);if(rv(o))for(let s of g$e(o)){let a=Uc(o,s);eK(a).isDirectory()&&(r.has(s)||n.push({detector:nv,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function v$e(t,e,r,n){let i=e.mainRoot,o=Uc(t,i);if(rv(o))for(let s of r){let a=Uc(o,s);rv(a)&&eK(a).isDirectory()||n.push({detector:nv,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function b$e(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Uc(t,i,s.from);if(!rv(a))continue;let c=Bo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Uc(a,l),d;try{d=h$e(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];S$e(p,s.to,e.importStyle)&&n.push({detector:nv,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function S$e(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var nv,tK,NI=y(()=>{"use strict";uf();lt();Fc();nv="ARCHITECTURE_FROM_SPEC";tK={name:nv,run:y$e}});import{existsSync as w$e,readFileSync as x$e}from"node:fs";import{join as $$e}from"node:path";function k$e(t){let{cwd:e="."}=t,r=$$e(e,"spec/capabilities.yaml");if(!w$e(r))return[];let n;try{let c=x$e(r,"utf8"),l=rK.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=J(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:iv,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:iv,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:iv,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var rK,iv,nK,iK=y(()=>{"use strict";rK=$t(rr(),1);lt();iv="CAPABILITIES_FEATURE_MAPPING";nK={name:iv,run:k$e}});import{existsSync as E$e,readFileSync as A$e}from"node:fs";import{join as T$e}from"node:path";function O$e(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function I$e(t){let{cwd:e="."}=t;return pe(e,jI,r=>P$e(r,e))}function P$e(t,e){let r=mi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=T$e(e,o);if(!E$e(s))continue;let a=A$e(s,"utf8");O$e(a)||n.push({detector:jI,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var jI,oK,sK=y(()=>{"use strict";Fc();_t();jI="CONVENTION_DRIFT";oK={name:jI,run:I$e}});import{existsSync as MI,readFileSync as aK}from"node:fs";import{join as ov}from"node:path";function R$e(t){return JSON.parse(t).total?.lines?.pct??0}function cK(t){let e=/MI(ov(c.dir,d)));if(!l){s.push(c.path);continue}let u=cK(aK(ov(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Qi,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=lK(n,i);return a0?[{detector:Qi,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function N$e(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=D$e(e,t.focusModules);if(s)return s}let r=mi(e),n=pt(e).language==="kotlin"?pI.find(s=>MI(ov(e,s)))??VV(e):r.coverageSummary,i=ov(e,n);if(!MI(i))return[{detector:Qi,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=aK(i,"utf8");o=r.coverageFormat==="jacoco-xml"?C$e(s):R$e(s)}catch(s){return[{detector:Qi,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:Qi,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=sv?[]:[{detector:Qi,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${sv}%`}]}var Qi,sv,uK,dK=y(()=>{"use strict";Z_();Fc();q_();mn();Qi="COVERAGE_DROP",sv=70;uK={name:Qi,run:N$e}});import{existsSync as j$e}from"node:fs";import{join as M$e}from"node:path";function F$e(t){let{cwd:e="."}=t;return pe(e,av,r=>z$e(r,e))}function z$e(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?j$e(M$e(e,r.path))?[]:[{detector:av,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:av,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var av,fK,pK=y(()=>{"use strict";_t();av="DELIVERABLE_INTEGRITY";fK={name:av,run:F$e}});function L$e(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:FI,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function U$e(t){let{cwd:e="."}=t;return pe(e,FI,r=>L$e(r))}var FI,mK,hK=y(()=>{"use strict";_t();FI="SMOKE_PROBE_DEMAND";mK={name:FI,run:U$e}});function q$e(t){let{cwd:e="."}=t;return pe(e,cv,r=>B$e(r,e))}function B$e(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=gc(e);if(n===null)return[{detector:cv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=Rd(e,o.modules??[]);s!==a&&i.push({detector:cv,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var cv,lv,zI=y(()=>{"use strict";Cd();_t();cv="STALE_ATTESTATION";lv={name:cv,run:q$e}});function H$e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}return Z$e(r)}function Z$e(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:gK,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var gK,uv,LI=y(()=>{"use strict";lt();gK="DEPENDENCY_CYCLE";uv={name:gK,run:H$e}});import{appendFileSync as G$e,existsSync as yK,mkdirSync as V$e,readFileSync as W$e}from"node:fs";import{dirname as K$e,join as J$e}from"node:path";function _K(t){return J$e(t,Y$e,X$e)}function vK(t){return UI.add(t),()=>UI.delete(t)}function oa(t,e){let r=_K(t),n=K$e(r);yK(n)||V$e(n,{recursive:!0}),G$e(r,`${JSON.stringify(e)} `,"utf8");for(let i of UI)try{i(t,e)}catch{}}function gn(t){let e=_K(t);if(!yK(e))return[];let r=W$e(e,"utf8").trim();return r.length===0?[]:r.split(` diff --git a/spec.yaml b/spec.yaml index e84f4682..738776f3 100644 --- a/spec.yaml +++ b/spec.yaml @@ -49,8 +49,8 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 199 + features: 200 scenarios: 2 capabilities: 6 - test_files: 170 - last_synced: "2026-07-01" + test_files: 171 + last_synced: "2026-07-02" diff --git a/spec/attestation.yaml b/spec/attestation.yaml index e1fdf1df..778fd537 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -4,10 +4,10 @@ # --tier=pre-push --strict` GREEN refreshes. Content-anchored: survives # fresh clones and squash/rebase (suggested .gitattributes: merge=union). attested: - F-001: 1eb56cee6b065fbe + F-001: 830ae324d89c3fce F-002: c116a9d32f862ee9 F-003: c9578f9a6e70dcdf - F-004: 791125e674b98fb5 + F-004: b6e68a1ab2d8fe81 F-005: 70c3b7166f297bff F-006: 488cb6f2d452a286 F-007: d1c159c46d5a454f @@ -29,7 +29,7 @@ attested: F-021: 8a1a82a59a1c45c7 F-022: 8f596a1c737f6d42 F-02343cd1: 77875ee09a7ea3bf - F-023: 0c14948e5a91bb0f + F-023: c347678282dafd98 F-024: f67a86816b06f8ee F-025: 187339b684896b8e F-026: bb35faf43ba582cb @@ -50,7 +50,7 @@ attested: F-041: cddb50fc41e49066 F-042: d1f661281bb9fb6e F-043: 2c5f4a94e3e57e9b - F-044: 2f5ee0e3cee5f762 + F-044: 95085e0995009f41 F-045: b494c9a80442ac20 F-046: 4b563fce74b6bb4b F-047: baf5a2dbb9bb5a4b @@ -85,7 +85,7 @@ attested: F-076: 0061ab2d4b4991a8 F-077: 7aac44757146b695 F-078: c6af3d128b98f4e6 - F-079: eaa08d9aeeb2a263 + F-079: f3188948e53e942f F-080: 1c19da74d32894e6 F-081: 248f9660cfb1b02b F-098d3b: 42d61bf806ce462b @@ -107,10 +107,10 @@ attested: F-2de65d: 84ad71574d306c81 F-315fd7: c3b042c80fa7c187 F-31eeb8: d88a9880d29ae411 - F-32b1e0: 9b29e21313d121b1 + F-32b1e0: 4cc7240778eaae75 F-3788c2: af9778dea8687b29 F-37b4a8: e067655bad681488 - F-3a5339: b2b2ea8775f99267 + F-3a5339: 7d790460b97b35a7 F-3b3690: 6a36aad282d36f3a F-40327b: 8295358f7b813c8a F-417ff0: 0cc5eeefc5e08377 @@ -125,7 +125,7 @@ attested: F-570a3f: 3f60012b22c9b715 F-59f093: 26735424fba6308c F-5b188856: 92b72281c248eba3 - F-5b9f9f: 0b972209be8b642f + F-5b9f9f: cad717b88efe592a F-5d3ed2: 9452eac28760fb99 F-5f6b45: 15323c4f5b619de7 F-64a5c159: adedb516a257c7ec @@ -163,7 +163,7 @@ attested: F-aee61f: e009b9eb07addd30 F-af45042a: 9c61ca116a28cbb6 F-af96b1: e75ca2cb3412a7a5 - F-b2094740: f379bf4feef6771a + F-b2094740: 2ea89b77e7c8e740 F-b43066: 9402b630adcf1eae F-b61449: 7095ce00662e987d F-b84c38: 61a41c3f765e8a92 @@ -173,6 +173,7 @@ attested: F-bb15e6: 9b629bd8910007fa F-bd07d7: 4bf7e1baddf5d754 F-bdcd90: 826853f7885a5a08 + F-bfe14aac: 2ea89b77e7c8e740 F-c037ae: 6a58cdcfd0474e5f F-c2c996: 5c73fa010b1502fa F-c48eb2: 6a581a63e255c279 @@ -184,11 +185,11 @@ attested: F-d2c806: b3d8668905855a6c F-d3bde4: 915d13b33258d3fc F-d49585: 11e3ac2dce796fc6 - F-d6b93648: f755a47c66e07635 + F-d6b93648: 2acbd4024d0f37ca F-d7312b: 000237d094145b6a F-d8223c: 0501e9564231899b F-d980359c: 8f1559276afc5c03 - F-dd51b42c: 496eeffa2641169d + F-dd51b42c: 30b7e2a656892648 F-dddb89: f5625354e55eba9b F-e0f6c7: fe68521cda464f23 F-eb732f: d8abb536ff850a7a diff --git a/spec/features/incremental-ts-gate-bfe14aac.yaml b/spec/features/incremental-ts-gate-bfe14aac.yaml new file mode 100644 index 00000000..96ea7885 --- /dev/null +++ b/spec/features/incremental-ts-gate-bfe14aac.yaml @@ -0,0 +1,33 @@ +id: F-bfe14aac +slug: incremental-ts-gate +title: "Incremental TS gate — tsc --incremental + eslint --cache (sound; ~3.4s faster on warm re-runs)" +status: done +modules: + - src/stages/toolchain/detect.ts +acceptance_criteria: + - id: AC-41107118 + ears: ubiquitous + action: "run the TypeScript type gate as tsc --noEmit --incremental with a tsBuildInfoFile under .cladding/cache, so an unchanged re-check reuses the build cache" + response: "detectToolchain's typescript gates.type carries --incremental + --tsBuildInfoFile .cladding/cache/tsc.tsbuildinfo" + text: "The system shall run the TS type gate with tsc --incremental and a .cladding/cache build-info file." + test_refs: ["tests/stages/incremental-gate.test.ts"] + - id: AC-1f2116fa + ears: ubiquitous + action: "run the TypeScript lint gate as eslint --cache with a cache-location under .cladding/cache, so unchanged files reuse cached lint results" + response: "detectToolchain's typescript gates.lint carries --cache + --cache-location .cladding/cache/eslint" + text: "The system shall run the TS lint gate with eslint --cache and a .cladding/cache cache-location." + test_refs: ["tests/stages/incremental-gate.test.ts"] + - id: AC-f253b9fa + ears: state + condition: "while a build cache from a prior run exists and the tree is unchanged" + action: "still catch a newly-introduced type/lint error (incremental is sound, not a correctness shortcut)" + response: "tsc --incremental rebuilds the affected program slice and eslint --cache keys on file+config hash, so a real error is never masked — the cache only skips proven-unchanged work" + text: "While a cache exists, the system shall still catch any real type/lint error (sound incrementality)." + test_refs: ["tests/stages/incremental-gate.test.ts"] + - id: AC-dd80d585 + ears: unwanted + condition: "if the gate writes its incremental caches" + action: "keep them under the .cladding/ namespace so they never pollute the managed project's git status" + response: "both cache paths live under .cladding/cache (already gitignored), not the project root" + text: "If the gate caches, then it shall write under .cladding/ so the project tree stays clean." + test_refs: ["tests/stages/incremental-gate.test.ts"] diff --git a/spec/index.yaml b/spec/index.yaml index f254aa46..1f9c16ab 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -174,6 +174,7 @@ features: F-bb15e6: {slug: clad-doctor, status: done, modules: 3} F-bd07d7: {slug: greenfield-seeds, status: done, modules: 5} F-bdcd90: {slug: oracle-policy-risk-weighted, status: done, modules: 8} + F-bfe14aac: {slug: incremental-ts-gate, status: done, modules: 1} F-c037ae: {slug: test-refs-repair, status: done, modules: 4} F-c2c996: {slug: checkpoint-events, status: done, modules: 3} F-c48eb2: {slug: scan-source-roots, status: done, modules: 5} diff --git a/src/stages/toolchain/detect.ts b/src/stages/toolchain/detect.ts index 0d243a5c..fcbd1594 100644 --- a/src/stages/toolchain/detect.ts +++ b/src/stages/toolchain/detect.ts @@ -111,8 +111,15 @@ const CHAIN: readonly Entry[] = [ // "not found" → the stage's missing-tool classification → skip (exit 2), // which the strict demand table (F-67d2e9) escalates when the spec // relies on the stage. - type: {cmd: 'npx', args: ['--no-install', 'tsc', '--noEmit']}, - lint: {cmd: 'npx', args: ['--no-install', 'eslint', '.']}, + // Incremental caches (F-bfe14aac): tsc --incremental reuses a build-info + // file and eslint --cache reuses per-file results, so an unchanged re-run + // (the local pre-commit/pre-push loop) skips proven-unchanged work — + // ~3.4s faster on cladding's own tree. SOUND, not a shortcut: tsc rebuilds + // the affected program slice (a new type error is still caught) and eslint + // keys the cache on file+config hash. Caches live under .cladding/ (already + // gitignored) so they never pollute the managed project's git status. + type: {cmd: 'npx', args: ['--no-install', 'tsc', '--noEmit', '--incremental', '--tsBuildInfoFile', '.cladding/cache/tsc.tsbuildinfo']}, + lint: {cmd: 'npx', args: ['--no-install', 'eslint', '.', '--cache', '--cache-location', '.cladding/cache/eslint']}, test: {cmd: 'npx', args: ['--no-install', 'vitest', 'run']}, coverage: {cmd: 'npx', args: ['--no-install', 'vitest', 'run', '--coverage']}, secret: {cmd: 'npx', args: ['--no-install', 'secretlint', '**/*']}, diff --git a/tests/stages/incremental-gate.test.ts b/tests/stages/incremental-gate.test.ts new file mode 100644 index 00000000..420bcd7f --- /dev/null +++ b/tests/stages/incremental-gate.test.ts @@ -0,0 +1,77 @@ +import {afterEach, beforeEach, describe, expect, it} from 'vitest'; +import {mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {detectToolchain} from '../../src/stages/toolchain/detect.js'; + +let dir: string; +beforeEach(() => { + dir = mkdtempSync(join(tmpdir(), 'incr-gate-')); +}); +afterEach(() => { + rmSync(dir, {recursive: true, force: true}); +}); + +const ts = () => writeFileSync(join(dir, 'package.json'), '{}'); +const py = () => writeFileSync(join(dir, 'pyproject.toml'), ''); + +const after = (args: readonly string[], flag: string) => + args[args.indexOf(flag) + 1]; + +describe('incremental TS gate (F-bfe14aac)', () => { + it('type gate uses incremental with cladding tsbuildinfo', () => { + ts(); + const {gates} = detectToolchain(dir); + expect(gates.type).toBeDefined(); + const {cmd, args} = gates.type!; + expect(cmd).toBe('npx'); + expect(args.slice(0, 3)).toEqual(['--no-install', 'tsc', '--noEmit']); + expect(args).toContain('--incremental'); + expect(args).toContain('--tsBuildInfoFile'); + expect(after(args, '--tsBuildInfoFile')).toBe( + '.cladding/cache/tsc.tsbuildinfo', + ); + }); + + it('lint gate uses eslint cache under cladding', () => { + ts(); + const {gates} = detectToolchain(dir); + expect(gates.lint).toBeDefined(); + const {args} = gates.lint!; + expect(args.slice(0, 3)).toEqual(['--no-install', 'eslint', '.']); + expect(args).toContain('--cache'); + expect(args).toContain('--cache-location'); + expect(after(args, '--cache-location')).toBe('.cladding/cache/eslint'); + }); + + it('all cache paths stay under .cladding/ (no project-root pollution)', () => { + ts(); + const {gates} = detectToolchain(dir); + const tsCache = after(gates.type!.args, '--tsBuildInfoFile'); + const lintCache = after(gates.lint!.args, '--cache-location'); + expect(tsCache.startsWith('.cladding/')).toBe(true); + expect(lintCache.startsWith('.cladding/')).toBe(true); + }); + + it('test and coverage gates are unchanged', () => { + ts(); + const {gates} = detectToolchain(dir); + expect(gates.test).toBeDefined(); + expect(gates.coverage).toBeDefined(); + expect(gates.test!.args).toEqual(['--no-install', 'vitest', 'run']); + expect(gates.coverage!.args).toEqual([ + '--no-install', + 'vitest', + 'run', + '--coverage', + ]); + }); + + it('non-TS (python) project is unaffected by incremental flags', () => { + py(); + const {gates} = detectToolchain(dir); + expect(gates.type?.args).not.toContain('--incremental'); + expect(gates.lint?.args).not.toContain('--cache'); + }); +}); diff --git a/tests/stages/toolchain.test.ts b/tests/stages/toolchain.test.ts index ac1b1a40..2b0cbfdb 100644 --- a/tests/stages/toolchain.test.ts +++ b/tests/stages/toolchain.test.ts @@ -146,7 +146,7 @@ describe('detectToolchain', () => { // State-transition: proves resolveTsLint actually reads the filesystem each call, // not a hard-coded return (defeats the one-way-test critique). writeFileSync(join(dir, 'package.json'), '{}'); - const eslintGate = {cmd: 'npx', args: ['--no-install', 'eslint', '.']}; + const eslintGate = {cmd: 'npx', args: ['--no-install', 'eslint', '.', '--cache', '--cache-location', '.cladding/cache/eslint']}; expect(detectToolchain(dir).gates.lint).toEqual(eslintGate); writeFileSync(join(dir, 'biome.json'), '{}'); expect(detectToolchain(dir).gates.lint).toEqual({cmd: 'npx', args: ['--no-install', 'biome', 'lint', '.']}); @@ -156,7 +156,7 @@ describe('detectToolchain', () => { test('typescript with no linter config → lint gate stays eslint (default preserved)', () => { writeFileSync(join(dir, 'package.json'), '{}'); - expect(detectToolchain(dir).gates.lint).toEqual({cmd: 'npx', args: ['--no-install', 'eslint', '.']}); + expect(detectToolchain(dir).gates.lint).toEqual({cmd: 'npx', args: ['--no-install', 'eslint', '.', '--cache', '--cache-location', '.cladding/cache/eslint']}); }); test('biome takes precedence over oxlint when both configs present', () => { @@ -170,7 +170,7 @@ describe('detectToolchain', () => { writeFileSync(join(dir, 'package.json'), '{}'); writeFileSync(join(dir, 'biome.json'), '{}'); const tc = detectToolchain(dir); - expect(tc.gates.type).toEqual({cmd: 'npx', args: ['--no-install', 'tsc', '--noEmit']}); + expect(tc.gates.type).toEqual({cmd: 'npx', args: ['--no-install', 'tsc', '--noEmit', '--incremental', '--tsBuildInfoFile', '.cladding/cache/tsc.tsbuildinfo']}); expect(tc.gates.test).toEqual({cmd: 'npx', args: ['--no-install', 'vitest', 'run']}); }); From 6e8a5cf2f65012490adc14d8787f2634d27b3e68 Mon Sep 17 00:00:00 2001 From: sungju Yun Date: Mon, 29 Jun 2026 21:45:41 +0900 Subject: [PATCH 2/2] =?UTF-8?q?perf(gate):=20run=20the=20test=20suite=20on?= =?UTF-8?q?ce=20per=20gate=20=E2=80=94=20share=20the=20coverage=20run=20wi?= =?UTF-8?q?th=20the=20unit=20stage=20(F-97abf5db)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pre-push ran BOTH stage_2.1 (vitest run) and stage_2.2 (vitest run --coverage), executing the full suite TWICE (~9.5s + ~10.7s). The coverage run already runs every test, so the unit run was redundant. - src/stages/test-run-cache.ts (new) — gate-scoped memo (mirrors spec cache F-cd0415): primeTestRunCache(on) + memoizeTestRun(cwd, run) + the pure unitActionFromCoverage decision. - unit.ts — in a primed gate, trigger + share the coverage run; on GREEN reuse it (no second suite run); on non-green fall back to a tests-only run. - cov.ts — read the shared (memoized) coverage run. - clad.ts — prime around the stage loop, clear in finally. SOUND attribution: reuse-pass is returned ONLY for a green coverage run, so a failing test can never surface as a unit pass. Verified: a failing test reds BOTH stages; a passing suite greens both with one run. Test SELECTION (changed-files) intentionally avoided — a gate must run the whole suite. Measured (cladding's own repo): clad check --tier=pre-push ~40.4s → ~30.1s (-~10s). Blind-authored tests (tests/stages/test-run-dedup.test.ts, 13). Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 13 + plugins/claude-code/dist/clad.js | 590 ++++++++++----------- spec.yaml | 4 +- spec/attestation.yaml | 87 +-- spec/features/test-run-dedup-97abf5db.yaml | 38 ++ spec/index.yaml | 1 + src/cli/clad.ts | 9 + src/stages/cov.ts | 5 +- src/stages/test-run-cache.ts | 59 +++ src/stages/unit.ts | 26 +- tests/stages/test-run-dedup.test.ts | 146 +++++ 11 files changed, 636 insertions(+), 342 deletions(-) create mode 100644 spec/features/test-run-dedup-97abf5db.yaml create mode 100644 src/stages/test-run-cache.ts create mode 100644 tests/stages/test-run-dedup.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de56161..1c4af8a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,19 @@ Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). ### Changed +- **Gate runs the test suite once, not twice** (`F-97abf5db`) — pre-push ran BOTH the + unit stage (`vitest run`) and the coverage stage (`vitest run --coverage`), executing + the full suite **twice** (~9.5s + ~10.7s). Since the coverage run already runs every + test, the unit run was redundant. A gate-scoped memo (mirroring the spec cache F-cd0415) + now shares ONE coverage run across both stages: the unit stage triggers it and, on a + GREEN run, reuses it instead of re-running. **Sound attribution:** a non-green coverage + run sends the unit stage to a tests-only fallback, so a *coverage-threshold* miss fails + coverage but not unit, and a *real test failure* still fails both (verified — a failing + test reds both stages). Measured on cladding's own repo: `clad check --tier=pre-push` + **~40.4s → ~30.1s (−~10s)**. Pass-through when unprimed (standalone stage / MCP), cleared + in a `finally`. Note: test *selection* (changed-files) stays out — a gate must run the + whole suite; this only removes the duplicate full run. + - **Incremental TS gate — tsc `--incremental` + eslint `--cache`** (`F-bfe14aac`) — the TypeScript type and lint gates re-ran from scratch every time. They now reuse a build cache: `tsc --noEmit --incremental` (build-info file) and `eslint --cache`, both written diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 5a97191a..e3a34976 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,102 +4,102 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var kae=Object.create;var Nk=Object.defineProperty;var Eae=Object.getOwnPropertyDescriptor;var Aae=Object.getOwnPropertyNames;var Tae=Object.getPrototypeOf,Oae=Object.prototype.hasOwnProperty;var Ue=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{for(var r in e)Nk(t,r,{get:e[r],enumerable:!0})},Iae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Aae(e))!Oae.call(t,i)&&i!==r&&Nk(t,i,{get:()=>e[i],enumerable:!(n=Eae(e,i))||n.enumerable});return t};var $t=(t,e,r)=>(r=t!=null?kae(Tae(t)):{},Iae(e||!t||!t.__esModule?Nk(r,"default",{value:t,enumerable:!0}):r,t));var Xu=b(Mk=>{var Wh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},jk=class extends Wh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Mk.CommanderError=Wh;Mk.InvalidArgumentError=jk});var Kh=b(zk=>{var{InvalidArgumentError:Pae}=Xu(),Fk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Pae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Rae(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}zk.Argument=Fk;zk.humanReadableArgName=Rae});var qk=b(Uk=>{var{humanReadableArgName:Cae}=Kh(),Lk=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Cae(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` -`)}displayWidth(e){return I2(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return utypeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{for(var r in e)Mk(t,r,{get:e[r],enumerable:!0})},Nae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Rae(e))!Dae.call(t,i)&&i!==r&&Mk(t,i,{get:()=>e[i],enumerable:!(n=Pae(e,i))||n.enumerable});return t};var $t=(t,e,r)=>(r=t!=null?Iae(Cae(t)):{},Nae(e||!t||!t.__esModule?Mk(r,"default",{value:t,enumerable:!0}):r,t));var ed=b(zk=>{var Jh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Fk=class extends Jh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};zk.CommanderError=Jh;zk.InvalidArgumentError=Fk});var Yh=b(Uk=>{var{InvalidArgumentError:jae}=ed(),Lk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new jae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Mae(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Uk.Argument=Lk;Uk.humanReadableArgName=Mae});var Hk=b(Bk=>{var{humanReadableArgName:Fae}=Yh(),qk=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Fae(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +`)}displayWidth(e){return C2(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function I2(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Uk.Help=Lk;Uk.stripColor=I2});var Gk=b(Zk=>{var{InvalidArgumentError:Dae}=Xu(),Bk=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Nae(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Dae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?P2(this.name().replace(/^no-/,"")):P2(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Hk=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function P2(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Nae(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function C2(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Bk.Help=qk;Bk.stripColor=C2});var Wk=b(Vk=>{var{InvalidArgumentError:zae}=ed(),Zk=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Lae(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new zae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?D2(this.name().replace(/^no-/,"")):D2(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Gk=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function D2(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Lae(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} - too many short flags`):i.test(s)?new Error(`${a} - too many long flags`):new Error(`${a} -- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Zk.Option=Bk;Zk.DualOptions=Hk});var C2=b(R2=>{function jae(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Mae(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=jae(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` +- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Vk.Option=Zk;Vk.DualOptions=Gk});var j2=b(N2=>{function Uae(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function qae(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Uae(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}R2.suggestSimilar=Mae});var M2=b(Yk=>{var Fae=Ue("node:events").EventEmitter,Vk=Ue("node:child_process"),Li=Ue("node:path"),Jh=Ue("node:fs"),ze=Ue("node:process"),{Argument:zae,humanReadableArgName:Lae}=Kh(),{CommanderError:Wk}=Xu(),{Help:Uae,stripColor:qae}=qk(),{Option:D2,DualOptions:Bae}=Gk(),{suggestSimilar:N2}=C2(),Kk=class t extends Fae{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ze.stdout.write(r),writeErr:r=>ze.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>ze.stdout.isTTY?ze.stdout.columns:void 0,getErrHelpWidth:()=>ze.stderr.isTTY?ze.stderr.columns:void 0,getOutHasColors:()=>Jk()??(ze.stdout.isTTY&&ze.stdout.hasColors?.()),getErrHasColors:()=>Jk()??(ze.stderr.isTTY&&ze.stderr.hasColors?.()),stripColor:r=>qae(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Uae,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new zae(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. -Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Wk(e,r,n)),ze.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new D2(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' -- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof D2)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){ze.versions?.electron&&(r.from="electron");let i=ze.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=ze.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":ze.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. -- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Jh.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist +(Did you mean ${n[0]}?)`:""}N2.suggestSimilar=qae});var L2=b(Qk=>{var Bae=Ue("node:events").EventEmitter,Kk=Ue("node:child_process"),Li=Ue("node:path"),Xh=Ue("node:fs"),ze=Ue("node:process"),{Argument:Hae,humanReadableArgName:Zae}=Yh(),{CommanderError:Jk}=ed(),{Help:Gae,stripColor:Vae}=Hk(),{Option:M2,DualOptions:Wae}=Wk(),{suggestSimilar:F2}=j2(),Yk=class t extends Bae{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>ze.stdout.write(r),writeErr:r=>ze.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>ze.stdout.isTTY?ze.stdout.columns:void 0,getErrHelpWidth:()=>ze.stderr.isTTY?ze.stderr.columns:void 0,getOutHasColors:()=>Xk()??(ze.stdout.isTTY&&ze.stdout.hasColors?.()),getErrHasColors:()=>Xk()??(ze.stderr.isTTY&&ze.stderr.hasColors?.()),stripColor:r=>Vae(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Gae,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Hae(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Jk(e,r,n)),ze.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new M2(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' +- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof M2)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){ze.versions?.electron&&(r.from="electron");let i=ze.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=ze.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":ze.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. +- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(Xh.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=Li.resolve(u,d);if(Jh.existsSync(f))return f;if(i.includes(Li.extname(d)))return;let p=i.find(m=>Jh.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Jh.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=Li.resolve(Li.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=Li.basename(this._scriptPath,Li.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(Li.extname(s));let c;ze.platform!=="win32"?n?(r.unshift(s),r=j2(ze.execArgv).concat(r),c=Vk.spawn(ze.argv[0],r,{stdio:"inherit"})):c=Vk.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=j2(ze.execArgv).concat(r),c=Vk.spawn(ze.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{ze.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new Wk(u,"commander.executeSubCommandAsync","(close)")):ze.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)ze.exit(1);else{let d=new Wk(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} + - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=Li.resolve(u,d);if(Xh.existsSync(f))return f;if(i.includes(Li.extname(d)))return;let p=i.find(m=>Xh.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=Xh.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=Li.resolve(Li.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=Li.basename(this._scriptPath,Li.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(Li.extname(s));let c;ze.platform!=="win32"?n?(r.unshift(s),r=z2(ze.execArgv).concat(r),c=Kk.spawn(ze.argv[0],r,{stdio:"inherit"})):c=Kk.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=z2(ze.execArgv).concat(r),c=Kk.spawn(ze.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{ze.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new Jk(u,"commander.executeSubCommandAsync","(close)")):ze.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)ze.exit(1);else{let d=new Jk(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ze.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,ze.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Bae(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=N2(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=N2(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Lae(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Li.basename(e,Li.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ze.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ze.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,ze.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Wae(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=F2(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=F2(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Zae(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Li.basename(e,Li.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ze.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function j2(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Jk(){if(ze.env.NO_COLOR||ze.env.FORCE_COLOR==="0"||ze.env.FORCE_COLOR==="false")return!1;if(ze.env.FORCE_COLOR||ze.env.CLICOLOR_FORCE!==void 0)return!0}Yk.Command=Kk;Yk.useColor=Jk});var U2=b(un=>{var{Argument:F2}=Kh(),{Command:Xk}=M2(),{CommanderError:Hae,InvalidArgumentError:z2}=Xu(),{Help:Zae}=qk(),{Option:L2}=Gk();un.program=new Xk;un.createCommand=t=>new Xk(t);un.createOption=(t,e)=>new L2(t,e);un.createArgument=(t,e)=>new F2(t,e);un.Command=Xk;un.Option=L2;un.Argument=F2;un.Help=Zae;un.CommanderError=Hae;un.InvalidArgumentError=z2;un.InvalidOptionArgumentError=z2});var Pe=b(Vt=>{"use strict";var eE=Symbol.for("yaml.alias"),Z2=Symbol.for("yaml.document"),Yh=Symbol.for("yaml.map"),G2=Symbol.for("yaml.pair"),tE=Symbol.for("yaml.scalar"),Xh=Symbol.for("yaml.seq"),Ui=Symbol.for("yaml.node.type"),Yae=t=>!!t&&typeof t=="object"&&t[Ui]===eE,Xae=t=>!!t&&typeof t=="object"&&t[Ui]===Z2,Qae=t=>!!t&&typeof t=="object"&&t[Ui]===Yh,ece=t=>!!t&&typeof t=="object"&&t[Ui]===G2,V2=t=>!!t&&typeof t=="object"&&t[Ui]===tE,tce=t=>!!t&&typeof t=="object"&&t[Ui]===Xh;function W2(t){if(t&&typeof t=="object")switch(t[Ui]){case Yh:case Xh:return!0}return!1}function rce(t){if(t&&typeof t=="object")switch(t[Ui]){case eE:case Yh:case tE:case Xh:return!0}return!1}var nce=t=>(V2(t)||W2(t))&&!!t.anchor;Vt.ALIAS=eE;Vt.DOC=Z2;Vt.MAP=Yh;Vt.NODE_TYPE=Ui;Vt.PAIR=G2;Vt.SCALAR=tE;Vt.SEQ=Xh;Vt.hasAnchor=nce;Vt.isAlias=Yae;Vt.isCollection=W2;Vt.isDocument=Xae;Vt.isMap=Qae;Vt.isNode=rce;Vt.isPair=ece;Vt.isScalar=V2;Vt.isSeq=tce});var Qu=b(rE=>{"use strict";var jt=Pe(),$r=Symbol("break visit"),K2=Symbol("skip children"),ii=Symbol("remove node");function Qh(t,e){let r=J2(e);jt.isDocument(t)?rc(null,t.contents,r,Object.freeze([t]))===ii&&(t.contents=null):rc(null,t,r,Object.freeze([]))}Qh.BREAK=$r;Qh.SKIP=K2;Qh.REMOVE=ii;function rc(t,e,r,n){let i=Y2(t,e,r,n);if(jt.isNode(i)||jt.isPair(i))return X2(t,n,i),rc(t,i,r,n);if(typeof i!="symbol"){if(jt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var Q2=Pe(),ice=Qu(),oce={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sce=t=>t.replace(/[!,[\]{}]/g,e=>oce[e]),ed=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+sce(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&Q2.isNode(e.contents)){let o={};ice.visit(e.contents,(s,a)=>{Q2.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};ed.defaultYaml={explicit:!1,version:"1.2"};ed.defaultTags={"!!":"tag:yaml.org,2002:"};eU.Directives=ed});var tg=b(td=>{"use strict";var tU=Pe(),ace=Qu();function cce(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function rU(t){let e=new Set;return ace.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function nU(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function lce(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=rU(t));let s=nU(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(tU.isScalar(s.node)||tU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}td.anchorIsValid=cce;td.anchorNames=rU;td.createNodeAnchors=lce;td.findNewAnchor=nU});var iE=b(iU=>{"use strict";function rd(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var uce=Pe();function oU(t,e,r){if(Array.isArray(t))return t.map((n,i)=>oU(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!uce.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}sU.toJS=oU});var rg=b(cU=>{"use strict";var dce=iE(),aU=Pe(),fce=wo(),oE=class{constructor(e){Object.defineProperty(this,aU.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!aU.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=fce.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?dce.applyReviver(o,{"":a},"",a):a}};cU.NodeBase=oE});var nd=b(lU=>{"use strict";var pce=tg(),mce=Qu(),ic=Pe(),hce=rg(),gce=wo(),sE=class extends hce.NodeBase{constructor(e){super(ic.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],mce.visit(e,{Node:(o,s)=>{(ic.isAlias(s)||ic.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(gce.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ng(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(pce.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function ng(t,e,r){if(ic.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(ic.isCollection(e)){let n=0;for(let i of e.items){let o=ng(t,i,r);o>n&&(n=o)}return n}else if(ic.isPair(e)){let n=ng(t,e.key,r),i=ng(t,e.value,r);return Math.max(n,i)}return 1}lU.Alias=sE});var It=b(aE=>{"use strict";var yce=Pe(),_ce=rg(),vce=wo(),bce=t=>!t||typeof t!="function"&&typeof t!="object",xo=class extends _ce.NodeBase{constructor(e){super(yce.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:vce.toJS(this.value,e,r)}toString(){return String(this.value)}};xo.BLOCK_FOLDED="BLOCK_FOLDED";xo.BLOCK_LITERAL="BLOCK_LITERAL";xo.PLAIN="PLAIN";xo.QUOTE_DOUBLE="QUOTE_DOUBLE";xo.QUOTE_SINGLE="QUOTE_SINGLE";aE.Scalar=xo;aE.isScalarValue=bce});var id=b(dU=>{"use strict";var Sce=nd(),Ms=Pe(),uU=It(),wce="tag:yaml.org,2002:";function xce(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function $ce(t,e,r){if(Ms.isDocument(t)&&(t=t.contents),Ms.isNode(t))return t;if(Ms.isPair(t)){let d=r.schema[Ms.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Sce.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=wce+e.slice(2));let l=xce(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new uU.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Ms.MAP]:Symbol.iterator in Object(t)?s[Ms.SEQ]:s[Ms.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new uU.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}dU.createNode=$ce});var og=b(ig=>{"use strict";var kce=id(),oi=Pe(),Ece=rg();function cE(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return kce.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var fU=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,lE=class extends Ece.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>oi.isNode(n)||oi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(fU(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(oi.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,cE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(oi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&oi.isScalar(o)?o.value:o:oi.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!oi.isPair(r))return!1;let n=r.value;return n==null||e&&oi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return oi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(oi.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,cE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};ig.Collection=lE;ig.collectionFromPath=cE;ig.isEmptyPath=fU});var od=b(sg=>{"use strict";var Ace=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function uE(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Tce=(t,e,r)=>t.endsWith(` -`)?uE(r,e):r.includes(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function z2(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function Xk(){if(ze.env.NO_COLOR||ze.env.FORCE_COLOR==="0"||ze.env.FORCE_COLOR==="false")return!1;if(ze.env.FORCE_COLOR||ze.env.CLICOLOR_FORCE!==void 0)return!0}Qk.Command=Yk;Qk.useColor=Xk});var H2=b(un=>{var{Argument:U2}=Yh(),{Command:eE}=L2(),{CommanderError:Kae,InvalidArgumentError:q2}=ed(),{Help:Jae}=Hk(),{Option:B2}=Wk();un.program=new eE;un.createCommand=t=>new eE(t);un.createOption=(t,e)=>new B2(t,e);un.createArgument=(t,e)=>new U2(t,e);un.Command=eE;un.Option=B2;un.Argument=U2;un.Help=Jae;un.CommanderError=Kae;un.InvalidArgumentError=q2;un.InvalidOptionArgumentError=q2});var Pe=b(Vt=>{"use strict";var rE=Symbol.for("yaml.alias"),W2=Symbol.for("yaml.document"),Qh=Symbol.for("yaml.map"),K2=Symbol.for("yaml.pair"),nE=Symbol.for("yaml.scalar"),eg=Symbol.for("yaml.seq"),Ui=Symbol.for("yaml.node.type"),rce=t=>!!t&&typeof t=="object"&&t[Ui]===rE,nce=t=>!!t&&typeof t=="object"&&t[Ui]===W2,ice=t=>!!t&&typeof t=="object"&&t[Ui]===Qh,oce=t=>!!t&&typeof t=="object"&&t[Ui]===K2,J2=t=>!!t&&typeof t=="object"&&t[Ui]===nE,sce=t=>!!t&&typeof t=="object"&&t[Ui]===eg;function Y2(t){if(t&&typeof t=="object")switch(t[Ui]){case Qh:case eg:return!0}return!1}function ace(t){if(t&&typeof t=="object")switch(t[Ui]){case rE:case Qh:case nE:case eg:return!0}return!1}var cce=t=>(J2(t)||Y2(t))&&!!t.anchor;Vt.ALIAS=rE;Vt.DOC=W2;Vt.MAP=Qh;Vt.NODE_TYPE=Ui;Vt.PAIR=K2;Vt.SCALAR=nE;Vt.SEQ=eg;Vt.hasAnchor=cce;Vt.isAlias=rce;Vt.isCollection=Y2;Vt.isDocument=nce;Vt.isMap=ice;Vt.isNode=ace;Vt.isPair=oce;Vt.isScalar=J2;Vt.isSeq=sce});var td=b(iE=>{"use strict";var jt=Pe(),$r=Symbol("break visit"),X2=Symbol("skip children"),ii=Symbol("remove node");function tg(t,e){let r=Q2(e);jt.isDocument(t)?nc(null,t.contents,r,Object.freeze([t]))===ii&&(t.contents=null):nc(null,t,r,Object.freeze([]))}tg.BREAK=$r;tg.SKIP=X2;tg.REMOVE=ii;function nc(t,e,r,n){let i=eU(t,e,r,n);if(jt.isNode(i)||jt.isPair(i))return tU(t,n,i),nc(t,i,r,n);if(typeof i!="symbol"){if(jt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var rU=Pe(),lce=td(),uce={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dce=t=>t.replace(/[!,[\]{}]/g,e=>uce[e]),rd=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+dce(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&rU.isNode(e.contents)){let o={};lce.visit(e.contents,(s,a)=>{rU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};rd.defaultYaml={explicit:!1,version:"1.2"};rd.defaultTags={"!!":"tag:yaml.org,2002:"};nU.Directives=rd});var ng=b(nd=>{"use strict";var iU=Pe(),fce=td();function pce(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function oU(t){let e=new Set;return fce.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function sU(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function mce(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=oU(t));let s=sU(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(iU.isScalar(s.node)||iU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}nd.anchorIsValid=pce;nd.anchorNames=oU;nd.createNodeAnchors=mce;nd.findNewAnchor=sU});var sE=b(aU=>{"use strict";function id(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var hce=Pe();function cU(t,e,r){if(Array.isArray(t))return t.map((n,i)=>cU(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!hce.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}lU.toJS=cU});var ig=b(dU=>{"use strict";var gce=sE(),uU=Pe(),yce=xo(),aE=class{constructor(e){Object.defineProperty(this,uU.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!uU.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=yce.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?gce.applyReviver(o,{"":a},"",a):a}};dU.NodeBase=aE});var od=b(fU=>{"use strict";var _ce=ng(),vce=td(),oc=Pe(),bce=ig(),Sce=xo(),cE=class extends bce.NodeBase{constructor(e){super(oc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],vce.visit(e,{Node:(o,s)=>{(oc.isAlias(s)||oc.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Sce.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=og(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(_ce.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function og(t,e,r){if(oc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(oc.isCollection(e)){let n=0;for(let i of e.items){let o=og(t,i,r);o>n&&(n=o)}return n}else if(oc.isPair(e)){let n=og(t,e.key,r),i=og(t,e.value,r);return Math.max(n,i)}return 1}fU.Alias=cE});var It=b(lE=>{"use strict";var wce=Pe(),xce=ig(),$ce=xo(),kce=t=>!t||typeof t!="function"&&typeof t!="object",$o=class extends xce.NodeBase{constructor(e){super(wce.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:$ce.toJS(this.value,e,r)}toString(){return String(this.value)}};$o.BLOCK_FOLDED="BLOCK_FOLDED";$o.BLOCK_LITERAL="BLOCK_LITERAL";$o.PLAIN="PLAIN";$o.QUOTE_DOUBLE="QUOTE_DOUBLE";$o.QUOTE_SINGLE="QUOTE_SINGLE";lE.Scalar=$o;lE.isScalarValue=kce});var sd=b(mU=>{"use strict";var Ece=od(),Ms=Pe(),pU=It(),Ace="tag:yaml.org,2002:";function Tce(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function Oce(t,e,r){if(Ms.isDocument(t)&&(t=t.contents),Ms.isNode(t))return t;if(Ms.isPair(t)){let d=r.schema[Ms.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Ece.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Ace+e.slice(2));let l=Tce(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new pU.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Ms.MAP]:Symbol.iterator in Object(t)?s[Ms.SEQ]:s[Ms.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new pU.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}mU.createNode=Oce});var ag=b(sg=>{"use strict";var Ice=sd(),oi=Pe(),Pce=ig();function uE(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Ice.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var hU=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,dE=class extends Pce.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>oi.isNode(n)||oi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(hU(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(oi.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,uE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(oi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&oi.isScalar(o)?o.value:o:oi.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!oi.isPair(r))return!1;let n=r.value;return n==null||e&&oi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return oi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(oi.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,uE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};sg.Collection=dE;sg.collectionFromPath=uE;sg.isEmptyPath=hU});var ad=b(cg=>{"use strict";var Rce=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function fE(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Cce=(t,e,r)=>t.endsWith(` +`)?fE(r,e):r.includes(` `)?` -`+uE(r,e):(t.endsWith(" ")?"":" ")+r;sg.indentComment=uE;sg.lineComment=Tce;sg.stringifyComment=Ace});var mU=b(sd=>{"use strict";var Oce="flow",dE="block",ag="quoted";function Ice(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,v=-1;r===dE&&(h=pU(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===ag&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}v=h}if(S===` -`)r===dE&&(h=pU(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` +`+fE(r,e):(t.endsWith(" ")?"":" ")+r;cg.indentComment=fE;cg.lineComment=Cce;cg.stringifyComment=Rce});var yU=b(cd=>{"use strict";var Dce="flow",pE="block",lg="quoted";function Nce(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,v=-1;r===pE&&(h=gU(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===lg&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}v=h}if(S===` +`)r===pE&&(h=gU(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` `&&p!==" "){let w=t[h+1];w&&w!==" "&&w!==` -`&&w!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===ag){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let w=h>v+1?h-2:g-1;if(u[w])return t;l.push(w),u[w]=!0,d=w+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Cn=It(),$o=mU(),lg=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ug=t=>/^(%|---|\.\.\.)/m.test(t);function Pce(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function ad(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(ug(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===lg){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let w=h>v+1?h-2:g-1;if(u[w])return t;l.push(w),u[w]=!0,d=w+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Cn=It(),ko=yU(),dg=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),fg=t=>/^(%|---|\.\.\.)/m.test(t);function jce(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function ld(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(fg(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length `;let d,f;for(f=r.length;f>0;--f){let x=r[f-1];if(x!==` `&&x!==" "&&x!==" ")break}let p=r.substring(f),m=p.indexOf(` `);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(pE,`$&${l}`));let h=!1,g,v=-1;for(g=0;g{I=!0});let k=$o.foldFlowLines(`${_}${x}${p}`,l,$o.FOLD_BLOCK,T);if(!I)return`>${w} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),I=!1,T=dg(n,!0);s!=="folded"&&e!==Cn.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{I=!0});let k=ko.foldFlowLines(`${_}${x}${p}`,l,ko.FOLD_BLOCK,T);if(!I)return`>${w} ${l}${k}`}return r=r.replace(/\n+/g,`$&${l}`),`|${w} -${l}${_}${r}${p}`}function Rce(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` -`)||u&&/[[\]{},]/.test(o))return oc(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` -`)?oc(o,e):cg(t,e,r,n);if(!a&&!u&&i!==Cn.Scalar.PLAIN&&o.includes(` -`))return cg(t,e,r,n);if(ug(o)){if(c==="")return e.forceBlockIndent=!0,cg(t,e,r,n);if(a&&c===l)return oc(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return oc(o,e)}return a?d:$o.foldFlowLines(d,c,$o.FOLD_FLOW,lg(e,!1))}function Cce(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Cn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Cn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Cn.Scalar.BLOCK_FOLDED:case Cn.Scalar.BLOCK_LITERAL:return i||o?oc(s.value,e):cg(s,e,r,n);case Cn.Scalar.QUOTE_DOUBLE:return ad(s.value,e);case Cn.Scalar.QUOTE_SINGLE:return fE(s.value,e);case Cn.Scalar.PLAIN:return Rce(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}hU.stringifyString=Cce});var ld=b(mE=>{"use strict";var Dce=tg(),ko=Pe(),Nce=od(),jce=cd();function Mce(t,e){let r=Object.assign({blockQuote:!0,commentString:Nce.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Fce(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(ko.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function zce(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(ko.isScalar(t)||ko.isCollection(t))&&t.anchor;o&&Dce.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Lce(t,e,r,n){if(ko.isPair(t))return t.toString(e,r,n);if(ko.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=ko.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Fce(e.doc.schema.tags,o));let s=zce(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):ko.isScalar(o)?jce.stringifyString(o,e,r,n):o.toString(e,r,n);return s?ko.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}mE.createStringifyContext=Mce;mE.stringify=Lce});var vU=b(_U=>{"use strict";var qi=Pe(),gU=It(),yU=ld(),ud=od();function Uce({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=qi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(qi.isCollection(t)||!qi.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||qi.isCollection(t)||(qi.isScalar(t)?t.type===gU.Scalar.BLOCK_FOLDED||t.type===gU.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=yU.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=ud.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=ud.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=ud.lineComment(g,r.indent,l(f))));let v,_,S;qi.isNode(e)?(v=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(v=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&qi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&qi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let w=!1,x=yU.stringify(e,r,()=>w=!0,()=>h=!0),I=" ";if(f||v||_){if(I=v?` +${l}${_}${r}${p}`}function Mce(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` +`)||u&&/[[\]{},]/.test(o))return sc(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` +`)?sc(o,e):ug(t,e,r,n);if(!a&&!u&&i!==Cn.Scalar.PLAIN&&o.includes(` +`))return ug(t,e,r,n);if(fg(o)){if(c==="")return e.forceBlockIndent=!0,ug(t,e,r,n);if(a&&c===l)return sc(o,e)}let d=o.replace(/\n+/g,`$& +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return sc(o,e)}return a?d:ko.foldFlowLines(d,c,ko.FOLD_FLOW,dg(e,!1))}function Fce(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Cn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Cn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Cn.Scalar.BLOCK_FOLDED:case Cn.Scalar.BLOCK_LITERAL:return i||o?sc(s.value,e):ug(s,e,r,n);case Cn.Scalar.QUOTE_DOUBLE:return ld(s.value,e);case Cn.Scalar.QUOTE_SINGLE:return mE(s.value,e);case Cn.Scalar.PLAIN:return Mce(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}_U.stringifyString=Fce});var dd=b(gE=>{"use strict";var zce=ng(),Eo=Pe(),Lce=ad(),Uce=ud();function qce(t,e){let r=Object.assign({blockQuote:!0,commentString:Lce.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Bce(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Eo.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Hce(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Eo.isScalar(t)||Eo.isCollection(t))&&t.anchor;o&&zce.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Zce(t,e,r,n){if(Eo.isPair(t))return t.toString(e,r,n);if(Eo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Eo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Bce(e.doc.schema.tags,o));let s=Hce(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Eo.isScalar(o)?Uce.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Eo.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}gE.createStringifyContext=qce;gE.stringify=Zce});var wU=b(SU=>{"use strict";var qi=Pe(),vU=It(),bU=dd(),fd=ad();function Gce({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=qi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(qi.isCollection(t)||!qi.isNode(t)&&typeof t=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||qi.isCollection(t)||(qi.isScalar(t)?t.type===vU.Scalar.BLOCK_FOLDED||t.type===vU.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=bU.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=fd.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=fd.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=fd.lineComment(g,r.indent,l(f))));let v,_,S;qi.isNode(e)?(v=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(v=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&qi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&qi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let w=!1,x=bU.stringify(e,r,()=>w=!0,()=>h=!0),I=" ";if(f||v||_){if(I=v?` `:"",_){let T=l(_);I+=` -${ud.indentComment(T,r.indent)}`}x===""&&!r.inFlow?I===` +${fd.indentComment(T,r.indent)}`}x===""&&!r.inFlow?I===` `&&S&&(I=` `):I+=` ${r.indent}`}else if(!p&&qi.isCollection(e)){let T=x[0],k=x.indexOf(` `),C=k!==-1,E=r.inFlow??e.flow??e.items.length===0;if(C||!E){let Z=!1;if(C&&(T==="&"||T==="!")){let ie=x.indexOf(" ");T==="&"&&ie!==-1&&ie{"use strict";var bU=Ue("process");function qce(t,...e){t==="debug"&&console.log(...e)}function Bce(t,e){(t==="debug"||t==="warn")&&(typeof bU.emitWarning=="function"?bU.emitWarning(e):console.warn(e))}hE.debug=qce;hE.warn=Bce});var hg=b(mg=>{"use strict";var pg=Pe(),SU=It(),dg="<<",fg={identify:t=>t===dg||typeof t=="symbol"&&t.description===dg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new SU.Scalar(Symbol(dg)),{addToJSMap:wU}),stringify:()=>dg},Hce=(t,e)=>(fg.identify(e)||pg.isScalar(e)&&(!e.type||e.type===SU.Scalar.PLAIN)&&fg.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===fg.tag&&r.default);function wU(t,e,r){let n=xU(t,r);if(pg.isSeq(n))for(let i of n.items)yE(t,e,i);else if(Array.isArray(n))for(let i of n)yE(t,e,i);else yE(t,e,n)}function yE(t,e,r){let n=xU(t,r);if(!pg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function xU(t,e){return t&&pg.isAlias(e)?e.resolve(t.doc,t):e}mg.addMergeToJSMap=wU;mg.isMergeKey=Hce;mg.merge=fg});var vE=b(EU=>{"use strict";var Zce=gE(),$U=hg(),Gce=ld(),kU=Pe(),_E=wo();function Vce(t,e,{key:r,value:n}){if(kU.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if($U.isMergeKey(t,r))$U.addMergeToJSMap(t,e,n);else{let i=_E.toJS(r,"",t);if(e instanceof Map)e.set(i,_E.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Wce(r,i,t),s=_E.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Wce(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(kU.isNode(t)&&r?.doc){let n=Gce.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Zce.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}EU.addPairToJSMap=Vce});var Eo=b(bE=>{"use strict";var AU=id(),Kce=vU(),Jce=vE(),gg=Pe();function Yce(t,e,r){let n=AU.createNode(t,void 0,r),i=AU.createNode(e,void 0,r);return new yg(n,i)}var yg=class t{constructor(e,r=null){Object.defineProperty(this,gg.NODE_TYPE,{value:gg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return gg.isNode(r)&&(r=r.clone(e)),gg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return Jce.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?Kce.stringifyPair(this,e,r,n):JSON.stringify(this)}};bE.Pair=yg;bE.createPair=Yce});var SE=b(OU=>{"use strict";var Fs=Pe(),TU=ld(),_g=od();function Xce(t,e,r){return(e.inFlow??t.flow?ele:Qce)(t,e,r)}function Qce({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(v+=_g.lineComment(v,o,l(g))),d&&g&&(d=!1),f.push(n+v)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var xU=Ue("process");function Vce(t,...e){t==="debug"&&console.log(...e)}function Wce(t,e){(t==="debug"||t==="warn")&&(typeof xU.emitWarning=="function"?xU.emitWarning(e):console.warn(e))}yE.debug=Vce;yE.warn=Wce});var yg=b(gg=>{"use strict";var hg=Pe(),$U=It(),pg="<<",mg={identify:t=>t===pg||typeof t=="symbol"&&t.description===pg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new $U.Scalar(Symbol(pg)),{addToJSMap:kU}),stringify:()=>pg},Kce=(t,e)=>(mg.identify(e)||hg.isScalar(e)&&(!e.type||e.type===$U.Scalar.PLAIN)&&mg.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===mg.tag&&r.default);function kU(t,e,r){let n=EU(t,r);if(hg.isSeq(n))for(let i of n.items)vE(t,e,i);else if(Array.isArray(n))for(let i of n)vE(t,e,i);else vE(t,e,n)}function vE(t,e,r){let n=EU(t,r);if(!hg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function EU(t,e){return t&&hg.isAlias(e)?e.resolve(t.doc,t):e}gg.addMergeToJSMap=kU;gg.isMergeKey=Kce;gg.merge=mg});var SE=b(OU=>{"use strict";var Jce=_E(),AU=yg(),Yce=dd(),TU=Pe(),bE=xo();function Xce(t,e,{key:r,value:n}){if(TU.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(AU.isMergeKey(t,r))AU.addMergeToJSMap(t,e,n);else{let i=bE.toJS(r,"",t);if(e instanceof Map)e.set(i,bE.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=Qce(r,i,t),s=bE.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Qce(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(TU.isNode(t)&&r?.doc){let n=Yce.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Jce.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}OU.addPairToJSMap=Xce});var Ao=b(wE=>{"use strict";var IU=sd(),ele=wU(),tle=SE(),_g=Pe();function rle(t,e,r){let n=IU.createNode(t,void 0,r),i=IU.createNode(e,void 0,r);return new vg(n,i)}var vg=class t{constructor(e,r=null){Object.defineProperty(this,_g.NODE_TYPE,{value:_g.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return _g.isNode(r)&&(r=r.clone(e)),_g.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return tle.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ele.stringifyPair(this,e,r,n):JSON.stringify(this)}};wE.Pair=vg;wE.createPair=rle});var xE=b(RU=>{"use strict";var Fs=Pe(),PU=dd(),bg=ad();function nle(t,e,r){return(e.inFlow??t.flow?ole:ile)(t,e,r)}function ile({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(v+=bg.lineComment(v,o,l(g))),d&&g&&(d=!1),f.push(n+v)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||v.includes(` -`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(v.length+2)>e.options.lineWidth)),l&&(v+=",")),g&&(v+=_g.lineComment(v,n,a(g))),d.push(v),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` +`+bg.indentComment(l(t),c),a&&a()):d&&s&&s(),p}function ole({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mg=null);l||(l=d.length>u||v.includes(` +`)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(v.length+2)>e.options.lineWidth)),l&&(v+=",")),g&&(v+=bg.lineComment(v,n,a(g))),d.push(v),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function vg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=_g.indentComment(e(n),t);r.push(o.trimStart())}}OU.stringifyCollection=Xce});var To=b(xE=>{"use strict";var tle=SE(),rle=vE(),nle=og(),Ao=Pe(),bg=Eo(),ile=It();function dd(t,e){let r=Ao.isScalar(e)?e.value:e;for(let n of t)if(Ao.isPair(n)&&(n.key===e||n.key===r||Ao.isScalar(n.key)&&n.key.value===r))return n}var wE=class extends nle.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ao.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(bg.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Ao.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new bg.Pair(e,e?.value):n=new bg.Pair(e.key,e.value);let i=dd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Ao.isScalar(i.value)&&ile.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=dd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=dd(this.items,e)?.value;return(!r&&Ao.isScalar(i)?i.value:i)??void 0}has(e){return!!dd(this.items,e)}set(e,r){this.add(new bg.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)rle.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Ao.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),tle.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};xE.YAMLMap=wE;xE.findPair=dd});var sc=b(PU=>{"use strict";var ole=Pe(),IU=To(),sle={collection:"map",default:!0,nodeClass:IU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ole.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>IU.YAMLMap.from(t,e,r)};PU.map=sle});var Oo=b(RU=>{"use strict";var ale=id(),cle=SE(),lle=og(),wg=Pe(),ule=It(),dle=wo(),$E=class extends lle.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(wg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Sg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Sg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&wg.isScalar(i)?i.value:i}has(e){let r=Sg(e);return typeof r=="number"&&r=0?e:null}RU.YAMLSeq=$E});var ac=b(DU=>{"use strict";var fle=Pe(),CU=Oo(),ple={collection:"seq",default:!0,nodeClass:CU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return fle.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>CU.YAMLSeq.from(t,e,r)};DU.seq=ple});var fd=b(NU=>{"use strict";var mle=cd(),hle={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),mle.stringifyString(t,e,r,n)}};NU.string=hle});var xg=b(FU=>{"use strict";var jU=It(),MU={identify:t=>t==null,createNode:()=>new jU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new jU.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&MU.test.test(t)?t:e.options.nullStr};FU.nullTag=MU});var kE=b(LU=>{"use strict";var gle=It(),zU={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new gle.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&zU.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};LU.boolTag=zU});var cc=b(UU=>{"use strict";function yle({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}UU.stringifyNumber=yle});var AE=b($g=>{"use strict";var _le=It(),EE=cc(),vle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:EE.stringifyNumber},ble={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():EE.stringifyNumber(t)}},Sle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new _le.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:EE.stringifyNumber};$g.float=Sle;$g.floatExp=ble;$g.floatNaN=vle});var OE=b(Eg=>{"use strict";var qU=cc(),kg=t=>typeof t=="bigint"||Number.isInteger(t),TE=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function BU(t,e,r){let{value:n}=t;return kg(n)&&n>=0?r+n.toString(e):qU.stringifyNumber(t)}var wle={identify:t=>kg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>TE(t,2,8,r),stringify:t=>BU(t,8,"0o")},xle={identify:kg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>TE(t,0,10,r),stringify:qU.stringifyNumber},$le={identify:t=>kg(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>TE(t,2,16,r),stringify:t=>BU(t,16,"0x")};Eg.int=xle;Eg.intHex=$le;Eg.intOct=wle});var ZU=b(HU=>{"use strict";var kle=sc(),Ele=xg(),Ale=ac(),Tle=fd(),Ole=kE(),IE=AE(),PE=OE(),Ile=[kle.map,Ale.seq,Tle.string,Ele.nullTag,Ole.boolTag,PE.intOct,PE.int,PE.intHex,IE.floatNaN,IE.floatExp,IE.float];HU.schema=Ile});var WU=b(VU=>{"use strict";var Ple=It(),Rle=sc(),Cle=ac();function GU(t){return typeof t=="bigint"||Number.isInteger(t)}var Ag=({value:t})=>JSON.stringify(t),Dle=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ag},{identify:t=>t==null,createNode:()=>new Ple.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ag},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ag},{identify:GU,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>GU(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ag}],Nle={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},jle=[Rle.map,Cle.seq].concat(Dle,Nle);VU.schema=jle});var CE=b(KU=>{"use strict";var pd=Ue("buffer"),RE=It(),Mle=cd(),Fle={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof pd.Buffer=="function")return pd.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Tg=Pe(),DE=Eo(),zle=It(),Lle=Oo();function JU(t,e){if(Tg.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new DE.Pair(new zle.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function Sg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=bg.indentComment(e(n),t);r.push(o.trimStart())}}RU.stringifyCollection=nle});var Oo=b(kE=>{"use strict";var sle=xE(),ale=SE(),cle=ag(),To=Pe(),wg=Ao(),lle=It();function pd(t,e){let r=To.isScalar(e)?e.value:e;for(let n of t)if(To.isPair(n)&&(n.key===e||n.key===r||To.isScalar(n.key)&&n.key.value===r))return n}var $E=class extends cle.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(To.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(wg.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;To.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new wg.Pair(e,e?.value):n=new wg.Pair(e.key,e.value);let i=pd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);To.isScalar(i.value)&&lle.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=pd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=pd(this.items,e)?.value;return(!r&&To.isScalar(i)?i.value:i)??void 0}has(e){return!!pd(this.items,e)}set(e,r){this.add(new wg.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)ale.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!To.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),sle.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};kE.YAMLMap=$E;kE.findPair=pd});var ac=b(DU=>{"use strict";var ule=Pe(),CU=Oo(),dle={collection:"map",default:!0,nodeClass:CU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ule.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>CU.YAMLMap.from(t,e,r)};DU.map=dle});var Io=b(NU=>{"use strict";var fle=sd(),ple=xE(),mle=ag(),$g=Pe(),hle=It(),gle=xo(),EE=class extends mle.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super($g.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=xg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=xg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&$g.isScalar(i)?i.value:i}has(e){let r=xg(e);return typeof r=="number"&&r=0?e:null}NU.YAMLSeq=EE});var cc=b(MU=>{"use strict";var yle=Pe(),jU=Io(),_le={collection:"seq",default:!0,nodeClass:jU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return yle.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>jU.YAMLSeq.from(t,e,r)};MU.seq=_le});var md=b(FU=>{"use strict";var vle=ud(),ble={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),vle.stringifyString(t,e,r,n)}};FU.string=ble});var kg=b(UU=>{"use strict";var zU=It(),LU={identify:t=>t==null,createNode:()=>new zU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new zU.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&LU.test.test(t)?t:e.options.nullStr};UU.nullTag=LU});var AE=b(BU=>{"use strict";var Sle=It(),qU={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Sle.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&qU.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};BU.boolTag=qU});var lc=b(HU=>{"use strict";function wle({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}HU.stringifyNumber=wle});var OE=b(Eg=>{"use strict";var xle=It(),TE=lc(),$le={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:TE.stringifyNumber},kle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():TE.stringifyNumber(t)}},Ele={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new xle.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:TE.stringifyNumber};Eg.float=Ele;Eg.floatExp=kle;Eg.floatNaN=$le});var PE=b(Tg=>{"use strict";var ZU=lc(),Ag=t=>typeof t=="bigint"||Number.isInteger(t),IE=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function GU(t,e,r){let{value:n}=t;return Ag(n)&&n>=0?r+n.toString(e):ZU.stringifyNumber(t)}var Ale={identify:t=>Ag(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>IE(t,2,8,r),stringify:t=>GU(t,8,"0o")},Tle={identify:Ag,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>IE(t,0,10,r),stringify:ZU.stringifyNumber},Ole={identify:t=>Ag(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>IE(t,2,16,r),stringify:t=>GU(t,16,"0x")};Tg.int=Tle;Tg.intHex=Ole;Tg.intOct=Ale});var WU=b(VU=>{"use strict";var Ile=ac(),Ple=kg(),Rle=cc(),Cle=md(),Dle=AE(),RE=OE(),CE=PE(),Nle=[Ile.map,Rle.seq,Cle.string,Ple.nullTag,Dle.boolTag,CE.intOct,CE.int,CE.intHex,RE.floatNaN,RE.floatExp,RE.float];VU.schema=Nle});var YU=b(JU=>{"use strict";var jle=It(),Mle=ac(),Fle=cc();function KU(t){return typeof t=="bigint"||Number.isInteger(t)}var Og=({value:t})=>JSON.stringify(t),zle=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Og},{identify:t=>t==null,createNode:()=>new jle.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Og},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Og},{identify:KU,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>KU(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Og}],Lle={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ule=[Mle.map,Fle.seq].concat(zle,Lle);JU.schema=Ule});var NE=b(XU=>{"use strict";var hd=Ue("buffer"),DE=It(),qle=ud(),Ble={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof hd.Buffer=="function")return hd.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Ig=Pe(),jE=Ao(),Hle=It(),Zle=Io();function QU(t,e){if(Ig.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new jE.Pair(new Hle.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=Tg.isPair(n)?n:new DE.Pair(n)}}else e("Expected a sequence for this tag");return t}function YU(t,e,r){let{replacer:n}=r,i=new Lle.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(DE.createPair(a,c,r))}return i}var Ule={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:JU,createNode:YU};Og.createPairs=YU;Og.pairs=Ule;Og.resolvePairs=JU});var ME=b(jE=>{"use strict";var XU=Pe(),NE=wo(),md=To(),qle=Oo(),QU=Ig(),zs=class t extends qle.YAMLSeq{constructor(){super(),this.add=md.YAMLMap.prototype.add.bind(this),this.delete=md.YAMLMap.prototype.delete.bind(this),this.get=md.YAMLMap.prototype.get.bind(this),this.has=md.YAMLMap.prototype.has.bind(this),this.set=md.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(XU.isPair(i)?(o=NE.toJS(i.key,"",r),s=NE.toJS(i.value,o,r)):o=NE.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=QU.createPairs(e,r,n),o=new this;return o.items=i.items,o}};zs.tag="tag:yaml.org,2002:omap";var Ble={collection:"seq",identify:t=>t instanceof Map,nodeClass:zs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=QU.resolvePairs(t,e),n=[];for(let{key:i}of r.items)XU.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new zs,r)},createNode:(t,e,r)=>zs.from(t,e,r)};jE.YAMLOMap=zs;jE.omap=Ble});var iq=b(FE=>{"use strict";var eq=It();function tq({value:t,source:e},r){return e&&(t?rq:nq).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var rq={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new eq.Scalar(!0),stringify:tq},nq={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new eq.Scalar(!1),stringify:tq};FE.falseTag=nq;FE.trueTag=rq});var oq=b(Pg=>{"use strict";var Hle=It(),zE=cc(),Zle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:zE.stringifyNumber},Gle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():zE.stringifyNumber(t)}},Vle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Hle.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:zE.stringifyNumber};Pg.float=Vle;Pg.floatExp=Gle;Pg.floatNaN=Zle});var aq=b(gd=>{"use strict";var sq=cc(),hd=t=>typeof t=="bigint"||Number.isInteger(t);function Rg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function LE(t,e,r){let{value:n}=t;if(hd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return sq.stringifyNumber(t)}var Wle={identify:hd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Rg(t,2,2,r),stringify:t=>LE(t,2,"0b")},Kle={identify:hd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Rg(t,1,8,r),stringify:t=>LE(t,8,"0")},Jle={identify:hd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Rg(t,0,10,r),stringify:sq.stringifyNumber},Yle={identify:hd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Rg(t,2,16,r),stringify:t=>LE(t,16,"0x")};gd.int=Jle;gd.intBin=Wle;gd.intHex=Yle;gd.intOct=Kle});var qE=b(UE=>{"use strict";var Ng=Pe(),Cg=Eo(),Dg=To(),Ls=class t extends Dg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Ng.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Cg.Pair(e.key,null):r=new Cg.Pair(e,null),Dg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Dg.findPair(this.items,e);return!r&&Ng.isPair(n)?Ng.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Dg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Cg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Cg.createPair(s,null,n));return o}};Ls.tag="tag:yaml.org,2002:set";var Xle={collection:"map",identify:t=>t instanceof Set,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ls.from(t,e,r),resolve(t,e){if(Ng.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ls,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};UE.YAMLSet=Ls;UE.set=Xle});var HE=b(jg=>{"use strict";var Qle=cc();function BE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function cq(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return Qle.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var eue={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>BE(t,r),stringify:cq},tue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>BE(t,!1),stringify:cq},lq={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(lq.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=BE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};jg.floatTime=tue;jg.intTime=eue;jg.timestamp=lq});var fq=b(dq=>{"use strict";var rue=sc(),nue=xg(),iue=ac(),oue=fd(),sue=CE(),uq=iq(),ZE=oq(),Mg=aq(),aue=hg(),cue=ME(),lue=Ig(),uue=qE(),GE=HE(),due=[rue.map,iue.seq,oue.string,nue.nullTag,uq.trueTag,uq.falseTag,Mg.intBin,Mg.intOct,Mg.int,Mg.intHex,ZE.floatNaN,ZE.floatExp,ZE.float,sue.binary,aue.merge,cue.omap,lue.pairs,uue.set,GE.intTime,GE.floatTime,GE.timestamp];dq.schema=due});var wq=b(KE=>{"use strict";var gq=sc(),fue=xg(),yq=ac(),pue=fd(),mue=kE(),VE=AE(),WE=OE(),hue=ZU(),gue=WU(),_q=CE(),yd=hg(),vq=ME(),bq=Ig(),pq=fq(),Sq=qE(),Fg=HE(),mq=new Map([["core",hue.schema],["failsafe",[gq.map,yq.seq,pue.string]],["json",gue.schema],["yaml11",pq.schema],["yaml-1.1",pq.schema]]),hq={binary:_q.binary,bool:mue.boolTag,float:VE.float,floatExp:VE.floatExp,floatNaN:VE.floatNaN,floatTime:Fg.floatTime,int:WE.int,intHex:WE.intHex,intOct:WE.intOct,intTime:Fg.intTime,map:gq.map,merge:yd.merge,null:fue.nullTag,omap:vq.omap,pairs:bq.pairs,seq:yq.seq,set:Sq.set,timestamp:Fg.timestamp},yue={"tag:yaml.org,2002:binary":_q.binary,"tag:yaml.org,2002:merge":yd.merge,"tag:yaml.org,2002:omap":vq.omap,"tag:yaml.org,2002:pairs":bq.pairs,"tag:yaml.org,2002:set":Sq.set,"tag:yaml.org,2002:timestamp":Fg.timestamp};function _ue(t,e,r){let n=mq.get(e);if(n&&!t)return r&&!n.includes(yd.merge)?n.concat(yd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(mq.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(yd.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?hq[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(hq).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}KE.coreKnownTags=yue;KE.getTags=_ue});var XE=b(xq=>{"use strict";var JE=Pe(),vue=sc(),bue=ac(),Sue=fd(),zg=wq(),wue=(t,e)=>t.keye.key?1:0,YE=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?zg.getTags(e,"compat"):e?zg.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?zg.coreKnownTags:{},this.tags=zg.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,JE.MAP,{value:vue.map}),Object.defineProperty(this,JE.SCALAR,{value:Sue.string}),Object.defineProperty(this,JE.SEQ,{value:bue.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?wue:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};xq.Schema=YE});var kq=b($q=>{"use strict";var xue=Pe(),QE=ld(),_d=od();function $ue(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=QE.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(_d.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(xue.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(_d.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=QE.stringify(t.contents,i,()=>a=null,c);a&&(l+=_d.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(QE.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` -`)?(r.push("..."),r.push(_d.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(_d.indentComment(o(c),"")))}return r.join(` +${o.comment}`:n.comment}n=i}t.items[r]=Ig.isPair(n)?n:new jE.Pair(n)}}else e("Expected a sequence for this tag");return t}function eq(t,e,r){let{replacer:n}=r,i=new Zle.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(jE.createPair(a,c,r))}return i}var Gle={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QU,createNode:eq};Pg.createPairs=eq;Pg.pairs=Gle;Pg.resolvePairs=QU});var zE=b(FE=>{"use strict";var tq=Pe(),ME=xo(),gd=Oo(),Vle=Io(),rq=Rg(),zs=class t extends Vle.YAMLSeq{constructor(){super(),this.add=gd.YAMLMap.prototype.add.bind(this),this.delete=gd.YAMLMap.prototype.delete.bind(this),this.get=gd.YAMLMap.prototype.get.bind(this),this.has=gd.YAMLMap.prototype.has.bind(this),this.set=gd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(tq.isPair(i)?(o=ME.toJS(i.key,"",r),s=ME.toJS(i.value,o,r)):o=ME.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=rq.createPairs(e,r,n),o=new this;return o.items=i.items,o}};zs.tag="tag:yaml.org,2002:omap";var Wle={collection:"seq",identify:t=>t instanceof Map,nodeClass:zs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=rq.resolvePairs(t,e),n=[];for(let{key:i}of r.items)tq.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new zs,r)},createNode:(t,e,r)=>zs.from(t,e,r)};FE.YAMLOMap=zs;FE.omap=Wle});var aq=b(LE=>{"use strict";var nq=It();function iq({value:t,source:e},r){return e&&(t?oq:sq).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var oq={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new nq.Scalar(!0),stringify:iq},sq={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new nq.Scalar(!1),stringify:iq};LE.falseTag=sq;LE.trueTag=oq});var cq=b(Cg=>{"use strict";var Kle=It(),UE=lc(),Jle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:UE.stringifyNumber},Yle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():UE.stringifyNumber(t)}},Xle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Kle.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:UE.stringifyNumber};Cg.float=Xle;Cg.floatExp=Yle;Cg.floatNaN=Jle});var uq=b(_d=>{"use strict";var lq=lc(),yd=t=>typeof t=="bigint"||Number.isInteger(t);function Dg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function qE(t,e,r){let{value:n}=t;if(yd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return lq.stringifyNumber(t)}var Qle={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Dg(t,2,2,r),stringify:t=>qE(t,2,"0b")},eue={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Dg(t,1,8,r),stringify:t=>qE(t,8,"0")},tue={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Dg(t,0,10,r),stringify:lq.stringifyNumber},rue={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Dg(t,2,16,r),stringify:t=>qE(t,16,"0x")};_d.int=tue;_d.intBin=Qle;_d.intHex=rue;_d.intOct=eue});var HE=b(BE=>{"use strict";var Mg=Pe(),Ng=Ao(),jg=Oo(),Ls=class t extends jg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Mg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ng.Pair(e.key,null):r=new Ng.Pair(e,null),jg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=jg.findPair(this.items,e);return!r&&Mg.isPair(n)?Mg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=jg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Ng.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Ng.createPair(s,null,n));return o}};Ls.tag="tag:yaml.org,2002:set";var nue={collection:"map",identify:t=>t instanceof Set,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ls.from(t,e,r),resolve(t,e){if(Mg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ls,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};BE.YAMLSet=Ls;BE.set=nue});var GE=b(Fg=>{"use strict";var iue=lc();function ZE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function dq(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return iue.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var oue={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>ZE(t,r),stringify:dq},sue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>ZE(t,!1),stringify:dq},fq={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(fq.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=ZE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Fg.floatTime=sue;Fg.intTime=oue;Fg.timestamp=fq});var hq=b(mq=>{"use strict";var aue=ac(),cue=kg(),lue=cc(),uue=md(),due=NE(),pq=aq(),VE=cq(),zg=uq(),fue=yg(),pue=zE(),mue=Rg(),hue=HE(),WE=GE(),gue=[aue.map,lue.seq,uue.string,cue.nullTag,pq.trueTag,pq.falseTag,zg.intBin,zg.intOct,zg.int,zg.intHex,VE.floatNaN,VE.floatExp,VE.float,due.binary,fue.merge,pue.omap,mue.pairs,hue.set,WE.intTime,WE.floatTime,WE.timestamp];mq.schema=gue});var kq=b(YE=>{"use strict";var vq=ac(),yue=kg(),bq=cc(),_ue=md(),vue=AE(),KE=OE(),JE=PE(),bue=WU(),Sue=YU(),Sq=NE(),vd=yg(),wq=zE(),xq=Rg(),gq=hq(),$q=HE(),Lg=GE(),yq=new Map([["core",bue.schema],["failsafe",[vq.map,bq.seq,_ue.string]],["json",Sue.schema],["yaml11",gq.schema],["yaml-1.1",gq.schema]]),_q={binary:Sq.binary,bool:vue.boolTag,float:KE.float,floatExp:KE.floatExp,floatNaN:KE.floatNaN,floatTime:Lg.floatTime,int:JE.int,intHex:JE.intHex,intOct:JE.intOct,intTime:Lg.intTime,map:vq.map,merge:vd.merge,null:yue.nullTag,omap:wq.omap,pairs:xq.pairs,seq:bq.seq,set:$q.set,timestamp:Lg.timestamp},wue={"tag:yaml.org,2002:binary":Sq.binary,"tag:yaml.org,2002:merge":vd.merge,"tag:yaml.org,2002:omap":wq.omap,"tag:yaml.org,2002:pairs":xq.pairs,"tag:yaml.org,2002:set":$q.set,"tag:yaml.org,2002:timestamp":Lg.timestamp};function xue(t,e,r){let n=yq.get(e);if(n&&!t)return r&&!n.includes(vd.merge)?n.concat(vd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(yq.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(vd.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?_q[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(_q).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}YE.coreKnownTags=wue;YE.getTags=xue});var eA=b(Eq=>{"use strict";var XE=Pe(),$ue=ac(),kue=cc(),Eue=md(),Ug=kq(),Aue=(t,e)=>t.keye.key?1:0,QE=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Ug.getTags(e,"compat"):e?Ug.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Ug.coreKnownTags:{},this.tags=Ug.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,XE.MAP,{value:$ue.map}),Object.defineProperty(this,XE.SCALAR,{value:Eue.string}),Object.defineProperty(this,XE.SEQ,{value:kue.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Aue:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Eq.Schema=QE});var Tq=b(Aq=>{"use strict";var Tue=Pe(),tA=dd(),bd=ad();function Oue(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=tA.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(bd.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Tue.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(bd.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=tA.stringify(t.contents,i,()=>a=null,c);a&&(l+=bd.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(tA.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +`)?(r.push("..."),r.push(bd.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(bd.indentComment(o(c),"")))}return r.join(` `)+` -`}$q.stringifyDocument=$ue});var vd=b(Eq=>{"use strict";var kue=nd(),lc=og(),dn=Pe(),Eue=Eo(),Aue=wo(),Tue=XE(),Oue=kq(),eA=tg(),Iue=iE(),Pue=id(),tA=nE(),rA=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dn.NODE_TYPE,{value:dn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new tA.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[dn.NODE_TYPE]:{value:dn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=dn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){uc(this.contents)&&this.contents.add(e)}addIn(e,r){uc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=eA.anchorNames(this);e.anchor=!r||n.has(r)?eA.findNewAnchor(r||"a",n):r}return new kue.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,v=r.filter(g).map(String);v.length>0&&(r=r.concat(v)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=eA.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Pue.createNode(e,u,m);return a&&dn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Eue.Pair(i,o)}delete(e){return uc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return lc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):uc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return dn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return lc.isEmptyPath(e)?!r&&dn.isScalar(this.contents)?this.contents.value:this.contents:dn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return dn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return lc.isEmptyPath(e)?this.contents!==void 0:dn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=lc.collectionFromPath(this.schema,[e],r):uc(this.contents)&&this.contents.set(e,r)}setIn(e,r){lc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=lc.collectionFromPath(this.schema,Array.from(e),r):uc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new tA.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new tA.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Tue.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Aue.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Iue.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Oue.stringifyDocument(this,e)}};function uc(t){if(dn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Eq.Document=rA});var wd=b(Sd=>{"use strict";var bd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},nA=class extends bd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},iA=class extends bd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Rue=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}Aq.stringifyDocument=Oue});var Sd=b(Oq=>{"use strict";var Iue=od(),uc=ag(),dn=Pe(),Pue=Ao(),Rue=xo(),Cue=eA(),Due=Tq(),rA=ng(),Nue=sE(),jue=sd(),nA=oE(),iA=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dn.NODE_TYPE,{value:dn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new nA.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[dn.NODE_TYPE]:{value:dn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=dn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){dc(this.contents)&&this.contents.add(e)}addIn(e,r){dc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=rA.anchorNames(this);e.anchor=!r||n.has(r)?rA.findNewAnchor(r||"a",n):r}return new Iue.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,v=r.filter(g).map(String);v.length>0&&(r=r.concat(v)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=rA.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=jue.createNode(e,u,m);return a&&dn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Pue.Pair(i,o)}delete(e){return dc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):dc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return dn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return uc.isEmptyPath(e)?!r&&dn.isScalar(this.contents)?this.contents.value:this.contents:dn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return dn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return uc.isEmptyPath(e)?this.contents!==void 0:dn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=uc.collectionFromPath(this.schema,[e],r):dc(this.contents)&&this.contents.set(e,r)}setIn(e,r){uc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=uc.collectionFromPath(this.schema,Array.from(e),r):dc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new nA.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new nA.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Cue.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Rue.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Nue.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Due.stringifyDocument(this,e)}};function dc(t){if(dn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Oq.Document=iA});var $d=b(xd=>{"use strict";var wd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},oA=class extends wd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},sA=class extends wd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Mue=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};Sd.YAMLError=bd;Sd.YAMLParseError=nA;Sd.YAMLWarning=iA;Sd.prettifyError=Rue});var xd=b(Aq=>{"use strict";function Cue(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,v=null,_=null,S=null,w=null,x=null;for(let k of t)switch(m&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&o(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&k.type!=="comment"&&k.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(h=k),u=!0;break;case"comment":{u||o(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=k.source.substring(1)||" ";d?d+=f+C:d=C,f="",l=!1;break}case"newline":l?d?d+=k.source:(!w||r!=="seq-item-ind")&&(c=!0):f+=k.source,l=!0,p=!0,(g||v)&&(_=k),u=!0;break;case"anchor":g&&o(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&o(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=k,x??(x=k.offset),l=!1,u=!1,m=!0;break;case"tag":{v&&o(k,"MULTIPLE_TAGS","A node can have at most one tag"),v=k,x??(x=k.offset),l=!1,u=!1,m=!0;break}case r:(g||v)&&o(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),w&&o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),w=k,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=k,l=!1,u=!1;break}default:o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,u=!1}let I=t[t.length-1],T=I?I.offset+I.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:w,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:v,newlineAfterProp:_,end:T,start:x??T}}Aq.resolveProps=Cue});var Lg=b(Tq=>{"use strict";function oA(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(oA(e.key)||oA(e.value))return!0}return!1;default:return!0}}Tq.containsNewline=oA});var sA=b(Oq=>{"use strict";var Due=Lg();function Nue(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Due.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Oq.flowIndentCheck=Nue});var aA=b(Pq=>{"use strict";var Iq=Pe();function jue(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||Iq.isScalar(o)&&Iq.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}Pq.mapIncludes=jue});var Mq=b(jq=>{"use strict";var Rq=Eo(),Mue=To(),Cq=xd(),Fue=Lg(),Dq=sA(),zue=aA(),Nq="All mapping items must start at the same column";function Lue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Mue.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=Cq.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Nq)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` -`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Fue.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Nq);r.atKey=!0;let v=h.end,_=f?t(r,f,h,i):e(r,v,d,null,h,i);r.schema.compat&&Dq.flowIndentCheck(n.indent,f,i),r.atKey=!1,zue.mapIncludes(r,a.items,_)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let S=Cq.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Uue=Oo(),que=xd(),Bue=sA();function Hue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Uue.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=que.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Bue.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Fq.resolveBlockSeq=Hue});var dc=b(Lq=>{"use strict";function Zue(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Lq.resolveEnd=Zue});var Hq=b(Bq=>{"use strict";var Gue=Pe(),Vue=Eo(),Uq=To(),Wue=Oo(),Kue=dc(),qq=xd(),Jue=Lg(),Yue=aA(),cA="Block collections are not allowed within flow collections",lA=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Xue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Uq.YAMLMap:Wue.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=Kue.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` -`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}Bq.resolveFlowCollection=Xue});var Gq=b(Zq=>{"use strict";var Que=Pe(),ede=It(),tde=To(),rde=Oo(),nde=Mq(),ide=zq(),ode=Hq();function uA(t,e,r,n,i,o){let s=r.type==="block-map"?nde.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?ide.resolveBlockSeq(t,e,r,n,o):ode.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function sde(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),uA(t,e,r,i,s)}let l=uA(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=Que.isNode(u)?u:new ede.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}Zq.composeCollection=sde});var fA=b(Vq=>{"use strict";var dA=It();function ade(t,e,r){let n=e.offset,i=cde(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?dA.Scalar.BLOCK_FOLDED:dA.Scalar.BLOCK_LITERAL,s=e.source?lde(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` +`}};xd.YAMLError=wd;xd.YAMLParseError=oA;xd.YAMLWarning=sA;xd.prettifyError=Mue});var kd=b(Iq=>{"use strict";function Fue(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,v=null,_=null,S=null,w=null,x=null;for(let k of t)switch(m&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&o(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&k.type!=="comment"&&k.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(h=k),u=!0;break;case"comment":{u||o(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=k.source.substring(1)||" ";d?d+=f+C:d=C,f="",l=!1;break}case"newline":l?d?d+=k.source:(!w||r!=="seq-item-ind")&&(c=!0):f+=k.source,l=!0,p=!0,(g||v)&&(_=k),u=!0;break;case"anchor":g&&o(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&o(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=k,x??(x=k.offset),l=!1,u=!1,m=!0;break;case"tag":{v&&o(k,"MULTIPLE_TAGS","A node can have at most one tag"),v=k,x??(x=k.offset),l=!1,u=!1,m=!0;break}case r:(g||v)&&o(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),w&&o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),w=k,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=k,l=!1,u=!1;break}default:o(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),l=!1,u=!1}let I=t[t.length-1],T=I?I.offset+I.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:w,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:v,newlineAfterProp:_,end:T,start:x??T}}Iq.resolveProps=Fue});var qg=b(Pq=>{"use strict";function aA(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(aA(e.key)||aA(e.value))return!0}return!1;default:return!0}}Pq.containsNewline=aA});var cA=b(Rq=>{"use strict";var zue=qg();function Lue(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&zue.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Rq.flowIndentCheck=Lue});var lA=b(Dq=>{"use strict";var Cq=Pe();function Uue(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||Cq.isScalar(o)&&Cq.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}Dq.mapIncludes=Uue});var Lq=b(zq=>{"use strict";var Nq=Ao(),que=Oo(),jq=kd(),Bue=qg(),Mq=cA(),Hue=lA(),Fq="All mapping items must start at the same column";function Zue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??que.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=jq.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Fq)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Bue.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Fq);r.atKey=!0;let v=h.end,_=f?t(r,f,h,i):e(r,v,d,null,h,i);r.schema.compat&&Mq.flowIndentCheck(n.indent,f,i),r.atKey=!1,Hue.mapIncludes(r,a.items,_)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let S=jq.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Gue=Io(),Vue=kd(),Wue=cA();function Kue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Gue.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Vue.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Wue.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Uq.resolveBlockSeq=Kue});var fc=b(Bq=>{"use strict";function Jue(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Bq.resolveEnd=Jue});var Vq=b(Gq=>{"use strict";var Yue=Pe(),Xue=Ao(),Hq=Oo(),Que=Io(),ede=fc(),Zq=kd(),tde=qg(),rde=lA(),uA="Block collections are not allowed within flow collections",dA=t=>t&&(t.type==="block-map"||t.type==="block-seq");function nde({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Hq.YAMLMap:Que.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ede.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}Gq.resolveFlowCollection=nde});var Kq=b(Wq=>{"use strict";var ide=Pe(),ode=It(),sde=Oo(),ade=Io(),cde=Lq(),lde=qq(),ude=Vq();function fA(t,e,r,n,i,o){let s=r.type==="block-map"?cde.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?lde.resolveBlockSeq(t,e,r,n,o):ude.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function dde(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),fA(t,e,r,i,s)}let l=fA(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=ide.isNode(u)?u:new ode.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}Wq.composeCollection=dde});var mA=b(Jq=>{"use strict";var pA=It();function fde(t,e,r){let n=e.offset,i=pde(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?pA.Scalar.BLOCK_FOLDED:pA.Scalar.BLOCK_LITERAL,s=e.source?mde(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hc||v[0]===" "?(f===" "?f=` `:!p&&f===` `&&(f=` @@ -112,131 +112,131 @@ ${l} `+s[h][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function cde({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let f=1;f{"use strict";var pA=It(),ude=dc();function dde(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=pA.Scalar.PLAIN,c=fde(o,l);break;case"single-quoted-scalar":a=pA.Scalar.QUOTE_SINGLE,c=pde(o,l);break;case"double-quoted-scalar":a=pA.Scalar.QUOTE_DOUBLE,c=mde(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=ude.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function fde(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Wq(t)}function pde(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Wq(t.slice(1,-1)).replace(/''/g,"'")}function Wq(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";var hA=It(),hde=fc();function gde(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=hA.Scalar.PLAIN,c=yde(o,l);break;case"single-quoted-scalar":a=hA.Scalar.QUOTE_SINGLE,c=_de(o,l);break;case"double-quoted-scalar":a=hA.Scalar.QUOTE_DOUBLE,c=vde(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=hde.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function yde(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Yq(t)}function _de(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Yq(t.slice(1,-1)).replace(/''/g,"'")}function Yq(t){let e,r;try{e=new RegExp(`(.*?)(?o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function hde(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function bde(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var gde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function yde(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Kq.resolveFlowScalar=dde});var Xq=b(Yq=>{"use strict";var Us=Pe(),Jq=It(),_de=fA(),vde=mA();function bde(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?_de.resolveBlockScalar(t,e,n):vde.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Us.SCALAR]:c?l=Sde(t.schema,i,c,r,n):e.type==="scalar"?l=wde(t,i,e,n):l=t.schema[Us.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Us.isScalar(d)?d:new Jq.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new Jq.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Sde(t,e,r,n,i){if(r==="!")return t[Us.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Us.SCALAR])}function wde({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Us.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Us.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}Yq.composeScalar=bde});var e4=b(Qq=>{"use strict";function xde(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}Qq.emptyScalarPosition=xde});var n4=b(gA=>{"use strict";var $de=nd(),kde=Pe(),Ede=Gq(),t4=Xq(),Ade=dc(),Tde=e4(),Ode={composeNode:r4,composeEmptyNode:hA};function r4(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Ide(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=t4.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Ede.composeCollection(Ode,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=hA(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!kde.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function hA(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Tde.emptyScalarPosition(e,r,n),indent:-1,source:""},d=t4.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Ide({options:t},{offset:e,source:r,end:n},i){let o=new $de.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Ade.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}gA.composeEmptyNode=hA;gA.composeNode=r4});var s4=b(o4=>{"use strict";var Pde=vd(),i4=n4(),Rde=dc(),Cde=xd();function Dde(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Pde.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Cde.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?i4.composeNode(l,i,u,s):i4.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Rde.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}o4.composeDoc=Dde});var _A=b(l4=>{"use strict";var Nde=Ue("process"),jde=nE(),Mde=vd(),$d=wd(),a4=Pe(),Fde=s4(),zde=dc();function kd(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function c4(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var Us=Pe(),Qq=It(),xde=mA(),$de=gA();function kde(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?xde.resolveBlockScalar(t,e,n):$de.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Us.SCALAR]:c?l=Ede(t.schema,i,c,r,n):e.type==="scalar"?l=Ade(t,i,e,n):l=t.schema[Us.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Us.isScalar(d)?d:new Qq.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new Qq.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Ede(t,e,r,n,i){if(r==="!")return t[Us.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Us.SCALAR])}function Ade({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Us.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Us.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}e4.composeScalar=kde});var n4=b(r4=>{"use strict";function Tde(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}r4.emptyScalarPosition=Tde});var s4=b(_A=>{"use strict";var Ode=od(),Ide=Pe(),Pde=Kq(),i4=t4(),Rde=fc(),Cde=n4(),Dde={composeNode:o4,composeEmptyNode:yA};function o4(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Nde(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=i4.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Pde.composeCollection(Dde,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=yA(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Ide.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function yA(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Cde.emptyScalarPosition(e,r,n),indent:-1,source:""},d=i4.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Nde({options:t},{offset:e,source:r,end:n},i){let o=new Ode.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Rde.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}_A.composeEmptyNode=yA;_A.composeNode=o4});var l4=b(c4=>{"use strict";var jde=Sd(),a4=s4(),Mde=fc(),Fde=kd();function zde(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new jde.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Fde.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?a4.composeNode(l,i,u,s):a4.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Mde.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}c4.composeDoc=zde});var bA=b(f4=>{"use strict";var Lde=Ue("process"),Ude=oE(),qde=Sd(),Ed=$d(),u4=Pe(),Bde=l4(),Hde=fc();function Ad(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function d4(t){let e="",r=!1,n=!1;for(let i=0;i{let s=kd(r);o?this.warnings.push(new $d.YAMLWarning(s,n,i)):this.errors.push(new $d.YAMLParseError(s,n,i))},this.directives=new jde.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=c4(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(a4.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];a4.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var vA=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Ad(r);o?this.warnings.push(new Ed.YAMLWarning(s,n,i)):this.errors.push(new Ed.YAMLParseError(s,n,i))},this.directives=new Ude.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=d4(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(u4.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];u4.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=kd(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Fde.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new $d.YAMLParseError(kd(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new $d.YAMLParseError(kd(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=zde.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new $d.YAMLParseError(kd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Mde.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};l4.Composer=yA});var f4=b(Ug=>{"use strict";var Lde=fA(),Ude=mA(),qde=wd(),u4=cd();function Bde(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new qde.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Ude.resolveFlowScalar(t,e,n);case"block-scalar":return Lde.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Hde(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=u4.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=Ad(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Bde.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ed.YAMLParseError(Ad(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ed.YAMLParseError(Ad(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Hde.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ed.YAMLParseError(Ad(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new qde.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};f4.Composer=vA});var h4=b(Bg=>{"use strict";var Zde=mA(),Gde=gA(),Vde=$d(),p4=ud();function Wde(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Vde.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gde.resolveFlowScalar(t,e,n);case"block-scalar":return Zde.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Kde(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=p4.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return d4(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Zde(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=u4.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Gde(t,c);break;case'"':vA(t,c,"double-quoted-scalar");break;case"'":vA(t,c,"single-quoted-scalar");break;default:vA(t,c,"scalar")}}function Gde(t,e){let r=e.indexOf(` +`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return m4(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Jde(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=p4.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Yde(t,c);break;case'"':SA(t,c,"double-quoted-scalar");break;case"'":SA(t,c,"single-quoted-scalar");break;default:SA(t,c,"scalar")}}function Yde(t,e){let r=e.indexOf(` `),n=e.substring(0,r),i=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];d4(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function d4(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function vA(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Ug.createScalarToken=Hde;Ug.resolveAsScalar=Bde;Ug.setScalarValue=Zde});var m4=b(p4=>{"use strict";var Vde=t=>"type"in t?Bg(t):qg(t);function Bg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Bg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=qg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=qg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=qg(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function qg({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Bg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Bg(n)),i}p4.stringify=Vde});var _4=b(y4=>{"use strict";var bA=Symbol("break visit"),Wde=Symbol("skip children"),h4=Symbol("remove item");function qs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),g4(Object.freeze([]),t,e)}qs.BREAK=bA;qs.SKIP=Wde;qs.REMOVE=h4;qs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};qs.parentCollection=(t,e)=>{let r=qs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function g4(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var SA=f4(),Kde=m4(),Jde=_4(),wA="\uFEFF",xA="",$A="",kA="",Yde=t=>!!t&&"items"in t,Xde=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Qde(t){switch(t){case wA:return"";case xA:return"";case $A:return"";case kA:return"";default:return JSON.stringify(t)}}function efe(t){switch(t){case wA:return"byte-order-mark";case xA:return"doc-mode";case $A:return"flow-error-end";case kA:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];m4(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function m4(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function SA(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Bg.createScalarToken=Kde;Bg.resolveAsScalar=Wde;Bg.setScalarValue=Jde});var y4=b(g4=>{"use strict";var Xde=t=>"type"in t?Zg(t):Hg(t);function Zg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Zg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Hg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Hg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Hg(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Hg({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Zg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Zg(n)),i}g4.stringify=Xde});var S4=b(b4=>{"use strict";var wA=Symbol("break visit"),Qde=Symbol("skip children"),_4=Symbol("remove item");function qs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),v4(Object.freeze([]),t,e)}qs.BREAK=wA;qs.SKIP=Qde;qs.REMOVE=_4;qs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};qs.parentCollection=(t,e)=>{let r=qs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function v4(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var xA=h4(),efe=y4(),tfe=S4(),$A="\uFEFF",kA="",EA="",AA="",rfe=t=>!!t&&"items"in t,nfe=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function ife(t){switch(t){case $A:return"";case kA:return"";case EA:return"";case AA:return"";default:return JSON.stringify(t)}}function ofe(t){switch(t){case $A:return"byte-order-mark";case kA:return"doc-mode";case EA:return"flow-error-end";case AA:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}kr.createScalarToken=SA.createScalarToken;kr.resolveAsScalar=SA.resolveAsScalar;kr.setScalarValue=SA.setScalarValue;kr.stringify=Kde.stringify;kr.visit=Jde.visit;kr.BOM=wA;kr.DOCUMENT=xA;kr.FLOW_END=$A;kr.SCALAR=kA;kr.isCollection=Yde;kr.isScalar=Xde;kr.prettyToken=Qde;kr.tokenType=efe});var TA=b(b4=>{"use strict";var Ed=Hg();function Dn(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var v4=new Set("0123456789ABCDEFabcdef"),tfe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Zg=new Set(",[]{}"),rfe=new Set(` ,[]{} -\r `),EA=t=>!t||rfe.has(t),AA=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}kr.createScalarToken=xA.createScalarToken;kr.resolveAsScalar=xA.resolveAsScalar;kr.setScalarValue=xA.setScalarValue;kr.stringify=efe.stringify;kr.visit=tfe.visit;kr.BOM=$A;kr.DOCUMENT=kA;kr.FLOW_END=EA;kr.SCALAR=AA;kr.isCollection=rfe;kr.isScalar=nfe;kr.prettyToken=ife;kr.tokenType=ofe});var IA=b(x4=>{"use strict";var Td=Gg();function Dn(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var w4=new Set("0123456789ABCDEFabcdef"),sfe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vg=new Set(",[]{}"),afe=new Set(` ,[]{} +\r `),TA=t=>!t||afe.has(t),OA=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Dn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Dn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Dn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(EA),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&nthis.indentValue&&!Dn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Dn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(TA),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Dn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(` `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===` -`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Ed.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Dn(o)||e&&Zg.has(o))break;r=n}else if(Dn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` +`&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Td.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Dn(o)||e&&Vg.has(o))break;r=n}else if(Dn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` -`,o=this.buffer[n+1]):r=n),o==="#"||e&&Zg.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Zg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Ed.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(EA),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Dn(n)||r&&Zg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Dn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(tfe.has(r))r=this.buffer[++e];else if(r==="%"&&v4.has(this.buffer[e+1])&&v4.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,o=this.buffer[n+1]):r=n),o==="#"||e&&Vg.has(o))break;if(i===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Vg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Td.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(TA),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Dn(n)||r&&Vg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Dn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(sfe.has(r))r=this.buffer[++e];else if(r==="%"&&w4.has(this.buffer[e+1])&&w4.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};b4.Lexer=AA});var IA=b(S4=>{"use strict";var OA=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var nfe=Ue("process"),w4=Hg(),ife=TA();function Io(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Vg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&$4(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&x4(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};x4.Lexer=OA});var RA=b($4=>{"use strict";var PA=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var cfe=Ue("process"),k4=Gg(),lfe=IA();function Po(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Kg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&A4(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&E4(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Io(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(k4(r.key)&&!Io(r.sep,"newline")){let s=fc(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(Io(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=fc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Io(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Io(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Vg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Io(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Gg(n),o=fc(i);$4(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Kg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Po(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(T4(r.key)&&!Po(r.sep,"newline")){let s=pc(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(Po(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=pc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Po(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Po(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Kg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Po(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Wg(n),o=pc(i);A4(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Gg(e),n=fc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Gg(e),n=fc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};E4.Parser=PA});var P4=b(Td=>{"use strict";var A4=_A(),ofe=vd(),Ad=wd(),sfe=gE(),afe=Pe(),cfe=IA(),T4=RA();function O4(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new cfe.LineCounter||null,prettyErrors:e}}function lfe(t,e={}){let{lineCounter:r,prettyErrors:n}=O4(e),i=new T4.Parser(r?.addNewLine),o=new A4.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Ad.prettifyError(t,r)),a.warnings.forEach(Ad.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function I4(t,e={}){let{lineCounter:r,prettyErrors:n}=O4(e),i=new T4.Parser(r?.addNewLine),o=new A4.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Ad.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Ad.prettifyError(t,r)),s.warnings.forEach(Ad.prettifyError(t,r))),s}function ufe(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=I4(t,r);if(!i)return null;if(i.warnings.forEach(o=>sfe.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function dfe(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return afe.isDocument(t)&&!n?t.toString(r):new ofe.Document(t,n,r).toString(r)}Td.parse=ufe;Td.parseAllDocuments=lfe;Td.parseDocument=I4;Td.stringify=dfe});var rr=b(qe=>{"use strict";var ffe=_A(),pfe=vd(),mfe=XE(),CA=wd(),hfe=nd(),Po=Pe(),gfe=Eo(),yfe=It(),_fe=To(),vfe=Oo(),bfe=Hg(),Sfe=TA(),wfe=IA(),xfe=RA(),Wg=P4(),R4=Qu();qe.Composer=ffe.Composer;qe.Document=pfe.Document;qe.Schema=mfe.Schema;qe.YAMLError=CA.YAMLError;qe.YAMLParseError=CA.YAMLParseError;qe.YAMLWarning=CA.YAMLWarning;qe.Alias=hfe.Alias;qe.isAlias=Po.isAlias;qe.isCollection=Po.isCollection;qe.isDocument=Po.isDocument;qe.isMap=Po.isMap;qe.isNode=Po.isNode;qe.isPair=Po.isPair;qe.isScalar=Po.isScalar;qe.isSeq=Po.isSeq;qe.Pair=gfe.Pair;qe.Scalar=yfe.Scalar;qe.YAMLMap=_fe.YAMLMap;qe.YAMLSeq=vfe.YAMLSeq;qe.CST=bfe;qe.Lexer=Sfe.Lexer;qe.LineCounter=wfe.LineCounter;qe.Parser=xfe.Parser;qe.parse=Wg.parse;qe.parseAllDocuments=Wg.parseAllDocuments;qe.parseDocument=Wg.parseDocument;qe.stringify=Wg.stringify;qe.visit=R4.visit;qe.visitAsync=R4.visitAsync});import{execFileSync as $fe}from"node:child_process";import{existsSync as kfe,readFileSync as Efe}from"node:fs";import{join as N4}from"node:path";function mc(t,e){return $fe("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function Xg(t){try{let e=mc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function Qg(t,e){Afe(t,e);let r=mc(t,["rev-parse","HEAD"]).trim(),n=Tfe(t,e);return{groups:Ofe(t,n),head:r,inventory:{after:D4(Jg(t,"spec.yaml")),before:D4(DA(t,e,"spec.yaml"))},since:e,unsharded_commits:Cfe(t,e)}}function NA(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Afe(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{mc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function Tfe(t,e){let r=mc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!C4(c)&&!C4(a)))if(s.startsWith("A")){let l=Kg(Jg(t,c));if(!l)continue;l.status==="done"?n.push(pc(l,"added-as-done")):l.status==="archived"&&n.push(pc(l,"archived"))}else if(s.startsWith("D")){let l=Kg(DA(t,e,a));l&&n.push(pc(l,"archived"))}else{let l=Kg(Jg(t,c));if(!l)continue;let d=Kg(DA(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(pc(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(pc(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(pc(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function C4(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function pc(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>NA(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function Kg(t){if(t===null)return null;let e;try{e=(0,Yg.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function Jg(t,e){let r=N4(t,e);if(!kfe(r))return null;try{return Efe(r,"utf8")}catch{return null}}function DA(t,e,r){try{return mc(t,["show",`${e}:${r}`])}catch{return null}}function Ofe(t,e){let r=Ife(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Ife(t){let e=Jg(t,N4("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,Yg.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function D4(t){let e={};if(t!==null)try{let n=(0,Yg.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Cfe(t,e){let r=mc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Pfe.test(a)&&(Rfe.test(a)||n.push({hash:s,subject:a}))}return n}var Yg,Pfe,Rfe,ey=y(()=>{"use strict";Yg=$t(rr(),1);Pfe=/^(feat|fix)(\([^)]*\))?!?:/,Rfe=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as Dfe}from"node:fs";import{join as Nfe}from"node:path";function ty(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${jfe[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` -`)}function ry(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Ffe(l,r)} |`)}return n.join(` -`)}function Ffe(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of Mfe)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${Dfe(Nfe(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function ny(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),j4(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)j4(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function j4(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=NA(r);n&&t.push(`- ${n}`)}t.push("")}var jfe,Mfe,jA=y(()=>{"use strict";ey();jfe={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Mfe=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as zfe}from"node:fs";function si(t="./spec.yaml"){let e=zfe(t,"utf8");return(0,M4.parse)(e)}var M4,iy=y(()=>{"use strict";M4=$t(rr(),1)});var Ro=b((Er,LA)=>{"use strict";var MA=Er.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+z4(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};MA.prototype.toString=function(){return this.property+" "+this.message};var oy=Er.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};oy.prototype.addError=function(e){var r;if(typeof e=="string")r=new MA(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new MA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Bs(this);if(this.throwError)throw r;return r};oy.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Lfe(t,e){return e+": "+t.toString()+` -`}oy.prototype.toString=function(e){return this.errors.map(Lfe).join("")};Object.defineProperty(oy.prototype,"valid",{get:function(){return!this.errors.length}});LA.exports.ValidatorResultError=Bs;function Bs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Bs.prototype=new Error;Bs.prototype.constructor=Bs;Bs.prototype.name="Validation Error";var F4=Er.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};F4.prototype=Object.create(Error.prototype,{constructor:{value:F4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var FA=Er.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+z4(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};FA.prototype.resolve=function(e){return L4(this.base,e)};FA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=L4(this.base,i||"");var s=new FA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Nn=Er.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Nn.regexp=Nn.regex;Nn.pattern=Nn.regex;Nn.ipv4=Nn["ip-address"];Er.isFormat=function(e,r,n){if(typeof e=="string"&&Nn[r]!==void 0){if(Nn[r]instanceof RegExp)return Nn[r].test(e);if(typeof Nn[r]=="function")return Nn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var z4=Er.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Er.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Ufe(t,e,r,n){typeof r=="object"?e[n]=zA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function qfe(t,e,r){e[r]=t[r]}function Bfe(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=zA(t[n],e[n]):r[n]=e[n]}function zA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Ufe.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(qfe.bind(null,t,n)),Object.keys(e).forEach(Bfe.bind(null,t,e,n))),n}LA.exports.deepMerge=zA;Er.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Hfe(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Er.encodePath=function(e){return e.map(Hfe).join("")};Er.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};Er.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var L4=Er.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var H4=b((J9e,B4)=>{"use strict";var Lr=Ro(),je=Lr.ValidatorResult,Co=Lr.SchemaError,UA={};UA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Me=UA.validators={};Me.type=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function qA(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}Me.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=new je(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Co("anyOf must be an array");if(!r.anyOf.some(qA.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};Me.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new Co("allOf must be an array");var o=new je(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};Me.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new Co("oneOf must be an array");var o=new je(e,r,n,i),s=new je(e,r,n,i),a=r.oneOf.filter(qA.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};Me.if=function(e,r,n,i){if(e===void 0)return null;if(!Lr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=qA.call(this,e,n,i,null,r.if),s=new je(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!Lr.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!Lr.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function BA(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}Me.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!Lr.isSchema(s))throw new Co('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(BA(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};Me.properties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new Co('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=BA(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function U4(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}Me.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new Co('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&U4.call(this,e,r,n,i,a,o)}return o}};Me.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new je(e,r,n,i);for(var s in e)U4.call(this,e,r,n,i,s,o);return o}};Me.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};Me.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};Me.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new je(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};Me.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!Lr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new je(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};Me.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};Me.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};Me.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new je(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};Me.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new je(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};Me.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};Me.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Zfe(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var HA=Ro();ZA.exports.SchemaScanResult=Z4;function Z4(t,e){this.id=t,this.ref=e}ZA.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=HA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=HA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!HA.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var G4=H4(),Do=Ro(),V4=sy().scan,W4=Do.ValidatorResult,Gfe=Do.ValidatorResultError,Od=Do.SchemaError,K4=Do.SchemaContext,Vfe="/",Zt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(ai),this.attributes=Object.create(G4.validators)};Zt.prototype.customFormats={};Zt.prototype.schemas=null;Zt.prototype.types=null;Zt.prototype.attributes=null;Zt.prototype.unresolvedRefs=null;Zt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=V4(r||Vfe,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Zt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=Do.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Od("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Zt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Od('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var ai=Zt.prototype.types={};ai.string=function(e){return typeof e=="string"};ai.number=function(e){return typeof e=="number"&&isFinite(e)};ai.integer=function(e){return typeof e=="number"&&e%1===0};ai.boolean=function(e){return typeof e=="boolean"};ai.array=function(e){return Array.isArray(e)};ai.null=function(e){return e===null};ai.date=function(e){return e instanceof Date};ai.any=function(e){return!0};ai.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};Y4.exports=Zt});var Q4=b((Q9e,Bi)=>{"use strict";var Wfe=Bi.exports.Validator=X4();Bi.exports.ValidatorResult=Ro().ValidatorResult;Bi.exports.ValidatorResultError=Ro().ValidatorResultError;Bi.exports.ValidationError=Ro().ValidationError;Bi.exports.SchemaError=Ro().SchemaError;Bi.exports.SchemaScanResult=sy().SchemaScanResult;Bi.exports.scan=sy().scan;Bi.exports.validate=function(t,e,r){var n=new Wfe;return n.validate(t,e,r)}});import{readFileSync as Kfe}from"node:fs";import{dirname as Jfe,join as Yfe}from"node:path";import{fileURLToPath as Xfe}from"node:url";function npe(t){let e=rpe.validate(t,tpe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function t6(t){let e=npe(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Wg(e),n=pc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Wg(e),n=pc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};O4.Parser=CA});var D4=b(Id=>{"use strict";var I4=bA(),ufe=Sd(),Od=$d(),dfe=_E(),ffe=Pe(),pfe=RA(),P4=DA();function R4(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new pfe.LineCounter||null,prettyErrors:e}}function mfe(t,e={}){let{lineCounter:r,prettyErrors:n}=R4(e),i=new P4.Parser(r?.addNewLine),o=new I4.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Od.prettifyError(t,r)),a.warnings.forEach(Od.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function C4(t,e={}){let{lineCounter:r,prettyErrors:n}=R4(e),i=new P4.Parser(r?.addNewLine),o=new I4.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Od.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Od.prettifyError(t,r)),s.warnings.forEach(Od.prettifyError(t,r))),s}function hfe(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=C4(t,r);if(!i)return null;if(i.warnings.forEach(o=>dfe.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function gfe(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return ffe.isDocument(t)&&!n?t.toString(r):new ufe.Document(t,n,r).toString(r)}Id.parse=hfe;Id.parseAllDocuments=mfe;Id.parseDocument=C4;Id.stringify=gfe});var rr=b(qe=>{"use strict";var yfe=bA(),_fe=Sd(),vfe=eA(),NA=$d(),bfe=od(),Ro=Pe(),Sfe=Ao(),wfe=It(),xfe=Oo(),$fe=Io(),kfe=Gg(),Efe=IA(),Afe=RA(),Tfe=DA(),Jg=D4(),N4=td();qe.Composer=yfe.Composer;qe.Document=_fe.Document;qe.Schema=vfe.Schema;qe.YAMLError=NA.YAMLError;qe.YAMLParseError=NA.YAMLParseError;qe.YAMLWarning=NA.YAMLWarning;qe.Alias=bfe.Alias;qe.isAlias=Ro.isAlias;qe.isCollection=Ro.isCollection;qe.isDocument=Ro.isDocument;qe.isMap=Ro.isMap;qe.isNode=Ro.isNode;qe.isPair=Ro.isPair;qe.isScalar=Ro.isScalar;qe.isSeq=Ro.isSeq;qe.Pair=Sfe.Pair;qe.Scalar=wfe.Scalar;qe.YAMLMap=xfe.YAMLMap;qe.YAMLSeq=$fe.YAMLSeq;qe.CST=kfe;qe.Lexer=Efe.Lexer;qe.LineCounter=Afe.LineCounter;qe.Parser=Tfe.Parser;qe.parse=Jg.parse;qe.parseAllDocuments=Jg.parseAllDocuments;qe.parseDocument=Jg.parseDocument;qe.stringify=Jg.stringify;qe.visit=N4.visit;qe.visitAsync=N4.visitAsync});import{execFileSync as Ofe}from"node:child_process";import{existsSync as Ife,readFileSync as Pfe}from"node:fs";import{join as F4}from"node:path";function hc(t,e){return Ofe("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function ey(t){try{let e=hc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ty(t,e){Rfe(t,e);let r=hc(t,["rev-parse","HEAD"]).trim(),n=Cfe(t,e);return{groups:Dfe(t,n),head:r,inventory:{after:M4(Xg(t,"spec.yaml")),before:M4(jA(t,e,"spec.yaml"))},since:e,unsharded_commits:Ffe(t,e)}}function MA(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Rfe(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{hc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function Cfe(t,e){let r=hc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!j4(c)&&!j4(a)))if(s.startsWith("A")){let l=Yg(Xg(t,c));if(!l)continue;l.status==="done"?n.push(mc(l,"added-as-done")):l.status==="archived"&&n.push(mc(l,"archived"))}else if(s.startsWith("D")){let l=Yg(jA(t,e,a));l&&n.push(mc(l,"archived"))}else{let l=Yg(Xg(t,c));if(!l)continue;let d=Yg(jA(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(mc(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(mc(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(mc(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function j4(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function mc(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>MA(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function Yg(t){if(t===null)return null;let e;try{e=(0,Qg.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function Xg(t,e){let r=F4(t,e);if(!Ife(r))return null;try{return Pfe(r,"utf8")}catch{return null}}function jA(t,e,r){try{return hc(t,["show",`${e}:${r}`])}catch{return null}}function Dfe(t,e){let r=Nfe(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Nfe(t){let e=Xg(t,F4("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,Qg.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function M4(t){let e={};if(t!==null)try{let n=(0,Qg.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Ffe(t,e){let r=hc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);jfe.test(a)&&(Mfe.test(a)||n.push({hash:s,subject:a}))}return n}var Qg,jfe,Mfe,ry=y(()=>{"use strict";Qg=$t(rr(),1);jfe=/^(feat|fix)(\([^)]*\))?!?:/,Mfe=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as zfe}from"node:fs";import{join as Lfe}from"node:path";function ny(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Ufe[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)}function iy(t,e,r){let n=[`# Audit \u2014 shipped changes since ${t.since}`,"","| feature | AC | EARS | verification refs |","|---|---|---|---|"],i=new Map(e.features.map(o=>[o.id,o]));for(let o of t.groups)for(let s of o.features){let a=i.get(s.id);if(!a){n.push(`| ${s.id} | \u2014 | \u2014 | (removed from spec \u2014 see git history at ${t.since}) |`);continue}let c=a.acceptance_criteria??[];if(c.length===0){n.push(`| ${a.id} | \u2014 | \u2014 | (no acceptance criteria) |`);continue}for(let l of c)n.push(`| ${a.id} | ${l.id} | ${l.ears??"\u2014"} | ${Bfe(l,r)} |`)}return n.join(` +`)}function Bfe(t,e){let r=[...t.test_refs??[],...t.oracle_refs??[],...t.evidence_refs??[]];return r.length===0?"(none)":r.map(n=>{for(let[o,s]of qfe)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${zfe(Lfe(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function oy(t){let e=[`# ${t.project.name} \u2014 capability catalog`,""],r=[...t.capabilities??[]].filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=new Map(t.features.map(s=>[s.id,s])),i=new Set;for(let s of r){e.push(`## ${s.title??s.id}`,""),s.summary&&e.push(s.summary,"");for(let a of s.features??[]){let c=n.get(a);!c||c.status==="archived"||(i.add(a),z4(e,c))}}let o=t.features.filter(s=>!i.has(s.id)&&s.status!=="archived").sort((s,a)=>s.id.localeCompare(a.id));if(o.length>0){e.push("## Uncategorized","");for(let s of o)z4(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` +`)}function z4(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=MA(r);n&&t.push(`- ${n}`)}t.push("")}var Ufe,qfe,FA=y(()=>{"use strict";ry();Ufe={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};qfe=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Hfe}from"node:fs";function si(t="./spec.yaml"){let e=Hfe(t,"utf8");return(0,L4.parse)(e)}var L4,sy=y(()=>{"use strict";L4=$t(rr(),1)});var Co=b((Er,qA)=>{"use strict";var zA=Er.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+q4(l)},"instance")):i!==void 0&&(this.property=i),e&&(this.message=e),n){var a=n.$id||n.id;this.schema=a||n}r!==void 0&&(this.instance=r),this.name=o,this.argument=s,this.stack=this.toString()};zA.prototype.toString=function(){return this.property+" "+this.message};var ay=Er.ValidatorResult=function(e,r,n,i){this.instance=e,this.schema=r,this.options=n,this.path=i.path,this.propertyPath=i.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};ay.prototype.addError=function(e){var r;if(typeof e=="string")r=new zA(e,this.instance,this.schema,this.path);else{if(!e)throw new Error("Missing error detail");if(!e.message)throw new Error("Missing error message");if(!e.name)throw new Error("Missing validator type");r=new zA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Bs(this);if(this.throwError)throw r;return r};ay.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Zfe(t,e){return e+": "+t.toString()+` +`}ay.prototype.toString=function(e){return this.errors.map(Zfe).join("")};Object.defineProperty(ay.prototype,"valid",{get:function(){return!this.errors.length}});qA.exports.ValidatorResultError=Bs;function Bs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Bs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Bs.prototype=new Error;Bs.prototype.constructor=Bs;Bs.prototype.name="Validation Error";var U4=Er.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};U4.prototype=Object.create(Error.prototype,{constructor:{value:U4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var LA=Er.SchemaContext=function(e,r,n,i,o){this.schema=e,this.options=r,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(s,a){return s+q4(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};LA.prototype.resolve=function(e){return B4(this.base,e)};LA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=B4(this.base,i||"");var s=new LA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var Nn=Er.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(t){return typeof t=="string"&&parseFloat(t)===parseInt(t,10)&&!isNaN(t)},regex:function(t){var e=!0;try{new RegExp(t)}catch{e=!1}return e},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};Nn.regexp=Nn.regex;Nn.pattern=Nn.regex;Nn.ipv4=Nn["ip-address"];Er.isFormat=function(e,r,n){if(typeof e=="string"&&Nn[r]!==void 0){if(Nn[r]instanceof RegExp)return Nn[r].test(e);if(typeof Nn[r]=="function")return Nn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var q4=Er.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Er.deepCompareStrict=function t(e,r){if(typeof e!=typeof r)return!1;if(Array.isArray(e))return!Array.isArray(r)||e.length!==r.length?!1:e.every(function(o,s){return t(e[s],r[s])});if(typeof e=="object"){if(!e||!r)return e===r;var n=Object.keys(e),i=Object.keys(r);return n.length!==i.length?!1:n.every(function(o){return t(e[o],r[o])})}return e===r};function Gfe(t,e,r,n){typeof r=="object"?e[n]=UA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Vfe(t,e,r){e[r]=t[r]}function Wfe(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=UA(t[n],e[n]):r[n]=e[n]}function UA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Gfe.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Vfe.bind(null,t,n)),Object.keys(e).forEach(Wfe.bind(null,t,e,n))),n}qA.exports.deepMerge=UA;Er.objectGetPath=function(e,r){for(var n=r.split("/").slice(1),i;typeof(i=n.shift())=="string";){var o=decodeURIComponent(i.replace(/~0/,"~").replace(/~1/g,"/"));if(!(o in e))return;e=e[o]}return e};function Kfe(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Er.encodePath=function(e){return e.map(Kfe).join("")};Er.getDecimalPlaces=function(e){var r=0;if(isNaN(e))return r;typeof e!="number"&&(e=Number(e));var n=e.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return r;r=Number(n[1].slice(1))}var i=n[0].split(".");return i.length===2&&(r+=i[1].length),r};Er.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var B4=Er.resolveUrl=function(e,r){let n=new URL(r,new URL(e,"resolve://"));if(n.protocol==="resolve:"){let{pathname:i,search:o,hash:s}=n;return i+o+s}return n.toString()}});var V4=b((nVe,G4)=>{"use strict";var Lr=Co(),je=Lr.ValidatorResult,Do=Lr.SchemaError,BA={};BA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Me=BA.validators={};Me.type=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=Array.isArray(r.type)?r.type:[r.type];if(!s.some(this.testType.bind(this,e,r,n,i))){var a=s.map(function(c){if(c){var l=c.$id||c.id;return l?"<"+l+">":c+""}});o.addError({name:"type",argument:a,message:"is not of a type(s) "+a})}return o};function HA(t,e,r,n,i){var o=e.throwError,s=e.throwAll;e.throwError=!1,e.throwAll=!1;var a=this.validateSchema(t,i,e,r);return e.throwError=o,e.throwAll=s,!a.valid&&n instanceof Function&&n(a),a.valid}Me.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new je(e,r,n,i),s=new je(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Do("anyOf must be an array");if(!r.anyOf.some(HA.bind(this,e,n,i,function(c){s.importErrors(c)}))){var a=r.anyOf.map(function(c,l){var u=c.$id||c.id;return u?"<"+u+">":c.title&&JSON.stringify(c.title)||c.$ref&&"<"+c.$ref+">"||"[subschema "+l+"]"});n.nestedErrors&&o.importErrors(s),o.addError({name:"anyOf",argument:a,message:"is not any of "+a.join(",")})}return o};Me.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new Do("allOf must be an array");var o=new je(e,r,n,i),s=this;return r.allOf.forEach(function(a,c){var l=s.validateSchema(e,a,n,i);if(!l.valid){var u=a.$id||a.id,d=u||a.title&&JSON.stringify(a.title)||a.$ref&&"<"+a.$ref+">"||"[subschema "+c+"]";o.addError({name:"allOf",argument:{id:d,length:l.errors.length,valid:l},message:"does not match allOf schema "+d+" with "+l.errors.length+" error[s]:"}),o.importErrors(l)}}),o};Me.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new Do("oneOf must be an array");var o=new je(e,r,n,i),s=new je(e,r,n,i),a=r.oneOf.filter(HA.bind(this,e,n,i,function(l){s.importErrors(l)})).length,c=r.oneOf.map(function(l,u){var d=l.$id||l.id;return d||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]"});return a!==1&&(n.nestedErrors&&o.importErrors(s),o.addError({name:"oneOf",argument:c,message:"is not exactly one from "+c.join(",")})),o};Me.if=function(e,r,n,i){if(e===void 0)return null;if(!Lr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=HA.call(this,e,n,i,null,r.if),s=new je(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!Lr.isSchema(r.then))throw new Error('Expected "then" keyword to be a schema');a=this.validateSchema(e,r.then,n,i.makeChild(r.then)),s.importErrors(a)}else{if(r.else===void 0)return;if(!Lr.isSchema(r.else))throw new Error('Expected "else" keyword to be a schema');a=this.validateSchema(e,r.else,n,i.makeChild(r.else)),s.importErrors(a)}return s};function ZA(t,e){if(Object.hasOwnProperty.call(t,e))return t[e];if(e in t){for(;t=Object.getPrototypeOf(t);)if(Object.propertyIsEnumerable.call(t,e))return t[e]}}Me.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!Lr.isSchema(s))throw new Do('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(ZA(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};Me.properties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.properties||{};for(var a in s){var c=s[a];if(c!==void 0){if(c===null)throw new Do('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=ZA(e,a),u=this.validateSchema(l,c,n,i.makeChild(c,a));u.instance!==o.instance[a]&&(o.instance[a]=u.instance),o.importErrors(u)}}return o}};function H4(t,e,r,n,i,o){if(this.types.object(t)&&!(e.properties&&e.properties[i]!==void 0))if(e.additionalProperties===!1)o.addError({name:"additionalProperties",argument:i,message:"is not allowed to have the additional property "+JSON.stringify(i)});else{var s=e.additionalProperties||{};typeof r.preValidateProperty=="function"&&r.preValidateProperty(t,i,s,r,n);var a=this.validateSchema(t[i],s,r,n.makeChild(s,i));a.instance!==o.instance[i]&&(o.instance[i]=a.instance),o.importErrors(a)}}Me.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=r.patternProperties||{};for(var a in e){var c=!0;for(var l in s){var u=s[l];if(u!==void 0){if(u===null)throw new Do('Unexpected null, expected schema in "patternProperties"');try{var d=new RegExp(l,"u")}catch{d=new RegExp(l)}if(d.test(a)){c=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,u,n,i);var f=this.validateSchema(e[a],u,n,i.makeChild(u,a));f.instance!==o.instance[a]&&(o.instance[a]=f.instance),o.importErrors(f)}}}c&&H4.call(this,e,r,n,i,a,o)}return o}};Me.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new je(e,r,n,i);for(var s in e)H4.call(this,e,r,n,i,s,o);return o}};Me.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length>=r.minProperties||o.addError({name:"minProperties",argument:r.minProperties,message:"does not meet minimum property length of "+r.minProperties}),o}};Me.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new je(e,r,n,i),s=Object.keys(e);return s.length<=r.maxProperties||o.addError({name:"maxProperties",argument:r.maxProperties,message:"does not meet maximum property length of "+r.maxProperties}),o}};Me.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new je(e,r,n,i);return e.every(function(a,c){if(Array.isArray(r.items))var l=r.items[c]===void 0?r.additionalItems:r.items[c];else var l=r.items;if(l===void 0)return!0;if(l===!1)return s.addError({name:"items",message:"additionalItems not permitted"}),!1;var u=o.validateSchema(a,l,n,i.makeChild(l,c));return u.instance!==s.instance[c]&&(s.instance[c]=u.instance),s.importErrors(u),!0}),s}};Me.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!Lr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new je(e,r,n,i),a=e.some(function(c,l){var u=o.validateSchema(c,r.contains,n,i.makeChild(r.contains,l));return u.errors.length===0});return a===!1&&s.addError({name:"contains",argument:r.contains,message:"must contain an item matching given schema"}),s}};Me.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMinimum&&r.exclusiveMinimum===!0?e>r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than "+r.minimum}):e>=r.minimum||o.addError({name:"minimum",argument:r.minimum,message:"must be greater than or equal to "+r.minimum}),o}};Me.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new je(e,r,n,i);return r.exclusiveMaximum&&r.exclusiveMaximum===!0?er.exclusiveMinimum;return s||o.addError({name:"exclusiveMinimum",argument:r.exclusiveMinimum,message:"must be strictly greater than "+r.exclusiveMinimum}),o}};Me.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new je(e,r,n,i),s=e=r.minLength||o.addError({name:"minLength",argument:r.minLength,message:"does not meet minimum length of "+r.minLength}),o}};Me.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new je(e,r,n,i),s=e.match(/[\uDC00-\uDFFF]/g),a=e.length-(s?s.length:0);return a<=r.maxLength||o.addError({name:"maxLength",argument:r.maxLength,message:"does not meet maximum length of "+r.maxLength}),o}};Me.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length>=r.minItems||o.addError({name:"minItems",argument:r.minItems,message:"does not meet minimum length of "+r.minItems}),o}};Me.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new je(e,r,n,i);return e.length<=r.maxItems||o.addError({name:"maxItems",argument:r.maxItems,message:"does not meet maximum length of "+r.maxItems}),o}};function Jfe(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var GA=Co();VA.exports.SchemaScanResult=W4;function W4(t,e){this.id=t,this.ref=e}VA.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=GA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=GA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!GA.deepCompareStrict(s[f],l))throw new Error("Schema <"+f+"> already exists with different definition");return s[f]}s[f]=l,f[f.length-1]=="#"&&(s[f.substring(0,f.length-1)]=l)}i(f+"/items",Array.isArray(l.items)?l.items:[l.items]),i(f+"/extends",Array.isArray(l.extends)?l.extends:[l.extends]),n(f+"/additionalItems",l.additionalItems),o(f+"/properties",l.properties),n(f+"/additionalProperties",l.additionalProperties),o(f+"/definitions",l.definitions),o(f+"/patternProperties",l.patternProperties),o(f+"/dependencies",l.dependencies),i(f+"/disallow",l.disallow),i(f+"/allOf",l.allOf),i(f+"/anyOf",l.anyOf),i(f+"/oneOf",l.oneOf),n(f+"/not",l.not)}function i(c,l){if(Array.isArray(l))for(var u=0;u{"use strict";var K4=V4(),No=Co(),J4=cy().scan,Y4=No.ValidatorResult,Yfe=No.ValidatorResultError,Pd=No.SchemaError,X4=No.SchemaContext,Xfe="/",Zt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(ai),this.attributes=Object.create(K4.validators)};Zt.prototype.customFormats={};Zt.prototype.schemas=null;Zt.prototype.types=null;Zt.prototype.attributes=null;Zt.prototype.unresolvedRefs=null;Zt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=J4(r||Xfe,e),o=r||e.$id||e.id;for(var s in i.id)this.schemas[s]=i.id[s];for(var s in i.ref)this.unresolvedRefs.push(s);return this.unresolvedRefs=this.unresolvedRefs.filter(function(a){return typeof n.schemas[a]>"u"}),this.schemas[o]};Zt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=No.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Pd("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Zt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Pd('Unexpected null in "type" keyword');if(typeof this.types[o]=="function")return this.types[o].call(this,e);if(o&&typeof o=="object"){var s=this.validateSchema(e,o,n,i);return s===void 0||!(s&&s.errors.length)}return!0}};var ai=Zt.prototype.types={};ai.string=function(e){return typeof e=="string"};ai.number=function(e){return typeof e=="number"&&isFinite(e)};ai.integer=function(e){return typeof e=="number"&&e%1===0};ai.boolean=function(e){return typeof e=="boolean"};ai.array=function(e){return Array.isArray(e)};ai.null=function(e){return e===null};ai.date=function(e){return e instanceof Date};ai.any=function(e){return!0};ai.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};e6.exports=Zt});var r6=b((sVe,Bi)=>{"use strict";var Qfe=Bi.exports.Validator=t6();Bi.exports.ValidatorResult=Co().ValidatorResult;Bi.exports.ValidatorResultError=Co().ValidatorResultError;Bi.exports.ValidationError=Co().ValidationError;Bi.exports.SchemaError=Co().SchemaError;Bi.exports.SchemaScanResult=cy().SchemaScanResult;Bi.exports.scan=cy().scan;Bi.exports.validate=function(t,e,r){var n=new Qfe;return n.validate(t,e,r)}});import{readFileSync as epe}from"node:fs";import{dirname as tpe,join as rpe}from"node:path";import{fileURLToPath as npe}from"node:url";function cpe(t){let e=ape.validate(t,spe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function i6(t){let e=cpe(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` - `)}`)}var e6,Qfe,epe,tpe,rpe,r6=y(()=>{"use strict";e6=$t(Q4(),1),Qfe=Jfe(Xfe(import.meta.url)),epe=Yfe(Qfe,"schema.json"),tpe=JSON.parse(Kfe(epe,"utf8")),rpe=new e6.Validator});import{existsSync as GA,readdirSync as ipe}from"node:fs";import{dirname as ope,join as Hs,resolve as i6}from"node:path";function n6(t){return GA(t)?ipe(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>si(Hs(t,r))):[]}function cy(t,e){ay=e?{cwd:i6(t),spec:e}:null}function J(t=".",e="spec.yaml"){return ay&&e==="spec.yaml"&&i6(t)===ay.cwd?ay.spec:spe(t,e)}function spe(t,e){let r=Hs(t,e),n=si(r),i=Hs(t,ope(e),"spec");if(!n.features||n.features.length===0){let o=n6(Hs(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=n6(Hs(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Hs(i,"architecture.yaml");GA(o)&&(n.architecture=si(o))}if(!n.capabilities||n.capabilities.length===0){let o=Hs(i,"capabilities.yaml");if(GA(o)){let s=si(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return t6(n),n}var ay,lt=y(()=>{"use strict";iy();r6();ay=null});import hc from"node:process";function KA(){return!!hc.stdout.isTTY}function H(t,e,r=""){let n=o6[t],i=r?` ${r}`:"";KA()?hc.stdout.write(`${VA[t]}${n}${WA} ${e}${i} -`):hc.stdout.write(`${n} ${e}${i} -`)}function Id(t,e,r=""){if(!KA())return;let n=r?` ${r}`:"";hc.stdout.write(`${s6}${VA.start}\xB7${WA} ${t} \xB7 ${e}${n}`)}function Zs(t,e,r=""){let n=o6[t],i=r?` ${r}`:"";KA()?hc.stdout.write(`${s6}${VA[t]}${n}${WA} ${e}${i} -`):hc.stdout.write(`${n} ${e}${i} -`)}var o6,VA,WA,s6,No=y(()=>{"use strict";o6={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},VA={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},WA="\x1B[0m",s6="\r\x1B[K"});import{execFileSync as c6}from"node:child_process";import{appendFileSync as ape,existsSync as JA,mkdirSync as cpe,readFileSync as lpe,renameSync as upe,statSync as dpe}from"node:fs";import{userInfo as fpe}from"node:os";import{dirname as ppe,join as l6}from"node:path";function u6(t){return l6(t,mpe,hpe)}function Ur(t,e){let r=u6(t),n=ppe(r);JA(n)||cpe(n,{recursive:!0});try{JA(r)&&dpe(r).size>ype&&upe(r,l6(n,gpe))}catch{}ape(r,`${JSON.stringify(e)} -`,"utf8")}function Pd(t){let e=u6(t);if(!JA(e))return[];let r=lpe(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function qr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function _pe(t){let e;try{e=c6("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=fpe().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function vpe(t){try{return c6("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function YA(t,e){try{let r=Pd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function Zi(t,e,r){try{let n=vpe(t),i=_pe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=YA(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Ur(t,qr(e,o))}catch{}}var mpe,hpe,gpe,ype,ci=y(()=>{"use strict";mpe=".cladding",hpe="events.log.jsonl",gpe="events.log.1.jsonl",ype=5*1024*1024});import{createHash as bpe}from"node:crypto";import{existsSync as Spe,readFileSync as d6,writeFileSync as wpe}from"node:fs";import{join as XA}from"node:path";function Rd(t,e){let r=bpe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(d6(XA(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function gc(t){let e=XA(t,...f6);if(!Spe(e))return null;let r=new Map;try{for(let n of d6(e,"utf8").split(` -`)){let i=n.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);i&&r.set(i[1],i[2])}}catch{return null}return r}function p6(t,e){let r=(e.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return!1;let i=`# Cladding \xB7 Tier C \u2014 verification attestation (GREEN strict pre-push gate). Do not edit by hand. + `)}`)}var n6,ipe,ope,spe,ape,o6=y(()=>{"use strict";n6=$t(r6(),1),ipe=tpe(npe(import.meta.url)),ope=rpe(ipe,"schema.json"),spe=JSON.parse(epe(ope,"utf8")),ape=new n6.Validator});import{existsSync as WA,readdirSync as lpe}from"node:fs";import{dirname as upe,join as Hs,resolve as a6}from"node:path";function s6(t){return WA(t)?lpe(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>si(Hs(t,r))):[]}function uy(t,e){ly=e?{cwd:a6(t),spec:e}:null}function J(t=".",e="spec.yaml"){return ly&&e==="spec.yaml"&&a6(t)===ly.cwd?ly.spec:dpe(t,e)}function dpe(t,e){let r=Hs(t,e),n=si(r),i=Hs(t,upe(e),"spec");if(!n.features||n.features.length===0){let o=s6(Hs(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=s6(Hs(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Hs(i,"architecture.yaml");WA(o)&&(n.architecture=si(o))}if(!n.capabilities||n.capabilities.length===0){let o=Hs(i,"capabilities.yaml");if(WA(o)){let s=si(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return i6(n),n}var ly,lt=y(()=>{"use strict";sy();o6();ly=null});import gc from"node:process";function YA(){return!!gc.stdout.isTTY}function H(t,e,r=""){let n=c6[t],i=r?` ${r}`:"";YA()?gc.stdout.write(`${KA[t]}${n}${JA} ${e}${i} +`):gc.stdout.write(`${n} ${e}${i} +`)}function Rd(t,e,r=""){if(!YA())return;let n=r?` ${r}`:"";gc.stdout.write(`${l6}${KA.start}\xB7${JA} ${t} \xB7 ${e}${n}`)}function Zs(t,e,r=""){let n=c6[t],i=r?` ${r}`:"";YA()?gc.stdout.write(`${l6}${KA[t]}${n}${JA} ${e}${i} +`):gc.stdout.write(`${n} ${e}${i} +`)}var c6,KA,JA,l6,jo=y(()=>{"use strict";c6={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},KA={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},JA="\x1B[0m",l6="\r\x1B[K"});import{execFileSync as d6}from"node:child_process";import{appendFileSync as fpe,existsSync as XA,mkdirSync as ppe,readFileSync as mpe,renameSync as hpe,statSync as gpe}from"node:fs";import{userInfo as ype}from"node:os";import{dirname as _pe,join as f6}from"node:path";function p6(t){return f6(t,vpe,bpe)}function Ur(t,e){let r=p6(t),n=_pe(r);XA(n)||ppe(n,{recursive:!0});try{XA(r)&&gpe(r).size>wpe&&hpe(r,f6(n,Spe))}catch{}fpe(r,`${JSON.stringify(e)} +`,"utf8")}function Cd(t){let e=p6(t);if(!XA(e))return[];let r=mpe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function qr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function xpe(t){let e;try{e=d6("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=ype().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function $pe(t){try{return d6("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function QA(t,e){try{let r=Cd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function Zi(t,e,r){try{let n=$pe(t),i=xpe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=QA(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Ur(t,qr(e,o))}catch{}}var vpe,bpe,Spe,wpe,ci=y(()=>{"use strict";vpe=".cladding",bpe="events.log.jsonl",Spe="events.log.1.jsonl",wpe=5*1024*1024});import{createHash as kpe}from"node:crypto";import{existsSync as Epe,readFileSync as m6,writeFileSync as Ape}from"node:fs";import{join as eT}from"node:path";function Dd(t,e){let r=kpe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(m6(eT(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function yc(t){let e=eT(t,...h6);if(!Epe(e))return null;let r=new Map;try{for(let n of m6(e,"utf8").split(` +`)){let i=n.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);i&&r.set(i[1],i[2])}}catch{return null}return r}function g6(t,e){let r=(e.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return!1;let i=`# Cladding \xB7 Tier C \u2014 verification attestation (GREEN strict pre-push gate). Do not edit by hand. # One line per done feature: sha256 tree-hash of its modules at the last # attested verification. STALE_ATTESTATION compares; \`clad check # --tier=pre-push --strict\` GREEN refreshes. Content-anchored: survives # fresh clones and squash/rebase (suggested .gitattributes: merge=union). attested: -`+r.map(o=>` ${o.id}: ${Rd(t,o.modules??[])}`).sort().join(` +`+r.map(o=>` ${o.id}: ${Dd(t,o.modules??[])}`).sort().join(` `)+` -`;return wpe(XA(t,...f6),i,"utf8"),!0}var f6,Cd=y(()=>{"use strict";f6=["spec","attestation.yaml"]});function kt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Gi=y(()=>{});import{fileURLToPath as Rpe}from"node:url";var yc,Cpe,tT,rT,_c=y(()=>{yc=(t,e)=>{let r=rT(Cpe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Cpe=t=>tT(t)?t.toString():t,tT=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,rT=t=>t instanceof URL?Rpe(t):t});var uy,nT=y(()=>{Gi();_c();uy=(t,e=[],r={})=>{let n=yc(t,"First argument"),[i,o]=kt(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!kt(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as Dpe}from"node:string_decoder";var b6,S6,Mt,Vi,Npe,w6,jpe,dy,x6,Mpe,Dd,Fpe,iT,zpe,Br=y(()=>{({toString:b6}=Object.prototype),S6=t=>b6.call(t)==="[object ArrayBuffer]",Mt=t=>b6.call(t)==="[object Uint8Array]",Vi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Npe=new TextEncoder,w6=t=>Npe.encode(t),jpe=new TextDecoder,dy=t=>jpe.decode(t),x6=(t,e)=>Mpe(t,e).join(""),Mpe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new Dpe(e),n=t.map(o=>typeof o=="string"?w6(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},Dd=t=>t.length===1&&Mt(t[0])?t[0]:iT(Fpe(t)),Fpe=t=>t.map(e=>typeof e=="string"?w6(e):e),iT=t=>{let e=new Uint8Array(zpe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},zpe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Lpe}from"node:child_process";var A6,T6,Upe,qpe,$6,Bpe,k6,E6,Hpe,O6=y(()=>{Gi();Br();A6=t=>Array.isArray(t)&&Array.isArray(t.raw),T6=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Upe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Upe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=qpe(i,t.raw[n]),c=k6(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>E6(d)):[E6(l)];return k6(c,u,a)},qpe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=$6.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],E6=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(kt(t)&&("stdout"in t||"isMaxBuffer"in t))return Hpe(t);throw t instanceof Lpe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Hpe=({stdout:t})=>{if(typeof t=="string")return t;if(Mt(t))return dy(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import oT from"node:process";var jn,fy,fn,py,Wi=y(()=>{jn=t=>fy.includes(t),fy=[oT.stdin,oT.stdout,oT.stderr],fn=["stdin","stdout","stderr"],py=t=>fn[t]??`stdio[${t}]`});import{debuglog as Zpe}from"node:util";var P6,sT,Gpe,Vpe,Wpe,Kpe,I6,Jpe,aT,Ype,Xpe,Qpe,eme,cT,Ki,Ji=y(()=>{Gi();Wi();P6=t=>{let e={...t};for(let r of cT)e[r]=sT(t,r);return e},sT=(t,e)=>{let r=Array.from({length:Gpe(t)+1}),n=Vpe(t[e],r,e);return Xpe(n,e)},Gpe=({stdio:t})=>Array.isArray(t)?Math.max(t.length,fn.length):fn.length,Vpe=(t,e,r)=>kt(t)?Wpe(t,e,r):e.fill(t),Wpe=(t,e,r)=>{for(let n of Object.keys(t).sort(Kpe))for(let i of Jpe(n,r,e))e[i]=t[n];return e},Kpe=(t,e)=>I6(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,Jpe=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=aT(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. +`;return Ape(eT(t,...h6),i,"utf8"),!0}var h6,Nd=y(()=>{"use strict";h6=["spec","attestation.yaml"]});function kt(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Gi=y(()=>{});import{fileURLToPath as Mpe}from"node:url";var _c,Fpe,nT,iT,vc=y(()=>{_c=(t,e)=>{let r=iT(Fpe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Fpe=t=>nT(t)?t.toString():t,nT=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,iT=t=>t instanceof URL?Mpe(t):t});var fy,oT=y(()=>{Gi();vc();fy=(t,e=[],r={})=>{let n=_c(t,"First argument"),[i,o]=kt(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!kt(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as zpe}from"node:string_decoder";var x6,$6,Mt,Vi,Lpe,k6,Upe,py,E6,qpe,jd,Bpe,sT,Hpe,Br=y(()=>{({toString:x6}=Object.prototype),$6=t=>x6.call(t)==="[object ArrayBuffer]",Mt=t=>x6.call(t)==="[object Uint8Array]",Vi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Lpe=new TextEncoder,k6=t=>Lpe.encode(t),Upe=new TextDecoder,py=t=>Upe.decode(t),E6=(t,e)=>qpe(t,e).join(""),qpe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new zpe(e),n=t.map(o=>typeof o=="string"?k6(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},jd=t=>t.length===1&&Mt(t[0])?t[0]:sT(Bpe(t)),Bpe=t=>t.map(e=>typeof e=="string"?k6(e):e),sT=t=>{let e=new Uint8Array(Hpe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Hpe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Zpe}from"node:child_process";var I6,P6,Gpe,Vpe,A6,Wpe,T6,O6,Kpe,R6=y(()=>{Gi();Br();I6=t=>Array.isArray(t)&&Array.isArray(t.raw),P6=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Gpe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Gpe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Vpe(i,t.raw[n]),c=T6(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>O6(d)):[O6(l)];return T6(c,u,a)},Vpe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=A6.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],O6=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(kt(t)&&("stdout"in t||"isMaxBuffer"in t))return Kpe(t);throw t instanceof Zpe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Kpe=({stdout:t})=>{if(typeof t=="string")return t;if(Mt(t))return py(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import aT from"node:process";var jn,my,fn,hy,Wi=y(()=>{jn=t=>my.includes(t),my=[aT.stdin,aT.stdout,aT.stderr],fn=["stdin","stdout","stderr"],hy=t=>fn[t]??`stdio[${t}]`});import{debuglog as Jpe}from"node:util";var D6,cT,Ype,Xpe,Qpe,eme,C6,tme,lT,rme,nme,ime,ome,uT,Ki,Ji=y(()=>{Gi();Wi();D6=t=>{let e={...t};for(let r of uT)e[r]=cT(t,r);return e},cT=(t,e)=>{let r=Array.from({length:Ype(t)+1}),n=Xpe(t[e],r,e);return nme(n,e)},Ype=({stdio:t})=>Array.isArray(t)?Math.max(t.length,fn.length):fn.length,Xpe=(t,e,r)=>kt(t)?Qpe(t,e,r):e.fill(t),Qpe=(t,e,r)=>{for(let n of Object.keys(t).sort(eme))for(let i of tme(n,r,e))e[i]=t[n];return e},eme=(t,e)=>C6(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,tme=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=lT(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},aT=t=>{if(t==="all")return t;if(fn.includes(t))return fn.indexOf(t);let e=Ype.exec(t);if(e!==null)return Number(e[1])},Ype=/^fd(\d+)$/,Xpe=(t,e)=>t.map(r=>r===void 0?eme[e]:r),Qpe=Zpe("execa").enabled?"full":"none",eme={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Qpe,stripFinalNewline:!0},cT=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ki=(t,e)=>e==="ipc"?t.at(-1):t[e]});var vc,bc,R6,lT,tme,my,hy,jo=y(()=>{Ji();vc=({verbose:t},e)=>lT(t,e)!=="none",bc=({verbose:t},e)=>!["none","short"].includes(lT(t,e)),R6=({verbose:t},e)=>{let r=lT(t,e);return my(r)?r:void 0},lT=(t,e)=>e===void 0?tme(t):Ki(t,e),tme=t=>t.find(e=>my(e))??hy.findLast(e=>t.includes(e)),my=t=>typeof t=="function",hy=["none","short","full"]});import{platform as rme}from"node:process";import{stripVTControlCharacters as nme}from"node:util";var C6,Nd,D6,ime,ome,sme,ame,cme,lme,ume,gy=y(()=>{C6=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>lme(D6(o))).join(" ");return{command:n,escapedCommand:i}},Nd=t=>nme(t).split(` -`).map(e=>D6(e)).join(` -`),D6=t=>t.replaceAll(sme,e=>ime(e)),ime=t=>{let e=ame[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=cme?`\\u${n.padStart(4,"0")}`:`\\U${n}`},ome=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},sme=ome(),ame={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},cme=65535,lme=t=>ume.test(t)?t:rme==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,ume=/^[\w./-]+$/});import N6 from"node:process";function uT(){let{env:t}=N6,{TERM:e,TERM_PROGRAM:r}=t;return N6.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var j6=y(()=>{});var M6,F6,dme,fme,pme,mme,hme,yy,fWe,z6=y(()=>{j6();M6={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},F6={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},dme={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},fme={...M6,...F6},pme={...M6,...dme},mme=uT(),hme=mme?fme:pme,yy=hme,fWe=Object.entries(F6)});import gme from"node:tty";var yme,ge,hWe,L6,gWe,yWe,_We,vWe,bWe,SWe,wWe,xWe,$We,kWe,EWe,AWe,TWe,OWe,IWe,_y,PWe,RWe,CWe,DWe,NWe,jWe,MWe,FWe,zWe,U6,LWe,q6,UWe,qWe,BWe,HWe,ZWe,GWe,VWe,WWe,KWe,JWe,YWe,dT=y(()=>{yme=gme?.WriteStream?.prototype?.hasColors?.()??!1,ge=(t,e)=>{if(!yme)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},hWe=ge(0,0),L6=ge(1,22),gWe=ge(2,22),yWe=ge(3,23),_We=ge(4,24),vWe=ge(53,55),bWe=ge(7,27),SWe=ge(8,28),wWe=ge(9,29),xWe=ge(30,39),$We=ge(31,39),kWe=ge(32,39),EWe=ge(33,39),AWe=ge(34,39),TWe=ge(35,39),OWe=ge(36,39),IWe=ge(37,39),_y=ge(90,39),PWe=ge(40,49),RWe=ge(41,49),CWe=ge(42,49),DWe=ge(43,49),NWe=ge(44,49),jWe=ge(45,49),MWe=ge(46,49),FWe=ge(47,49),zWe=ge(100,49),U6=ge(91,39),LWe=ge(92,39),q6=ge(93,39),UWe=ge(94,39),qWe=ge(95,39),BWe=ge(96,39),HWe=ge(97,39),ZWe=ge(101,49),GWe=ge(102,49),VWe=ge(103,49),WWe=ge(104,49),KWe=ge(105,49),JWe=ge(106,49),YWe=ge(107,49)});var B6=y(()=>{dT();dT()});var G6,vme,vy,H6,bme,Z6,Sme,V6=y(()=>{z6();B6();G6=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=vme(r),c=bme[t]({failed:o,reject:s,piped:n}),l=Sme[t]({reject:s});return`${_y(`[${a}]`)} ${_y(`[${i}]`)} ${l(c)} ${l(e)}`},vme=t=>`${vy(t.getHours(),2)}:${vy(t.getMinutes(),2)}:${vy(t.getSeconds(),2)}.${vy(t.getMilliseconds(),3)}`,vy=(t,e)=>String(t).padStart(e,"0"),H6=({failed:t,reject:e})=>t?e?yy.cross:yy.warning:yy.tick,bme={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:H6,duration:H6},Z6=t=>t,Sme={command:()=>L6,output:()=>Z6,ipc:()=>Z6,error:({reject:t})=>t?U6:q6,duration:()=>_y}});var W6,wme,xme,K6=y(()=>{jo();W6=(t,e,r)=>{let n=R6(e,r);return t.map(({verboseLine:i,verboseObject:o})=>wme(i,o,n)).filter(i=>i!==void 0).map(i=>xme(i)).join("")},wme=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},xme=t=>t.endsWith(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},lT=t=>{if(t==="all")return t;if(fn.includes(t))return fn.indexOf(t);let e=rme.exec(t);if(e!==null)return Number(e[1])},rme=/^fd(\d+)$/,nme=(t,e)=>t.map(r=>r===void 0?ome[e]:r),ime=Jpe("execa").enabled?"full":"none",ome={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ime,stripFinalNewline:!0},uT=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ki=(t,e)=>e==="ipc"?t.at(-1):t[e]});var bc,Sc,N6,dT,sme,gy,yy,Mo=y(()=>{Ji();bc=({verbose:t},e)=>dT(t,e)!=="none",Sc=({verbose:t},e)=>!["none","short"].includes(dT(t,e)),N6=({verbose:t},e)=>{let r=dT(t,e);return gy(r)?r:void 0},dT=(t,e)=>e===void 0?sme(t):Ki(t,e),sme=t=>t.find(e=>gy(e))??yy.findLast(e=>t.includes(e)),gy=t=>typeof t=="function",yy=["none","short","full"]});import{platform as ame}from"node:process";import{stripVTControlCharacters as cme}from"node:util";var j6,Md,M6,lme,ume,dme,fme,pme,mme,hme,_y=y(()=>{j6=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>mme(M6(o))).join(" ");return{command:n,escapedCommand:i}},Md=t=>cme(t).split(` +`).map(e=>M6(e)).join(` +`),M6=t=>t.replaceAll(dme,e=>lme(e)),lme=t=>{let e=fme[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=pme?`\\u${n.padStart(4,"0")}`:`\\U${n}`},ume=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},dme=ume(),fme={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},pme=65535,mme=t=>hme.test(t)?t:ame==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,hme=/^[\w./-]+$/});import F6 from"node:process";function fT(){let{env:t}=F6,{TERM:e,TERM_PROGRAM:r}=t;return F6.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var z6=y(()=>{});var L6,U6,gme,yme,_me,vme,bme,vy,vWe,q6=y(()=>{z6();L6={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},U6={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},gme={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},yme={...L6,...U6},_me={...L6,...gme},vme=fT(),bme=vme?yme:_me,vy=bme,vWe=Object.entries(U6)});import Sme from"node:tty";var wme,ge,wWe,B6,xWe,$We,kWe,EWe,AWe,TWe,OWe,IWe,PWe,RWe,CWe,DWe,NWe,jWe,MWe,by,FWe,zWe,LWe,UWe,qWe,BWe,HWe,ZWe,GWe,H6,VWe,Z6,WWe,KWe,JWe,YWe,XWe,QWe,eKe,tKe,rKe,nKe,iKe,pT=y(()=>{wme=Sme?.WriteStream?.prototype?.hasColors?.()??!1,ge=(t,e)=>{if(!wme)return i=>i;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return i=>{let o=i+"",s=o.indexOf(n);if(s===-1)return r+o+n;let a=r,c=0,u=(e===22?n:"")+r;for(;s!==-1;)a+=o.slice(c,s)+u,c=s+n.length,s=o.indexOf(n,c);return a+=o.slice(c)+n,a}},wWe=ge(0,0),B6=ge(1,22),xWe=ge(2,22),$We=ge(3,23),kWe=ge(4,24),EWe=ge(53,55),AWe=ge(7,27),TWe=ge(8,28),OWe=ge(9,29),IWe=ge(30,39),PWe=ge(31,39),RWe=ge(32,39),CWe=ge(33,39),DWe=ge(34,39),NWe=ge(35,39),jWe=ge(36,39),MWe=ge(37,39),by=ge(90,39),FWe=ge(40,49),zWe=ge(41,49),LWe=ge(42,49),UWe=ge(43,49),qWe=ge(44,49),BWe=ge(45,49),HWe=ge(46,49),ZWe=ge(47,49),GWe=ge(100,49),H6=ge(91,39),VWe=ge(92,39),Z6=ge(93,39),WWe=ge(94,39),KWe=ge(95,39),JWe=ge(96,39),YWe=ge(97,39),XWe=ge(101,49),QWe=ge(102,49),eKe=ge(103,49),tKe=ge(104,49),rKe=ge(105,49),nKe=ge(106,49),iKe=ge(107,49)});var G6=y(()=>{pT();pT()});var K6,$me,Sy,V6,kme,W6,Eme,J6=y(()=>{q6();G6();K6=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=$me(r),c=kme[t]({failed:o,reject:s,piped:n}),l=Eme[t]({reject:s});return`${by(`[${a}]`)} ${by(`[${i}]`)} ${l(c)} ${l(e)}`},$me=t=>`${Sy(t.getHours(),2)}:${Sy(t.getMinutes(),2)}:${Sy(t.getSeconds(),2)}.${Sy(t.getMilliseconds(),3)}`,Sy=(t,e)=>String(t).padStart(e,"0"),V6=({failed:t,reject:e})=>t?e?vy.cross:vy.warning:vy.tick,kme={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:V6,duration:V6},W6=t=>t,Eme={command:()=>B6,output:()=>W6,ipc:()=>W6,error:({reject:t})=>t?H6:Z6,duration:()=>by}});var Y6,Ame,Tme,X6=y(()=>{Mo();Y6=(t,e,r)=>{let n=N6(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Ame(i,o,n)).filter(i=>i!==void 0).map(i=>Tme(i)).join("")},Ame=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Tme=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as $me}from"node:util";var li,kme,Eme,Ame,by,Tme,Sc=y(()=>{gy();V6();K6();li=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=kme({type:t,result:i,verboseInfo:n}),s=Eme(e,o),a=W6(s,n,r);a!==""&&console.warn(a.slice(0,-1))},kme=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Eme=(t,e)=>t.split(` -`).map(r=>Ame({...e,message:r})),Ame=t=>({verboseLine:G6(t),verboseObject:t}),by=t=>{let e=typeof t=="string"?t:$me(t);return Nd(e).replaceAll(" "," ".repeat(Tme))},Tme=2});var J6,Y6=y(()=>{jo();Sc();J6=(t,e)=>{vc(e)&&li({type:"command",verboseMessage:t,verboseInfo:e})}});var X6,Ome,Ime,Pme,Q6=y(()=>{jo();X6=(t,e,r)=>{Pme(t);let n=Ome(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Ome=t=>vc({verbose:t})?Ime++:void 0,Ime=0n,Pme=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!hy.includes(e)&&!my(e)){let r=hy.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as eB}from"node:process";var Sy,fT,wy=y(()=>{Sy=()=>eB.bigint(),fT=t=>Number(eB.bigint()-t)/1e6});var xy,pT=y(()=>{Y6();Q6();wy();gy();Ji();xy=(t,e,r)=>{let n=Sy(),{command:i,escapedCommand:o}=C6(t,e),s=sT(r,"verbose"),a=X6(s,o,{...r});return J6(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var oB=b((xKe,iB)=>{iB.exports=nB;nB.sync=Cme;var tB=Ue("fs");function Rme(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{lB.exports=aB;aB.sync=Dme;var sB=Ue("fs");function aB(t,e,r){sB.stat(t,function(n,i){r(n,n?!1:cB(i,e))})}function Dme(t,e){return cB(sB.statSync(t),e)}function cB(t,e){return t.isFile()&&Nme(t,e)}function Nme(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var fB=b((EKe,dB)=>{var kKe=Ue("fs"),$y;process.platform==="win32"||global.TESTING_WINDOWS?$y=oB():$y=uB();dB.exports=mT;mT.sync=jme;function mT(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){mT(t,e||{},function(o,s){o?i(o):n(s)})})}$y(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function jme(t,e){try{return $y.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var vB=b((AKe,_B)=>{var wc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pB=Ue("path"),Mme=wc?";":":",mB=fB(),hB=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),gB=(t,e)=>{let r=e.colon||Mme,n=t.match(/\//)||wc&&t.match(/\\/)?[""]:[...wc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=wc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=wc?i.split(r):[""];return wc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},yB=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=gB(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(hB(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=pB.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];mB(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Fme=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=gB(t,e),o=[];for(let s=0;s{"use strict";var bB=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};hT.exports=bB;hT.exports.default=bB});var kB=b((OKe,$B)=>{"use strict";var wB=Ue("path"),zme=vB(),Lme=SB();function xB(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=zme.sync(t.command,{path:r[Lme({env:r})],pathExt:e?wB.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=wB.resolve(i?t.options.cwd:"",s)),s}function Ume(t){return xB(t)||xB(t,!0)}$B.exports=Ume});var EB=b((IKe,yT)=>{"use strict";var gT=/([()\][%!^"`<>&|;, *?])/g;function qme(t){return t=t.replace(gT,"^$1"),t}function Bme(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(gT,"^$1"),e&&(t=t.replace(gT,"^$1")),t}yT.exports.command=qme;yT.exports.argument=Bme});var TB=b((PKe,AB)=>{"use strict";AB.exports=/^#!(.*)/});var IB=b((RKe,OB)=>{"use strict";var Hme=TB();OB.exports=(t="")=>{let e=t.match(Hme);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var RB=b((CKe,PB)=>{"use strict";var _T=Ue("fs"),Zme=IB();function Gme(t){let r=Buffer.alloc(150),n;try{n=_T.openSync(t,"r"),_T.readSync(n,r,0,150,0),_T.closeSync(n)}catch{}return Zme(r.toString())}PB.exports=Gme});var jB=b((DKe,NB)=>{"use strict";var Vme=Ue("path"),CB=kB(),DB=EB(),Wme=RB(),Kme=process.platform==="win32",Jme=/\.(?:com|exe)$/i,Yme=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Xme(t){t.file=CB(t);let e=t.file&&Wme(t.file);return e?(t.args.unshift(t.file),t.command=e,CB(t)):t.file}function Qme(t){if(!Kme)return t;let e=Xme(t),r=!Jme.test(e);if(t.options.forceShell||r){let n=Yme.test(e);t.command=Vme.normalize(t.command),t.command=DB.command(t.command),t.args=t.args.map(o=>DB.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function ehe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:Qme(n)}NB.exports=ehe});var zB=b((NKe,FB)=>{"use strict";var vT=process.platform==="win32";function bT(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function the(t,e){if(!vT)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=MB(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function MB(t,e){return vT&&t===1&&!e.file?bT(e.original,"spawn"):null}function rhe(t,e){return vT&&t===1&&!e.file?bT(e.original,"spawnSync"):null}FB.exports={hookChildProcess:the,verifyENOENT:MB,verifyENOENTSync:rhe,notFoundError:bT}});var qB=b((jKe,xc)=>{"use strict";var LB=Ue("child_process"),ST=jB(),wT=zB();function UB(t,e,r){let n=ST(t,e,r),i=LB.spawn(n.command,n.args,n.options);return wT.hookChildProcess(i,n),i}function nhe(t,e,r){let n=ST(t,e,r),i=LB.spawnSync(n.command,n.args,n.options);return i.error=i.error||wT.verifyENOENTSync(i.status,n),i}xc.exports=UB;xc.exports.spawn=UB;xc.exports.sync=nhe;xc.exports._parse=ST;xc.exports._enoent=wT});function ky(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var BB=y(()=>{});var HB=y(()=>{});import{promisify as ihe}from"node:util";import{execFile as ohe,execFileSync as UKe}from"node:child_process";import ZB from"node:path";import{fileURLToPath as she}from"node:url";function Ey(t){return t instanceof URL?she(t):t}function GB(t){return{*[Symbol.iterator](){let e=ZB.resolve(Ey(t)),r;for(;r!==e;)yield e,r=e,e=ZB.resolve(e,"..")}}}var HKe,ZKe,VB=y(()=>{HB();HKe=ihe(ohe);ZKe=10*1024*1024});import Ay from"node:process";import Gs from"node:path";var ahe,che,lhe,WB,KB=y(()=>{BB();VB();ahe=({cwd:t=Ay.cwd(),path:e=Ay.env[ky()],preferLocal:r=!0,execPath:n=Ay.execPath,addExecPath:i=!0}={})=>{let o=Gs.resolve(Ey(t)),s=[],a=e.split(Gs.delimiter);return r&&che(s,a,o),i&&lhe(s,a,n,o),e===""||e===Gs.delimiter?`${s.join(Gs.delimiter)}${e}`:[...s,e].join(Gs.delimiter)},che=(t,e,r)=>{for(let n of GB(r)){let i=Gs.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},lhe=(t,e,r,n)=>{let i=Gs.resolve(n,Ey(r),"..");e.includes(i)||t.push(i)},WB=({env:t=Ay.env,...e}={})=>{t={...t};let r=ky({env:t});return e.path=t[r],t[r]=ahe(e),t}});var JB,Mn,YB,XB,QB,Ty,jd,Md,Vs=y(()=>{JB=(t,e,r)=>{let n=r?Md:jd,i=t instanceof Mn?{}:{cause:t};return new n(e,i)},Mn=class extends Error{},YB=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,QB,{value:!0,writable:!1,enumerable:!1,configurable:!1})},XB=t=>Ty(t)&&QB in t,QB=Symbol("isExecaError"),Ty=t=>Object.prototype.toString.call(t)==="[object Error]",jd=class extends Error{};YB(jd,jd.name);Md=class extends Error{};YB(Md,Md.name)});var eH,uhe,tH,rH,nH=y(()=>{eH=()=>{let t=rH-tH+1;return Array.from({length:t},uhe)},uhe=(t,e)=>({name:`SIGRT${e+1}`,number:tH+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),tH=34,rH=64});var iH,oH=y(()=>{iH=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as dhe}from"node:os";var xT,fhe,sH=y(()=>{oH();nH();xT=()=>{let t=eH();return[...iH,...t].map(fhe)},fhe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=dhe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as phe}from"node:os";var mhe,hhe,aH,ghe,yhe,_he,c3e,cH=y(()=>{sH();mhe=()=>{let t=xT();return Object.fromEntries(t.map(hhe))},hhe=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],aH=mhe(),ghe=()=>{let t=xT(),e=65,r=Array.from({length:e},(n,i)=>yhe(i,t));return Object.assign({},...r)},yhe=(t,e)=>{let r=_he(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},_he=(t,e)=>{let r=e.find(({name:n})=>phe.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},c3e=ghe()});import{constants as Fd}from"node:os";var uH,dH,fH,vhe,bhe,lH,She,$T,whe,xhe,Oy,zd=y(()=>{cH();uH=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return fH(t,e)},dH=t=>t===0?t:fH(t,"`subprocess.kill()`'s argument"),fH=(t,e)=>{if(Number.isInteger(t))return vhe(t,e);if(typeof t=="string")return She(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. -${$T()}`)},vhe=(t,e)=>{if(lH.has(t))return lH.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. -${$T()}`)},bhe=()=>new Map(Object.entries(Fd.signals).reverse().map(([t,e])=>[e,t])),lH=bhe(),She=(t,e)=>{if(t in Fd.signals)return t;throw t.toUpperCase()in Fd.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. -${$T()}`)},$T=()=>`Available signal names: ${whe()}. -Available signal numbers: ${xhe()}.`,whe=()=>Object.keys(Fd.signals).sort().map(t=>`'${t}'`).join(", "),xhe=()=>[...new Set(Object.values(Fd.signals).sort((t,e)=>t-e))].join(", "),Oy=t=>aH[t].description});import{setTimeout as $he}from"node:timers/promises";var pH,khe,mH,Ehe,Ahe,The,kT,Iy=y(()=>{Vs();zd();pH=t=>{if(t===!1)return t;if(t===!0)return khe;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},khe=1e3*5,mH=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Ehe(s,a,r);Ahe(l,n);let u=t(c);return The({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Ehe=(t,e,r)=>{let[n=r,i]=Ty(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!Ty(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:dH(n),error:i}},Ahe=(t,e)=>{t!==void 0&&e.reject(t)},The=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&kT({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},kT=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await $he(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Ohe}from"node:events";var Py,ET=y(()=>{Py=async(t,e)=>{t.aborted||await Ohe(t,"abort",{signal:e})}});var hH,gH,Ihe,AT=y(()=>{ET();hH=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},gH=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Ihe(t,e,n,i)],Ihe=async(t,e,r,{signal:n})=>{throw await Py(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var $c,Phe,TT,yH,_H,Ry,vH,bH,SH,wH,xH,$H,Rhe,Che,Dhe,Fn,Nhe,Mo,kc,Ec=y(()=>{$c=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Phe(t,e,r),TT(t,e,n)},Phe=(t,e,r)=>{if(!r)throw new Error(`${Fn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},TT=(t,e,r)=>{if(!r)throw new Error(`${Fn(t,e)} cannot be used: the ${Mo(e)} has already exited or disconnected.`)},yH=t=>{throw new Error(`${Fn("getOneMessage",t)} could not complete: the ${Mo(t)} exited or disconnected.`)},_H=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Mo(t)} is sending a message too, instead of listening to incoming messages. +`});import{inspect as Ome}from"node:util";var li,Ime,Pme,Rme,wy,Cme,wc=y(()=>{_y();J6();X6();li=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Ime({type:t,result:i,verboseInfo:n}),s=Pme(e,o),a=Y6(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Ime=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:i=!1,...o}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:i,result:e,options:o}),Pme=(t,e)=>t.split(` +`).map(r=>Rme({...e,message:r})),Rme=t=>({verboseLine:K6(t),verboseObject:t}),wy=t=>{let e=typeof t=="string"?t:Ome(t);return Md(e).replaceAll(" "," ".repeat(Cme))},Cme=2});var Q6,eB=y(()=>{Mo();wc();Q6=(t,e)=>{bc(e)&&li({type:"command",verboseMessage:t,verboseInfo:e})}});var tB,Dme,Nme,jme,rB=y(()=>{Mo();tB=(t,e,r)=>{jme(t);let n=Dme(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Dme=t=>bc({verbose:t})?Nme++:void 0,Nme=0n,jme=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!yy.includes(e)&&!gy(e)){let r=yy.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as nB}from"node:process";var xy,mT,$y=y(()=>{xy=()=>nB.bigint(),mT=t=>Number(nB.bigint()-t)/1e6});var ky,hT=y(()=>{eB();rB();$y();_y();Ji();ky=(t,e,r)=>{let n=xy(),{command:i,escapedCommand:o}=j6(t,e),s=cT(r,"verbose"),a=tB(s,o,{...r});return Q6(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var cB=b((IKe,aB)=>{aB.exports=sB;sB.sync=Fme;var iB=Ue("fs");function Mme(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{fB.exports=uB;uB.sync=zme;var lB=Ue("fs");function uB(t,e,r){lB.stat(t,function(n,i){r(n,n?!1:dB(i,e))})}function zme(t,e){return dB(lB.statSync(t),e)}function dB(t,e){return t.isFile()&&Lme(t,e)}function Lme(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),u=a|c,d=r&l||r&c&&i===s||r&a&&n===o||r&u&&o===0;return d}});var hB=b((CKe,mB)=>{var RKe=Ue("fs"),Ey;process.platform==="win32"||global.TESTING_WINDOWS?Ey=cB():Ey=pB();mB.exports=gT;gT.sync=Ume;function gT(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){gT(t,e||{},function(o,s){o?i(o):n(s)})})}Ey(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Ume(t,e){try{return Ey.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var wB=b((DKe,SB)=>{var xc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",gB=Ue("path"),qme=xc?";":":",yB=hB(),_B=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),vB=(t,e)=>{let r=e.colon||qme,n=t.match(/\//)||xc&&t.match(/\\/)?[""]:[...xc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=xc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=xc?i.split(r):[""];return xc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},bB=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=vB(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(_B(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=gB.join(p,t),h=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;u(c(h,l,0))}),c=(l,u,d)=>new Promise((f,p)=>{if(d===i.length)return f(a(u+1));let m=i[d];yB(l+m,{pathExt:o},(h,g)=>{if(!h&&g)if(e.all)s.push(l+m);else return f(l+m);return f(c(l,u,d+1))})});return r?a(0).then(l=>r(null,l),r):a(0)},Bme=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=vB(t,e),o=[];for(let s=0;s{"use strict";var xB=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};yT.exports=xB;yT.exports.default=xB});var TB=b((jKe,AB)=>{"use strict";var kB=Ue("path"),Hme=wB(),Zme=$B();function EB(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=Hme.sync(t.command,{path:r[Zme({env:r})],pathExt:e?kB.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=kB.resolve(i?t.options.cwd:"",s)),s}function Gme(t){return EB(t)||EB(t,!0)}AB.exports=Gme});var OB=b((MKe,vT)=>{"use strict";var _T=/([()\][%!^"`<>&|;, *?])/g;function Vme(t){return t=t.replace(_T,"^$1"),t}function Wme(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(_T,"^$1"),e&&(t=t.replace(_T,"^$1")),t}vT.exports.command=Vme;vT.exports.argument=Wme});var PB=b((FKe,IB)=>{"use strict";IB.exports=/^#!(.*)/});var CB=b((zKe,RB)=>{"use strict";var Kme=PB();RB.exports=(t="")=>{let e=t.match(Kme);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var NB=b((LKe,DB)=>{"use strict";var bT=Ue("fs"),Jme=CB();function Yme(t){let r=Buffer.alloc(150),n;try{n=bT.openSync(t,"r"),bT.readSync(n,r,0,150,0),bT.closeSync(n)}catch{}return Jme(r.toString())}DB.exports=Yme});var zB=b((UKe,FB)=>{"use strict";var Xme=Ue("path"),jB=TB(),MB=OB(),Qme=NB(),ehe=process.platform==="win32",the=/\.(?:com|exe)$/i,rhe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function nhe(t){t.file=jB(t);let e=t.file&&Qme(t.file);return e?(t.args.unshift(t.file),t.command=e,jB(t)):t.file}function ihe(t){if(!ehe)return t;let e=nhe(t),r=!the.test(e);if(t.options.forceShell||r){let n=rhe.test(e);t.command=Xme.normalize(t.command),t.command=MB.command(t.command),t.args=t.args.map(o=>MB.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function ohe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:ihe(n)}FB.exports=ohe});var qB=b((qKe,UB)=>{"use strict";var ST=process.platform==="win32";function wT(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function she(t,e){if(!ST)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=LB(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function LB(t,e){return ST&&t===1&&!e.file?wT(e.original,"spawn"):null}function ahe(t,e){return ST&&t===1&&!e.file?wT(e.original,"spawnSync"):null}UB.exports={hookChildProcess:she,verifyENOENT:LB,verifyENOENTSync:ahe,notFoundError:wT}});var ZB=b((BKe,$c)=>{"use strict";var BB=Ue("child_process"),xT=zB(),$T=qB();function HB(t,e,r){let n=xT(t,e,r),i=BB.spawn(n.command,n.args,n.options);return $T.hookChildProcess(i,n),i}function che(t,e,r){let n=xT(t,e,r),i=BB.spawnSync(n.command,n.args,n.options);return i.error=i.error||$T.verifyENOENTSync(i.status,n),i}$c.exports=HB;$c.exports.spawn=HB;$c.exports.sync=che;$c.exports._parse=xT;$c.exports._enoent=$T});function Ay(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var GB=y(()=>{});var VB=y(()=>{});import{promisify as lhe}from"node:util";import{execFile as uhe,execFileSync as WKe}from"node:child_process";import WB from"node:path";import{fileURLToPath as dhe}from"node:url";function Ty(t){return t instanceof URL?dhe(t):t}function KB(t){return{*[Symbol.iterator](){let e=WB.resolve(Ty(t)),r;for(;r!==e;)yield e,r=e,e=WB.resolve(e,"..")}}}var YKe,XKe,JB=y(()=>{VB();YKe=lhe(uhe);XKe=10*1024*1024});import Oy from"node:process";import Gs from"node:path";var fhe,phe,mhe,YB,XB=y(()=>{GB();JB();fhe=({cwd:t=Oy.cwd(),path:e=Oy.env[Ay()],preferLocal:r=!0,execPath:n=Oy.execPath,addExecPath:i=!0}={})=>{let o=Gs.resolve(Ty(t)),s=[],a=e.split(Gs.delimiter);return r&&phe(s,a,o),i&&mhe(s,a,n,o),e===""||e===Gs.delimiter?`${s.join(Gs.delimiter)}${e}`:[...s,e].join(Gs.delimiter)},phe=(t,e,r)=>{for(let n of KB(r)){let i=Gs.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},mhe=(t,e,r,n)=>{let i=Gs.resolve(n,Ty(r),"..");e.includes(i)||t.push(i)},YB=({env:t=Oy.env,...e}={})=>{t={...t};let r=Ay({env:t});return e.path=t[r],t[r]=fhe(e),t}});var QB,Mn,eH,tH,rH,Iy,Fd,zd,Vs=y(()=>{QB=(t,e,r)=>{let n=r?zd:Fd,i=t instanceof Mn?{}:{cause:t};return new n(e,i)},Mn=class extends Error{},eH=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,rH,{value:!0,writable:!1,enumerable:!1,configurable:!1})},tH=t=>Iy(t)&&rH in t,rH=Symbol("isExecaError"),Iy=t=>Object.prototype.toString.call(t)==="[object Error]",Fd=class extends Error{};eH(Fd,Fd.name);zd=class extends Error{};eH(zd,zd.name)});var nH,hhe,iH,oH,sH=y(()=>{nH=()=>{let t=oH-iH+1;return Array.from({length:t},hhe)},hhe=(t,e)=>({name:`SIGRT${e+1}`,number:iH+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),iH=34,oH=64});var aH,cH=y(()=>{aH=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as ghe}from"node:os";var kT,yhe,lH=y(()=>{cH();sH();kT=()=>{let t=nH();return[...aH,...t].map(yhe)},yhe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=ghe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as _he}from"node:os";var vhe,bhe,uH,She,whe,xhe,h3e,dH=y(()=>{lH();vhe=()=>{let t=kT();return Object.fromEntries(t.map(bhe))},bhe=({name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s})=>[t,{name:t,number:e,description:r,supported:n,action:i,forced:o,standard:s}],uH=vhe(),She=()=>{let t=kT(),e=65,r=Array.from({length:e},(n,i)=>whe(i,t));return Object.assign({},...r)},whe=(t,e)=>{let r=xhe(t,e);if(r===void 0)return{};let{name:n,description:i,supported:o,action:s,forced:a,standard:c}=r;return{[t]:{name:n,number:t,description:i,supported:o,action:s,forced:a,standard:c}}},xhe=(t,e)=>{let r=e.find(({name:n})=>_he.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},h3e=She()});import{constants as Ld}from"node:os";var pH,mH,hH,$he,khe,fH,Ehe,ET,Ahe,The,Py,Ud=y(()=>{dH();pH=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return hH(t,e)},mH=t=>t===0?t:hH(t,"`subprocess.kill()`'s argument"),hH=(t,e)=>{if(Number.isInteger(t))return $he(t,e);if(typeof t=="string")return Ehe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +${ET()}`)},$he=(t,e)=>{if(fH.has(t))return fH.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. +${ET()}`)},khe=()=>new Map(Object.entries(Ld.signals).reverse().map(([t,e])=>[e,t])),fH=khe(),Ehe=(t,e)=>{if(t in Ld.signals)return t;throw t.toUpperCase()in Ld.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. +${ET()}`)},ET=()=>`Available signal names: ${Ahe()}. +Available signal numbers: ${The()}.`,Ahe=()=>Object.keys(Ld.signals).sort().map(t=>`'${t}'`).join(", "),The=()=>[...new Set(Object.values(Ld.signals).sort((t,e)=>t-e))].join(", "),Py=t=>uH[t].description});import{setTimeout as Ohe}from"node:timers/promises";var gH,Ihe,yH,Phe,Rhe,Che,AT,Ry=y(()=>{Vs();Ud();gH=t=>{if(t===!1)return t;if(t===!0)return Ihe;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Ihe=1e3*5,yH=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Phe(s,a,r);Rhe(l,n);let u=t(c);return Che({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Phe=(t,e,r)=>{let[n=r,i]=Iy(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!Iy(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:mH(n),error:i}},Rhe=(t,e)=>{t!==void 0&&e.reject(t)},Che=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&AT({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},AT=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await Ohe(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Dhe}from"node:events";var Cy,TT=y(()=>{Cy=async(t,e)=>{t.aborted||await Dhe(t,"abort",{signal:e})}});var _H,vH,Nhe,OT=y(()=>{TT();_H=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},vH=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Nhe(t,e,n,i)],Nhe=async(t,e,r,{signal:n})=>{throw await Cy(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var kc,jhe,IT,bH,SH,Dy,wH,xH,$H,kH,EH,AH,Mhe,Fhe,zhe,Fn,Lhe,Fo,Ec,Ac=y(()=>{kc=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{jhe(t,e,r),IT(t,e,n)},jhe=(t,e,r)=>{if(!r)throw new Error(`${Fn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},IT=(t,e,r)=>{if(!r)throw new Error(`${Fn(t,e)} cannot be used: the ${Fo(e)} has already exited or disconnected.`)},bH=t=>{throw new Error(`${Fn("getOneMessage",t)} could not complete: the ${Fo(t)} exited or disconnected.`)},SH=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Fo(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${Fn("getOneMessage",t)}, ${Fn("sendMessage",t,"message, {strict: true}")}, -]);`)},Ry=(t,e)=>new Error(`${Fn("sendMessage",e)} failed when sending an acknowledgment response to the ${Mo(e)}.`,{cause:t}),vH=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Mo(t)} is not listening to incoming messages.`)},bH=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Mo(t)} exited without listening to incoming messages.`)},SH=()=>new Error(`\`cancelSignal\` aborted: the ${Mo(!0)} disconnected.`),wH=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},xH=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Fn(e,r)} cannot be used: the ${Mo(r)} is disconnecting.`,{cause:t})},$H=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Rhe(t))throw new Error(`${Fn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Rhe=({code:t,message:e})=>Che.has(t)||Dhe.some(r=>e.includes(r)),Che=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Dhe=["could not be cloned","circular structure","call stack size exceeded"],Fn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Nhe(e)}${t}(${r})`,Nhe=t=>t?"":"subprocess.",Mo=t=>t?"parent process":"subprocess",kc=t=>{t.connected&&t.disconnect()}});var ui,Ac=y(()=>{ui=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var Dy,Tc,di,kH,jhe,Mhe,EH,Fhe,AH,Ld,Cy,Fo=y(()=>{Ji();Dy=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=di.get(t),o=kH(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(EH(o,e,n,!0));return s},Tc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=di.get(t),o=kH(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(EH(o,e,n,!1));return s},di=new WeakMap,kH=(t,e,r)=>{let n=jhe(e,r);return Mhe(n,e,r,t),n},jhe=(t,e)=>{let r=aT(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ld(e)}" must not be "${t}". +]);`)},Dy=(t,e)=>new Error(`${Fn("sendMessage",e)} failed when sending an acknowledgment response to the ${Fo(e)}.`,{cause:t}),wH=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Fo(t)} is not listening to incoming messages.`)},xH=t=>{throw new Error(`${Fn("sendMessage",t)} failed: the ${Fo(t)} exited without listening to incoming messages.`)},$H=()=>new Error(`\`cancelSignal\` aborted: the ${Fo(!0)} disconnected.`),kH=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},EH=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Fn(e,r)} cannot be used: the ${Fo(r)} is disconnecting.`,{cause:t})},AH=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Mhe(t))throw new Error(`${Fn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Mhe=({code:t,message:e})=>Fhe.has(t)||zhe.some(r=>e.includes(r)),Fhe=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),zhe=["could not be cloned","circular structure","call stack size exceeded"],Fn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Lhe(e)}${t}(${r})`,Lhe=t=>t?"":"subprocess.",Fo=t=>t?"parent process":"subprocess",Ec=t=>{t.connected&&t.disconnect()}});var ui,Tc=y(()=>{ui=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var jy,Oc,di,TH,Uhe,qhe,OH,Bhe,IH,qd,Ny,zo=y(()=>{Ji();jy=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=di.get(t),o=TH(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(OH(o,e,n,!0));return s},Oc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=di.get(t),o=TH(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(OH(o,e,n,!1));return s},di=new WeakMap,TH=(t,e,r)=>{let n=Uhe(e,r);return qhe(n,e,r,t),n},Uhe=(t,e)=>{let r=lT(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${qd(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). -It is optional and defaults to "${i}".`)},Mhe=(t,e,r,n)=>{let i=n[AH(t)];if(i===void 0)throw new TypeError(`"${Ld(r)}" must not be ${e}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Ld(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Ld(r)}" must not be ${e}. It must be a writable stream, not readable.`)},EH=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Fhe(t,r);return`The "${i}: ${Cy(o)}" option is incompatible with using "${Ld(n)}: ${Cy(e)}". -Please set this option with "pipe" instead.`},Fhe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=AH(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},AH=t=>t==="all"?1:t,Ld=t=>t?"to":"from",Cy=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as zhe}from"node:events";var Ws,Ny=y(()=>{Ws=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),zhe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var jy,OT,My,IT,TH,OH,Ud=y(()=>{jy=(t,e)=>{e&&OT(t)},OT=t=>{t.refCounted()},My=(t,e)=>{e&&IT(t)},IT=t=>{t.unrefCounted()},TH=(t,e)=>{e&&(IT(t),IT(t))},OH=(t,e)=>{e&&(OT(t),OT(t))}});import{once as Lhe}from"node:events";import{scheduler as Uhe}from"node:timers/promises";var IH,PH,Fy,RH=y(()=>{Ly();Ud();zy();Uy();IH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(DH(i)||jH(i))return;Fy.has(t)||Fy.set(t,[]);let o=Fy.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await NH(t,n,i),await Uhe.yield();let s=await CH({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},PH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{PT();let o=Fy.get(t);for(;o?.length>0;)await Lhe(n,"message:done");t.removeListener("message",i),OH(e,r),n.connected=!1,n.emit("disconnect")},Fy=new WeakMap});import{EventEmitter as qhe}from"node:events";var zo,qy,Bhe,By,qd=y(()=>{RH();Ud();zo=(t,e,r)=>{if(qy.has(t))return qy.get(t);let n=new qhe;return n.connected=!0,qy.set(t,n),Bhe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},qy=new WeakMap,Bhe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=IH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",PH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),TH(r,n)},By=t=>{let e=qy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as Hhe}from"node:events";var MH,Zhe,FH,CH,DH,zH,Hy,Ghe,Zy,LH,zy=y(()=>{Ac();Ny();Wy();Ec();qd();Ly();MH=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=zo(t,e,r),s=Gy(t,o);return{id:Zhe++,type:Zy,message:n,hasListeners:s}},Zhe=0n,FH=(t,e)=>{if(!(e?.type!==Zy||e.hasListeners))for(let{id:r}of t)r!==void 0&&Hy[r].resolve({isDeadlock:!0,hasListeners:!1})},CH=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Zy||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:LH,message:Gy(e,i)};try{await Vy({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},DH=t=>{if(t?.type!==LH)return!1;let{id:e,message:r}=t;return Hy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},zH=async(t,e,r)=>{if(t?.type!==Zy)return;let n=ui();Hy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,Ghe(e,r,i)]);o&&_H(r),s||vH(r)}finally{i.abort(),delete Hy[t.id]}},Hy={},Ghe=async(t,e,{signal:r})=>{Ws(t,1,r),await Hhe(t,"disconnect",{signal:r}),bH(e)},Zy="execa:ipc:request",LH="execa:ipc:response"});var UH,qH,NH,Bd,Gy,Vhe,Ly=y(()=>{Ac();Ji();Fo();zy();UH=(t,e,r)=>{Bd.has(t)||Bd.set(t,new Set);let n=Bd.get(t),i=ui(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},qH=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},NH=async(t,e,r)=>{for(;!Gy(t,e)&&Bd.get(t)?.size>0;){let n=[...Bd.get(t)];FH(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Bd=new WeakMap,Gy=(t,e)=>e.listenerCount("message")>Vhe(t),Vhe=t=>di.has(t)&&!Ki(di.get(t).options.buffer,"ipc")?1:0});import{promisify as Whe}from"node:util";var Vy,Khe,CT,Jhe,RT,Wy=y(()=>{Ec();Ly();zy();Vy=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return $c({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),Khe({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},Khe=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=MH({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=UH(t,s,o);try{await CT({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw kc(t),c}finally{qH(a)}},CT=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=Jhe(t);try{await Promise.all([zH(n,t,r),o(n)])}catch(s){throw xH({error:s,methodName:e,isSubprocess:r}),$H({error:s,methodName:e,isSubprocess:r,message:i}),s}},Jhe=t=>{if(RT.has(t))return RT.get(t);let e=Whe(t.send.bind(t));return RT.set(t,e),e},RT=new WeakMap});import{scheduler as Yhe}from"node:timers/promises";var HH,ZH,Xhe,BH,jH,GH,PT,DT,Uy=y(()=>{Wy();qd();Ec();HH=(t,e)=>{let r="cancelSignal";return TT(r,!1,t.connected),CT({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:GH,message:e},message:e})},ZH=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await Xhe({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),DT.signal),Xhe=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!BH){if(BH=!0,!n){wH();return}if(e===null){PT();return}zo(t,e,r),await Yhe.yield()}},BH=!1,jH=t=>t?.type!==GH?!1:(DT.abort(t.message),!0),GH="execa:ipc:cancel",PT=()=>{DT.abort(SH())},DT=new AbortController});var VH,WH,Qhe,ege,NT=y(()=>{ET();Uy();Iy();VH=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},WH=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[Qhe({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],Qhe=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await Py(e,i);let o=ege(e);throw await HH(t,o),kT({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},ege=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as tge}from"node:timers/promises";var KH,JH,rge,jT=y(()=>{Vs();KH=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},JH=(t,e,r,n)=>e===0||e===void 0?[]:[rge(t,e,r,n)],rge=async(t,e,r,{signal:n})=>{throw await tge(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Mn}});import{execPath as nge,execArgv as ige}from"node:process";import YH from"node:path";var XH,QH,MT=y(()=>{_c();XH=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},QH=(t,e,{node:r=!1,nodePath:n=nge,nodeOptions:i=ige.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=yc(n,'The "nodePath" option'),l=YH.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(YH.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as oge}from"node:v8";var eZ,sge,age,cge,tZ,FT=y(()=>{eZ=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");cge[r](t)}},sge=t=>{try{oge(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},age=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},cge={advanced:sge,json:age},tZ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var nZ,lge,Hr,zT,uge,rZ,Ky,Ks=y(()=>{nZ=({encoding:t})=>{if(zT.has(t))return;let e=uge(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ky(t)}\`. -Please rename it to ${Ky(e)}.`);let r=[...zT].map(n=>Ky(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ky(t)}\`. -Please rename it to one of: ${r}.`)},lge=new Set(["utf8","utf16le"]),Hr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),zT=new Set([...lge,...Hr]),uge=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in rZ)return rZ[e];if(zT.has(e))return e},rZ={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ky=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as dge}from"node:fs";import fge from"node:path";import pge from"node:process";var iZ,oZ,sZ,LT=y(()=>{_c();iZ=(t=oZ())=>{let e=yc(t,'The "cwd" option');return fge.resolve(e)},oZ=()=>{try{return pge.cwd()}catch(t){throw t.message=`The current directory does not exist. -${t.message}`,t}},sZ=(t,e)=>{if(e===oZ())return t;let r;try{r=dge(e)}catch(n){return`The "cwd" option is invalid: ${e}. +It is optional and defaults to "${i}".`)},qhe=(t,e,r,n)=>{let i=n[IH(t)];if(i===void 0)throw new TypeError(`"${qd(r)}" must not be ${e}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${qd(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${qd(r)}" must not be ${e}. It must be a writable stream, not readable.`)},OH=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Bhe(t,r);return`The "${i}: ${Ny(o)}" option is incompatible with using "${qd(n)}: ${Ny(e)}". +Please set this option with "pipe" instead.`},Bhe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=IH(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},IH=t=>t==="all"?1:t,qd=t=>t?"to":"from",Ny=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Hhe}from"node:events";var Ws,My=y(()=>{Ws=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Hhe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var Fy,PT,zy,RT,PH,RH,Bd=y(()=>{Fy=(t,e)=>{e&&PT(t)},PT=t=>{t.refCounted()},zy=(t,e)=>{e&&RT(t)},RT=t=>{t.unrefCounted()},PH=(t,e)=>{e&&(RT(t),RT(t))},RH=(t,e)=>{e&&(PT(t),PT(t))}});import{once as Zhe}from"node:events";import{scheduler as Ghe}from"node:timers/promises";var CH,DH,Ly,NH=y(()=>{qy();Bd();Uy();By();CH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(MH(i)||zH(i))return;Ly.has(t)||Ly.set(t,[]);let o=Ly.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await FH(t,n,i),await Ghe.yield();let s=await jH({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},DH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{CT();let o=Ly.get(t);for(;o?.length>0;)await Zhe(n,"message:done");t.removeListener("message",i),RH(e,r),n.connected=!1,n.emit("disconnect")},Ly=new WeakMap});import{EventEmitter as Vhe}from"node:events";var Lo,Hy,Whe,Zy,Hd=y(()=>{NH();Bd();Lo=(t,e,r)=>{if(Hy.has(t))return Hy.get(t);let n=new Vhe;return n.connected=!0,Hy.set(t,n),Whe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Hy=new WeakMap,Whe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=CH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",DH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),PH(r,n)},Zy=t=>{let e=Hy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as Khe}from"node:events";var LH,Jhe,UH,jH,MH,qH,Gy,Yhe,Vy,BH,Uy=y(()=>{Tc();My();Jy();Ac();Hd();qy();LH=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=Lo(t,e,r),s=Wy(t,o);return{id:Jhe++,type:Vy,message:n,hasListeners:s}},Jhe=0n,UH=(t,e)=>{if(!(e?.type!==Vy||e.hasListeners))for(let{id:r}of t)r!==void 0&&Gy[r].resolve({isDeadlock:!0,hasListeners:!1})},jH=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Vy||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:BH,message:Wy(e,i)};try{await Ky({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},MH=t=>{if(t?.type!==BH)return!1;let{id:e,message:r}=t;return Gy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},qH=async(t,e,r)=>{if(t?.type!==Vy)return;let n=ui();Gy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,Yhe(e,r,i)]);o&&SH(r),s||wH(r)}finally{i.abort(),delete Gy[t.id]}},Gy={},Yhe=async(t,e,{signal:r})=>{Ws(t,1,r),await Khe(t,"disconnect",{signal:r}),xH(e)},Vy="execa:ipc:request",BH="execa:ipc:response"});var HH,ZH,FH,Zd,Wy,Xhe,qy=y(()=>{Tc();Ji();zo();Uy();HH=(t,e,r)=>{Zd.has(t)||Zd.set(t,new Set);let n=Zd.get(t),i=ui(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},ZH=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},FH=async(t,e,r)=>{for(;!Wy(t,e)&&Zd.get(t)?.size>0;){let n=[...Zd.get(t)];UH(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Zd=new WeakMap,Wy=(t,e)=>e.listenerCount("message")>Xhe(t),Xhe=t=>di.has(t)&&!Ki(di.get(t).options.buffer,"ipc")?1:0});import{promisify as Qhe}from"node:util";var Ky,ege,NT,tge,DT,Jy=y(()=>{Ac();qy();Uy();Ky=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return kc({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),ege({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},ege=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=LH({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=HH(t,s,o);try{await NT({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Ec(t),c}finally{ZH(a)}},NT=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=tge(t);try{await Promise.all([qH(n,t,r),o(n)])}catch(s){throw EH({error:s,methodName:e,isSubprocess:r}),AH({error:s,methodName:e,isSubprocess:r,message:i}),s}},tge=t=>{if(DT.has(t))return DT.get(t);let e=Qhe(t.send.bind(t));return DT.set(t,e),e},DT=new WeakMap});import{scheduler as rge}from"node:timers/promises";var VH,WH,nge,GH,zH,KH,CT,jT,By=y(()=>{Jy();Hd();Ac();VH=(t,e)=>{let r="cancelSignal";return IT(r,!1,t.connected),NT({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:KH,message:e},message:e})},WH=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await nge({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),jT.signal),nge=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!GH){if(GH=!0,!n){kH();return}if(e===null){CT();return}Lo(t,e,r),await rge.yield()}},GH=!1,zH=t=>t?.type!==KH?!1:(jT.abort(t.message),!0),KH="execa:ipc:cancel",CT=()=>{jT.abort($H())},jT=new AbortController});var JH,YH,ige,oge,MT=y(()=>{TT();By();Ry();JH=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},YH=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[ige({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],ige=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await Cy(e,i);let o=oge(e);throw await VH(t,o),AT({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},oge=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as sge}from"node:timers/promises";var XH,QH,age,FT=y(()=>{Vs();XH=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},QH=(t,e,r,n)=>e===0||e===void 0?[]:[age(t,e,r,n)],age=async(t,e,r,{signal:n})=>{throw await sge(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Mn}});import{execPath as cge,execArgv as lge}from"node:process";import eZ from"node:path";var tZ,rZ,zT=y(()=>{vc();tZ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},rZ=(t,e,{node:r=!1,nodePath:n=cge,nodeOptions:i=lge.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=_c(n,'The "nodePath" option'),l=eZ.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(eZ.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as uge}from"node:v8";var nZ,dge,fge,pge,iZ,LT=y(()=>{nZ=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");pge[r](t)}},dge=t=>{try{uge(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},fge=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},pge={advanced:dge,json:fge},iZ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var sZ,mge,Hr,UT,hge,oZ,Yy,Ks=y(()=>{sZ=({encoding:t})=>{if(UT.has(t))return;let e=hge(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Yy(t)}\`. +Please rename it to ${Yy(e)}.`);let r=[...UT].map(n=>Yy(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Yy(t)}\`. +Please rename it to one of: ${r}.`)},mge=new Set(["utf8","utf16le"]),Hr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),UT=new Set([...mge,...Hr]),hge=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in oZ)return oZ[e];if(UT.has(e))return e},oZ={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Yy=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as gge}from"node:fs";import yge from"node:path";import _ge from"node:process";var aZ,cZ,lZ,qT=y(()=>{vc();aZ=(t=cZ())=>{let e=_c(t,'The "cwd" option');return yge.resolve(e)},cZ=()=>{try{return _ge.cwd()}catch(t){throw t.message=`The current directory does not exist. +${t.message}`,t}},lZ=(t,e)=>{if(e===cZ())return t;let r;try{r=gge(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import mge from"node:path";import aZ from"node:process";var cZ,Jy,hge,gge,UT=y(()=>{cZ=$t(qB(),1);KB();Iy();zd();AT();NT();jT();MT();FT();Ks();LT();_c();Ji();Jy=(t,e,r)=>{r.cwd=iZ(r.cwd);let[n,i,o]=QH(t,e,r),{command:s,args:a,options:c}=cZ.default._parse(n,i,o),l=P6(c),u=hge(l);return KH(u),nZ(u),eZ(u),hH(u),VH(u),u.shell=rT(u.shell),u.env=gge(u),u.killSignal=uH(u.killSignal),u.forceKillAfterDelay=pH(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!Hr.has(u.encoding)&&u.buffer[f]),aZ.platform==="win32"&&mge.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},hge=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),gge=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...aZ.env,...t}:t;return r||n?WB({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Yy,qT=y(()=>{Yy=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Oc(t){if(typeof t=="string")return yge(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return _ge(t)}var yge,_ge,lZ,vge,uZ,bge,BT=y(()=>{yge=t=>t.at(-1)===lZ?t.slice(0,t.at(-2)===uZ?-2:-1):t,_ge=t=>t.at(-1)===vge?t.subarray(0,t.at(-2)===bge?-2:-1):t,lZ=` -`,vge=lZ.codePointAt(0),uZ="\r",bge=uZ.codePointAt(0)});function zn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function HT(t,{checkOpen:e=!0}={}){return zn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Js(t,{checkOpen:e=!0}={}){return zn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function ZT(t,e){return HT(t,e)&&Js(t,e)}var Ys=y(()=>{});function dZ(){return this[VT].next()}function fZ(t){return this[VT].return(t)}function WT({preventCancel:t=!1}={}){let e=this.getReader(),r=new GT(e,t),n=Object.create(wge);return n[VT]=r,n}var Sge,GT,VT,wge,pZ=y(()=>{Sge=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),GT=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},VT=Symbol();Object.defineProperty(dZ,"name",{value:"next"});Object.defineProperty(fZ,"name",{value:"return"});wge=Object.create(Sge,{next:{enumerable:!0,configurable:!0,writable:!0,value:dZ},return:{enumerable:!0,configurable:!0,writable:!0,value:fZ}})});var mZ=y(()=>{});var hZ=y(()=>{pZ();mZ()});var gZ,xge,$ge,kge,Hd,KT=y(()=>{Ys();hZ();gZ=t=>{if(Js(t,{checkOpen:!1})&&Hd.on!==void 0)return $ge(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(xge.call(t)==="[object ReadableStream]")return WT.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:xge}=Object.prototype,$ge=async function*(t){let e=new AbortController,r={};kge(t,e,r);try{for await(let[n]of Hd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},kge=async(t,e,r)=>{try{await Hd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Hd={}});var Ic,Ege,vZ,yZ,Age,_Z,fi,Zd=y(()=>{KT();Ic=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=gZ(t),u=e();u.length=0;try{for await(let d of l){let f=Age(d),p=r[f](d,u);vZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return Ege({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},Ege=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&vZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},vZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){yZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&yZ(c,e,i,o),new fi},yZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},Age=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=_Z.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&_Z.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:_Z}=Object.prototype,fi=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Yi,Gd,Xy,Qy,e_,t_=y(()=>{Yi=t=>t,Gd=()=>{},Xy=({contents:t})=>t,Qy=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},e_=t=>t.length});async function r_(t,e){return Ic(t,Pge,e)}var Tge,Oge,Ige,Pge,bZ=y(()=>{Zd();t_();Tge=()=>({contents:[]}),Oge=()=>1,Ige=(t,{contents:e})=>(e.push(t),e),Pge={init:Tge,convertChunk:{string:Yi,buffer:Yi,arrayBuffer:Yi,dataView:Yi,typedArray:Yi,others:Yi},getSize:Oge,truncateChunk:Gd,addChunk:Ige,getFinalChunk:Gd,finalize:Xy}});async function n_(t,e){return Ic(t,Lge,e)}var Rge,Cge,Dge,SZ,wZ,Nge,jge,Mge,Fge,$Z,xZ,zge,kZ,Lge,EZ=y(()=>{Zd();t_();Rge=()=>({contents:new ArrayBuffer(0)}),Cge=t=>Dge.encode(t),Dge=new TextEncoder,SZ=t=>new Uint8Array(t),wZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Nge=(t,e)=>t.slice(0,e),jge=(t,{contents:e,length:r},n)=>{let i=kZ()?Fge(e,n):Mge(e,n);return new Uint8Array(i).set(t,r),i},Mge=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer($Z(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Fge=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:$Z(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},$Z=t=>xZ**Math.ceil(Math.log(t)/Math.log(xZ)),xZ=2,zge=({contents:t,length:e})=>kZ()?t:t.slice(0,e),kZ=()=>"resize"in ArrayBuffer.prototype,Lge={init:Rge,convertChunk:{string:Cge,buffer:SZ,arrayBuffer:SZ,dataView:wZ,typedArray:wZ,others:Qy},getSize:e_,truncateChunk:Nge,addChunk:jge,getFinalChunk:Gd,finalize:zge}});async function o_(t,e){return Ic(t,Zge,e)}var Uge,i_,qge,Bge,Hge,Zge,AZ=y(()=>{Zd();t_();Uge=()=>({contents:"",textDecoder:new TextDecoder}),i_=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),qge=(t,{contents:e})=>e+t,Bge=(t,e)=>t.slice(0,e),Hge=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Zge={init:Uge,convertChunk:{string:Yi,buffer:i_,arrayBuffer:i_,dataView:i_,typedArray:i_,others:Qy},getSize:e_,truncateChunk:Bge,addChunk:qge,getFinalChunk:Hge,finalize:Xy}});var TZ=y(()=>{bZ();EZ();AZ();Zd()});import{on as Gge}from"node:events";import{finished as Vge}from"node:stream/promises";var s_=y(()=>{KT();TZ();Object.assign(Hd,{on:Gge,finished:Vge})});var OZ,Wge,IZ,PZ,Kge,RZ,CZ,a_,Xs=y(()=>{s_();Wi();Ji();OZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof fi))throw t;if(o==="all")return t;let s=Wge(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},Wge=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",IZ=(t,e,r)=>{if(e.length!==r)return;let n=new fi;throw n.maxBufferInfo={fdNumber:"ipc"},n},PZ=(t,e)=>{let{streamName:r,threshold:n,unit:i}=Kge(t,e);return`Command's ${r} was larger than ${n} ${i}`},Kge=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Ki(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:py(r),threshold:i,unit:n}},RZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>a_(r)),CZ=(t,e,r)=>{if(!e)return t;let n=a_(r);return t.length>n?t.slice(0,n):t},a_=([,t])=>t});import{inspect as Jge}from"node:util";var NZ,Yge,Xge,Qge,eye,tye,DZ,jZ=y(()=>{BT();Br();LT();gy();Xs();zd();Vs();NZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:v})=>{let _=n?.code,S=Yge({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),w=Qge(n,v),x=w===void 0?"":` -${w}`,I=`${S}: ${a}${x}`,T=e===void 0?[t[2],t[1]]:[e],k=[I,...T,...t.slice(3),r.map(C=>eye(C)).join(` -`)].map(C=>Nd(Oc(tye(C)))).filter(Boolean).join(` - -`);return{originalMessage:w,shortMessage:I,message:k}},Yge=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=Xge(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${PZ(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${Oy(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Xge=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Qge=(t,e)=>{if(t instanceof Mn)return;let r=XB(t)?t.originalMessage:String(t?.message??t),n=Nd(sZ(r,e));return n===""?void 0:n},eye=t=>typeof t=="string"?t:Jge(t),tye=t=>Array.isArray(t)?t.map(e=>Oc(DZ(e))).filter(Boolean).join(` -`):DZ(t),DZ=t=>typeof t=="string"?t:Mt(t)?dy(t):""});var c_,Pc,Vd,rye,MZ,nye,Wd=y(()=>{zd();wy();Vs();jZ();c_=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>MZ({command:t,escapedCommand:e,cwd:o,durationMs:fT(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Pc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Vd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Vd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:v,cwd:_,maxBuffer:S},isSync:w})=>{let{exitCode:x,signal:I,signalDescription:T}=nye(l,u),{originalMessage:k,shortMessage:C,message:E}=NZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:I,signalDescription:T,exitCode:x,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:v,maxBuffer:S,timeout:h,cwd:_}),Z=JB(t,E,w);return Object.assign(Z,rye({error:Z,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:x,signal:I,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:k,shortMessage:C})),Z},rye=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:v})=>MZ({shortMessage:v,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:fT(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),MZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),nye=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:Oy(e);return{exitCode:r,signal:n,signalDescription:i}}});function iye(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(FZ(t*1e3)%1e3),nanoseconds:Math.trunc(FZ(t*1e6)%1e3)}}function oye(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function JT(t){switch(typeof t){case"number":{if(Number.isFinite(t))return iye(t);break}case"bigint":return oye(t)}throw new TypeError("Expected a finite number or bigint")}var FZ,zZ=y(()=>{FZ=t=>Number.isFinite(t)?t:0});function YT(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+cye);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&sye(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+aye(d,u):f;i.push(p)}},a=JT(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),v=h?m.toFixed(h):g;s(Number.parseFloat(v),"millisecond","ms",v)}}else{let u=(r?Number(t%lye):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var sye,aye,cye,lye,LZ=y(()=>{zZ();sye=t=>t===0||t===0n,aye=(t,e)=>e===1||e===1n?t:`${t}s`,cye=1e-7,lye=24n*60n*60n*1000n});var UZ,qZ=y(()=>{Sc();UZ=(t,e)=>{t.failed&&li({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var BZ,uye,HZ=y(()=>{LZ();jo();Sc();qZ();BZ=(t,e)=>{vc(e)&&(UZ(t,e),uye(t,e))},uye=(t,e)=>{let r=`(done in ${YT(t.durationMs)})`;li({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Rc,l_=y(()=>{HZ();Rc=(t,e,{reject:r})=>{if(BZ(t,e),t.failed&&r)throw t;return t}});var VZ,dye,fye,WZ,KZ,ZZ,pye,XT,GZ,Qs,JZ,mye,u_,YZ,hye,gye,QT,XZ,yye,QZ,d_,_ye,eO,vye,bye,eG,pn,f_,tO,tG,rG,Lo,dr=y(()=>{Ys();Gi();Br();VZ=(t,e)=>Qs(t)?"asyncGenerator":JZ(t)?"generator":u_(t)?"fileUrl":hye(t)?"filePath":_ye(t)?"webStream":zn(t,{checkOpen:!1})?"native":Mt(t)?"uint8Array":vye(t)?"asyncIterable":bye(t)?"iterable":eO(t)?WZ({transform:t},e):mye(t)?dye(t,e):"native",dye=(t,e)=>ZT(t.transform,{checkOpen:!1})?fye(t,e):eO(t.transform)?WZ(t,e):pye(t,e),fye=(t,e)=>(KZ(t,e,"Duplex stream"),"duplex"),WZ=(t,e)=>(KZ(t,e,"web TransformStream"),"webTransform"),KZ=({final:t,binary:e,objectMode:r},n,i)=>{ZZ(t,`${n}.final`,i),ZZ(e,`${n}.binary`,i),XT(r,`${n}.objectMode`)},ZZ=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},pye=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!GZ(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ZT(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(eO(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!GZ(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return XT(r,`${i}.binary`),XT(n,`${i}.objectMode`),Qs(t)||Qs(e)?"asyncGenerator":"generator"},XT=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},GZ=t=>Qs(t)||JZ(t),Qs=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",JZ=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",mye=t=>kt(t)&&(t.transform!==void 0||t.final!==void 0),u_=t=>Object.prototype.toString.call(t)==="[object URL]",YZ=t=>u_(t)&&t.protocol!=="file:",hye=t=>kt(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>gye.has(e))&&QT(t.file),gye=new Set(["file","append"]),QT=t=>typeof t=="string",XZ=(t,e)=>t==="native"&&typeof e=="string"&&!yye.has(e),yye=new Set(["ipc","ignore","inherit","overlapped","pipe"]),QZ=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",d_=t=>Object.prototype.toString.call(t)==="[object WritableStream]",_ye=t=>QZ(t)||d_(t),eO=t=>QZ(t?.readable)&&d_(t?.writable),vye=t=>eG(t)&&typeof t[Symbol.asyncIterator]=="function",bye=t=>eG(t)&&typeof t[Symbol.iterator]=="function",eG=t=>typeof t=="object"&&t!==null,pn=new Set(["generator","asyncGenerator","duplex","webTransform"]),f_=new Set(["fileUrl","filePath","fileNumber"]),tO=new Set(["fileUrl","filePath"]),tG=new Set([...tO,"webStream","nodeStream"]),rG=new Set(["webTransform","duplex"]),Lo={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var rO,Sye,wye,nG,nO=y(()=>{dr();rO=(t,e,r,n)=>n==="output"?Sye(t,e,r):wye(t,e,r),Sye=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},wye=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},nG=(t,e)=>{let r=t.findLast(({type:n})=>pn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var iG,xye,$ye,kye,Eye,Aye,Tye,oG=y(()=>{Gi();Ks();dr();nO();iG=(t,e,r,n)=>[...t.filter(({type:i})=>!pn.has(i)),...xye(t,e,r,n)],xye=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>pn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=$ye({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Tye(o,r)},$ye=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?kye({stdioItem:t,optionName:i}):e==="webTransform"?Eye({stdioItem:t,index:r,newTransforms:n,direction:o}):Aye({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),kye=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Eye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=kt(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=rO(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Aye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=kt(e)?e:{transform:e},d=c||Hr.has(o),{writableObjectMode:f,readableObjectMode:p}=rO(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Tye=(t,e)=>e==="input"?t.reverse():t});import iO from"node:process";var sG,Oye,Iye,Cc,oO,aG,Pye,Rye,cG=y(()=>{Ys();dr();sG=(t,e,r)=>{let n=t.map(i=>Oye(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Rye},Oye=({type:t,value:e},r)=>Iye[r]??aG[t](e),Iye=["input","output","output"],Cc=()=>{},oO=()=>"input",aG={generator:Cc,asyncGenerator:Cc,fileUrl:Cc,filePath:Cc,iterable:oO,asyncIterable:oO,uint8Array:oO,webStream:t=>d_(t)?"output":"input",nodeStream(t){return Js(t,{checkOpen:!1})?HT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Cc,duplex:Cc,native(t){let e=Pye(t);if(e!==void 0)return e;if(zn(t,{checkOpen:!1}))return aG.nodeStream(t)}},Pye=t=>{if([0,iO.stdin].includes(t))return"input";if([1,2,iO.stdout,iO.stderr].includes(t))return"output"},Rye="output"});var lG,uG=y(()=>{lG=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var dG,Cye,Dye,fG,Nye,jye,pG=y(()=>{Wi();uG();jo();dG=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Cye(t,n).map((a,c)=>fG(a,c));return o?Nye(s,r,i):lG(s,e)},Cye=(t,e)=>{if(t===void 0)return fn.map(n=>e[n]);if(Dye(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,fn.length);return Array.from({length:r},(n,i)=>t[i])},Dye=t=>fn.some(e=>t[e]!==void 0),fG=(t,e)=>Array.isArray(t)?t.map(r=>fG(r,e)):t??(e>=fn.length?"ignore":"pipe"),Nye=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!bc(r,i)&&jye(n)?"ignore":n),jye=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Mye}from"node:fs";import Fye from"node:tty";var hG,zye,Lye,Uye,qye,mG,gG=y(()=>{Ys();Wi();Br();Fo();hG=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?zye({stdioItem:t,fdNumber:n,direction:i}):qye({stdioItem:t,fdNumber:n}),zye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Lye({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(zn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Lye=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Uye(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Fye.isatty(i))throw new TypeError(`The \`${e}: ${Cy(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Vi(Mye(i)),optionName:e}}},Uye=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=fy.indexOf(t);if(r!==-1)return r},qye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:mG(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:mG(e,e,r),optionName:r}:zn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,mG=(t,e,r)=>{let n=fy[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var yG,Bye,Hye,Zye,Gye,_G=y(()=>{Ys();Br();dr();yG=({input:t,inputFile:e},r)=>r===0?[...Bye(t),...Zye(e)]:[],Bye=t=>t===void 0?[]:[{type:Hye(t),value:t,optionName:"input"}],Hye=t=>{if(Js(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Mt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Zye=t=>t===void 0?[]:[{...Gye(t),optionName:"inputFile"}],Gye=t=>{if(u_(t))return{type:"fileUrl",value:t};if(QT(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var vG,bG,Vye,Wye,SG,Kye,Jye,wG,xG=y(()=>{dr();vG=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),bG=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=Vye(i,t);if(s.length!==0){if(o){Wye({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(tG.has(t))return SG({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});rG.has(t)&&Jye({otherStdioItems:s,type:t,value:e,optionName:r})}},Vye=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),Wye=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{tO.has(e)&&SG({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},SG=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>Kye(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return wG(s,n,e),i==="output"?o[0].stream:void 0},Kye=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Jye=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);wG(i,n,e)},wG=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Lo[r]} that is the same.`)}});var p_,Yye,Xye,Qye,e_e,t_e,r_e,n_e,i_e,o_e,s_e,a_e,sO,c_e,m_=y(()=>{Wi();oG();nO();dr();cG();pG();gG();_G();xG();p_=(t,e,r,n)=>{let o=dG(e,r,n).map((a,c)=>Yye({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=o_e({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>c_e(a)),s},Yye=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=py(e),{stdioItems:o,isStdioArray:s}=Xye({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=sG(o,e,i),c=o.map(d=>hG({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=iG(c,i,a,r),u=nG(l,a);return i_e(l,u),{direction:a,objectMode:u,stdioItems:l}},Xye=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>Qye(c,n)),...yG(r,e)],s=vG(o),a=s.length>1;return e_e(s,a,n),r_e(s),{stdioItems:s,isStdioArray:a}},Qye=(t,e)=>({type:VZ(t,e),value:t,optionName:e}),e_e=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(t_e.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},t_e=new Set(["ignore","ipc"]),r_e=t=>{for(let e of t)n_e(e)},n_e=({type:t,value:e,optionName:r})=>{if(YZ(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(XZ(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},i_e=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>f_.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},o_e=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(s_e({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw sO(i),o}},s_e=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>a_e({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},a_e=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=bG({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},sO=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!jn(r)&&r.destroy()},c_e=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as $G}from"node:fs";var EG,pi,l_e,AG,kG,u_e,TG=y(()=>{Br();m_();dr();EG=(t,e)=>p_(u_e,t,e,!0),pi=({type:t,optionName:e})=>{AG(e,Lo[t])},l_e=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&AG(t,`"${e}"`),{}),AG=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},kG={generator(){},asyncGenerator:pi,webStream:pi,nodeStream:pi,webTransform:pi,duplex:pi,asyncIterable:pi,native:l_e},u_e={input:{...kG,fileUrl:({value:t})=>({contents:[Vi($G(t))]}),filePath:({value:{file:t}})=>({contents:[Vi($G(t))]}),fileNumber:pi,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...kG,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:pi,string:pi,uint8Array:pi}}});var Xi,aO,Kd=y(()=>{BT();Xi=(t,{stripFinalNewline:e},r)=>aO(e,r)&&t!==void 0&&!Array.isArray(t)?Oc(t):t,aO=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var h_,lO,OG,IG,d_e,f_e,p_e,PG,m_e,cO,h_e,g_e,y_e,g_=y(()=>{h_=(t,e,r,n)=>t||r?void 0:IG(e,n),lO=(t,e,r)=>r?t.flatMap(n=>OG(n,e)):OG(t,e),OG=(t,e)=>{let{transform:r,final:n}=IG(e,{});return[...r(t),...n()]},IG=(t,e)=>(e.previousChunks="",{transform:d_e.bind(void 0,e,t),final:p_e.bind(void 0,e)}),d_e=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=cO(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=cO(n,r.slice(i+1))),t.previousChunks=n},f_e=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),p_e=function*({previousChunks:t}){t.length>0&&(yield t)},PG=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:m_e.bind(void 0,n)},m_e=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?h_e:y_e;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},cO=(t,e)=>`${t}${e}`,h_e={windowsNewline:`\r +${t}`}});import vge from"node:path";import uZ from"node:process";var dZ,Xy,bge,Sge,BT=y(()=>{dZ=$t(ZB(),1);XB();Ry();Ud();OT();MT();FT();zT();LT();Ks();qT();vc();Ji();Xy=(t,e,r)=>{r.cwd=aZ(r.cwd);let[n,i,o]=rZ(t,e,r),{command:s,args:a,options:c}=dZ.default._parse(n,i,o),l=D6(c),u=bge(l);return XH(u),sZ(u),nZ(u),_H(u),JH(u),u.shell=iT(u.shell),u.env=Sge(u),u.killSignal=pH(u.killSignal),u.forceKillAfterDelay=gH(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!Hr.has(u.encoding)&&u.buffer[f]),uZ.platform==="win32"&&vge.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},bge=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Sge=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...uZ.env,...t}:t;return r||n?YB({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var Qy,HT=y(()=>{Qy=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Ic(t){if(typeof t=="string")return wge(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return xge(t)}var wge,xge,fZ,$ge,pZ,kge,ZT=y(()=>{wge=t=>t.at(-1)===fZ?t.slice(0,t.at(-2)===pZ?-2:-1):t,xge=t=>t.at(-1)===$ge?t.subarray(0,t.at(-2)===kge?-2:-1):t,fZ=` +`,$ge=fZ.codePointAt(0),pZ="\r",kge=pZ.codePointAt(0)});function zn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function GT(t,{checkOpen:e=!0}={}){return zn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Js(t,{checkOpen:e=!0}={}){return zn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function VT(t,e){return GT(t,e)&&Js(t,e)}var Ys=y(()=>{});function mZ(){return this[KT].next()}function hZ(t){return this[KT].return(t)}function JT({preventCancel:t=!1}={}){let e=this.getReader(),r=new WT(e,t),n=Object.create(Age);return n[KT]=r,n}var Ege,WT,KT,Age,gZ=y(()=>{Ege=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),WT=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},KT=Symbol();Object.defineProperty(mZ,"name",{value:"next"});Object.defineProperty(hZ,"name",{value:"return"});Age=Object.create(Ege,{next:{enumerable:!0,configurable:!0,writable:!0,value:mZ},return:{enumerable:!0,configurable:!0,writable:!0,value:hZ}})});var yZ=y(()=>{});var _Z=y(()=>{gZ();yZ()});var vZ,Tge,Oge,Ige,Gd,YT=y(()=>{Ys();_Z();vZ=t=>{if(Js(t,{checkOpen:!1})&&Gd.on!==void 0)return Oge(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Tge.call(t)==="[object ReadableStream]")return JT.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Tge}=Object.prototype,Oge=async function*(t){let e=new AbortController,r={};Ige(t,e,r);try{for await(let[n]of Gd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},Ige=async(t,e,r)=>{try{await Gd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Gd={}});var Pc,Pge,wZ,bZ,Rge,SZ,fi,Vd=y(()=>{YT();Pc=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=vZ(t),u=e();u.length=0;try{for await(let d of l){let f=Rge(d),p=r[f](d,u);wZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return Pge({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},Pge=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&wZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},wZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){bZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&bZ(c,e,i,o),new fi},bZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},Rge=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=SZ.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&SZ.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:SZ}=Object.prototype,fi=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Yi,Wd,e_,t_,r_,n_=y(()=>{Yi=t=>t,Wd=()=>{},e_=({contents:t})=>t,t_=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},r_=t=>t.length});async function i_(t,e){return Pc(t,jge,e)}var Cge,Dge,Nge,jge,xZ=y(()=>{Vd();n_();Cge=()=>({contents:[]}),Dge=()=>1,Nge=(t,{contents:e})=>(e.push(t),e),jge={init:Cge,convertChunk:{string:Yi,buffer:Yi,arrayBuffer:Yi,dataView:Yi,typedArray:Yi,others:Yi},getSize:Dge,truncateChunk:Wd,addChunk:Nge,getFinalChunk:Wd,finalize:e_}});async function o_(t,e){return Pc(t,Zge,e)}var Mge,Fge,zge,$Z,kZ,Lge,Uge,qge,Bge,AZ,EZ,Hge,TZ,Zge,OZ=y(()=>{Vd();n_();Mge=()=>({contents:new ArrayBuffer(0)}),Fge=t=>zge.encode(t),zge=new TextEncoder,$Z=t=>new Uint8Array(t),kZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Lge=(t,e)=>t.slice(0,e),Uge=(t,{contents:e,length:r},n)=>{let i=TZ()?Bge(e,n):qge(e,n);return new Uint8Array(i).set(t,r),i},qge=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(AZ(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Bge=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:AZ(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},AZ=t=>EZ**Math.ceil(Math.log(t)/Math.log(EZ)),EZ=2,Hge=({contents:t,length:e})=>TZ()?t:t.slice(0,e),TZ=()=>"resize"in ArrayBuffer.prototype,Zge={init:Mge,convertChunk:{string:Fge,buffer:$Z,arrayBuffer:$Z,dataView:kZ,typedArray:kZ,others:t_},getSize:r_,truncateChunk:Lge,addChunk:Uge,getFinalChunk:Wd,finalize:Hge}});async function a_(t,e){return Pc(t,Jge,e)}var Gge,s_,Vge,Wge,Kge,Jge,IZ=y(()=>{Vd();n_();Gge=()=>({contents:"",textDecoder:new TextDecoder}),s_=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Vge=(t,{contents:e})=>e+t,Wge=(t,e)=>t.slice(0,e),Kge=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Jge={init:Gge,convertChunk:{string:Yi,buffer:s_,arrayBuffer:s_,dataView:s_,typedArray:s_,others:t_},getSize:r_,truncateChunk:Wge,addChunk:Vge,getFinalChunk:Kge,finalize:e_}});var PZ=y(()=>{xZ();OZ();IZ();Vd()});import{on as Yge}from"node:events";import{finished as Xge}from"node:stream/promises";var c_=y(()=>{YT();PZ();Object.assign(Gd,{on:Yge,finished:Xge})});var RZ,Qge,CZ,DZ,eye,NZ,jZ,l_,Xs=y(()=>{c_();Wi();Ji();RZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof fi))throw t;if(o==="all")return t;let s=Qge(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},Qge=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",CZ=(t,e,r)=>{if(e.length!==r)return;let n=new fi;throw n.maxBufferInfo={fdNumber:"ipc"},n},DZ=(t,e)=>{let{streamName:r,threshold:n,unit:i}=eye(t,e);return`Command's ${r} was larger than ${n} ${i}`},eye=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Ki(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:hy(r),threshold:i,unit:n}},NZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>l_(r)),jZ=(t,e,r)=>{if(!e)return t;let n=l_(r);return t.length>n?t.slice(0,n):t},l_=([,t])=>t});import{inspect as tye}from"node:util";var FZ,rye,nye,iye,oye,sye,MZ,zZ=y(()=>{ZT();Br();qT();_y();Xs();Ud();Vs();FZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:v})=>{let _=n?.code,S=rye({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),w=iye(n,v),x=w===void 0?"":` +${w}`,I=`${S}: ${a}${x}`,T=e===void 0?[t[2],t[1]]:[e],k=[I,...T,...t.slice(3),r.map(C=>oye(C)).join(` +`)].map(C=>Md(Ic(sye(C)))).filter(Boolean).join(` + +`);return{originalMessage:w,shortMessage:I,message:k}},rye=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=nye(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${DZ(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${Py(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},nye=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",iye=(t,e)=>{if(t instanceof Mn)return;let r=tH(t)?t.originalMessage:String(t?.message??t),n=Md(lZ(r,e));return n===""?void 0:n},oye=t=>typeof t=="string"?t:tye(t),sye=t=>Array.isArray(t)?t.map(e=>Ic(MZ(e))).filter(Boolean).join(` +`):MZ(t),MZ=t=>typeof t=="string"?t:Mt(t)?py(t):""});var u_,Rc,Kd,aye,LZ,cye,Jd=y(()=>{Ud();$y();Vs();zZ();u_=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>LZ({command:t,escapedCommand:e,cwd:o,durationMs:mT(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Rc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Kd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Kd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:v,cwd:_,maxBuffer:S},isSync:w})=>{let{exitCode:x,signal:I,signalDescription:T}=cye(l,u),{originalMessage:k,shortMessage:C,message:E}=FZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:I,signalDescription:T,exitCode:x,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:v,maxBuffer:S,timeout:h,cwd:_}),Z=QB(t,E,w);return Object.assign(Z,aye({error:Z,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:x,signal:I,signalDescription:T,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:k,shortMessage:C})),Z},aye=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:v})=>LZ({shortMessage:v,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:mT(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),LZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),cye=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:Py(e);return{exitCode:r,signal:n,signalDescription:i}}});function lye(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(UZ(t*1e3)%1e3),nanoseconds:Math.trunc(UZ(t*1e6)%1e3)}}function uye(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function XT(t){switch(typeof t){case"number":{if(Number.isFinite(t))return lye(t);break}case"bigint":return uye(t)}throw new TypeError("Expected a finite number or bigint")}var UZ,qZ=y(()=>{UZ=t=>Number.isFinite(t)?t:0});function QT(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+pye);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&dye(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+fye(d,u):f;i.push(p)}},a=XT(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),v=h?m.toFixed(h):g;s(Number.parseFloat(v),"millisecond","ms",v)}}else{let u=(r?Number(t%mye):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var dye,fye,pye,mye,BZ=y(()=>{qZ();dye=t=>t===0||t===0n,fye=(t,e)=>e===1||e===1n?t:`${t}s`,pye=1e-7,mye=24n*60n*60n*1000n});var HZ,ZZ=y(()=>{wc();HZ=(t,e)=>{t.failed&&li({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var GZ,hye,VZ=y(()=>{BZ();Mo();wc();ZZ();GZ=(t,e)=>{bc(e)&&(HZ(t,e),hye(t,e))},hye=(t,e)=>{let r=`(done in ${QT(t.durationMs)})`;li({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Cc,d_=y(()=>{VZ();Cc=(t,e,{reject:r})=>{if(GZ(t,e),t.failed&&r)throw t;return t}});var JZ,gye,yye,YZ,XZ,WZ,_ye,eO,KZ,Qs,QZ,vye,f_,eG,bye,Sye,tO,tG,wye,rG,p_,xye,rO,$ye,kye,nG,pn,m_,nO,iG,oG,Uo,dr=y(()=>{Ys();Gi();Br();JZ=(t,e)=>Qs(t)?"asyncGenerator":QZ(t)?"generator":f_(t)?"fileUrl":bye(t)?"filePath":xye(t)?"webStream":zn(t,{checkOpen:!1})?"native":Mt(t)?"uint8Array":$ye(t)?"asyncIterable":kye(t)?"iterable":rO(t)?YZ({transform:t},e):vye(t)?gye(t,e):"native",gye=(t,e)=>VT(t.transform,{checkOpen:!1})?yye(t,e):rO(t.transform)?YZ(t,e):_ye(t,e),yye=(t,e)=>(XZ(t,e,"Duplex stream"),"duplex"),YZ=(t,e)=>(XZ(t,e,"web TransformStream"),"webTransform"),XZ=({final:t,binary:e,objectMode:r},n,i)=>{WZ(t,`${n}.final`,i),WZ(e,`${n}.binary`,i),eO(r,`${n}.objectMode`)},WZ=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},_ye=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!KZ(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(VT(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(rO(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!KZ(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return eO(r,`${i}.binary`),eO(n,`${i}.objectMode`),Qs(t)||Qs(e)?"asyncGenerator":"generator"},eO=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},KZ=t=>Qs(t)||QZ(t),Qs=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",QZ=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",vye=t=>kt(t)&&(t.transform!==void 0||t.final!==void 0),f_=t=>Object.prototype.toString.call(t)==="[object URL]",eG=t=>f_(t)&&t.protocol!=="file:",bye=t=>kt(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Sye.has(e))&&tO(t.file),Sye=new Set(["file","append"]),tO=t=>typeof t=="string",tG=(t,e)=>t==="native"&&typeof e=="string"&&!wye.has(e),wye=new Set(["ipc","ignore","inherit","overlapped","pipe"]),rG=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",p_=t=>Object.prototype.toString.call(t)==="[object WritableStream]",xye=t=>rG(t)||p_(t),rO=t=>rG(t?.readable)&&p_(t?.writable),$ye=t=>nG(t)&&typeof t[Symbol.asyncIterator]=="function",kye=t=>nG(t)&&typeof t[Symbol.iterator]=="function",nG=t=>typeof t=="object"&&t!==null,pn=new Set(["generator","asyncGenerator","duplex","webTransform"]),m_=new Set(["fileUrl","filePath","fileNumber"]),nO=new Set(["fileUrl","filePath"]),iG=new Set([...nO,"webStream","nodeStream"]),oG=new Set(["webTransform","duplex"]),Uo={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var iO,Eye,Aye,sG,oO=y(()=>{dr();iO=(t,e,r,n)=>n==="output"?Eye(t,e,r):Aye(t,e,r),Eye=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Aye=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},sG=(t,e)=>{let r=t.findLast(({type:n})=>pn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var aG,Tye,Oye,Iye,Pye,Rye,Cye,cG=y(()=>{Gi();Ks();dr();oO();aG=(t,e,r,n)=>[...t.filter(({type:i})=>!pn.has(i)),...Tye(t,e,r,n)],Tye=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>pn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Oye({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Cye(o,r)},Oye=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Iye({stdioItem:t,optionName:i}):e==="webTransform"?Pye({stdioItem:t,index:r,newTransforms:n,direction:o}):Rye({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Iye=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Pye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=kt(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=iO(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Rye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=kt(e)?e:{transform:e},d=c||Hr.has(o),{writableObjectMode:f,readableObjectMode:p}=iO(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Cye=(t,e)=>e==="input"?t.reverse():t});import sO from"node:process";var lG,Dye,Nye,Dc,aO,uG,jye,Mye,dG=y(()=>{Ys();dr();lG=(t,e,r)=>{let n=t.map(i=>Dye(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Mye},Dye=({type:t,value:e},r)=>Nye[r]??uG[t](e),Nye=["input","output","output"],Dc=()=>{},aO=()=>"input",uG={generator:Dc,asyncGenerator:Dc,fileUrl:Dc,filePath:Dc,iterable:aO,asyncIterable:aO,uint8Array:aO,webStream:t=>p_(t)?"output":"input",nodeStream(t){return Js(t,{checkOpen:!1})?GT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Dc,duplex:Dc,native(t){let e=jye(t);if(e!==void 0)return e;if(zn(t,{checkOpen:!1}))return uG.nodeStream(t)}},jye=t=>{if([0,sO.stdin].includes(t))return"input";if([1,2,sO.stdout,sO.stderr].includes(t))return"output"},Mye="output"});var fG,pG=y(()=>{fG=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var mG,Fye,zye,hG,Lye,Uye,gG=y(()=>{Wi();pG();Mo();mG=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Fye(t,n).map((a,c)=>hG(a,c));return o?Lye(s,r,i):fG(s,e)},Fye=(t,e)=>{if(t===void 0)return fn.map(n=>e[n]);if(zye(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${fn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,fn.length);return Array.from({length:r},(n,i)=>t[i])},zye=t=>fn.some(e=>t[e]!==void 0),hG=(t,e)=>Array.isArray(t)?t.map(r=>hG(r,e)):t??(e>=fn.length?"ignore":"pipe"),Lye=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Sc(r,i)&&Uye(n)?"ignore":n),Uye=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as qye}from"node:fs";import Bye from"node:tty";var _G,Hye,Zye,Gye,Vye,yG,vG=y(()=>{Ys();Wi();Br();zo();_G=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Hye({stdioItem:t,fdNumber:n,direction:i}):Vye({stdioItem:t,fdNumber:n}),Hye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Zye({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(zn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Zye=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Gye(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Bye.isatty(i))throw new TypeError(`The \`${e}: ${Ny(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Vi(qye(i)),optionName:e}}},Gye=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=my.indexOf(t);if(r!==-1)return r},Vye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:yG(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:yG(e,e,r),optionName:r}:zn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,yG=(t,e,r)=>{let n=my[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var bG,Wye,Kye,Jye,Yye,SG=y(()=>{Ys();Br();dr();bG=({input:t,inputFile:e},r)=>r===0?[...Wye(t),...Jye(e)]:[],Wye=t=>t===void 0?[]:[{type:Kye(t),value:t,optionName:"input"}],Kye=t=>{if(Js(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Mt(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Jye=t=>t===void 0?[]:[{...Yye(t),optionName:"inputFile"}],Yye=t=>{if(f_(t))return{type:"fileUrl",value:t};if(tO(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var wG,xG,Xye,Qye,$G,e_e,t_e,kG,EG=y(()=>{dr();wG=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),xG=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=Xye(i,t);if(s.length!==0){if(o){Qye({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(iG.has(t))return $G({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});oG.has(t)&&t_e({otherStdioItems:s,type:t,value:e,optionName:r})}},Xye=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),Qye=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{nO.has(e)&&$G({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},$G=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>e_e(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return kG(s,n,e),i==="output"?o[0].stream:void 0},e_e=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,t_e=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);kG(i,n,e)},kG=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Uo[r]} that is the same.`)}});var h_,r_e,n_e,i_e,o_e,s_e,a_e,c_e,l_e,u_e,d_e,f_e,cO,p_e,g_=y(()=>{Wi();cG();oO();dr();dG();gG();vG();SG();EG();h_=(t,e,r,n)=>{let o=mG(e,r,n).map((a,c)=>r_e({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=u_e({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>p_e(a)),s},r_e=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=hy(e),{stdioItems:o,isStdioArray:s}=n_e({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=lG(o,e,i),c=o.map(d=>_G({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=aG(c,i,a,r),u=sG(l,a);return l_e(l,u),{direction:a,objectMode:u,stdioItems:l}},n_e=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>i_e(c,n)),...bG(r,e)],s=wG(o),a=s.length>1;return o_e(s,a,n),a_e(s),{stdioItems:s,isStdioArray:a}},i_e=(t,e)=>({type:JZ(t,e),value:t,optionName:e}),o_e=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(s_e.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},s_e=new Set(["ignore","ipc"]),a_e=t=>{for(let e of t)c_e(e)},c_e=({type:t,value:e,optionName:r})=>{if(eG(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(tG(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},l_e=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>m_.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},u_e=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(d_e({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw cO(i),o}},d_e=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>f_e({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},f_e=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=xG({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},cO=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!jn(r)&&r.destroy()},p_e=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as AG}from"node:fs";var OG,pi,m_e,IG,TG,h_e,PG=y(()=>{Br();g_();dr();OG=(t,e)=>h_(h_e,t,e,!0),pi=({type:t,optionName:e})=>{IG(e,Uo[t])},m_e=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&IG(t,`"${e}"`),{}),IG=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},TG={generator(){},asyncGenerator:pi,webStream:pi,nodeStream:pi,webTransform:pi,duplex:pi,asyncIterable:pi,native:m_e},h_e={input:{...TG,fileUrl:({value:t})=>({contents:[Vi(AG(t))]}),filePath:({value:{file:t}})=>({contents:[Vi(AG(t))]}),fileNumber:pi,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...TG,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:pi,string:pi,uint8Array:pi}}});var Xi,lO,Yd=y(()=>{ZT();Xi=(t,{stripFinalNewline:e},r)=>lO(e,r)&&t!==void 0&&!Array.isArray(t)?Ic(t):t,lO=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var y_,dO,RG,CG,g_e,y_e,__e,DG,v_e,uO,b_e,S_e,w_e,__=y(()=>{y_=(t,e,r,n)=>t||r?void 0:CG(e,n),dO=(t,e,r)=>r?t.flatMap(n=>RG(n,e)):RG(t,e),RG=(t,e)=>{let{transform:r,final:n}=CG(e,{});return[...r(t),...n()]},CG=(t,e)=>(e.previousChunks="",{transform:g_e.bind(void 0,e,t),final:__e.bind(void 0,e)}),g_e=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=uO(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=uO(n,r.slice(i+1))),t.previousChunks=n},y_e=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),__e=function*({previousChunks:t}){t.length>0&&(yield t)},DG=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:v_e.bind(void 0,n)},v_e=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?b_e:w_e;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},uO=(t,e)=>`${t}${e}`,b_e={windowsNewline:`\r `,unixNewline:` `,LF:` -`,concatBytes:cO},g_e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},y_e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:g_e}});import{Buffer as __e}from"node:buffer";var RG,v_e,CG,b_e,S_e,DG,NG=y(()=>{Br();RG=(t,e)=>t?void 0:v_e.bind(void 0,e),v_e=function*(t,e){if(typeof e!="string"&&!Mt(e)&&!__e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},CG=(t,e)=>t?b_e.bind(void 0,e):S_e.bind(void 0,e),b_e=function*(t,e){DG(t,e),yield e},S_e=function*(t,e){if(DG(t,e),typeof e!="string"&&!Mt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},DG=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. +`,concatBytes:uO},S_e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},w_e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:S_e}});import{Buffer as x_e}from"node:buffer";var NG,$_e,jG,k_e,E_e,MG,FG=y(()=>{Br();NG=(t,e)=>t?void 0:$_e.bind(void 0,e),$_e=function*(t,e){if(typeof e!="string"&&!Mt(e)&&!x_e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},jG=(t,e)=>t?k_e.bind(void 0,e):E_e.bind(void 0,e),k_e=function*(t,e){MG(t,e),yield e},E_e=function*(t,e){if(MG(t,e),typeof e!="string"&&!Mt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},MG=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`)}});import{Buffer as w_e}from"node:buffer";import{StringDecoder as x_e}from"node:string_decoder";var y_,$_e,k_e,E_e,uO=y(()=>{Br();y_=(t,e,r)=>{if(r)return;if(t)return{transform:$_e.bind(void 0,new TextEncoder)};let n=new x_e(e);return{transform:k_e.bind(void 0,n),final:E_e.bind(void 0,n)}},$_e=function*(t,e){w_e.isBuffer(e)?yield Vi(e):typeof e=="string"?yield t.encode(e):yield e},k_e=function*(t,e){yield Mt(e)?t.write(e):e},E_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as jG}from"node:util";var dO,__,MG,A_e,FG,T_e,zG=y(()=>{dO=jG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),__=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=T_e}=e[r];for await(let i of n(t))yield*__(i,e,r+1)},MG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*A_e(r,Number(e),t)},A_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*__(n,r,e+1)},FG=jG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),T_e=function*(t){yield t}});var fO,LG,ea,Jd,O_e,I_e,pO=y(()=>{fO=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},LG=(t,e)=>[...e.flatMap(r=>[...ea(r,t,0)]),...Jd(t)],ea=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=I_e}=e[r];for(let i of n(t))yield*ea(i,e,r+1)},Jd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*O_e(r,Number(e),t)},O_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ea(n,r,e+1)},I_e=function*(t){yield t}});import{Transform as P_e,getDefaultHighWaterMark as UG}from"node:stream";var mO,v_,qG,b_=y(()=>{dr();g_();NG();uO();zG();pO();mO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=qG(t,s,o),l=Qs(e),u=Qs(r),d=l?dO.bind(void 0,__,a):fO.bind(void 0,ea),f=l||u?dO.bind(void 0,MG,a):fO.bind(void 0,Jd),p=l||u?FG.bind(void 0,a):void 0;return{stream:new P_e({writableObjectMode:n,writableHighWaterMark:UG(n),readableObjectMode:i,readableHighWaterMark:UG(i),transform(h,g,v){d([h,c,0],this,v)},flush(h){f([c],this,h)},destroy:p})}},v_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=qG(s,r,a);t=LG(c,t)}return t},qG=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:RG(n,a)},y_(r,s,n),h_(r,o,n,c),{transform:t,final:e},{transform:CG(i,a)},PG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var BG,R_e,C_e,D_e,N_e,HG=y(()=>{b_();Br();dr();BG=(t,e)=>{for(let r of R_e(t))C_e(t,r,e)},R_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),C_e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Lo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>D_e(a,n));r.input=Dd(s)},D_e=(t,e)=>{let r=v_(t,e,"utf8",!0);return N_e(r),Dd(r)},N_e=t=>{let e=t.find(r=>typeof r!="string"&&!Mt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var S_,j_e,M_e,ZG,GG,F_e,VG,hO=y(()=>{Ks();dr();Sc();jo();S_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&bc(r,n)&&!Hr.has(e)&&j_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&M_e.has(o))||t.every(({type:i})=>pn.has(i))),j_e=t=>t===1||t===2,M_e=new Set(["pipe","overlapped"]),ZG=async(t,e,r,n)=>{for await(let i of t)F_e(e)||VG(i,r,n)},GG=(t,e,r)=>{for(let n of t)VG(n,e,r)},F_e=t=>t._readableState.pipes.length>0,VG=(t,e,r)=>{let n=by(t);li({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as z_e,appendFileSync as L_e}from"node:fs";var WG,U_e,q_e,B_e,H_e,Z_e,KG=y(()=>{hO();b_();g_();Br();dr();Xs();WG=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>U_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},U_e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=CZ(t,o,d),p=Vi(f),{stdioItems:m,objectMode:h}=e[r],g=q_e([p],m,c,n),{serializedResult:v,finalResult:_=v}=B_e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});H_e({serializedResult:v,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&Z_e(v,m,i),S}catch(w){return n.error=w,S}},q_e=(t,e,r,n)=>{try{return v_(t,e,r,!1)}catch(i){return n.error=i,t}},B_e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Dd(t)};let s=x6(t,r);return n[o]?{serializedResult:s,finalResult:lO(s,!i[o],e)}:{serializedResult:s}},H_e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!S_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=lO(t,!1,s);try{GG(a,e,n)}catch(c){r.error??=c}},Z_e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>f_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?L_e(n,t):(r.add(o),z_e(n,t))}}});var JG,YG=y(()=>{Br();Kd();JG=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Xi(e,r,"all")]:Array.isArray(e)?[Xi(t,r,"all"),...e]:Mt(t)&&Mt(e)?iT([t,e]):`${t}${e}`}});import{once as gO}from"node:events";var XG,G_e,QG,e9,V_e,yO,_O=y(()=>{Vs();XG=async(t,e)=>{let[r,n]=await G_e(t);return e.isForcefullyTerminated??=!1,[r,n]},G_e=async t=>{let[e,r]=await Promise.allSettled([gO(t,"spawn"),gO(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?QG(t):r.value},QG=async t=>{try{return await gO(t,"exit")}catch{return QG(t)}},e9=async t=>{let[e,r]=await t;if(!V_e(e,r)&&yO(e,r))throw new Mn;return[e,r]},V_e=(t,e)=>t===void 0&&e===void 0,yO=(t,e)=>t!==0||e!==null});var t9,W_e,r9=y(()=>{Vs();Xs();_O();t9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=W_e(t,e,r),s=o?.code==="ETIMEDOUT",a=RZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},W_e=(t,e,r)=>t!==void 0?t:yO(e,r)?new Mn:void 0});import{spawnSync as K_e}from"node:child_process";var n9,J_e,Y_e,X_e,w_,Q_e,eve,tve,rve,i9=y(()=>{pT();UT();qT();Wd();l_();TG();Kd();HG();KG();Xs();YG();r9();n9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=J_e(t,e,r),d=Q_e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Rc(d,c,l)},J_e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),a=Y_e(r),{file:c,commandArguments:l,options:u}=Jy(t,e,a);X_e(u);let d=EG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Y_e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,X_e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&w_("ipcInput"),t&&w_("ipc: true"),r&&w_("detached: true"),n&&w_("cancelSignal")},w_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Q_e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=eve({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=t9(c,r),{output:m,error:h=l}=WG({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>Xi(_,r,S)),v=Xi(JG(m,r),r,"all");return rve({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:v,options:r,command:n,escapedCommand:i,startTime:a})},eve=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{BG(o,r);let a=tve(r);return K_e(...Yy(t,e,a))}catch(a){return Pc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},tve=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:a_(e)}),rve=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?c_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Vd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as vO,on as nve}from"node:events";var o9,ive,ove,sve,ave,s9=y(()=>{Ec();qd();Ud();o9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>($c({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),ive({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),ive=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{jy(e,i);let o=zo(t,e,r),s=new AbortController;try{return await Promise.race([ove(o,n,s),sve(o,r,s),ave(o,r,s)])}catch(a){throw kc(t),a}finally{s.abort(),My(e,i)}},ove=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await vO(t,"message",{signal:r});return n}for await(let[n]of nve(t,"message",{signal:r}))if(e(n))return n},sve=async(t,e,{signal:r})=>{await vO(t,"disconnect",{signal:r}),yH(e)},ave=async(t,e,{signal:r})=>{let[n]=await vO(t,"strict:error",{signal:r});throw Ry(n,e)}});import{once as c9,on as cve}from"node:events";var l9,bO,lve,uve,dve,a9,SO=y(()=>{Ec();qd();Ud();l9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>bO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),bO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{$c({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:By(t)}),jy(e,o);let s=zo(t,e,r),a=new AbortController,c={};return lve(t,s,a),uve({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),dve({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},lve=async(t,e,r)=>{try{await c9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},uve=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await c9(t,"strict:error",{signal:r.signal});n.error=Ry(i,e),r.abort()}catch{}},dve=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of cve(r,"message",{signal:o.signal}))a9(s),yield c}catch{a9(s)}finally{o.abort(),My(e,a),n||kc(t),i&&await t}},a9=({error:t})=>{if(t)throw t}});import u9 from"node:process";var d9,f9,p9,wO=y(()=>{Wy();s9();SO();Uy();d9=(t,{ipc:e})=>{Object.assign(t,p9(t,!1,e))},f9=()=>{let t=u9,e=!0,r=u9.channel!==void 0;return{...p9(t,e,r),getCancelSignal:ZH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},p9=(t,e,r)=>({sendMessage:Vy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:o9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:l9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as fve}from"node:child_process";import{PassThrough as pve,Readable as mve,Writable as hve,Duplex as gve}from"node:stream";var m9,yve,Yd,_ve,vve,bve,Sve,h9=y(()=>{m_();Wd();l_();m9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{sO(n);let a=new fve;yve(a,n),Object.assign(a,{readable:_ve,writable:vve,duplex:bve});let c=Pc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Sve(c,s,i);return{subprocess:a,promise:l}},yve=(t,e)=>{let r=Yd(),n=Yd(),i=Yd(),o=Array.from({length:e.length-3},Yd),s=Yd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Yd=()=>{let t=new pve;return t.end(),t},_ve=()=>new mve({read(){}}),vve=()=>new hve({write(){}}),bve=()=>new gve({read(){},write(){}}),Sve=async(t,e,r)=>Rc(t,e,r)});import{createReadStream as g9,createWriteStream as y9}from"node:fs";import{Buffer as wve}from"node:buffer";import{Readable as Xd,Writable as xve,Duplex as $ve}from"node:stream";var v9,Qd,_9,kve,b9=y(()=>{b_();m_();dr();v9=(t,e)=>p_(kve,t,e,!1),Qd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Lo[t]}.`)},_9={fileNumber:Qd,generator:mO,asyncGenerator:mO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:$ve.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},kve={input:{..._9,fileUrl:({value:t})=>({stream:g9(t)}),filePath:({value:{file:t}})=>({stream:g9(t)}),webStream:({value:t})=>({stream:Xd.fromWeb(t)}),iterable:({value:t})=>({stream:Xd.from(t)}),asyncIterable:({value:t})=>({stream:Xd.from(t)}),string:({value:t})=>({stream:Xd.from(t)}),uint8Array:({value:t})=>({stream:Xd.from(wve.from(t))})},output:{..._9,fileUrl:({value:t})=>({stream:y9(t)}),filePath:({value:{file:t,append:e}})=>({stream:y9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:xve.fromWeb(t)}),iterable:Qd,asyncIterable:Qd,string:Qd,uint8Array:Qd}}});import{on as Eve,once as S9}from"node:events";import{PassThrough as Ave,getDefaultHighWaterMark as Tve}from"node:stream";import{finished as $9}from"node:stream/promises";function ta(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)$O(i);let e=t.some(({readableObjectMode:i})=>i),r=Ove(t,e),n=new xO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Ove,xO,Ive,Pve,Rve,$O,Cve,Dve,Nve,jve,Mve,k9,E9,kO,A9,Fve,x_,w9,x9,$_=y(()=>{Ove=(t,e)=>{if(t.length===0)return Tve(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},xO=class extends Ave{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if($O(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Ive(this,this.#t,this.#o);let r=Cve({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if($O(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},Ive=async(t,e,r)=>{x_(t,w9);let n=new AbortController;try{await Promise.race([Pve(t,n),Rve(t,e,r,n)])}finally{n.abort(),x_(t,-w9)}},Pve=async(t,{signal:e})=>{try{await $9(t,{signal:e,cleanup:!0})}catch(r){throw k9(t,r),r}},Rve=async(t,e,r,{signal:n})=>{for await(let[i]of Eve(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},$O=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Cve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{x_(t,x9);let a=new AbortController;try{await Promise.race([Dve(o,e,a),Nve({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),jve({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),x_(t,-x9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?kO(t):Mve(t))},Dve=async(t,e,{signal:r})=>{try{await t,r.aborted||kO(e)}catch(n){r.aborted||k9(e,n)}},Nve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await $9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;E9(s)?i.add(e):A9(t,s)}},jve=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await S9(t,i,{signal:o}),!t.readable)return S9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},Mve=t=>{t.writable&&t.end()},k9=(t,e)=>{E9(e)?kO(t):A9(t,e)},E9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",kO=t=>{(t.readable||t.writable)&&t.destroy()},A9=(t,e)=>{t.destroyed||(t.once("error",Fve),t.destroy(e))},Fve=()=>{},x_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},w9=2,x9=1});import{finished as T9}from"node:stream/promises";var Dc,zve,EO,Lve,AO,k_=y(()=>{Wi();Dc=(t,e)=>{t.pipe(e),zve(t,e),Lve(t,e)},zve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}EO(e)}},EO=t=>{t.writable&&t.end()},Lve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await T9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}AO(t)}},AO=t=>{t.readable&&t.destroy()}});var O9,Uve,qve,Bve,Hve,Zve,I9=y(()=>{$_();Wi();Ny();dr();k_();O9=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>pn.has(c)))Uve(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!pn.has(c)))Bve({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:ta(o);Dc(s,i)}},Uve=(t,e,r,n)=>{r==="output"?Dc(t.stdio[n],e):Dc(e,t.stdio[n]);let i=qve[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},qve=["stdin","stdout","stderr"],Bve=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;Hve(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},Hve=(t,{signal:e})=>{jn(t)&&Ws(t,Zve,e)},Zve=2});var ra,P9=y(()=>{ra=[];ra.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ra.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ra.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var E_,TO,OO,Gve,IO,A_,Vve,PO,RO,CO,R9,ZXe,GXe,C9=y(()=>{P9();E_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",TO=Symbol.for("signal-exit emitter"),OO=globalThis,Gve=Object.defineProperty.bind(Object),IO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(OO[TO])return OO[TO];Gve(OO,TO,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},A_=class{},Vve=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),PO=class extends A_{onExit(){return()=>{}}load(){}unload(){}},RO=class extends A_{#t=CO.platform==="win32"?"SIGINT":"SIGHUP";#r=new IO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of ra)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!E_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of ra)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,ra.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return E_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&E_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},CO=globalThis.process,{onExit:R9,load:ZXe,unload:GXe}=Vve(E_(CO)?new RO(CO):new PO)});import{addAbortListener as Wve}from"node:events";var D9,N9=y(()=>{C9();D9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=R9(()=>{t.kill()});Wve(n,()=>{i()})}});var M9,Kve,Jve,j9,Yve,F9=y(()=>{nT();wy();Fo();_c();M9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=Sy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=Kve(r,n,i),{sourceStream:d,sourceError:f}=Yve(t,l),{options:p,fileDescriptors:m}=di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},Kve=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=Jve(t,e,...r),a=Dy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},Jve=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(j9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||tT(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=uy(r,...n);return{destination:e(j9)(i,o,s),pipeOptions:s}}if(di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},j9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Yve=(t,e)=>{try{return{sourceStream:Tc(t,e)}}catch(r){return{sourceError:r}}}});var L9,Xve,DO,z9,NO=y(()=>{Wd();k_();L9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=Xve({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw DO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},Xve=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return AO(t),n;if(e!==void 0)return EO(r),e},DO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Pc({error:t,command:z9,escapedCommand:z9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),z9="source.pipe(destination)"});var U9,q9=y(()=>{U9=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as Qve}from"node:stream/promises";var B9,ebe,tbe,rbe,T_,nbe,ibe,H9=y(()=>{$_();Ny();k_();B9=(t,e,r)=>{let n=T_.has(e)?tbe(t,e):ebe(t,e);return Ws(t,nbe,r.signal),Ws(e,ibe,r.signal),rbe(e),n},ebe=(t,e)=>{let r=ta([t]);return Dc(r,e),T_.set(e,r),r},tbe=(t,e)=>{let r=T_.get(e);return r.add(t),r},rbe=async t=>{try{await Qve(t,{cleanup:!0,readable:!1,writable:!0})}catch{}T_.delete(t)},T_=new WeakMap,nbe=2,ibe=1});import{aborted as obe}from"node:util";var Z9,sbe,G9=y(()=>{NO();Z9=(t,e)=>t===void 0?[]:[sbe(t,e)],sbe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await obe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw DO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var O_,abe,cbe,V9=y(()=>{Gi();F9();NO();q9();H9();G9();O_=(t,...e)=>{if(kt(e[0]))return O_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=M9(t,...e),i=abe({...n,destination:r});return i.pipe=O_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},abe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=cbe(t,i);L9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=B9(e,o,d);return await Promise.race([U9(u),...Z9(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},cbe=(t,e)=>Promise.allSettled([t,e])});import{on as lbe}from"node:events";import{getDefaultHighWaterMark as ube}from"node:stream";var I_,dbe,jO,fbe,K9,MO,W9,pbe,mbe,P_=y(()=>{uO();g_();pO();I_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return dbe(e,s),K9({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},dbe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},jO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;fbe(e,s,t);let a=t.readableObjectMode&&!o;return K9({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},fbe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},K9=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=lbe(t,"data",{signal:e.signal,highWaterMark:W9,highWatermark:W9});return pbe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},MO=ube(!0),W9=MO,pbe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=mbe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ea(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*Jd(a)}},mbe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[y_(t,r,!e),h_(t,i,!n,{})].filter(Boolean)});import{setImmediate as hbe}from"node:timers/promises";var J9,gbe,ybe,_be,FO,Y9,zO=y(()=>{s_();Br();hO();P_();Xs();Kd();J9=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=gbe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([ybe(t),d]);return}let f=aO(c,r),p=jO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([_be({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},gbe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!S_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=jO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await ZG(a,t,r,o)},ybe=async t=>{await hbe(),t.readableFlowing===null&&t.resume()},_be=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await r_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await n_(r,{maxBuffer:o})):await o_(r,{maxBuffer:o})}catch(a){return Y9(OZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},FO=async t=>{try{return await t}catch(e){return Y9(e)}},Y9=({bufferedData:t})=>S6(t)?new Uint8Array(t):t});import{finished as vbe}from"node:stream/promises";var ef,bbe,Sbe,wbe,xbe,$be,LO,R_,X9,C_=y(()=>{ef=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=bbe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],vbe(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||xbe(a,e,r,n)}finally{s.abort()}},bbe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Sbe(t,r,n),n},Sbe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{wbe(e,r),n.call(t,...i)}},wbe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},xbe=(t,e,r,n)=>{if(!$be(t,e,r,n))throw t},$be=(t,e,r,n=!0)=>r.propagating?X9(t)||R_(t):(r.propagating=!0,LO(r,e)===n?X9(t):R_(t)),LO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",R_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",X9=t=>t?.code==="EPIPE"});var Q9,UO,qO=y(()=>{zO();C_();Q9=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>UO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),UO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=ef(t,e,l);if(LO(l,e)){await u;return}let[d]=await Promise.all([J9({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var eV,tV,kbe,Ebe,BO=y(()=>{$_();qO();eV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?ta([t,e].filter(Boolean)):void 0,tV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>UO({...kbe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Ebe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),kbe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Ebe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var rV,nV,iV=y(()=>{Sc();jo();rV=t=>bc(t,"ipc"),nV=(t,e)=>{let r=by(t);li({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var oV,sV,aV=y(()=>{Xs();iV();Ji();SO();oV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=rV(o),a=Ki(e,"ipc"),c=Ki(r,"ipc");for await(let l of bO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(IZ(t,i,c),i.push(l)),s&&nV(l,o);return i},sV=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Abe}from"node:events";var cV,Tbe,Obe,Ibe,lV=y(()=>{Ys();jT();AT();NT();Wi();dr();zO();aV();FT();BO();qO();_O();C_();cV=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:v})=>{let _=XG(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},w=Q9({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),x=tV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),I=[],T=oV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:I,verboseInfo:p}),k=Tbe(h,t,S),C=Obe(m,S);try{return await Promise.race([Promise.all([{},e9(_),Promise.all(w),x,T,tZ(t,d),...k,...C]),g,Ibe(t,v),...JH(t,o,f,v),...gH({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:v}),...WH({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:v})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(w.map(Z=>FO(Z))),FO(x),sV(T,I),Promise.allSettled(k),Promise.allSettled(C)])}},Tbe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:ef(n,i,r)),Obe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>zn(o,{checkOpen:!1})&&!jn(o)).map(({type:i,value:o,stream:s=o})=>ef(s,n,e,{isSameDirection:pn.has(i),stopOnExit:i==="native"}))),Ibe=async(t,{signal:e})=>{let[r]=await Abe(t,"error",{signal:e});throw r}});var uV,tf,Nc,D_=y(()=>{Ac();uV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),tf=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ui();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Nc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as dV}from"node:stream/promises";var HO,fV,ZO,GO,N_,j_,VO=y(()=>{C_();HO=async t=>{if(t!==void 0)try{await ZO(t)}catch{}},fV=async t=>{if(t!==void 0)try{await GO(t)}catch{}},ZO=async t=>{await dV(t,{cleanup:!0,readable:!1,writable:!0})},GO=async t=>{await dV(t,{cleanup:!0,readable:!0,writable:!1})},N_=async(t,e)=>{if(await t,e)throw e},j_=(t,e,r)=>{r&&!R_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Pbe}from"node:stream";import{callbackify as Rbe}from"node:util";var pV,WO,KO,JO,Cbe,YO,XO,mV,QO=y(()=>{Ks();Fo();P_();Ac();D_();VO();pV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Hr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=WO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=KO(a,s),{read:f,onStdoutDataDone:p}=JO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Pbe({read:f,destroy:Rbe(XO.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return YO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},WO=(t,e,r)=>{let n=Tc(t,e),i=tf(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},KO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:MO},JO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ui(),s=I_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Cbe(this,s,o)},onStdoutDataDone:o}},Cbe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},YO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await GO(t),await n,await HO(i),await e,r.readable&&r.push(null)}catch(o){await HO(i),mV(r,o)}},XO=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Nc(r,e)&&(mV(t,n),await N_(e,n))},mV=(t,e)=>{j_(t,t.readable,e)}});import{Writable as Dbe}from"node:stream";import{callbackify as hV}from"node:util";var gV,eI,tI,Nbe,jbe,rI,nI,yV,iI=y(()=>{Fo();D_();VO();gV=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=eI(t,r,e),s=new Dbe({...tI(n,t,i),destroy:hV(nI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return rI(n,s),s},eI=(t,e,r)=>{let n=Dy(t,e),i=tf(r,n,"writableFinal"),o=tf(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},tI=(t,e,r)=>({write:Nbe.bind(void 0,t),final:hV(jbe.bind(void 0,t,e,r))}),Nbe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},jbe=async(t,e,r)=>{await Nc(r,e)&&(t.writable&&t.end(),await e)},rI=async(t,e,r)=>{try{await ZO(t),e.writable&&e.end()}catch(n){await fV(r),yV(e,n)}},nI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Nc(r,e),await Nc(n,e)&&(yV(t,i),await N_(e,i))},yV=(t,e)=>{j_(t,t.writable,e)}});import{Duplex as Mbe}from"node:stream";import{callbackify as Fbe}from"node:util";var _V,zbe,vV=y(()=>{Ks();QO();iI();_V=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Hr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=WO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=eI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=KO(c,a),{read:g,onStdoutDataDone:v}=JO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Mbe({read:g,...tI(u,t,d),destroy:Fbe(zbe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return YO({subprocessStdout:c,onStdoutDataDone:v,readable:_,subprocess:t,subprocessStdin:u}),rI(u,_,c),_},zbe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([XO({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),nI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var oI,Lbe,bV=y(()=>{Ks();Fo();P_();oI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Hr.has(e),s=Tc(t,r),a=I_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Lbe(a,s,t)},Lbe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var SV,wV=y(()=>{D_();QO();iI();vV();bV();SV=(t,{encoding:e})=>{let r=uV();t.readable=pV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=gV.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=_V.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=oI.bind(void 0,t,e),t[Symbol.asyncIterator]=oI.bind(void 0,t,e,{})}});var xV,Ube,qbe,$V=y(()=>{xV=(t,e)=>{for(let[r,n]of qbe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Ube=(async()=>{})().constructor.prototype,qbe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Ube,t)])});import{setMaxListeners as Bbe}from"node:events";import{spawn as Hbe}from"node:child_process";var kV,Zbe,Gbe,Vbe,Wbe,Kbe,EV=y(()=>{s_();pT();UT();Fo();qT();wO();Wd();l_();h9();b9();Kd();I9();Iy();N9();V9();BO();lV();wV();Ac();$V();kV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Zbe(t,e,r),{subprocess:f,promise:p}=Vbe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=O_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),xV(f,p),di.set(f,{options:u,fileDescriptors:d}),f},Zbe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=xy(t,e,r),{file:a,commandArguments:c,options:l}=Jy(t,e,r),u=Gbe(l),d=v9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Gbe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},Vbe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Hbe(...Yy(t,e,r))}catch(m){return m9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Bbe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];O9(c,a,l),D9(c,r,l);let d={},f=ui();c.kill=mH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=eV(c,r),SV(c,r),d9(c,r);let p=Wbe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Wbe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await cV({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let v=m.map((w,x)=>Xi(w,e,x)),_=Xi(h,e,"all"),S=Kbe({errorInfo:d,exitCode:f,signal:p,stdio:v,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Rc(S,n,e)},Kbe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Vd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof fi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):c_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var M_,Jbe,Ybe,AV=y(()=>{Gi();Ji();M_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,Jbe(n,t[n],i)]));return{...t,...r}},Jbe=(t,e,r)=>Ybe.has(t)&&kt(e)&&kt(r)?{...e,...r}:r,Ybe=new Set(["env",...cT])});var Uo,Xbe,Qbe,TV=y(()=>{Gi();nT();O6();i9();EV();AV();Uo=(t,e,r,n)=>{let i=(s,a,c)=>Uo(s,a,r,c),o=(...s)=>Xbe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},Xbe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(kt(o))return i(t,M_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=Qbe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?n9(a,c,l):kV(a,c,l,i)},Qbe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=A6(e)?T6(e,r):[e,...r],[s,a,c]=uy(...o),l=M_(M_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var OV,IV,PV,eSe,tSe,RV=y(()=>{OV=({file:t,commandArguments:e})=>PV(t,e),IV=({file:t,commandArguments:e})=>({...PV(t,e),isSync:!0}),PV=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=eSe(t);return{file:r,commandArguments:n}},eSe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(tSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},tSe=/ +/g});var CV,DV,rSe,NV,nSe,jV,MV=y(()=>{CV=(t,e,r)=>{t.sync=e(rSe,r),t.s=t.sync},DV=({options:t})=>NV(t),rSe=({options:t})=>({...NV(t),isSync:!0}),NV=t=>({options:{...nSe(t),...t}}),nSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},jV={preferLocal:!0}});var Met,Qe,Fet,zet,Let,Uet,qet,Bet,Het,Zet,Ar=y(()=>{TV();RV();MT();MV();wO();Met=Uo(()=>({})),Qe=Uo(()=>({isSync:!0})),Fet=Uo(OV),zet=Uo(IV),Let=Uo(XH),Uet=Uo(DV,{},jV,CV),{sendMessage:qet,getOneMessage:Bet,getEachMessage:Het,getCancelSignal:Zet}=f9()});import{existsSync as F_,statSync as iSe}from"node:fs";import{dirname as sI,extname as oSe,isAbsolute as FV,join as aI,relative as cI,resolve as z_,sep as sSe}from"node:path";function L_(t){return t==="./gradlew"||t==="gradle"}function aSe(t){return(F_(aI(t,"build.gradle.kts"))||F_(aI(t,"build.gradle")))&&F_(aI(t,"gradle.properties"))}function cSe(t,e){let n=cI(t,e).split(sSe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function qo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function lSe(t,e){let r=z_(t,e),n=r;F_(r)?iSe(r).isFile()&&(n=sI(r)):oSe(r)!==""&&(n=sI(r));let i=cI(t,n);if(i.startsWith("..")||FV(i))return null;let o=n;for(;;){if(aSe(o))return o;if(z_(o)===z_(t))return null;let s=sI(o);if(s===o)return null;let a=cI(t,s);if(a.startsWith("..")||FV(a))return null;o=s}}function U_(t,e){let r=z_(t),n=new Map,i=[];for(let o of e){let s=lSe(r,o);if(!s){i.push(o);continue}let a=cSe(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var q_=y(()=>{"use strict"});import{existsSync as uSe,readFileSync as dSe}from"node:fs";import{join as fSe}from"node:path";function jc(t="."){let e=fSe(t,".cladding","config.yaml");if(!uSe(e))return lI;try{let n=(0,zV.parse)(dSe(e,"utf8"))?.gate;if(!n)return lI;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of pSe){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return lI}}function LV(t,e){let r=[],n=!1;for(let i of t){let o=mSe.exec(i);if(o){n=!0;for(let s of e)r.push(qo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var zV,pSe,lI,mSe,B_=y(()=>{"use strict";zV=$t(rr(),1);q_();pSe=["type","lint","test","coverage"],lI={scope:"feature"};mSe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as dI,readFileSync as UV,readdirSync as hSe,statSync as gSe}from"node:fs";import{join as H_}from"node:path";function mI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=H_(t,e);if(dI(r))try{if(qV.test(UV(r,"utf8")))return!0}catch{}}return!1}function BV(t){try{return dI(t)&&qV.test(UV(t,"utf8"))}catch{return!1}}function HV(t,e=0){if(e>4||!dI(t))return!1;let r;try{r=hSe(t)}catch{return!1}for(let n of r){let i=H_(t,n),o=!1;try{o=gSe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(HV(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&BV(i))return!0}return!1}function vSe(t){if(mI(t))return!0;for(let e of ySe)if(BV(H_(t,e)))return!0;for(let e of _Se)if(HV(H_(t,e)))return!0;return!1}function ZV(t="."){let e=jc(t).coverage;return e||(vSe(t)?"kover":"jacoco")}function GV(t="."){return fI[ZV(t)]}function VV(t="."){return uI[ZV(t)]}var fI,uI,pI,qV,ySe,_Se,Z_=y(()=>{"use strict";B_();fI={kover:"koverXmlReport",jacoco:"jacocoTestReport"},uI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},pI=[uI.kover,uI.jacoco],qV=/kover/i;ySe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],_Se=["buildSrc","build-logic"]});import{existsSync as hI,readdirSync as WV}from"node:fs";import{join as G_}from"node:path";function gI(t){return hI(G_(t,"gradlew"))?"./gradlew":"gradle"}function bSe(t){let e=gI(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[GV(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function wSe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function kSe(t,e){for(let r of e)if(hI(G_(t,r)))return r}function ESe(t,e){try{return WV(t).find(n=>n.endsWith(e))}catch{return}}function TSe(t,e){for(let r of ASe)if(r.configs.some(n=>hI(G_(t,n))))return r.gate;return e}function pt(t="."){for(let e of xSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=ESe(t,o):r=kSe(t,[o]),r)break;if(!r||e.requiresSource&&!wSe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:TSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return $Se}var SSe,xSe,$Se,ASe,mn=y(()=>{"use strict";Z_();SSe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);xSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit","--incremental","--tsBuildInfoFile",".cladding/cache/tsc.tsbuildinfo"]},lint:{cmd:"npx",args:["--no-install","eslint",".","--cache","--cache-location",".cladding/cache/eslint"]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:bSe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],$Se={language:"unknown",manifest:"",gates:{}};ASe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as OSe,readFileSync as ISe}from"node:fs";import{join as PSe}from"node:path";function rf(t){return t.code==="ENOENT"}function V_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return KV.test(o)||KV.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Ft(t,e,r){return rf(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function nr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Mc(t,e){let r=PSe(t,"package.json");if(!OSe(r))return!1;try{return!!JSON.parse(ISe(r,"utf8")).scripts?.[e]}catch{return!1}}var KV,hn=y(()=>{"use strict";KV=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function RSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;if(!n)return[{detector:W_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Qe(n.cmd,[...n.args],{cwd:e,reject:!1});return rf(i)?[{detector:W_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:V_(i,W_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var W_,K_,yI=y(()=>{"use strict";Ar();mn();hn();W_="ARCHITECTURE_VIOLATION";K_={name:W_,run:RSe}});import JV from"node:process";function na(t={}){let r=K_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:CSe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` -`)}}var CSe,DSe,J_=y(()=>{"use strict";yI();CSe="stage_1.5";DSe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${JV.argv[1]}`;if(DSe){let t=na();console.log(JSON.stringify(t)),JV.exit(t.exitCode)}});import{existsSync as _I,readdirSync as YV}from"node:fs";import{join as Y_}from"node:path";function jSe(t,e){let r=Y_(t,e.path);if(!_I(r))return!0;if(e.isDirectory)try{return YV(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function MSe(t){let{cwd:e="."}=t,r=[];for(let i of NSe)jSe(e,i)&&r.push({detector:nf,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Y_(e,"spec.yaml");if(_I(n)){let i=LSe(n),o=i?null:FSe(e);if(i)r.push({detector:nf,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:nf,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=zSe(e);s&&r.push({detector:nf,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function FSe(t){for(let e of["spec/features","spec/scenarios"]){let r=Y_(t,e);if(!_I(r))continue;let n;try{n=YV(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{si(Y_(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function zSe(t){try{return J(t),null}catch(e){return e.message}}function LSe(t){let e;try{e=si(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var nf,NSe,XV,QV=y(()=>{"use strict";lt();iy();nf="ABSENCE_OF_GOVERNANCE",NSe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];XV={name:nf,run:MSe}});function X_(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function vI(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=X_(r)==="while",o=qSe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${X_(r)}'`}let n=USe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:X_(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${X_(r)}'`:null}function BSe(t,e){let r=vI(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function eW(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...BSe(r,n));return e}var USe,qSe,bI=y(()=>{"use strict";USe={event:"when",state:"while",optional:"where",unwanted:"if"},qSe=/\bwhen\b/i});function pe(t,e,r){let n;try{n=J(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var _t=y(()=>{"use strict";lt()});function HSe(t){let{cwd:e="."}=t;return pe(e,Q_,ZSe)}function ZSe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:Q_,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of eW(t.features))e.push({detector:Q_,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Q_,tW,rW=y(()=>{"use strict";bI();_t();Q_="AC_DRIFT";tW={name:Q_,run:HSe}});function mi(t=".",e){let n=(e??"").trim().toLowerCase()||pt(t).language;return KSe[n]??nW}var GSe,VSe,nW,WSe,KSe,Fc=y(()=>{"use strict";mn();GSe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,VSe=/^[ \t]*import\s+([\w.]+)/gm,nW={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:GSe,importStyle:"relative"},WSe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:VSe,importStyle:"dotted"},KSe={typescript:nW,kotlin:WSe}});import{existsSync as JSe,readFileSync as YSe,readdirSync as XSe,statSync as QSe}from"node:fs";import{join as oW,relative as iW}from"node:path";function ewe(t,e){if(!JSe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=XSe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=oW(i,s),c;try{c=QSe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function twe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function nwe(t){return rwe.test(t)}function iwe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=mi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>ewe(oW(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=YSe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";lt();Fc();sW="AI_HINTS_FORBIDDEN_PATTERN";rwe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;aW={name:sW,run:iwe}});function owe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:lW,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var lW,uW,dW=y(()=>{"use strict";lt();lW="AC_DUPLICATE_WITHIN_FEATURE";uW={name:lW,run:owe}});import{createRequire as swe}from"module";import{basename as awe,dirname as wI,normalize as cwe,relative as lwe,resolve as uwe,sep as mW}from"path";import*as dwe from"fs";function fwe(t){let e=cwe(t);return e.length>1&&e[e.length-1]===mW&&(e=e.substring(0,e.length-1)),e}function hW(t,e){return t.replace(pwe,e)}function hwe(t){return t==="/"||mwe.test(t)}function SI(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=uwe(t)),(n||o)&&(t=fwe(t)),t===".")return"";let s=t[t.length-1]!==i;return hW(s?t+i:t,i)}function gW(t,e){return e+t}function gwe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:hW(lwe(t,n),e.pathSeparator)+e.pathSeparator+r}}function ywe(t){return t}function _we(t,e,r){return e+t+r}function vwe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?gwe(t,e):n?gW:ywe}function bwe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function Swe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function kwe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?Swe(t):bwe(t):n&&n.length?xwe:wwe:$we}function Pwe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?Iwe:r&&r.length?n?Ewe:Awe:n?Twe:Owe}function Dwe(t){return t.group?Cwe:Rwe}function Mwe(t){return t.group?Nwe:jwe}function Lwe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?zwe:Fwe}function yW(t,e,r){if(r.options.useRealPaths)return Uwe(e,r);let n=wI(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=wI(n)}return r.symlinks.set(t,e),i>1}function Uwe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function ev(t,e,r,n){e(t&&!n?t:null,r)}function Jwe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?qwe:Gwe:n?e?Bwe:Kwe:i?e?Zwe:Wwe:e?Hwe:Vwe}function Qwe(t){return t?Xwe:Ywe}function nxe(t,e){return new Promise((r,n)=>{bW(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function bW(t,e,r){new vW(t,e,r).start()}function ixe(t,e){return new vW(t,e).start()}var fW,pwe,mwe,wwe,xwe,$we,Ewe,Awe,Twe,Owe,Iwe,Rwe,Cwe,Nwe,jwe,Fwe,zwe,qwe,Bwe,Hwe,Zwe,Gwe,Vwe,Wwe,Kwe,_W,Ywe,Xwe,exe,txe,rxe,vW,pW,SW,wW,xW=y(()=>{fW=swe(import.meta.url);pwe=/[\\/]/g;mwe=/^[a-z]:[\\/]$/i;wwe=(t,e)=>{e.push(t||".")},xwe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},$we=()=>{};Ewe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},Awe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},Twe=(t,e,r,n)=>{r.files++},Owe=(t,e)=>{e.push(t)},Iwe=()=>{};Rwe=t=>t,Cwe=()=>[""].slice(0,0);Nwe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},jwe=()=>{};Fwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&yW(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},zwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&yW(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};qwe=t=>t.counts,Bwe=t=>t.groups,Hwe=t=>t.paths,Zwe=t=>t.paths.slice(0,t.options.maxFiles),Gwe=(t,e,r)=>(ev(e,r,t.counts,t.options.suppressErrors),null),Vwe=(t,e,r)=>(ev(e,r,t.paths,t.options.suppressErrors),null),Wwe=(t,e,r)=>(ev(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),Kwe=(t,e,r)=>(ev(e,r,t.groups,t.options.suppressErrors),null);_W={withFileTypes:!0},Ywe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",_W,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},Xwe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",_W)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};exe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},txe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},rxe=class{aborted=!1;abort(){this.aborted=!0}},vW=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=Jwe(e,this.isSynchronous),this.root=SI(t,e),this.state={root:hwe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new txe,options:e,queue:new exe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new rxe,fs:e.fs||dwe},this.joinPath=vwe(this.root,e),this.pushDirectory=kwe(this.root,e),this.pushFile=Pwe(e),this.getArray=Dwe(e),this.groupFiles=Mwe(e),this.resolveSymlink=Lwe(e,this.isSynchronous),this.walkDirectory=Qwe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(v.isDirectory()){if(_=SI(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=awe(_),w=SI(wI(_),this.state.options);_=this.joinPath(S,w),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};pW=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return nxe(this.root,this.options)}withCallback(t){bW(this.root,this.options,t)}sync(){return ixe(this.root,this.options)}},SW=null;try{fW.resolve("picomatch"),SW=fW("picomatch")}catch{}wW=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:mW,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new pW(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new pW(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||SW;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var of=b((Vtt,TW)=>{"use strict";var $W="[^\\\\/]",oxe="(?=.)",kW="[^/]",xI="(?:\\/|$)",EW="(?:^|\\/)",$I=`\\.{1,2}${xI}`,sxe="(?!\\.)",axe=`(?!${EW}${$I})`,cxe=`(?!\\.{0,1}${xI})`,lxe=`(?!${$I})`,uxe="[^.\\/]",dxe=`${kW}*?`,fxe="/",AW={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:oxe,QMARK:kW,END_ANCHOR:xI,DOTS_SLASH:$I,NO_DOT:sxe,NO_DOTS:axe,NO_DOT_SLASH:cxe,NO_DOTS_SLASH:lxe,QMARK_NO_DOT:uxe,STAR:dxe,START_ANCHOR:EW,SEP:fxe},pxe={...AW,SLASH_LITERAL:"[\\\\/]",QMARK:$W,STAR:`${$W}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},mxe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};TW.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:mxe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?pxe:AW}}});var sf=b(Tr=>{"use strict";var{REGEX_BACKSLASH:hxe,REGEX_REMOVE_BACKSLASH:gxe,REGEX_SPECIAL_CHARS:yxe,REGEX_SPECIAL_CHARS_GLOBAL:_xe}=of();Tr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Tr.hasRegexChars=t=>yxe.test(t);Tr.isRegexChar=t=>t.length===1&&Tr.hasRegexChars(t);Tr.escapeRegex=t=>t.replace(_xe,"\\$1");Tr.toPosixSlashes=t=>t.replace(hxe,"/");Tr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Tr.removeBackslashes=t=>t.replace(gxe,e=>e==="\\"?"":e);Tr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Tr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Tr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Tr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Tr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var jW=b((Ktt,NW)=>{"use strict";var OW=sf(),{CHAR_ASTERISK:kI,CHAR_AT:vxe,CHAR_BACKWARD_SLASH:af,CHAR_COMMA:bxe,CHAR_DOT:EI,CHAR_EXCLAMATION_MARK:AI,CHAR_FORWARD_SLASH:DW,CHAR_LEFT_CURLY_BRACE:TI,CHAR_LEFT_PARENTHESES:OI,CHAR_LEFT_SQUARE_BRACKET:Sxe,CHAR_PLUS:wxe,CHAR_QUESTION_MARK:IW,CHAR_RIGHT_CURLY_BRACE:xxe,CHAR_RIGHT_PARENTHESES:PW,CHAR_RIGHT_SQUARE_BRACKET:$xe}=of(),RW=t=>t===DW||t===af,CW=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},kxe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,v=!1,_=!1,S=!1,w=!1,x=!1,I=0,T,k,C={value:"",depth:0,isGlob:!1},E=()=>l>=n,Z=()=>c.charCodeAt(l+1),ie=()=>(T=k,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),R=c.slice(d)):m===!0?(xe="",R=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&RW(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(R&&(R=OW.removeBackslashes(R)),xe&&_===!0&&(xe=OW.removeBackslashes(xe)));let cn={prefix:P,input:t,start:u,base:xe,glob:R,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:w};if(r.tokens===!0&&(cn.maxDepth=0,RW(k)||s.push(C),cn.tokens=s),r.parts===!0||r.tokens===!0){let Ge;for(let ft=0;ft{"use strict";var cf=of(),Zr=sf(),{MAX_LENGTH:tv,POSIX_REGEX_SOURCE:Exe,REGEX_NON_SPECIAL_CHARS:Axe,REGEX_SPECIAL_CHARS_BACKREF:Txe,REPLACEMENTS:MW}=cf,Oxe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Zr.escapeRegex(i)).join("..")}return r},zc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,FW=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Ixe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},zW=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Ixe(e))return e.replace(/\\(.)/g,"$1")},Pxe=t=>{let e=t.map(zW).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},Rxe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=zW(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Zr.escapeRegex(r[0]):`[${r.map(i=>Zr.escapeRegex(i)).join("")}]`}*`},Cxe=t=>{let e=0,r=t.trim(),n=II(r);for(;n;)e++,r=n.body.trim(),n=II(r);return e},Dxe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:cf.DEFAULT_MAX_EXTGLOB_RECURSION,n=FW(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Pxe(n)))return{risky:!0};for(let i of n){let o=Rxe(i);if(o)return{risky:!0,safeOutput:o};if(Cxe(i)>r)return{risky:!0}}return{risky:!1}},PI=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=MW[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(tv,r.maxLength):tv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=cf.globChars(r.windows),l=cf.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:v,QMARK:_,QMARK_NO_DOT:S,STAR:w,START_ANCHOR:x}=c,I=U=>`(${a}(?:(?!${x}${U.dot?m:u}).)*?)`,T=r.dot?"":h,k=r.dot?_:S,C=r.bash===!0?I(r):w;r.capture&&(C=`(${C})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Zr.removePrefix(t,E),i=t.length;let Z=[],ie=[],xe=[],P=o,R,cn=()=>E.index===i-1,Ge=E.peek=(U=1)=>t[E.index+U],ft=E.advance=()=>t[++E.index]||"",zi=()=>t.slice(E.index+1),ln=(U="",ct=0)=>{E.consumed+=U,E.index+=ct},bo=U=>{E.output+=U.output!=null?U.output:U.value,ln(U.value)},xae=()=>{let U=1;for(;Ge()==="!"&&(Ge(2)!=="("||Ge(3)==="?");)ft(),E.start++,U++;return U%2===0?!1:(E.negated=!0,E.start++,!0)},Gh=U=>{E[U]++,xe.push(U)},So=U=>{E[U]--,xe.pop()},Ee=U=>{if(P.type==="globstar"){let ct=E.braces>0&&(U.type==="comma"||U.type==="brace"),L=U.extglob===!0||Z.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!ct&&!L&&(E.output=E.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=C,E.output+=P.output)}if(Z.length&&U.type!=="paren"&&(Z[Z.length-1].inner+=U.value),(U.value||U.output)&&bo(U),P&&P.type==="text"&&U.type==="text"){P.output=(P.output||P.value)+U.value,P.value+=U.value;return}U.prev=P,s.push(U),P=U},Vh=(U,ct)=>{let L={...l[ct],conditions:1,inner:""};L.prev=P,L.parens=E.parens,L.output=E.output,L.startIndex=E.index,L.tokensIndex=s.length;let Ae=(r.capture?"(":"")+L.open;Gh("parens"),Ee({type:U,value:ct,output:E.output?"":p}),Ee({type:"paren",extglob:!0,value:ft(),output:Ae}),Z.push(L)},$ae=U=>{let ct=t.slice(U.startIndex,E.index+1),L=t.slice(U.startIndex+2,E.index),Ae=Dxe(L,r);if((U.type==="plus"||U.type==="star")&&Ae.risky){let it=Ae.safeOutput?(U.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ri=s[U.tokensIndex];ri.type="text",ri.value=ct,ri.output=it||Zr.escapeRegex(ct);for(let ni=U.tokensIndex+1;ni1&&U.inner.includes("/")&&(it=I(r)),(it!==C||cn()||/^\)+$/.test(zi()))&&(ot=U.close=`)$))${it}`),U.inner.includes("*")&&(Nt=zi())&&/^\.[^\\/.]+$/.test(Nt)){let ri=PI(Nt,{...e,fastpaths:!1}).output;ot=U.close=`)${ri})${it})`}U.prev.type==="bos"&&(E.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:R,output:ot}),So("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let U=!1,ct=t.replace(Txe,(L,Ae,ot,Nt,it,ri)=>Nt==="\\"?(U=!0,L):Nt==="?"?Ae?Ae+Nt+(it?_.repeat(it.length):""):ri===0?k+(it?_.repeat(it.length):""):_.repeat(ot.length):Nt==="."?u.repeat(ot.length):Nt==="*"?Ae?Ae+Nt+(it?C:""):C:Ae?L:`\\${L}`);return U===!0&&(r.unescape===!0?ct=ct.replace(/\\/g,""):ct=ct.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),ct===t&&r.contains===!0?(E.output=t,E):(E.output=Zr.wrapOutput(ct,E,e),E)}for(;!cn();){if(R=ft(),R==="\0")continue;if(R==="\\"){let L=Ge();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){R+="\\",Ee({type:"text",value:R});continue}let Ae=/^\\+/.exec(zi()),ot=0;if(Ae&&Ae[0].length>2&&(ot=Ae[0].length,E.index+=ot,ot%2!==0&&(R+="\\")),r.unescape===!0?R=ft():R+=ft(),E.brackets===0){Ee({type:"text",value:R});continue}}if(E.brackets>0&&(R!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&R===":"){let L=P.value.slice(1);if(L.includes("[")&&(P.posix=!0,L.includes(":"))){let Ae=P.value.lastIndexOf("["),ot=P.value.slice(0,Ae),Nt=P.value.slice(Ae+2),it=Exe[Nt];if(it){P.value=ot+it,E.backtrack=!0,ft(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(R==="["&&Ge()!==":"||R==="-"&&Ge()==="]")&&(R=`\\${R}`),R==="]"&&(P.value==="["||P.value==="[^")&&(R=`\\${R}`),r.posix===!0&&R==="!"&&P.value==="["&&(R="^"),P.value+=R,bo({value:R});continue}if(E.quotes===1&&R!=='"'){R=Zr.escapeRegex(R),P.value+=R,bo({value:R});continue}if(R==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:R});continue}if(R==="("){Gh("parens"),Ee({type:"paren",value:R});continue}if(R===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zc("opening","("));let L=Z[Z.length-1];if(L&&E.parens===L.parens+1){$ae(Z.pop());continue}Ee({type:"paren",value:R,output:E.parens?")":"\\)"}),So("parens");continue}if(R==="["){if(r.nobracket===!0||!zi().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zc("closing","]"));R=`\\${R}`}else Gh("brackets");Ee({type:"bracket",value:R});continue}if(R==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Ee({type:"text",value:R,output:`\\${R}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zc("opening","["));Ee({type:"text",value:R,output:`\\${R}`});continue}So("brackets");let L=P.value.slice(1);if(P.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(R=`/${R}`),P.value+=R,bo({value:R}),r.literalBrackets===!1||Zr.hasRegexChars(L))continue;let Ae=Zr.escapeRegex(P.value);if(E.output=E.output.slice(0,-P.value.length),r.literalBrackets===!0){E.output+=Ae,P.value=Ae;continue}P.value=`(${a}${Ae}|${P.value})`,E.output+=P.value;continue}if(R==="{"&&r.nobrace!==!0){Gh("braces");let L={type:"brace",value:R,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};ie.push(L),Ee(L);continue}if(R==="}"){let L=ie[ie.length-1];if(r.nobrace===!0||!L){Ee({type:"text",value:R,output:R});continue}let Ae=")";if(L.dots===!0){let ot=s.slice(),Nt=[];for(let it=ot.length-1;it>=0&&(s.pop(),ot[it].type!=="brace");it--)ot[it].type!=="dots"&&Nt.unshift(ot[it].value);Ae=Oxe(Nt,r),E.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let ot=E.output.slice(0,L.outputIndex),Nt=E.tokens.slice(L.tokensIndex);L.value=L.output="\\{",R=Ae="\\}",E.output=ot;for(let it of Nt)E.output+=it.output||it.value}Ee({type:"brace",value:R,output:Ae}),So("braces"),ie.pop();continue}if(R==="|"){Z.length>0&&Z[Z.length-1].conditions++,Ee({type:"text",value:R});continue}if(R===","){let L=R,Ae=ie[ie.length-1];Ae&&xe[xe.length-1]==="braces"&&(Ae.comma=!0,L="|"),Ee({type:"comma",value:R,output:L});continue}if(R==="/"){if(P.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),P=o;continue}Ee({type:"slash",value:R,output:f});continue}if(R==="."){if(E.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let L=ie[ie.length-1];P.type="dots",P.output+=R,P.value+=R,L.dots=!0;continue}if(E.braces+E.parens===0&&P.type!=="bos"&&P.type!=="slash"){Ee({type:"text",value:R,output:u});continue}Ee({type:"dot",value:R,output:u});continue}if(R==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Vh("qmark",R);continue}if(P&&P.type==="paren"){let Ae=Ge(),ot=R;(P.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(zi()))&&(ot=`\\${R}`),Ee({type:"text",value:R,output:ot});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){Ee({type:"qmark",value:R,output:S});continue}Ee({type:"qmark",value:R,output:_});continue}if(R==="!"){if(r.noextglob!==!0&&Ge()==="("&&(Ge(2)!=="?"||!/[!=<:]/.test(Ge(3)))){Vh("negate",R);continue}if(r.nonegate!==!0&&E.index===0){xae();continue}}if(R==="+"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Vh("plus",R);continue}if(P&&P.value==="("||r.regex===!1){Ee({type:"plus",value:R,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||E.parens>0){Ee({type:"plus",value:R});continue}Ee({type:"plus",value:d});continue}if(R==="@"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Ee({type:"at",extglob:!0,value:R,output:""});continue}Ee({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);let L=Axe.exec(zi());L&&(R+=L[0],E.index+=L[0].length),Ee({type:"text",value:R});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=R,P.output=C,E.backtrack=!0,E.globstar=!0,ln(R);continue}let U=zi();if(r.noextglob!==!0&&/^\([^?]/.test(U)){Vh("star",R);continue}if(P.type==="star"){if(r.noglobstar===!0){ln(R);continue}let L=P.prev,Ae=L.prev,ot=L.type==="slash"||L.type==="bos",Nt=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!ot||U[0]&&U[0]!=="/")){Ee({type:"star",value:R,output:""});continue}let it=E.braces>0&&(L.type==="comma"||L.type==="brace"),ri=Z.length&&(L.type==="pipe"||L.type==="paren");if(!ot&&L.type!=="paren"&&!it&&!ri){Ee({type:"star",value:R,output:""});continue}for(;U.slice(0,3)==="/**";){let ni=t[E.index+4];if(ni&&ni!=="/")break;U=U.slice(3),ln("/**",3)}if(L.type==="bos"&&cn()){P.type="globstar",P.value+=R,P.output=I(r),E.output=P.output,E.globstar=!0,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Nt&&cn()){E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=I(r)+(r.strictSlashes?")":"|$)"),P.value+=R,E.globstar=!0,E.output+=L.output+P.output,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&U[0]==="/"){let ni=U[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=`${I(r)}${f}|${f}${ni})`,P.value+=R,E.output+=L.output+P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&U[0]==="/"){P.type="globstar",P.value+=R,P.output=`(?:^|${f}|${I(r)}${f})`,E.output=P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-P.output.length),P.type="globstar",P.output=I(r),P.value+=R,E.output+=P.output,E.globstar=!0,ln(R);continue}let ct={type:"star",value:R,output:C};if(r.bash===!0){ct.output=".*?",(P.type==="bos"||P.type==="slash")&&(ct.output=T+ct.output),Ee(ct);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){ct.output=R,Ee(ct);continue}(E.index===E.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(E.output+=g,P.output+=g):r.dot===!0?(E.output+=v,P.output+=v):(E.output+=T,P.output+=T),Ge()!=="*"&&(E.output+=p,P.output+=p)),Ee(ct)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing","]"));E.output=Zr.escapeLast(E.output,"["),So("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing",")"));E.output=Zr.escapeLast(E.output,"("),So("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zc("closing","}"));E.output=Zr.escapeLast(E.output,"{"),So("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),E.backtrack===!0){E.output="";for(let U of E.tokens)E.output+=U.output!=null?U.output:U.value,U.suffix&&(E.output+=U.suffix)}return E};PI.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(tv,r.maxLength):tv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=MW[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=cf.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",v={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,w=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let k=/^(.*?)\.(\w+)$/.exec(T);if(!k)return;let C=w(k[1]);return C?C+o+k[2]:void 0}}},x=Zr.removePrefix(t,v),I=w(x);return I&&r.strictSlashes!==!0&&(I+=`${s}?`),I};LW.exports=PI});var HW=b((Ytt,BW)=>{"use strict";var Nxe=jW(),RI=UW(),qW=sf(),jxe=of(),Mxe=t=>t&&typeof t=="object"&&!Array.isArray(t),Et=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Et(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=Mxe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Et.compileRe(t,e):Et.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Et(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Et.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Et.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?qW.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Et.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Et.matchBase=(t,e,r)=>(e instanceof RegExp?e:Et.makeRe(e,r)).test(qW.basename(t));Et.isMatch=(t,e,r)=>Et(e,r)(t);Et.parse=(t,e)=>Array.isArray(t)?t.map(r=>Et.parse(r,e)):RI(t,{...e,fastpaths:!1});Et.scan=(t,e)=>Nxe(t,e);Et.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Et.toRegex(a,e);return n===!0&&(c.state=t),c};Et.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=RI.fastpaths(t,e)),i.output||(i=RI(t,e)),Et.compileRe(i,e,r,n)};Et.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Et.constants=jxe;BW.exports=Et});var WW=b((Xtt,VW)=>{"use strict";var ZW=HW(),Fxe=sf();function GW(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Fxe.isWindows()}),ZW(t,e,r)}Object.assign(GW,ZW);VW.exports=GW});import{readdir as zxe,readdirSync as Lxe,realpath as Uxe,realpathSync as qxe,stat as Bxe,statSync as Hxe}from"fs";import{isAbsolute as Zxe,posix as ia,resolve as Gxe}from"path";import{fileURLToPath as Vxe}from"url";function Jxe(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&Kxe.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>ia.relative(t,n)||".":n=>ia.relative(t,`${e}/${n}`)||"."}function Qxe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=ia.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function XW(t){var e;let r=Lc.default.scan(t,e$e);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function s$e(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Lc.default.scan(t);return r.isGlob||r.negated}function lf(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function QW(t){return typeof t=="string"?[t]:t??[]}function CI(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=o$e(o);s=Zxe(s.replace(c$e,""))?ia.relative(a,s):ia.normalize(s);let c=(i=a$e.exec(s))===null||i===void 0?void 0:i[0],l=XW(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?ia.join(o,...d):o}return s}function l$e(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(CI(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(CI(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(CI(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function u$e(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=l$e(t,e,n);t.debug&&lf("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(JW,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Lc.default)(i.match,f),m=(0,Lc.default)(i.ignore,f),h=Jxe(i.match,f),g=KW(r,d,o),v=o?g:KW(r,d,!0),_=(x,I)=>{let T=v(I,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let w=new wW({filters:[a?(x,I)=>{let T=g(x,I),k=p(T)&&!m(T);return k&&lf(`matched ${T}`),k}:(x,I)=>{let T=g(x,I);return p(T)&&!m(T)}],exclude:a?(x,I)=>{let T=_(x,I);return lf(`${T?"skipped":"crawling"} ${I}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&lf("internal properties:",{...n,root:d}),[w,r!==d&&!o&&Qxe(r,d)]}function d$e(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function p$e(t){let e={...f$e,...t};return e.cwd=(e.cwd instanceof URL?Vxe(e.cwd):Gxe(e.cwd)).replace(JW,"/"),e.ignore=QW(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||zxe,readdirSync:e.fs.readdirSync||Lxe,realpath:e.fs.realpath||Uxe,realpathSync:e.fs.realpathSync||qxe,stat:e.fs.stat||Bxe,statSync:e.fs.statSync||Hxe}),e.debug&&lf("globbing with options:",e),e}function m$e(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Wxe(t)||typeof t=="string",i=QW((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=p$e(n?e:t);return i.length>0?u$e(o,i):[]}function Bo(t,e){let[r,n]=m$e(t,e);return r?d$e(r.sync(),n):[]}var Lc,Wxe,JW,YW,Kxe,Yxe,Xxe,e$e,t$e,r$e,n$e,i$e,o$e,a$e,c$e,f$e,uf=y(()=>{xW();Lc=$t(WW(),1),Wxe=Array.isArray,JW=/\\/g,YW=process.platform==="win32",Kxe=/^(\/?\.\.)+$/;Yxe=/^[A-Z]:\/$/i,Xxe=YW?t=>Yxe.test(t):t=>t==="/";e$e={parts:!0};t$e=/(?t.replace(t$e,"\\$&"),i$e=t=>t.replace(r$e,"\\$&"),o$e=YW?i$e:n$e;a$e=/^(\/?\.\.)+/,c$e=/\\(?=[()[\]{}!*+?@|])/g;f$e={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as rv,readFileSync as h$e,readdirSync as g$e,statSync as eK}from"node:fs";import{join as Uc}from"node:path";function y$e(t){let{cwd:e="."}=t,r,n;try{let c=J(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=mi(e,n),o=[],{layers:s,forbiddenImports:a}=DI(r);return s.size>0&&(_$e(e,i,s,o),v$e(e,i,s,o)),a.length>0&&b$e(e,i,a,o),o}function DI(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function _$e(t,e,r,n){let i=e.mainRoot,o=Uc(t,i);if(rv(o))for(let s of g$e(o)){let a=Uc(o,s);eK(a).isDirectory()&&(r.has(s)||n.push({detector:nv,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function v$e(t,e,r,n){let i=e.mainRoot,o=Uc(t,i);if(rv(o))for(let s of r){let a=Uc(o,s);rv(a)&&eK(a).isDirectory()||n.push({detector:nv,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function b$e(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Uc(t,i,s.from);if(!rv(a))continue;let c=Bo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Uc(a,l),d;try{d=h$e(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];S$e(p,s.to,e.importStyle)&&n.push({detector:nv,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function S$e(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var nv,tK,NI=y(()=>{"use strict";uf();lt();Fc();nv="ARCHITECTURE_FROM_SPEC";tK={name:nv,run:y$e}});import{existsSync as w$e,readFileSync as x$e}from"node:fs";import{join as $$e}from"node:path";function k$e(t){let{cwd:e="."}=t,r=$$e(e,"spec/capabilities.yaml");if(!w$e(r))return[];let n;try{let c=x$e(r,"utf8"),l=rK.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=J(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:iv,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:iv,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:iv,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var rK,iv,nK,iK=y(()=>{"use strict";rK=$t(rr(),1);lt();iv="CAPABILITIES_FEATURE_MAPPING";nK={name:iv,run:k$e}});import{existsSync as E$e,readFileSync as A$e}from"node:fs";import{join as T$e}from"node:path";function O$e(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function I$e(t){let{cwd:e="."}=t;return pe(e,jI,r=>P$e(r,e))}function P$e(t,e){let r=mi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=T$e(e,o);if(!E$e(s))continue;let a=A$e(s,"utf8");O$e(a)||n.push({detector:jI,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var jI,oK,sK=y(()=>{"use strict";Fc();_t();jI="CONVENTION_DRIFT";oK={name:jI,run:I$e}});import{existsSync as MI,readFileSync as aK}from"node:fs";import{join as ov}from"node:path";function R$e(t){return JSON.parse(t).total?.lines?.pct??0}function cK(t){let e=/MI(ov(c.dir,d)));if(!l){s.push(c.path);continue}let u=cK(aK(ov(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Qi,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=lK(n,i);return a0?[{detector:Qi,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function N$e(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=D$e(e,t.focusModules);if(s)return s}let r=mi(e),n=pt(e).language==="kotlin"?pI.find(s=>MI(ov(e,s)))??VV(e):r.coverageSummary,i=ov(e,n);if(!MI(i))return[{detector:Qi,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=aK(i,"utf8");o=r.coverageFormat==="jacoco-xml"?C$e(s):R$e(s)}catch(s){return[{detector:Qi,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:Qi,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=sv?[]:[{detector:Qi,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${sv}%`}]}var Qi,sv,uK,dK=y(()=>{"use strict";Z_();Fc();q_();mn();Qi="COVERAGE_DROP",sv=70;uK={name:Qi,run:N$e}});import{existsSync as j$e}from"node:fs";import{join as M$e}from"node:path";function F$e(t){let{cwd:e="."}=t;return pe(e,av,r=>z$e(r,e))}function z$e(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?j$e(M$e(e,r.path))?[]:[{detector:av,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:av,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var av,fK,pK=y(()=>{"use strict";_t();av="DELIVERABLE_INTEGRITY";fK={name:av,run:F$e}});function L$e(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:FI,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function U$e(t){let{cwd:e="."}=t;return pe(e,FI,r=>L$e(r))}var FI,mK,hK=y(()=>{"use strict";_t();FI="SMOKE_PROBE_DEMAND";mK={name:FI,run:U$e}});function q$e(t){let{cwd:e="."}=t;return pe(e,cv,r=>B$e(r,e))}function B$e(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=gc(e);if(n===null)return[{detector:cv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=Rd(e,o.modules??[]);s!==a&&i.push({detector:cv,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var cv,lv,zI=y(()=>{"use strict";Cd();_t();cv="STALE_ATTESTATION";lv={name:cv,run:q$e}});function H$e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}return Z$e(r)}function Z$e(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:gK,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var gK,uv,LI=y(()=>{"use strict";lt();gK="DEPENDENCY_CYCLE";uv={name:gK,run:H$e}});import{appendFileSync as G$e,existsSync as yK,mkdirSync as V$e,readFileSync as W$e}from"node:fs";import{dirname as K$e,join as J$e}from"node:path";function _K(t){return J$e(t,Y$e,X$e)}function vK(t){return UI.add(t),()=>UI.delete(t)}function oa(t,e){let r=_K(t),n=K$e(r);yK(n)||V$e(n,{recursive:!0}),G$e(r,`${JSON.stringify(e)} -`,"utf8");for(let i of UI)try{i(t,e)}catch{}}function gn(t){let e=_K(t);if(!yK(e))return[];let r=W$e(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var Y$e,X$e,UI,Ln=y(()=>{"use strict";Y$e=".cladding",X$e="audit.log.jsonl";UI=new Set});import{existsSync as Q$e}from"node:fs";import{join as e0e}from"node:path";function t0e(t){let{cwd:e="."}=t,r=gn(e);if(r.length===0)return[{detector:qI,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(Q$e(e0e(e,i.artifact))||n.push({detector:qI,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var qI,bK,SK=y(()=>{"use strict";Ln();qI="EVIDENCE_MISMATCH";bK={name:qI,run:t0e}});import{existsSync as r0e,readFileSync as n0e}from"node:fs";import{join as i0e}from"node:path";function o0e(t){let e=i0e(t,kK);if(!r0e(e))return null;try{let n=((0,$K.parse)(n0e(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*xK(t,e){for(let r of t??[])r.startsWith(wK)&&(yield{ref:r,name:r.slice(wK.length),field:e})}function s0e(t){let{cwd:e="."}=t,r=o0e(e);if(r===null)return[];let n;try{n=J(e)}catch(o){return[{detector:BI,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...xK(s.evidence_refs,"evidence_refs"),...xK(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:BI,severity:"warn",path:kK,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var $K,BI,wK,kK,EK,AK=y(()=>{"use strict";$K=$t(rr(),1);lt();BI="FIXTURE_REFERENCE_INVALID",wK="fixture:",kK="conformance/fixtures.yaml";EK={name:BI,run:s0e}});function a0e(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.secret;if(!n)return[{detector:dv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Qe(n.cmd,[...n.args],{cwd:e,reject:!1});return rf(i)?[{detector:dv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:V_(i,dv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var dv,fv,HI=y(()=>{"use strict";Ar();mn();hn();dv="HARDCODED_SECRET";fv={name:dv,run:a0e}});import{existsSync as qc,readFileSync as ZI}from"node:fs";import{join as sa}from"node:path";function c0e(t){return Bo(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function df(t){if(!qc(t))return null;try{return JSON.parse(ZI(t,"utf8"))}catch{return null}}function l0e(t,e){let r=sa(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(ZI(r,"utf8"))}catch(c){e.push({detector:eo,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:eo,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=c0e(t);s!==a&&e.push({detector:eo,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function u0e(t,e){for(let r of TK){let n=sa(t,r.path);if(!qc(n))continue;let i=df(n);if(!i){e.push({detector:eo,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:eo,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function d0e(t,e){let r=df(sa(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of TK){let s=sa(t,o.path);if(!qc(s))continue;let a=df(s);a?.version&&a.version!==n&&e.push({detector:eo,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=sa(t,".claude-plugin","marketplace.json");if(qc(i)){let o=df(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:eo,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function f0e(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function p0e(t,e){let r=sa(t,"src","cli","clad.ts"),n=sa(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!qc(r)||!qc(n))return;let i=f0e(ZI(r,"utf8"));if(i.length===0)return;let s=df(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:eo,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function m0e(t){let{cwd:e="."}=t,r=[];return l0e(e,r),p0e(e,r),u0e(e,r),d0e(e,r),r}var eo,TK,OK,IK=y(()=>{"use strict";uf();eo="HARNESS_INTEGRITY",TK=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];OK={name:eo,run:m0e}});import{existsSync as h0e,readFileSync as g0e}from"node:fs";import{join as y0e}from"node:path";function v0e(t){let{cwd:e="."}=t;return pe(e,pv,r=>w0e(r,e))}function b0e(){return _0e}function S0e(t){let e=y0e(t,"spec/capabilities.yaml");if(!h0e(e))return!1;try{let r=PK.default.parse(g0e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function w0e(t,e){let r=t.features.length;if(r{"use strict";PK=$t(rr(),1);_t();pv="HOLLOW_GOVERNANCE",_0e=8;RK={name:pv,run:v0e}});function x0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];return DK(r.features.map(i=>i.id),"feature","spec/features/",n),DK((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function DK(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:NK,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var NK,jK,MK=y(()=>{"use strict";lt();NK="ID_COLLISION";jK={name:NK,run:x0e}});import{existsSync as ff,readFileSync as GI,readdirSync as VI,statSync as $0e,writeFileSync as zK}from"node:fs";import{join as to}from"node:path";function FK(t){if(!ff(t))return 0;try{return VI(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function k0e(t){if(!ff(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=VI(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=to(n,o),a;try{a=$0e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function E0e(t){let e=to(t,"spec","capabilities.yaml");if(!ff(e))return 0;try{let r=mv.default.parse(GI(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Ho(t="."){let e=FK(to(t,"spec","features")),r=FK(to(t,"spec","scenarios")),n=E0e(t),i=k0e(to(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function Bc(t,e){let r=to(t,"spec.yaml");if(!ff(r))return;let n=GI(r,"utf8"),i=A0e(n,e);i!==n&&zK(r,i)}function A0e(t,e){let r=t.includes(`\r + if (condition) { yield value; }`)}});import{Buffer as A_e}from"node:buffer";import{StringDecoder as T_e}from"node:string_decoder";var v_,O_e,I_e,P_e,fO=y(()=>{Br();v_=(t,e,r)=>{if(r)return;if(t)return{transform:O_e.bind(void 0,new TextEncoder)};let n=new T_e(e);return{transform:I_e.bind(void 0,n),final:P_e.bind(void 0,n)}},O_e=function*(t,e){A_e.isBuffer(e)?yield Vi(e):typeof e=="string"?yield t.encode(e):yield e},I_e=function*(t,e){yield Mt(e)?t.write(e):e},P_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as zG}from"node:util";var pO,b_,LG,R_e,UG,C_e,qG=y(()=>{pO=zG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),b_=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=C_e}=e[r];for await(let i of n(t))yield*b_(i,e,r+1)},LG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*R_e(r,Number(e),t)},R_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*b_(n,r,e+1)},UG=zG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),C_e=function*(t){yield t}});var mO,BG,ea,Xd,D_e,N_e,hO=y(()=>{mO=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},BG=(t,e)=>[...e.flatMap(r=>[...ea(r,t,0)]),...Xd(t)],ea=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=N_e}=e[r];for(let i of n(t))yield*ea(i,e,r+1)},Xd=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*D_e(r,Number(e),t)},D_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ea(n,r,e+1)},N_e=function*(t){yield t}});import{Transform as j_e,getDefaultHighWaterMark as HG}from"node:stream";var gO,S_,ZG,w_=y(()=>{dr();__();FG();fO();qG();hO();gO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=ZG(t,s,o),l=Qs(e),u=Qs(r),d=l?pO.bind(void 0,b_,a):mO.bind(void 0,ea),f=l||u?pO.bind(void 0,LG,a):mO.bind(void 0,Xd),p=l||u?UG.bind(void 0,a):void 0;return{stream:new j_e({writableObjectMode:n,writableHighWaterMark:HG(n),readableObjectMode:i,readableHighWaterMark:HG(i),transform(h,g,v){d([h,c,0],this,v)},flush(h){f([c],this,h)},destroy:p})}},S_=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=ZG(s,r,a);t=BG(c,t)}return t},ZG=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:NG(n,a)},v_(r,s,n),y_(r,o,n,c),{transform:t,final:e},{transform:jG(i,a)},DG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var GG,M_e,F_e,z_e,L_e,VG=y(()=>{w_();Br();dr();GG=(t,e)=>{for(let r of M_e(t))F_e(t,r,e)},M_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),F_e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Uo[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>z_e(a,n));r.input=jd(s)},z_e=(t,e)=>{let r=S_(t,e,"utf8",!0);return L_e(r),jd(r)},L_e=t=>{let e=t.find(r=>typeof r!="string"&&!Mt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)}});var x_,U_e,q_e,WG,KG,B_e,JG,yO=y(()=>{Ks();dr();wc();Mo();x_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Sc(r,n)&&!Hr.has(e)&&U_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&q_e.has(o))||t.every(({type:i})=>pn.has(i))),U_e=t=>t===1||t===2,q_e=new Set(["pipe","overlapped"]),WG=async(t,e,r,n)=>{for await(let i of t)B_e(e)||JG(i,r,n)},KG=(t,e,r)=>{for(let n of t)JG(n,e,r)},B_e=t=>t._readableState.pipes.length>0,JG=(t,e,r)=>{let n=wy(t);li({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as H_e,appendFileSync as Z_e}from"node:fs";var YG,G_e,V_e,W_e,K_e,J_e,XG=y(()=>{yO();w_();__();Br();dr();Xs();YG=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>G_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},G_e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=jZ(t,o,d),p=Vi(f),{stdioItems:m,objectMode:h}=e[r],g=V_e([p],m,c,n),{serializedResult:v,finalResult:_=v}=W_e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});K_e({serializedResult:v,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&J_e(v,m,i),S}catch(w){return n.error=w,S}},V_e=(t,e,r,n)=>{try{return S_(t,e,r,!1)}catch(i){return n.error=i,t}},W_e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:jd(t)};let s=E6(t,r);return n[o]?{serializedResult:s,finalResult:dO(s,!i[o],e)}:{serializedResult:s}},K_e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!x_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=dO(t,!1,s);try{KG(a,e,n)}catch(c){r.error??=c}},J_e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>m_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?Z_e(n,t):(r.add(o),H_e(n,t))}}});var QG,e9=y(()=>{Br();Yd();QG=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Xi(e,r,"all")]:Array.isArray(e)?[Xi(t,r,"all"),...e]:Mt(t)&&Mt(e)?sT([t,e]):`${t}${e}`}});import{once as _O}from"node:events";var t9,Y_e,r9,n9,X_e,vO,bO=y(()=>{Vs();t9=async(t,e)=>{let[r,n]=await Y_e(t);return e.isForcefullyTerminated??=!1,[r,n]},Y_e=async t=>{let[e,r]=await Promise.allSettled([_O(t,"spawn"),_O(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?r9(t):r.value},r9=async t=>{try{return await _O(t,"exit")}catch{return r9(t)}},n9=async t=>{let[e,r]=await t;if(!X_e(e,r)&&vO(e,r))throw new Mn;return[e,r]},X_e=(t,e)=>t===void 0&&e===void 0,vO=(t,e)=>t!==0||e!==null});var i9,Q_e,o9=y(()=>{Vs();Xs();bO();i9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=Q_e(t,e,r),s=o?.code==="ETIMEDOUT",a=NZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},Q_e=(t,e,r)=>t!==void 0?t:vO(e,r)?new Mn:void 0});import{spawnSync as eve}from"node:child_process";var s9,tve,rve,nve,$_,ive,ove,sve,ave,a9=y(()=>{hT();BT();HT();Jd();d_();PG();Yd();VG();XG();Xs();e9();o9();s9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=tve(t,e,r),d=ive({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Cc(d,c,l)},tve=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ky(t,e,r),a=rve(r),{file:c,commandArguments:l,options:u}=Xy(t,e,a);nve(u);let d=OG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},rve=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,nve=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&$_("ipcInput"),t&&$_("ipc: true"),r&&$_("detached: true"),n&&$_("cancelSignal")},$_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},ive=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=ove({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=i9(c,r),{output:m,error:h=l}=YG({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>Xi(_,r,S)),v=Xi(QG(m,r),r,"all");return ave({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:v,options:r,command:n,escapedCommand:i,startTime:a})},ove=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{GG(o,r);let a=sve(r);return eve(...Qy(t,e,a))}catch(a){return Rc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},sve=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:l_(e)}),ave=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?u_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Kd({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0})});import{once as SO,on as cve}from"node:events";var c9,lve,uve,dve,fve,l9=y(()=>{Ac();Hd();Bd();c9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(kc({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Zy(t)}),lve({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),lve=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{Fy(e,i);let o=Lo(t,e,r),s=new AbortController;try{return await Promise.race([uve(o,n,s),dve(o,r,s),fve(o,r,s)])}catch(a){throw Ec(t),a}finally{s.abort(),zy(e,i)}},uve=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await SO(t,"message",{signal:r});return n}for await(let[n]of cve(t,"message",{signal:r}))if(e(n))return n},dve=async(t,e,{signal:r})=>{await SO(t,"disconnect",{signal:r}),bH(e)},fve=async(t,e,{signal:r})=>{let[n]=await SO(t,"strict:error",{signal:r});throw Dy(n,e)}});import{once as d9,on as pve}from"node:events";var f9,wO,mve,hve,gve,u9,xO=y(()=>{Ac();Hd();Bd();f9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>wO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),wO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{kc({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Zy(t)}),Fy(e,o);let s=Lo(t,e,r),a=new AbortController,c={};return mve(t,s,a),hve({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),gve({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},mve=async(t,e,r)=>{try{await d9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},hve=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await d9(t,"strict:error",{signal:r.signal});n.error=Dy(i,e),r.abort()}catch{}},gve=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of pve(r,"message",{signal:o.signal}))u9(s),yield c}catch{u9(s)}finally{o.abort(),zy(e,a),n||Ec(t),i&&await t}},u9=({error:t})=>{if(t)throw t}});import p9 from"node:process";var m9,h9,g9,$O=y(()=>{Jy();l9();xO();By();m9=(t,{ipc:e})=>{Object.assign(t,g9(t,!1,e))},h9=()=>{let t=p9,e=!0,r=p9.channel!==void 0;return{...g9(t,e,r),getCancelSignal:WH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},g9=(t,e,r)=>({sendMessage:Ky.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:c9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:f9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as yve}from"node:child_process";import{PassThrough as _ve,Readable as vve,Writable as bve,Duplex as Sve}from"node:stream";var y9,wve,Qd,xve,$ve,kve,Eve,_9=y(()=>{g_();Jd();d_();y9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{cO(n);let a=new yve;wve(a,n),Object.assign(a,{readable:xve,writable:$ve,duplex:kve});let c=Rc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Eve(c,s,i);return{subprocess:a,promise:l}},wve=(t,e)=>{let r=Qd(),n=Qd(),i=Qd(),o=Array.from({length:e.length-3},Qd),s=Qd(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},Qd=()=>{let t=new _ve;return t.end(),t},xve=()=>new vve({read(){}}),$ve=()=>new bve({write(){}}),kve=()=>new Sve({read(){},write(){}}),Eve=async(t,e,r)=>Cc(t,e,r)});import{createReadStream as v9,createWriteStream as b9}from"node:fs";import{Buffer as Ave}from"node:buffer";import{Readable as ef,Writable as Tve,Duplex as Ove}from"node:stream";var w9,tf,S9,Ive,x9=y(()=>{w_();g_();dr();w9=(t,e)=>h_(Ive,t,e,!1),tf=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Uo[t]}.`)},S9={fileNumber:tf,generator:gO,asyncGenerator:gO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Ove.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Ive={input:{...S9,fileUrl:({value:t})=>({stream:v9(t)}),filePath:({value:{file:t}})=>({stream:v9(t)}),webStream:({value:t})=>({stream:ef.fromWeb(t)}),iterable:({value:t})=>({stream:ef.from(t)}),asyncIterable:({value:t})=>({stream:ef.from(t)}),string:({value:t})=>({stream:ef.from(t)}),uint8Array:({value:t})=>({stream:ef.from(Ave.from(t))})},output:{...S9,fileUrl:({value:t})=>({stream:b9(t)}),filePath:({value:{file:t,append:e}})=>({stream:b9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Tve.fromWeb(t)}),iterable:tf,asyncIterable:tf,string:tf,uint8Array:tf}}});import{on as Pve,once as $9}from"node:events";import{PassThrough as Rve,getDefaultHighWaterMark as Cve}from"node:stream";import{finished as A9}from"node:stream/promises";function ta(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)EO(i);let e=t.some(({readableObjectMode:i})=>i),r=Dve(t,e),n=new kO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Dve,kO,Nve,jve,Mve,EO,Fve,zve,Lve,Uve,qve,T9,O9,AO,I9,Bve,k_,k9,E9,E_=y(()=>{Dve=(t,e)=>{if(t.length===0)return Cve(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},kO=class extends Rve{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(EO(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Nve(this,this.#t,this.#o);let r=Fve({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(EO(e),!this.#t.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},Nve=async(t,e,r)=>{k_(t,k9);let n=new AbortController;try{await Promise.race([jve(t,n),Mve(t,e,r,n)])}finally{n.abort(),k_(t,-k9)}},jve=async(t,{signal:e})=>{try{await A9(t,{signal:e,cleanup:!0})}catch(r){throw T9(t,r),r}},Mve=async(t,e,r,{signal:n})=>{for await(let[i]of Pve(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},EO=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Fve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{k_(t,E9);let a=new AbortController;try{await Promise.race([zve(o,e,a),Lve({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),Uve({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),k_(t,-E9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?AO(t):qve(t))},zve=async(t,e,{signal:r})=>{try{await t,r.aborted||AO(e)}catch(n){r.aborted||T9(e,n)}},Lve=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await A9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;O9(s)?i.add(e):I9(t,s)}},Uve=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await $9(t,i,{signal:o}),!t.readable)return $9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},qve=t=>{t.writable&&t.end()},T9=(t,e)=>{O9(e)?AO(t):I9(t,e)},O9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",AO=t=>{(t.readable||t.writable)&&t.destroy()},I9=(t,e)=>{t.destroyed||(t.once("error",Bve),t.destroy(e))},Bve=()=>{},k_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},k9=2,E9=1});import{finished as P9}from"node:stream/promises";var Nc,Hve,TO,Zve,OO,A_=y(()=>{Wi();Nc=(t,e)=>{t.pipe(e),Hve(t,e),Zve(t,e)},Hve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await P9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}TO(e)}},TO=t=>{t.writable&&t.end()},Zve=async(t,e)=>{if(!(jn(t)||jn(e))){try{await P9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}OO(t)}},OO=t=>{t.readable&&t.destroy()}});var R9,Gve,Vve,Wve,Kve,Jve,C9=y(()=>{E_();Wi();My();dr();A_();R9=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>pn.has(c)))Gve(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!pn.has(c)))Wve({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:ta(o);Nc(s,i)}},Gve=(t,e,r,n)=>{r==="output"?Nc(t.stdio[n],e):Nc(e,t.stdio[n]);let i=Vve[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},Vve=["stdin","stdout","stderr"],Wve=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;Kve(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},Kve=(t,{signal:e})=>{jn(t)&&Ws(t,Jve,e)},Jve=2});var ra,D9=y(()=>{ra=[];ra.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ra.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ra.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var T_,IO,PO,Yve,RO,O_,Xve,CO,DO,NO,N9,XXe,QXe,j9=y(()=>{D9();T_=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",IO=Symbol.for("signal-exit emitter"),PO=globalThis,Yve=Object.defineProperty.bind(Object),RO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(PO[IO])return PO[IO];Yve(PO,IO,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},O_=class{},Xve=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),CO=class extends O_{onExit(){return()=>{}}load(){}unload(){}},DO=class extends O_{#t=NO.platform==="win32"?"SIGINT":"SIGHUP";#r=new RO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of ra)this.#i[r]=()=>{let n=this.#e.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!T_(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of ra)try{let r=this.#i[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#c(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,ra.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(e){return T_(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&T_(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return n.call(this.#e,e,...r)}},NO=globalThis.process,{onExit:N9,load:XXe,unload:QXe}=Xve(T_(NO)?new DO(NO):new CO)});import{addAbortListener as Qve}from"node:events";var M9,F9=y(()=>{j9();M9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=N9(()=>{t.kill()});Qve(n,()=>{i()})}});var L9,ebe,tbe,z9,rbe,U9=y(()=>{oT();$y();zo();vc();L9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=xy(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=ebe(r,n,i),{sourceStream:d,sourceError:f}=rbe(t,l),{options:p,fileDescriptors:m}=di.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},ebe=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=tbe(t,e,...r),a=jy(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},tbe=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(z9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||nT(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=fy(r,...n);return{destination:e(z9)(i,o,s),pipeOptions:s}}if(di.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},z9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),rbe=(t,e)=>{try{return{sourceStream:Oc(t,e)}}catch(r){return{sourceError:r}}}});var B9,nbe,jO,q9,MO=y(()=>{Jd();A_();B9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=nbe({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw jO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},nbe=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return OO(t),n;if(e!==void 0)return TO(r),e},jO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Rc({error:t,command:q9,escapedCommand:q9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),q9="source.pipe(destination)"});var H9,Z9=y(()=>{H9=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s}});import{finished as ibe}from"node:stream/promises";var G9,obe,sbe,abe,I_,cbe,lbe,V9=y(()=>{E_();My();A_();G9=(t,e,r)=>{let n=I_.has(e)?sbe(t,e):obe(t,e);return Ws(t,cbe,r.signal),Ws(e,lbe,r.signal),abe(e),n},obe=(t,e)=>{let r=ta([t]);return Nc(r,e),I_.set(e,r),r},sbe=(t,e)=>{let r=I_.get(e);return r.add(t),r},abe=async t=>{try{await ibe(t,{cleanup:!0,readable:!1,writable:!0})}catch{}I_.delete(t)},I_=new WeakMap,cbe=2,lbe=1});import{aborted as ube}from"node:util";var W9,dbe,K9=y(()=>{MO();W9=(t,e)=>t===void 0?[]:[dbe(t,e)],dbe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await ube(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw jO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var P_,fbe,pbe,J9=y(()=>{Gi();U9();MO();Z9();V9();K9();P_=(t,...e)=>{if(kt(e[0]))return P_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=L9(t,...e),i=fbe({...n,destination:r});return i.pipe=P_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},fbe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=pbe(t,i);B9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=G9(e,o,d);return await Promise.race([H9(u),...W9(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},pbe=(t,e)=>Promise.allSettled([t,e])});import{on as mbe}from"node:events";import{getDefaultHighWaterMark as hbe}from"node:stream";var R_,gbe,FO,ybe,X9,zO,Y9,_be,vbe,C_=y(()=>{fO();__();hO();R_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return gbe(e,s),X9({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},gbe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},FO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;ybe(e,s,t);let a=t.readableObjectMode&&!o;return X9({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},ybe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},X9=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=mbe(t,"data",{signal:e.signal,highWaterMark:Y9,highWatermark:Y9});return _be({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},zO=hbe(!0),Y9=zO,_be=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=vbe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*ea(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*Xd(a)}},vbe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[v_(t,r,!e),y_(t,i,!n,{})].filter(Boolean)});import{setImmediate as bbe}from"node:timers/promises";var Q9,Sbe,wbe,xbe,LO,eV,UO=y(()=>{c_();Br();yO();C_();Xs();Yd();Q9=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=Sbe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([wbe(t),d]);return}let f=lO(c,r),p=FO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([xbe({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},Sbe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!x_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=FO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await WG(a,t,r,o)},wbe=async t=>{await bbe(),t.readableFlowing===null&&t.resume()},xbe=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await i_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await o_(r,{maxBuffer:o})):await a_(r,{maxBuffer:o})}catch(a){return eV(RZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},LO=async t=>{try{return await t}catch(e){return eV(e)}},eV=({bufferedData:t})=>$6(t)?new Uint8Array(t):t});import{finished as $be}from"node:stream/promises";var rf,kbe,Ebe,Abe,Tbe,Obe,qO,D_,tV,N_=y(()=>{rf=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=kbe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],$be(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Tbe(a,e,r,n)}finally{s.abort()}},kbe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Ebe(t,r,n),n},Ebe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{Abe(e,r),n.call(t,...i)}},Abe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Tbe=(t,e,r,n)=>{if(!Obe(t,e,r,n))throw t},Obe=(t,e,r,n=!0)=>r.propagating?tV(t)||D_(t):(r.propagating=!0,qO(r,e)===n?tV(t):D_(t)),qO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",D_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",tV=t=>t?.code==="EPIPE"});var rV,BO,HO=y(()=>{UO();N_();rV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>BO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),BO=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=rf(t,e,l);if(qO(l,e)){await u;return}let[d]=await Promise.all([Q9({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d}});var nV,iV,Ibe,Pbe,ZO=y(()=>{E_();HO();nV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?ta([t,e].filter(Boolean)):void 0,iV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>BO({...Ibe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Pbe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Ibe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},Pbe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var oV,sV,aV=y(()=>{wc();Mo();oV=t=>Sc(t,"ipc"),sV=(t,e)=>{let r=wy(t);li({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var cV,lV,uV=y(()=>{Xs();aV();Ji();xO();cV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=oV(o),a=Ki(e,"ipc"),c=Ki(r,"ipc");for await(let l of wO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(CZ(t,i,c),i.push(l)),s&&sV(l,o);return i},lV=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Rbe}from"node:events";var dV,Cbe,Dbe,Nbe,fV=y(()=>{Ys();FT();OT();MT();Wi();dr();UO();uV();LT();ZO();HO();bO();N_();dV=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:v})=>{let _=t9(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},w=rV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),x=iV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),I=[],T=cV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:I,verboseInfo:p}),k=Cbe(h,t,S),C=Dbe(m,S);try{return await Promise.race([Promise.all([{},n9(_),Promise.all(w),x,T,iZ(t,d),...k,...C]),g,Nbe(t,v),...QH(t,o,f,v),...vH({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:v}),...YH({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:v})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(w.map(Z=>LO(Z))),LO(x),lV(T,I),Promise.allSettled(k),Promise.allSettled(C)])}},Cbe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:rf(n,i,r)),Dbe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>zn(o,{checkOpen:!1})&&!jn(o)).map(({type:i,value:o,stream:s=o})=>rf(s,n,e,{isSameDirection:pn.has(i),stopOnExit:i==="native"}))),Nbe=async(t,{signal:e})=>{let[r]=await Rbe(t,"error",{signal:e});throw r}});var pV,nf,jc,j_=y(()=>{Tc();pV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),nf=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=ui();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},jc=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n}});import{finished as mV}from"node:stream/promises";var GO,hV,VO,WO,M_,F_,KO=y(()=>{N_();GO=async t=>{if(t!==void 0)try{await VO(t)}catch{}},hV=async t=>{if(t!==void 0)try{await WO(t)}catch{}},VO=async t=>{await mV(t,{cleanup:!0,readable:!1,writable:!0})},WO=async t=>{await mV(t,{cleanup:!0,readable:!0,writable:!1})},M_=async(t,e)=>{if(await t,e)throw e},F_=(t,e,r)=>{r&&!D_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as jbe}from"node:stream";import{callbackify as Mbe}from"node:util";var gV,JO,YO,XO,Fbe,QO,eI,yV,tI=y(()=>{Ks();zo();C_();Tc();j_();KO();gV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Hr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=JO(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=YO(a,s),{read:f,onStdoutDataDone:p}=XO({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new jbe({read:f,destroy:Mbe(eI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return QO({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},JO=(t,e,r)=>{let n=Oc(t,e),i=nf(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},YO=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:zO},XO=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=ui(),s=R_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Fbe(this,s,o)},onStdoutDataDone:o}},Fbe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},QO=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await WO(t),await n,await GO(i),await e,r.readable&&r.push(null)}catch(o){await GO(i),yV(r,o)}},eI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await jc(r,e)&&(yV(t,n),await M_(e,n))},yV=(t,e)=>{F_(t,t.readable,e)}});import{Writable as zbe}from"node:stream";import{callbackify as _V}from"node:util";var vV,rI,nI,Lbe,Ube,iI,oI,bV,sI=y(()=>{zo();j_();KO();vV=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=rI(t,r,e),s=new zbe({...nI(n,t,i),destroy:_V(oI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return iI(n,s),s},rI=(t,e,r)=>{let n=jy(t,e),i=nf(r,n,"writableFinal"),o=nf(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},nI=(t,e,r)=>({write:Lbe.bind(void 0,t),final:_V(Ube.bind(void 0,t,e,r))}),Lbe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Ube=async(t,e,r)=>{await jc(r,e)&&(t.writable&&t.end(),await e)},iI=async(t,e,r)=>{try{await VO(t),e.writable&&e.end()}catch(n){await hV(r),bV(e,n)}},oI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await jc(r,e),await jc(n,e)&&(bV(t,i),await M_(e,i))},bV=(t,e)=>{F_(t,t.writable,e)}});import{Duplex as qbe}from"node:stream";import{callbackify as Bbe}from"node:util";var SV,Hbe,wV=y(()=>{Ks();tI();sI();SV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Hr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=JO(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=rI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=YO(c,a),{read:g,onStdoutDataDone:v}=XO({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new qbe({read:g,...nI(u,t,d),destroy:Bbe(Hbe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:m,writableObjectMode:u.writableObjectMode,encoding:p});return QO({subprocessStdout:c,onStdoutDataDone:v,readable:_,subprocess:t,subprocessStdin:u}),iI(u,_,c),_},Hbe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([eI({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),oI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var aI,Zbe,xV=y(()=>{Ks();zo();C_();aI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Hr.has(e),s=Oc(t,r),a=R_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Zbe(a,s,t)},Zbe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var $V,kV=y(()=>{j_();tI();sI();wV();xV();$V=(t,{encoding:e})=>{let r=pV();t.readable=gV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=vV.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=SV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=aI.bind(void 0,t,e),t[Symbol.asyncIterator]=aI.bind(void 0,t,e,{})}});var EV,Gbe,Vbe,AV=y(()=>{EV=(t,e)=>{for(let[r,n]of Vbe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Gbe=(async()=>{})().constructor.prototype,Vbe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Gbe,t)])});import{setMaxListeners as Wbe}from"node:events";import{spawn as Kbe}from"node:child_process";var TV,Jbe,Ybe,Xbe,Qbe,eSe,OV=y(()=>{c_();hT();BT();zo();HT();$O();Jd();d_();_9();x9();Yd();C9();Ry();F9();J9();ZO();fV();kV();Tc();AV();TV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Jbe(t,e,r),{subprocess:f,promise:p}=Xbe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=P_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),EV(f,p),di.set(f,{options:u,fileDescriptors:d}),f},Jbe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=ky(t,e,r),{file:a,commandArguments:c,options:l}=Xy(t,e,r),u=Ybe(l),d=w9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},Ybe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},Xbe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Kbe(...Qy(t,e,r))}catch(m){return y9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Wbe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];R9(c,a,l),M9(c,r,l);let d={},f=ui();c.kill=yH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=nV(c,r),$V(c,r),m9(c,r);let p=Qbe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},Qbe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await dV({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let v=m.map((w,x)=>Xi(w,e,x)),_=Xi(h,e,"all"),S=eSe({errorInfo:d,exitCode:f,signal:p,stdio:v,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Cc(S,n,e)},eSe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?Kd({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof fi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):u_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var z_,tSe,rSe,IV=y(()=>{Gi();Ji();z_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,tSe(n,t[n],i)]));return{...t,...r}},tSe=(t,e,r)=>rSe.has(t)&&kt(e)&&kt(r)?{...e,...r}:r,rSe=new Set(["env",...uT])});var qo,nSe,iSe,PV=y(()=>{Gi();oT();R6();a9();OV();IV();qo=(t,e,r,n)=>{let i=(s,a,c)=>qo(s,a,r,c),o=(...s)=>nSe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},nSe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(kt(o))return i(t,z_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=iSe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?s9(a,c,l):TV(a,c,l,i)},iSe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=I6(e)?P6(e,r):[e,...r],[s,a,c]=fy(...o),l=z_(z_(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}}});var RV,CV,DV,oSe,sSe,NV=y(()=>{RV=({file:t,commandArguments:e})=>DV(t,e),CV=({file:t,commandArguments:e})=>({...DV(t,e),isSync:!0}),DV=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=oSe(t);return{file:r,commandArguments:n}},oSe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(sSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},sSe=/ +/g});var jV,MV,aSe,FV,cSe,zV,LV=y(()=>{jV=(t,e,r)=>{t.sync=e(aSe,r),t.s=t.sync},MV=({options:t})=>FV(t),aSe=({options:t})=>({...FV(t),isSync:!0}),FV=t=>({options:{...cSe(t),...t}}),cSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},zV={preferLocal:!0}});var Het,Ve,Zet,Get,Vet,Wet,Ket,Jet,Yet,Xet,Ar=y(()=>{PV();NV();zT();LV();$O();Het=qo(()=>({})),Ve=qo(()=>({isSync:!0})),Zet=qo(RV),Get=qo(CV),Vet=qo(tZ),Wet=qo(MV,{},zV,jV),{sendMessage:Ket,getOneMessage:Jet,getEachMessage:Yet,getCancelSignal:Xet}=h9()});import{existsSync as L_,statSync as lSe}from"node:fs";import{dirname as cI,extname as uSe,isAbsolute as UV,join as lI,relative as uI,resolve as U_,sep as dSe}from"node:path";function q_(t){return t==="./gradlew"||t==="gradle"}function fSe(t){return(L_(lI(t,"build.gradle.kts"))||L_(lI(t,"build.gradle")))&&L_(lI(t,"gradle.properties"))}function pSe(t,e){let n=uI(t,e).split(dSe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function Bo(t,e){return t===":"?`:${e}`:`${t}:${e}`}function mSe(t,e){let r=U_(t,e),n=r;L_(r)?lSe(r).isFile()&&(n=cI(r)):uSe(r)!==""&&(n=cI(r));let i=uI(t,n);if(i.startsWith("..")||UV(i))return null;let o=n;for(;;){if(fSe(o))return o;if(U_(o)===U_(t))return null;let s=cI(o);if(s===o)return null;let a=uI(t,s);if(a.startsWith("..")||UV(a))return null;o=s}}function B_(t,e){let r=U_(t),n=new Map,i=[];for(let o of e){let s=mSe(r,o);if(!s){i.push(o);continue}let a=pSe(r,s);n.has(a)||n.set(a,{path:a,dir:s})}if(i.length>0)throw new Error(`cannot map module(s) to a Gradle project (no build.gradle[.kts] + gradle.properties ancestor under ${r}): ${i.join(", ")}`);return[...n.values()].sort((o,s)=>o.paths.path?1:0)}var H_=y(()=>{"use strict"});import{existsSync as hSe,readFileSync as gSe}from"node:fs";import{join as ySe}from"node:path";function Mc(t="."){let e=ySe(t,".cladding","config.yaml");if(!hSe(e))return dI;try{let n=(0,qV.parse)(gSe(e,"utf8"))?.gate;if(!n)return dI;let i=n.scope==="repo"?"repo":"feature",o=n.coverage==="kover"||n.coverage==="jacoco"?n.coverage:void 0,s=typeof n.test_report=="string"?n.test_report:void 0,a={};if(n.commands&&typeof n.commands=="object")for(let l of _Se){let u=n.commands[l];Array.isArray(u)&&u.every(d=>typeof d=="string")&&(a[l]=u)}let c={scope:i};return Object.keys(a).length>0&&(c.commands=a),o&&(c.coverage=o),s&&(c.testReport=s),c}catch{return dI}}function BV(t,e){let r=[],n=!1;for(let i of t){let o=vSe.exec(i);if(o){n=!0;for(let s of e)r.push(Bo(s.path,o[1]))}else r.push(i)}return n&&e.length===0||r.length===0?null:{cmd:r[0],args:r.slice(1)}}var qV,_Se,dI,vSe,Z_=y(()=>{"use strict";qV=$t(rr(),1);H_();_Se=["type","lint","test","coverage"],dI={scope:"feature"};vSe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as pI,readFileSync as HV,readdirSync as bSe,statSync as SSe}from"node:fs";import{join as G_}from"node:path";function gI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=G_(t,e);if(pI(r))try{if(ZV.test(HV(r,"utf8")))return!0}catch{}}return!1}function GV(t){try{return pI(t)&&ZV.test(HV(t,"utf8"))}catch{return!1}}function VV(t,e=0){if(e>4||!pI(t))return!1;let r;try{r=bSe(t)}catch{return!1}for(let n of r){let i=G_(t,n),o=!1;try{o=SSe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(VV(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&GV(i))return!0}return!1}function $Se(t){if(gI(t))return!0;for(let e of wSe)if(GV(G_(t,e)))return!0;for(let e of xSe)if(VV(G_(t,e)))return!0;return!1}function WV(t="."){let e=Mc(t).coverage;return e||($Se(t)?"kover":"jacoco")}function KV(t="."){return mI[WV(t)]}function JV(t="."){return fI[WV(t)]}var mI,fI,hI,ZV,wSe,xSe,V_=y(()=>{"use strict";Z_();mI={kover:"koverXmlReport",jacoco:"jacocoTestReport"},fI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},hI=[fI.kover,fI.jacoco],ZV=/kover/i;wSe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],xSe=["buildSrc","build-logic"]});import{existsSync as yI,readdirSync as YV}from"node:fs";import{join as W_}from"node:path";function _I(t){return yI(W_(t,"gradlew"))?"./gradlew":"gradle"}function kSe(t){let e=_I(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[KV(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function ASe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function ISe(t,e){for(let r of e)if(yI(W_(t,r)))return r}function PSe(t,e){try{return YV(t).find(n=>n.endsWith(e))}catch{return}}function CSe(t,e){for(let r of RSe)if(r.configs.some(n=>yI(W_(t,n))))return r.gate;return e}function pt(t="."){for(let e of TSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=PSe(t,o):r=ISe(t,[o]),r)break;if(!r||e.requiresSource&&!ASe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:CSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return OSe}var ESe,TSe,OSe,RSe,mn=y(()=>{"use strict";V_();ESe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);TSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit","--incremental","--tsBuildInfoFile",".cladding/cache/tsc.tsbuildinfo"]},lint:{cmd:"npx",args:["--no-install","eslint",".","--cache","--cache-location",".cladding/cache/eslint"]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:kSe},{language:"java",manifests:["pom.xml","build.gradle","build.gradle.kts"],gates:{type:{cmd:"mvn",args:["compile","-q"]},lint:{cmd:"mvn",args:["checkstyle:check","-q"]},test:{cmd:"mvn",args:["test","-q"]},coverage:{cmd:"mvn",args:["jacoco:report","-q"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"php",manifests:["composer.json"],gates:{type:{cmd:"phpstan",args:["analyse"]},lint:{cmd:"phpcs",args:[]},test:{cmd:"phpunit",args:[]},coverage:{cmd:"phpunit",args:["--coverage-text"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"ruby",manifests:["Gemfile"],gates:{type:{cmd:"srb",args:["tc"]},lint:{cmd:"rubocop",args:[]},test:{cmd:"bundle",args:["exec","rspec"]},coverage:{cmd:"bundle",args:["exec","rspec","--format","documentation"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"elixir",manifests:["mix.exs"],gates:{type:{cmd:"mix",args:["dialyzer"]},lint:{cmd:"mix",args:["credo"]},test:{cmd:"mix",args:["test"]},coverage:{cmd:"mix",args:["coveralls"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dotnet",manifests:[".csproj",".sln",".fsproj"],gates:{type:{cmd:"dotnet",args:["build","--nologo","-v","q"]},lint:{cmd:"dotnet",args:["format","--verify-no-changes"]},test:{cmd:"dotnet",args:["test","--nologo"]},coverage:{cmd:"dotnet",args:["test",'--collect:"XPlat Code Coverage"']},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}],OSe={language:"unknown",manifest:"",gates:{}};RSe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as DSe,readFileSync as NSe}from"node:fs";import{join as jSe}from"node:path";function na(t){return t.code==="ENOENT"}function K_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return XV.test(o)||XV.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Ft(t,e,r){return na(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function nr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Fc(t,e){let r=jSe(t,"package.json");if(!DSe(r))return!1;try{return!!JSON.parse(NSe(r,"utf8")).scripts?.[e]}catch{return!1}}var XV,hn=y(()=>{"use strict";XV=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function MSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;if(!n)return[{detector:J_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Ve(n.cmd,[...n.args],{cwd:e,reject:!1});return na(i)?[{detector:J_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:K_(i,J_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var J_,Y_,vI=y(()=>{"use strict";Ar();mn();hn();J_="ARCHITECTURE_VIOLATION";Y_={name:J_,run:MSe}});import QV from"node:process";function ia(t={}){let r=Y_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:FSe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` +`)}}var FSe,zSe,X_=y(()=>{"use strict";vI();FSe="stage_1.5";zSe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${QV.argv[1]}`;if(zSe){let t=ia();console.log(JSON.stringify(t)),QV.exit(t.exitCode)}});import{existsSync as bI,readdirSync as eW}from"node:fs";import{join as Q_}from"node:path";function USe(t,e){let r=Q_(t,e.path);if(!bI(r))return!0;if(e.isDirectory)try{return eW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function qSe(t){let{cwd:e="."}=t,r=[];for(let i of LSe)USe(e,i)&&r.push({detector:of,severity:i.severity,path:i.path,message:`${i.path} is absent \u2014 cladding scaffold incomplete (${i.purpose}). Run \`clad init --intent ""\` to populate it.`});let n=Q_(e,"spec.yaml");if(bI(n)){let i=ZSe(n),o=i?null:BSe(e);if(i)r.push({detector:of,severity:"error",path:"spec.yaml",message:`spec.yaml is present but unreadable (${i}) \u2014 cladding is governing nothing. Fix the SSoT root, then \`clad sync\` to validate.`});else if(o)r.push({detector:of,severity:"error",path:o.path,message:`spec shard '${o.path}' is present but unparseable (${o.reason}) \u2014 loadSpec throws on it, so every spec-gated detector silently passes. Fix it, then \`clad sync\`.`});else{let s=HSe(e);s&&r.push({detector:of,severity:"error",path:"spec.yaml",message:`spec.yaml is present and parses, but the assembled spec does not load (${s}) \u2014 every spec-gated detector then degrades to non-blocking info, so the gate would pass GREEN on an unloadable SSoT. Fix it, then \`clad sync\` to validate.`})}}return r}function BSe(t){for(let e of["spec/features","spec/scenarios"]){let r=Q_(t,e);if(!bI(r))continue;let n;try{n=eW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{si(Q_(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function HSe(t){try{return J(t),null}catch(e){return e.message}}function ZSe(t){let e;try{e=si(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var of,LSe,tW,rW=y(()=>{"use strict";lt();sy();of="ABSENCE_OF_GOVERNANCE",LSe=[{path:"spec.yaml",severity:"error",purpose:"SSoT root \u2014 every spec-gated detector needs it"},{path:"spec/architecture.yaml",severity:"warn",purpose:"architecture invariants (layers + forbidden_imports)"},{path:"spec/capabilities.yaml",severity:"warn",purpose:"capability \u2194 feature traceability"},{path:"docs/project-context.md",severity:"warn",purpose:"intent narrative + decision history"},{path:"docs/conventions.md",severity:"info",purpose:"project style guide (recommended)"},{path:"spec/scenarios",severity:"info",purpose:"user-journey scenarios (recommended)",isDirectory:!0}];tW={name:of,run:qSe}});function ev(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function SI(t,e){let r=e?.trim()??"";if(!t)return r.length>0?"condition is present but ears pattern is not declared":null;if(t==="ubiquitous")return r.length>0?`ears='ubiquitous' but condition is present ('${r.slice(0,40)}\u2026')`:null;if(t==="complex"){if(r.length===0)return"ears='complex' requires a 'while' precondition and a 'when' trigger \u2014 empty";let i=ev(r)==="while",o=VSe.test(r);return i?o?null:"ears='complex' requires a 'when' trigger clause after the 'while' precondition \u2014 none found":`ears='complex' requires the condition to start with 'while' (precondition) \u2014 got '${ev(r)}'`}let n=GSe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:ev(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${ev(r)}'`:null}function WSe(t,e){let r=SI(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function nW(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...WSe(r,n));return e}var GSe,VSe,wI=y(()=>{"use strict";GSe={event:"when",state:"while",optional:"where",unwanted:"if"},VSe=/\bwhen\b/i});function pe(t,e,r){let n;try{n=J(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var _t=y(()=>{"use strict";lt()});function KSe(t){let{cwd:e="."}=t;return pe(e,tv,JSe)}function JSe(t){let e=[];for(let r of t.features)for(let n of r.acceptance_criteria??[]){let i=!!n.text?.trim(),o=!!(n.condition?.trim()||n.action?.trim()||n.response?.trim());!i&&!o&&e.push({detector:tv,severity:"error",message:`${r.id}.${n.id} has neither rendered text nor any EARS field (condition/action/response) \u2014 structurally empty AC`})}for(let r of nW(t.features))e.push({detector:tv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var tv,iW,oW=y(()=>{"use strict";wI();_t();tv="AC_DRIFT";iW={name:tv,run:KSe}});function mi(t=".",e){let n=(e??"").trim().toLowerCase()||pt(t).language;return ewe[n]??sW}var YSe,XSe,sW,QSe,ewe,zc=y(()=>{"use strict";mn();YSe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,XSe=/^[ \t]*import\s+([\w.]+)/gm,sW={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:YSe,importStyle:"relative"},QSe={ext:"kt",extensions:[".kt",".kts"],sourceRoots:["src/main/kotlin","src/test/kotlin"],mainRoot:"src/main/kotlin",testGlobs:["src/test/kotlin/**/*Test.kt","src/test/kotlin/**/*Tests.kt"],coverageSummary:"build/reports/jacoco/test/jacocoTestReport.xml",coverageFormat:"jacoco-xml",importMatcher:XSe,importStyle:"dotted"},ewe={typescript:sW,kotlin:QSe}});import{existsSync as twe,readFileSync as rwe,readdirSync as nwe,statSync as iwe}from"node:fs";import{join as cW,relative as aW}from"node:path";function owe(t,e){if(!twe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=nwe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=cW(i,s),c;try{c=iwe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function swe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function cwe(t){return awe.test(t)}function lwe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=mi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>owe(cW(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=rwe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";lt();zc();lW="AI_HINTS_FORBIDDEN_PATTERN";awe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;uW={name:lW,run:lwe}});function uwe(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];for(let i of r.features){let o=(i.acceptance_criteria??[]).map(a=>a.id),s=new Map;for(let a of o)s.set(a,(s.get(a)??0)+1);for(let[a,c]of s)c>1&&n.push({detector:fW,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var fW,pW,mW=y(()=>{"use strict";lt();fW="AC_DUPLICATE_WITHIN_FEATURE";pW={name:fW,run:uwe}});import{createRequire as dwe}from"module";import{basename as fwe,dirname as $I,normalize as pwe,relative as mwe,resolve as hwe,sep as yW}from"path";import*as gwe from"fs";function ywe(t){let e=pwe(t);return e.length>1&&e[e.length-1]===yW&&(e=e.substring(0,e.length-1)),e}function _W(t,e){return t.replace(_we,e)}function bwe(t){return t==="/"||vwe.test(t)}function xI(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=hwe(t)),(n||o)&&(t=ywe(t)),t===".")return"";let s=t[t.length-1]!==i;return _W(s?t+i:t,i)}function vW(t,e){return e+t}function Swe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:_W(mwe(t,n),e.pathSeparator)+e.pathSeparator+r}}function wwe(t){return t}function xwe(t,e,r){return e+t+r}function $we(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?Swe(t,e):n?vW:wwe}function kwe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function Ewe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function Iwe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?Ewe(t):kwe(t):n&&n.length?Twe:Awe:Owe}function jwe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?Nwe:r&&r.length?n?Pwe:Rwe:n?Cwe:Dwe}function zwe(t){return t.group?Fwe:Mwe}function qwe(t){return t.group?Lwe:Uwe}function Zwe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Hwe:Bwe}function bW(t,e,r){if(r.options.useRealPaths)return Gwe(e,r);let n=$I(t),i=1;for(;n!==r.root&&i<2;){let o=r.symlinks.get(n);!!o&&(o===e||o.startsWith(e)||e.startsWith(o))?i++:n=$I(n)}return r.symlinks.set(t,e),i>1}function Gwe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function rv(t,e,r,n){e(t&&!n?t:null,r)}function txe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?Vwe:Ywe:n?e?Wwe:exe:i?e?Jwe:Qwe:e?Kwe:Xwe}function ixe(t){return t?nxe:rxe}function cxe(t,e){return new Promise((r,n)=>{xW(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function xW(t,e,r){new wW(t,e,r).start()}function lxe(t,e){return new wW(t,e).start()}var hW,_we,vwe,Awe,Twe,Owe,Pwe,Rwe,Cwe,Dwe,Nwe,Mwe,Fwe,Lwe,Uwe,Bwe,Hwe,Vwe,Wwe,Kwe,Jwe,Ywe,Xwe,Qwe,exe,SW,rxe,nxe,oxe,sxe,axe,wW,gW,$W,kW,EW=y(()=>{hW=dwe(import.meta.url);_we=/[\\/]/g;vwe=/^[a-z]:[\\/]$/i;Awe=(t,e)=>{e.push(t||".")},Twe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},Owe=()=>{};Pwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},Rwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},Cwe=(t,e,r,n)=>{r.files++},Dwe=(t,e)=>{e.push(t)},Nwe=()=>{};Mwe=t=>t,Fwe=()=>[""].slice(0,0);Lwe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Uwe=()=>{};Bwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue(),i.realpath(t,(s,a)=>{if(s)return n.dequeue(o?null:s,e);i.stat(a,(c,l)=>{if(c)return n.dequeue(o?null:c,e);if(l.isDirectory()&&bW(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},Hwe=function(t,e,r){let{queue:n,fs:i,options:{suppressErrors:o}}=e;n.enqueue();try{let s=i.realpathSync(t),a=i.statSync(s);if(a.isDirectory()&&bW(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};Vwe=t=>t.counts,Wwe=t=>t.groups,Kwe=t=>t.paths,Jwe=t=>t.paths.slice(0,t.options.maxFiles),Ywe=(t,e,r)=>(rv(e,r,t.counts,t.options.suppressErrors),null),Xwe=(t,e,r)=>(rv(e,r,t.paths,t.options.suppressErrors),null),Qwe=(t,e,r)=>(rv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),exe=(t,e,r)=>(rv(e,r,t.groups,t.options.suppressErrors),null);SW={withFileTypes:!0},rxe=(t,e,r,n,i)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);let{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",SW,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},nxe=(t,e,r,n,i)=>{let{fs:o}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let s=[];try{s=o.readdirSync(e||".",SW)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};oxe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},sxe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},axe=class{aborted=!1;abort(){this.aborted=!0}},wW=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=txe(e,this.isSynchronous),this.root=xI(t,e),this.state={root:bwe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new sxe,options:e,queue:new oxe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new axe,fs:e.fs||gwe},this.joinPath=$we(this.root,e),this.pushDirectory=Iwe(this.root,e),this.pushFile=jwe(e),this.getArray=zwe(e),this.groupFiles=qwe(e),this.resolveSymlink=Zwe(e,this.isSynchronous),this.walkDirectory=ixe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,r)=>{let{paths:n,options:{filters:i,resolveSymlinks:o,excludeSymlinks:s,exclude:a,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:d},controller:f}=this.state;if(f.aborted||l&&l.aborted||c&&n.length>c)return;let p=this.getArray(this.state.paths);for(let m=0;m{if(v.isDirectory()){if(_=xI(_,this.state.options),a&&a(h.name,u?_:g+d))return;this.walkDirectory(this.state,_,u?_:g+d,r-1,this.walk)}else{_=u?_:g;let S=fwe(_),w=xI($I(_),this.state.options);_=this.joinPath(S,w),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};gW=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return cxe(this.root,this.options)}withCallback(t){xW(this.root,this.options,t)}sync(){return lxe(this.root,this.options)}},$W=null;try{hW.resolve("picomatch"),$W=hW("picomatch")}catch{}kW=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:yW,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new gW(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new gW(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||$W;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=r(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(i=>n(i)),this}}});var sf=b((ert,PW)=>{"use strict";var AW="[^\\\\/]",uxe="(?=.)",TW="[^/]",kI="(?:\\/|$)",OW="(?:^|\\/)",EI=`\\.{1,2}${kI}`,dxe="(?!\\.)",fxe=`(?!${OW}${EI})`,pxe=`(?!\\.{0,1}${kI})`,mxe=`(?!${EI})`,hxe="[^.\\/]",gxe=`${TW}*?`,yxe="/",IW={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:uxe,QMARK:TW,END_ANCHOR:kI,DOTS_SLASH:EI,NO_DOT:dxe,NO_DOTS:fxe,NO_DOT_SLASH:pxe,NO_DOTS_SLASH:mxe,QMARK_NO_DOT:hxe,STAR:gxe,START_ANCHOR:OW,SEP:yxe},_xe={...IW,SLASH_LITERAL:"[\\\\/]",QMARK:AW,STAR:`${AW}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},vxe={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};PW.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:vxe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?_xe:IW}}});var af=b(Tr=>{"use strict";var{REGEX_BACKSLASH:bxe,REGEX_REMOVE_BACKSLASH:Sxe,REGEX_SPECIAL_CHARS:wxe,REGEX_SPECIAL_CHARS_GLOBAL:xxe}=sf();Tr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Tr.hasRegexChars=t=>wxe.test(t);Tr.isRegexChar=t=>t.length===1&&Tr.hasRegexChars(t);Tr.escapeRegex=t=>t.replace(xxe,"\\$1");Tr.toPosixSlashes=t=>t.replace(bxe,"/");Tr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Tr.removeBackslashes=t=>t.replace(Sxe,e=>e==="\\"?"":e);Tr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Tr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Tr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Tr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Tr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var zW=b((rrt,FW)=>{"use strict";var RW=af(),{CHAR_ASTERISK:AI,CHAR_AT:$xe,CHAR_BACKWARD_SLASH:cf,CHAR_COMMA:kxe,CHAR_DOT:TI,CHAR_EXCLAMATION_MARK:OI,CHAR_FORWARD_SLASH:MW,CHAR_LEFT_CURLY_BRACE:II,CHAR_LEFT_PARENTHESES:PI,CHAR_LEFT_SQUARE_BRACKET:Exe,CHAR_PLUS:Axe,CHAR_QUESTION_MARK:CW,CHAR_RIGHT_CURLY_BRACE:Txe,CHAR_RIGHT_PARENTHESES:DW,CHAR_RIGHT_SQUARE_BRACKET:Oxe}=sf(),NW=t=>t===MW||t===cf,jW=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Ixe=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,o=[],s=[],a=[],c=t,l=-1,u=0,d=0,f=!1,p=!1,m=!1,h=!1,g=!1,v=!1,_=!1,S=!1,w=!1,x=!1,I=0,T,k,C={value:"",depth:0,isGlob:!1},E=()=>l>=n,Z=()=>c.charCodeAt(l+1),ie=()=>(T=k,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),xe&&m===!0&&d>0?(xe=c.slice(0,d),R=c.slice(d)):m===!0?(xe="",R=c):xe=c,xe&&xe!==""&&xe!=="/"&&xe!==c&&NW(xe.charCodeAt(xe.length-1))&&(xe=xe.slice(0,-1)),r.unescape===!0&&(R&&(R=RW.removeBackslashes(R)),xe&&_===!0&&(xe=RW.removeBackslashes(xe)));let cn={prefix:P,input:t,start:u,base:xe,glob:R,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:w};if(r.tokens===!0&&(cn.maxDepth=0,NW(k)||s.push(C),cn.tokens=s),r.parts===!0||r.tokens===!0){let Ge;for(let ft=0;ft{"use strict";var lf=sf(),Zr=af(),{MAX_LENGTH:nv,POSIX_REGEX_SOURCE:Pxe,REGEX_NON_SPECIAL_CHARS:Rxe,REGEX_SPECIAL_CHARS_BACKREF:Cxe,REPLACEMENTS:LW}=lf,Dxe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>Zr.escapeRegex(i)).join("..")}return r},Lc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,UW=t=>{let e=[],r=0,n=0,i=0,o="",s=!1;for(let a of t){if(s===!0){o+=a,s=!1;continue}if(a==="\\"){o+=a,s=!0;continue}if(a==='"'){i=i===1?0:1,o+=a;continue}if(i===0){if(a==="[")r++;else if(a==="]"&&r>0)r--;else if(r===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(o),o="";continue}}}o+=a}return e.push(o),e},Nxe=t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},qW=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Nxe(e))return e.replace(/\\(.)/g,"$1")},jxe=t=>{let e=t.map(qW).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,i=0,o=!1;for(let s=1;s0){r--;continue}if(!(r>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&s!==t.length-1?void 0:{type:t[0],body:t.slice(2,s),end:s}}}}},Mxe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=qW(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Zr.escapeRegex(r[0]):`[${r.map(i=>Zr.escapeRegex(i)).join("")}]`}*`},Fxe=t=>{let e=0,r=t.trim(),n=RI(r);for(;n;)e++,r=n.body.trim(),n=RI(r);return e},zxe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:lf.DEFAULT_MAX_EXTGLOB_RECURSION,n=UW(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||jxe(n)))return{risky:!0};for(let i of n){let o=Mxe(i);if(o)return{risky:!0,safeOutput:o};if(Fxe(i)>r)return{risky:!0}}return{risky:!1}},CI=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=LW[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(nv,r.maxLength):nv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let o={type:"bos",value:"",output:r.prepend||""},s=[o],a=r.capture?"":"?:",c=lf.globChars(r.windows),l=lf.extglobChars(c),{DOT_LITERAL:u,PLUS_LITERAL:d,SLASH_LITERAL:f,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:h,NO_DOT_SLASH:g,NO_DOTS_SLASH:v,QMARK:_,QMARK_NO_DOT:S,STAR:w,START_ANCHOR:x}=c,I=U=>`(${a}(?:(?!${x}${U.dot?m:u}).)*?)`,T=r.dot?"":h,k=r.dot?_:S,C=r.bash===!0?I(r):w;r.capture&&(C=`(${C})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let E={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:s};t=Zr.removePrefix(t,E),i=t.length;let Z=[],ie=[],xe=[],P=o,R,cn=()=>E.index===i-1,Ge=E.peek=(U=1)=>t[E.index+U],ft=E.advance=()=>t[++E.index]||"",zi=()=>t.slice(E.index+1),ln=(U="",ct=0)=>{E.consumed+=U,E.index+=ct},So=U=>{E.output+=U.output!=null?U.output:U.value,ln(U.value)},Tae=()=>{let U=1;for(;Ge()==="!"&&(Ge(2)!=="("||Ge(3)==="?");)ft(),E.start++,U++;return U%2===0?!1:(E.negated=!0,E.start++,!0)},Wh=U=>{E[U]++,xe.push(U)},wo=U=>{E[U]--,xe.pop()},Ee=U=>{if(P.type==="globstar"){let ct=E.braces>0&&(U.type==="comma"||U.type==="brace"),L=U.extglob===!0||Z.length&&(U.type==="pipe"||U.type==="paren");U.type!=="slash"&&U.type!=="paren"&&!ct&&!L&&(E.output=E.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=C,E.output+=P.output)}if(Z.length&&U.type!=="paren"&&(Z[Z.length-1].inner+=U.value),(U.value||U.output)&&So(U),P&&P.type==="text"&&U.type==="text"){P.output=(P.output||P.value)+U.value,P.value+=U.value;return}U.prev=P,s.push(U),P=U},Kh=(U,ct)=>{let L={...l[ct],conditions:1,inner:""};L.prev=P,L.parens=E.parens,L.output=E.output,L.startIndex=E.index,L.tokensIndex=s.length;let Ae=(r.capture?"(":"")+L.open;Wh("parens"),Ee({type:U,value:ct,output:E.output?"":p}),Ee({type:"paren",extglob:!0,value:ft(),output:Ae}),Z.push(L)},Oae=U=>{let ct=t.slice(U.startIndex,E.index+1),L=t.slice(U.startIndex+2,E.index),Ae=zxe(L,r);if((U.type==="plus"||U.type==="star")&&Ae.risky){let it=Ae.safeOutput?(U.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ri=s[U.tokensIndex];ri.type="text",ri.value=ct,ri.output=it||Zr.escapeRegex(ct);for(let ni=U.tokensIndex+1;ni1&&U.inner.includes("/")&&(it=I(r)),(it!==C||cn()||/^\)+$/.test(zi()))&&(ot=U.close=`)$))${it}`),U.inner.includes("*")&&(Nt=zi())&&/^\.[^\\/.]+$/.test(Nt)){let ri=CI(Nt,{...e,fastpaths:!1}).output;ot=U.close=`)${ri})${it})`}U.prev.type==="bos"&&(E.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:R,output:ot}),wo("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let U=!1,ct=t.replace(Cxe,(L,Ae,ot,Nt,it,ri)=>Nt==="\\"?(U=!0,L):Nt==="?"?Ae?Ae+Nt+(it?_.repeat(it.length):""):ri===0?k+(it?_.repeat(it.length):""):_.repeat(ot.length):Nt==="."?u.repeat(ot.length):Nt==="*"?Ae?Ae+Nt+(it?C:""):C:Ae?L:`\\${L}`);return U===!0&&(r.unescape===!0?ct=ct.replace(/\\/g,""):ct=ct.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),ct===t&&r.contains===!0?(E.output=t,E):(E.output=Zr.wrapOutput(ct,E,e),E)}for(;!cn();){if(R=ft(),R==="\0")continue;if(R==="\\"){let L=Ge();if(L==="/"&&r.bash!==!0||L==="."||L===";")continue;if(!L){R+="\\",Ee({type:"text",value:R});continue}let Ae=/^\\+/.exec(zi()),ot=0;if(Ae&&Ae[0].length>2&&(ot=Ae[0].length,E.index+=ot,ot%2!==0&&(R+="\\")),r.unescape===!0?R=ft():R+=ft(),E.brackets===0){Ee({type:"text",value:R});continue}}if(E.brackets>0&&(R!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&R===":"){let L=P.value.slice(1);if(L.includes("[")&&(P.posix=!0,L.includes(":"))){let Ae=P.value.lastIndexOf("["),ot=P.value.slice(0,Ae),Nt=P.value.slice(Ae+2),it=Pxe[Nt];if(it){P.value=ot+it,E.backtrack=!0,ft(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(R==="["&&Ge()!==":"||R==="-"&&Ge()==="]")&&(R=`\\${R}`),R==="]"&&(P.value==="["||P.value==="[^")&&(R=`\\${R}`),r.posix===!0&&R==="!"&&P.value==="["&&(R="^"),P.value+=R,So({value:R});continue}if(E.quotes===1&&R!=='"'){R=Zr.escapeRegex(R),P.value+=R,So({value:R});continue}if(R==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:R});continue}if(R==="("){Wh("parens"),Ee({type:"paren",value:R});continue}if(R===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Lc("opening","("));let L=Z[Z.length-1];if(L&&E.parens===L.parens+1){Oae(Z.pop());continue}Ee({type:"paren",value:R,output:E.parens?")":"\\)"}),wo("parens");continue}if(R==="["){if(r.nobracket===!0||!zi().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Lc("closing","]"));R=`\\${R}`}else Wh("brackets");Ee({type:"bracket",value:R});continue}if(R==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){Ee({type:"text",value:R,output:`\\${R}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Lc("opening","["));Ee({type:"text",value:R,output:`\\${R}`});continue}wo("brackets");let L=P.value.slice(1);if(P.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(R=`/${R}`),P.value+=R,So({value:R}),r.literalBrackets===!1||Zr.hasRegexChars(L))continue;let Ae=Zr.escapeRegex(P.value);if(E.output=E.output.slice(0,-P.value.length),r.literalBrackets===!0){E.output+=Ae,P.value=Ae;continue}P.value=`(${a}${Ae}|${P.value})`,E.output+=P.value;continue}if(R==="{"&&r.nobrace!==!0){Wh("braces");let L={type:"brace",value:R,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};ie.push(L),Ee(L);continue}if(R==="}"){let L=ie[ie.length-1];if(r.nobrace===!0||!L){Ee({type:"text",value:R,output:R});continue}let Ae=")";if(L.dots===!0){let ot=s.slice(),Nt=[];for(let it=ot.length-1;it>=0&&(s.pop(),ot[it].type!=="brace");it--)ot[it].type!=="dots"&&Nt.unshift(ot[it].value);Ae=Dxe(Nt,r),E.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let ot=E.output.slice(0,L.outputIndex),Nt=E.tokens.slice(L.tokensIndex);L.value=L.output="\\{",R=Ae="\\}",E.output=ot;for(let it of Nt)E.output+=it.output||it.value}Ee({type:"brace",value:R,output:Ae}),wo("braces"),ie.pop();continue}if(R==="|"){Z.length>0&&Z[Z.length-1].conditions++,Ee({type:"text",value:R});continue}if(R===","){let L=R,Ae=ie[ie.length-1];Ae&&xe[xe.length-1]==="braces"&&(Ae.comma=!0,L="|"),Ee({type:"comma",value:R,output:L});continue}if(R==="/"){if(P.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),P=o;continue}Ee({type:"slash",value:R,output:f});continue}if(R==="."){if(E.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let L=ie[ie.length-1];P.type="dots",P.output+=R,P.value+=R,L.dots=!0;continue}if(E.braces+E.parens===0&&P.type!=="bos"&&P.type!=="slash"){Ee({type:"text",value:R,output:u});continue}Ee({type:"dot",value:R,output:u});continue}if(R==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Kh("qmark",R);continue}if(P&&P.type==="paren"){let Ae=Ge(),ot=R;(P.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(zi()))&&(ot=`\\${R}`),Ee({type:"text",value:R,output:ot});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){Ee({type:"qmark",value:R,output:S});continue}Ee({type:"qmark",value:R,output:_});continue}if(R==="!"){if(r.noextglob!==!0&&Ge()==="("&&(Ge(2)!=="?"||!/[!=<:]/.test(Ge(3)))){Kh("negate",R);continue}if(r.nonegate!==!0&&E.index===0){Tae();continue}}if(R==="+"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Kh("plus",R);continue}if(P&&P.value==="("||r.regex===!1){Ee({type:"plus",value:R,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||E.parens>0){Ee({type:"plus",value:R});continue}Ee({type:"plus",value:d});continue}if(R==="@"){if(r.noextglob!==!0&&Ge()==="("&&Ge(2)!=="?"){Ee({type:"at",extglob:!0,value:R,output:""});continue}Ee({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);let L=Rxe.exec(zi());L&&(R+=L[0],E.index+=L[0].length),Ee({type:"text",value:R});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=R,P.output=C,E.backtrack=!0,E.globstar=!0,ln(R);continue}let U=zi();if(r.noextglob!==!0&&/^\([^?]/.test(U)){Kh("star",R);continue}if(P.type==="star"){if(r.noglobstar===!0){ln(R);continue}let L=P.prev,Ae=L.prev,ot=L.type==="slash"||L.type==="bos",Nt=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!ot||U[0]&&U[0]!=="/")){Ee({type:"star",value:R,output:""});continue}let it=E.braces>0&&(L.type==="comma"||L.type==="brace"),ri=Z.length&&(L.type==="pipe"||L.type==="paren");if(!ot&&L.type!=="paren"&&!it&&!ri){Ee({type:"star",value:R,output:""});continue}for(;U.slice(0,3)==="/**";){let ni=t[E.index+4];if(ni&&ni!=="/")break;U=U.slice(3),ln("/**",3)}if(L.type==="bos"&&cn()){P.type="globstar",P.value+=R,P.output=I(r),E.output=P.output,E.globstar=!0,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Nt&&cn()){E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=I(r)+(r.strictSlashes?")":"|$)"),P.value+=R,E.globstar=!0,E.output+=L.output+P.output,ln(R);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&U[0]==="/"){let ni=U[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(L.output+P.output).length),L.output=`(?:${L.output}`,P.type="globstar",P.output=`${I(r)}${f}|${f}${ni})`,P.value+=R,E.output+=L.output+P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&U[0]==="/"){P.type="globstar",P.value+=R,P.output=`(?:^|${f}|${I(r)}${f})`,E.output=P.output,E.globstar=!0,ln(R+ft()),Ee({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-P.output.length),P.type="globstar",P.output=I(r),P.value+=R,E.output+=P.output,E.globstar=!0,ln(R);continue}let ct={type:"star",value:R,output:C};if(r.bash===!0){ct.output=".*?",(P.type==="bos"||P.type==="slash")&&(ct.output=T+ct.output),Ee(ct);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){ct.output=R,Ee(ct);continue}(E.index===E.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(E.output+=g,P.output+=g):r.dot===!0?(E.output+=v,P.output+=v):(E.output+=T,P.output+=T),Ge()!=="*"&&(E.output+=p,P.output+=p)),Ee(ct)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lc("closing","]"));E.output=Zr.escapeLast(E.output,"["),wo("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lc("closing",")"));E.output=Zr.escapeLast(E.output,"("),wo("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Lc("closing","}"));E.output=Zr.escapeLast(E.output,"{"),wo("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),E.backtrack===!0){E.output="";for(let U of E.tokens)E.output+=U.output!=null?U.output:U.value,U.suffix&&(E.output+=U.suffix)}return E};CI.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(nv,r.maxLength):nv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=LW[t]||t;let{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:u,NO_DOTS_SLASH:d,STAR:f,START_ANCHOR:p}=lf.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",v={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=T=>T.noglobstar===!0?_:`(${g}(?:(?!${p}${T.dot?c:o}).)*?)`,w=T=>{switch(T){case"*":return`${m}${a}${_}`;case".*":return`${o}${a}${_}`;case"*.*":return`${m}${_}${o}${a}${_}`;case"*/*":return`${m}${_}${s}${a}${h}${_}`;case"**":return m+S(r);case"**/*":return`(?:${m}${S(r)}${s})?${h}${a}${_}`;case"**/*.*":return`(?:${m}${S(r)}${s})?${h}${_}${o}${a}${_}`;case"**/.*":return`(?:${m}${S(r)}${s})?${o}${a}${_}`;default:{let k=/^(.*?)\.(\w+)$/.exec(T);if(!k)return;let C=w(k[1]);return C?C+o+k[2]:void 0}}},x=Zr.removePrefix(t,v),I=w(x);return I&&r.strictSlashes!==!0&&(I+=`${s}?`),I};BW.exports=CI});var VW=b((irt,GW)=>{"use strict";var Lxe=zW(),DI=HW(),ZW=af(),Uxe=sf(),qxe=t=>t&&typeof t=="object"&&!Array.isArray(t),Et=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Et(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=qxe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},o=i.windows,s=n?Et.compileRe(t,e):Et.makeRe(t,e,!1,!0),a=s.state;delete s.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Et(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Et.test(u,s,e,{glob:t,posix:o}),h={glob:t,state:a,regex:s,posix:o,input:u,output:m,match:p,isMatch:f};return typeof i.onResult=="function"&&i.onResult(h),f===!1?(h.isMatch=!1,d?h:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(h),h.isMatch=!1,d?h:!1):(typeof i.onMatch=="function"&&i.onMatch(h),d?h:!0)};return r&&(l.state=a),l};Et.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let o=r||{},s=o.format||(i?ZW.toPosixSlashes:null),a=t===n,c=a&&s?s(t):t;return a===!1&&(c=s?s(t):t,a=c===n),(a===!1||o.capture===!0)&&(o.matchBase===!0||o.basename===!0?a=Et.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Et.matchBase=(t,e,r)=>(e instanceof RegExp?e:Et.makeRe(e,r)).test(ZW.basename(t));Et.isMatch=(t,e,r)=>Et(e,r)(t);Et.parse=(t,e)=>Array.isArray(t)?t.map(r=>Et.parse(r,e)):DI(t,{...e,fastpaths:!1});Et.scan=(t,e)=>Lxe(t,e);Et.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},o=i.contains?"":"^",s=i.contains?"":"$",a=`${o}(?:${t.output})${s}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Et.toRegex(a,e);return n===!0&&(c.state=t),c};Et.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=DI.fastpaths(t,e)),i.output||(i=DI(t,e)),Et.compileRe(i,e,r,n)};Et.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Et.constants=Uxe;GW.exports=Et});var YW=b((ort,JW)=>{"use strict";var WW=VW(),Bxe=af();function KW(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Bxe.isWindows()}),WW(t,e,r)}Object.assign(KW,WW);JW.exports=KW});import{readdir as Hxe,readdirSync as Zxe,realpath as Gxe,realpathSync as Vxe,stat as Wxe,statSync as Kxe}from"fs";import{isAbsolute as Jxe,posix as oa,resolve as Yxe}from"path";import{fileURLToPath as Xxe}from"url";function t$e(t,e={}){let r=t.length,n=Array(r),i=Array(r),o,s;for(o=0;o{let c=a.split("/");if(c[0]===".."&&e$e.test(a))return!0;for(o=0;oo.slice(i,s?-1:void 0)||"."}let n=e.slice(t.length+1);return n?(i,o)=>{if(i===".")return n;let s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>oa.relative(t,n)||".":n=>oa.relative(t,`${e}/${n}`)||"."}function i$e(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=oa.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function tK(t){var e;let r=Uc.default.scan(t,o$e);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function d$e(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Uc.default.scan(t);return r.isGlob||r.negated}function uf(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function rK(t){return typeof t=="string"?[t]:t??[]}function NI(t,e,r,n){var i;let o=e.cwd,s=t;t[t.length-1]==="/"&&(s=t.slice(0,-1)),s[s.length-1]!=="*"&&e.expandDirectories&&(s+="/**");let a=u$e(o);s=Jxe(s.replace(p$e,""))?oa.relative(a,s):oa.normalize(s);let c=(i=f$e.exec(s))===null||i===void 0?void 0:i[0],l=tK(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?oa.join(o,...d):o}return s}function m$e(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(NI(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(NI(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(NI(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function h$e(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=m$e(t,e,n);t.debug&&uf("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(QW,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Uc.default)(i.match,f),m=(0,Uc.default)(i.ignore,f),h=t$e(i.match,f),g=XW(r,d,o),v=o?g:XW(r,d,!0),_=(x,I)=>{let T=v(I,!0);return T!=="."&&!h(T)||m(T)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let w=new kW({filters:[a?(x,I)=>{let T=g(x,I),k=p(T)&&!m(T);return k&&uf(`matched ${T}`),k}:(x,I)=>{let T=g(x,I);return p(T)&&!m(T)}],exclude:a?(x,I)=>{let T=_(x,I);return uf(`${T?"skipped":"crawling"} ${I}`),T}:_,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:l,excludeSymlinks:!l,excludeFiles:u,includeDirs:u||!t.onlyFiles,maxDepth:S,signal:t.signal}).crawl(d);return t.debug&&uf("internal properties:",{...n,root:d}),[w,r!==d&&!o&&i$e(r,d)]}function g$e(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function _$e(t){let e={...y$e,...t};return e.cwd=(e.cwd instanceof URL?Xxe(e.cwd):Yxe(e.cwd)).replace(QW,"/"),e.ignore=rK(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Hxe,readdirSync:e.fs.readdirSync||Zxe,realpath:e.fs.realpath||Gxe,realpathSync:e.fs.realpathSync||Vxe,stat:e.fs.stat||Wxe,statSync:e.fs.statSync||Kxe}),e.debug&&uf("globbing with options:",e),e}function v$e(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Qxe(t)||typeof t=="string",i=rK((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=_$e(n?e:t);return i.length>0?h$e(o,i):[]}function Ho(t,e){let[r,n]=v$e(t,e);return r?g$e(r.sync(),n):[]}var Uc,Qxe,QW,eK,e$e,r$e,n$e,o$e,s$e,a$e,c$e,l$e,u$e,f$e,p$e,y$e,df=y(()=>{EW();Uc=$t(YW(),1),Qxe=Array.isArray,QW=/\\/g,eK=process.platform==="win32",e$e=/^(\/?\.\.)+$/;r$e=/^[A-Z]:\/$/i,n$e=eK?t=>r$e.test(t):t=>t==="/";o$e={parts:!0};s$e=/(?t.replace(s$e,"\\$&"),l$e=t=>t.replace(a$e,"\\$&"),u$e=eK?l$e:c$e;f$e=/^(\/?\.\.)+/,p$e=/\\(?=[()[\]{}!*+?@|])/g;y$e={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as iv,readFileSync as b$e,readdirSync as S$e,statSync as nK}from"node:fs";import{join as qc}from"node:path";function w$e(t){let{cwd:e="."}=t,r,n;try{let c=J(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=mi(e,n),o=[],{layers:s,forbiddenImports:a}=jI(r);return s.size>0&&(x$e(e,i,s,o),$$e(e,i,s,o)),a.length>0&&k$e(e,i,a,o),o}function jI(t){let e=new Set,r=[];for(let i of t.layers??[])if(Array.isArray(i))for(let o of i)e.add(o);else{let o=i;if(typeof o.name=="string"&&o.name.length>0){e.add(o.name);for(let s of o.forbidden_imports??[])typeof s=="string"&&r.push({from:o.name,to:s})}}let n=t.forbidden_imports??[];return{layers:e,forbiddenImports:[...n,...r]}}function x$e(t,e,r,n){let i=e.mainRoot,o=qc(t,i);if(iv(o))for(let s of S$e(o)){let a=qc(o,s);nK(a).isDirectory()&&(r.has(s)||n.push({detector:ov,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function $$e(t,e,r,n){let i=e.mainRoot,o=qc(t,i);if(iv(o))for(let s of r){let a=qc(o,s);iv(a)&&nK(a).isDirectory()||n.push({detector:ov,severity:"warn",path:`${i}/${s}/`,message:`spec/architecture.yaml declares layer '${s}' but ${i}/${s}/ does not exist \u2014 fix the spec or create the directory`})}}function k$e(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=qc(t,i,s.from);if(!iv(a))continue;let c=Ho([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=qc(a,l),d;try{d=b$e(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];E$e(p,s.to,e.importStyle)&&n.push({detector:ov,severity:"error",path:`${i}/${s.from}/${l}`,message:`${i}/${s.from}/${l} imports from '${p}' which crosses into the '${s.to}' layer \u2014 spec/architecture.yaml forbids imports from '${s.from}' to '${s.to}'`})}}}}function E$e(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var ov,iK,MI=y(()=>{"use strict";df();lt();zc();ov="ARCHITECTURE_FROM_SPEC";iK={name:ov,run:w$e}});import{existsSync as A$e,readFileSync as T$e}from"node:fs";import{join as O$e}from"node:path";function I$e(t){let{cwd:e="."}=t,r=O$e(e,"spec/capabilities.yaml");if(!A$e(r))return[];let n;try{let c=T$e(r,"utf8"),l=oK.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=J(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:sv,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:sv,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:sv,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var oK,sv,sK,aK=y(()=>{"use strict";oK=$t(rr(),1);lt();sv="CAPABILITIES_FEATURE_MAPPING";sK={name:sv,run:I$e}});import{existsSync as P$e,readFileSync as R$e}from"node:fs";import{join as C$e}from"node:path";function D$e(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function N$e(t){let{cwd:e="."}=t;return pe(e,FI,r=>j$e(r,e))}function j$e(t,e){let r=mi(e,t.project?.language),n=[];for(let i of t.features)for(let o of i.modules??[]){if(!r.extensions.some(c=>o.endsWith(c)))continue;let s=C$e(e,o);if(!P$e(s))continue;let a=R$e(s,"utf8");D$e(a)||n.push({detector:FI,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var FI,cK,lK=y(()=>{"use strict";zc();_t();FI="CONVENTION_DRIFT";cK={name:FI,run:N$e}});import{existsSync as zI,readFileSync as uK}from"node:fs";import{join as av}from"node:path";function M$e(t){return JSON.parse(t).total?.lines?.pct??0}function dK(t){let e=/zI(av(c.dir,d)));if(!l){s.push(c.path);continue}let u=dK(uK(av(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Qi,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=fK(n,i);return a0?[{detector:Qi,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function L$e(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=z$e(e,t.focusModules);if(s)return s}let r=mi(e),n=pt(e).language==="kotlin"?hI.find(s=>zI(av(e,s)))??JV(e):r.coverageSummary,i=av(e,n);if(!zI(i))return[{detector:Qi,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=uK(i,"utf8");o=r.coverageFormat==="jacoco-xml"?F$e(s):M$e(s)}catch(s){return[{detector:Qi,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:Qi,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=cv?[]:[{detector:Qi,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${cv}%`}]}var Qi,cv,pK,mK=y(()=>{"use strict";V_();zc();H_();mn();Qi="COVERAGE_DROP",cv=70;pK={name:Qi,run:L$e}});import{existsSync as U$e}from"node:fs";import{join as q$e}from"node:path";function B$e(t){let{cwd:e="."}=t;return pe(e,lv,r=>H$e(r,e))}function H$e(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?U$e(q$e(e,r.path))?[]:[{detector:lv,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:lv,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var lv,hK,gK=y(()=>{"use strict";_t();lv="DELIVERABLE_INTEGRITY";hK={name:lv,run:B$e}});function Z$e(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:LI,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function G$e(t){let{cwd:e="."}=t;return pe(e,LI,r=>Z$e(r))}var LI,yK,_K=y(()=>{"use strict";_t();LI="SMOKE_PROBE_DEMAND";yK={name:LI,run:G$e}});function V$e(t){let{cwd:e="."}=t;return pe(e,uv,r=>W$e(r,e))}function W$e(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=yc(e);if(n===null)return[{detector:uv,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=Dd(e,o.modules??[]);s!==a&&i.push({detector:uv,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var uv,dv,UI=y(()=>{"use strict";Nd();_t();uv="STALE_ATTESTATION";dv={name:uv,run:V$e}});function K$e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}return J$e(r)}function J$e(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:vK,severity:"error",path:"spec.yaml",message:`circular depends_on cycle: ${h.join(" \u2192 ")} \u2014 these features can never all become ready, so the drive loop deadlocks. Break the cycle by removing one edge.`}))}else p===n&&u(f)}l.pop(),s.set(d,o)}for(let d of r.keys())s.get(d)===n&&u(d);return a}var vK,fv,qI=y(()=>{"use strict";lt();vK="DEPENDENCY_CYCLE";fv={name:vK,run:K$e}});import{appendFileSync as Y$e,existsSync as bK,mkdirSync as X$e,readFileSync as Q$e}from"node:fs";import{dirname as e0e,join as t0e}from"node:path";function SK(t){return t0e(t,r0e,n0e)}function wK(t){return BI.add(t),()=>BI.delete(t)}function sa(t,e){let r=SK(t),n=e0e(r);bK(n)||X$e(n,{recursive:!0}),Y$e(r,`${JSON.stringify(e)} +`,"utf8");for(let i of BI)try{i(t,e)}catch{}}function gn(t){let e=SK(t);if(!bK(e))return[];let r=Q$e(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var r0e,n0e,BI,Ln=y(()=>{"use strict";r0e=".cladding",n0e="audit.log.jsonl";BI=new Set});import{existsSync as i0e}from"node:fs";import{join as o0e}from"node:path";function s0e(t){let{cwd:e="."}=t,r=gn(e);if(r.length===0)return[{detector:HI,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=[];for(let i of r)i.artifact&&(i0e(o0e(e,i.artifact))||n.push({detector:HI,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var HI,xK,$K=y(()=>{"use strict";Ln();HI="EVIDENCE_MISMATCH";xK={name:HI,run:s0e}});import{existsSync as a0e,readFileSync as c0e}from"node:fs";import{join as l0e}from"node:path";function u0e(t){let e=l0e(t,TK);if(!a0e(e))return null;try{let n=((0,AK.parse)(c0e(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*EK(t,e){for(let r of t??[])r.startsWith(kK)&&(yield{ref:r,name:r.slice(kK.length),field:e})}function d0e(t){let{cwd:e="."}=t,r=u0e(e);if(r===null)return[];let n;try{n=J(e)}catch(o){return[{detector:ZI,severity:"info",message:`spec.yaml not loaded: ${o.message}`}]}let i=[];for(let o of n.features)for(let s of o.acceptance_criteria??[]){let a=[...EK(s.evidence_refs,"evidence_refs"),...EK(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:ZI,severity:"warn",path:TK,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var AK,ZI,kK,TK,OK,IK=y(()=>{"use strict";AK=$t(rr(),1);lt();ZI="FIXTURE_REFERENCE_INVALID",kK="fixture:",TK="conformance/fixtures.yaml";OK={name:ZI,run:d0e}});function f0e(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.secret;if(!n)return[{detector:pv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Ve(n.cmd,[...n.args],{cwd:e,reject:!1});return na(i)?[{detector:pv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:K_(i,pv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var pv,mv,GI=y(()=>{"use strict";Ar();mn();hn();pv="HARDCODED_SECRET";mv={name:pv,run:f0e}});import{existsSync as Bc,readFileSync as VI}from"node:fs";import{join as aa}from"node:path";function p0e(t){return Ho(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function ff(t){if(!Bc(t))return null;try{return JSON.parse(VI(t,"utf8"))}catch{return null}}function m0e(t,e){let r=aa(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(VI(r,"utf8"))}catch(c){e.push({detector:eo,severity:"info",message:`plugin.json not loaded: ${c.message}`});return}let i=n.ironclad?.current?.detectors;if(!i)return;let o=i.match(/^(\d+)\/(\d+)$/);if(!o){e.push({detector:eo,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=p0e(t);s!==a&&e.push({detector:eo,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function h0e(t,e){for(let r of PK){let n=aa(t,r.path);if(!Bc(n))continue;let i=ff(n);if(!i){e.push({detector:eo,severity:"warn",message:`${r.host}: ${r.path} could not be parsed as JSON`});continue}for(let o of r.required)(i[o]===void 0||i[o]===null||i[o]==="")&&e.push({detector:eo,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function g0e(t,e){let r=ff(aa(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of PK){let s=aa(t,o.path);if(!Bc(s))continue;let a=ff(s);a?.version&&a.version!==n&&e.push({detector:eo,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=aa(t,".claude-plugin","marketplace.json");if(Bc(i)){let o=ff(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:eo,severity:"error",message:`marketplace: .claude-plugin/marketplace.json plugin '${s.name??"?"}' version='${s.version}' but package.json version='${n}' \u2014 the catalog advertises a stale version; bump it in lockstep`})}}function y0e(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function _0e(t,e){let r=aa(t,"src","cli","clad.ts"),n=aa(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Bc(r)||!Bc(n))return;let i=y0e(VI(r,"utf8"));if(i.length===0)return;let s=ff(n)?.ironclad?.current?.["stages-implemented"];if(!Array.isArray(s))return;let a=new Set(i),c=new Set(s),l=i.filter(f=>!c.has(f)),u=s.filter(f=>!a.has(f));if(l.length===0&&u.length===0)return;let d=[l.length?`missing [${l.join(", ")}]`:"",u.length?`unexpected [${u.join(", ")}]`:""].filter(Boolean).join("; ");e.push({detector:eo,severity:"error",message:`plugins/claude-code/.claude-plugin/plugin.json stages-implemented disagrees with TIER_STAGES.all (src/cli/clad.ts): ${d} \u2014 run \`npm run build:plugin\` to re-derive`})}function v0e(t){let{cwd:e="."}=t,r=[];return m0e(e,r),_0e(e,r),h0e(e,r),g0e(e,r),r}var eo,PK,RK,CK=y(()=>{"use strict";df();eo="HARNESS_INTEGRITY",PK=[{host:"claude-code",path:"plugins/claude-code/.claude-plugin/plugin.json",required:["name","version"]},{host:"codex",path:"plugins/codex/.codex-plugin/plugin.json",required:["name","version","description"]},{host:"gemini-cli",path:"plugins/gemini-cli/gemini-extension.json",required:["name","version"]}];RK={name:eo,run:v0e}});import{existsSync as b0e,readFileSync as S0e}from"node:fs";import{join as w0e}from"node:path";function $0e(t){let{cwd:e="."}=t;return pe(e,hv,r=>A0e(r,e))}function k0e(){return x0e}function E0e(t){let e=w0e(t,"spec/capabilities.yaml");if(!b0e(e))return!1;try{let r=DK.default.parse(S0e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function A0e(t,e){let r=t.features.length;if(r{"use strict";DK=$t(rr(),1);_t();hv="HOLLOW_GOVERNANCE",x0e=8;NK={name:hv,run:$0e}});function T0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];return MK(r.features.map(i=>i.id),"feature","spec/features/",n),MK((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function MK(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:FK,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var FK,zK,LK=y(()=>{"use strict";lt();FK="ID_COLLISION";zK={name:FK,run:T0e}});import{existsSync as pf,readFileSync as WI,readdirSync as KI,statSync as O0e,writeFileSync as qK}from"node:fs";import{join as to}from"node:path";function UK(t){if(!pf(t))return 0;try{return KI(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function I0e(t){if(!pf(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=KI(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=to(n,o),a;try{a=O0e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function P0e(t){let e=to(t,"spec","capabilities.yaml");if(!pf(e))return 0;try{let r=gv.default.parse(WI(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Zo(t="."){let e=UK(to(t,"spec","features")),r=UK(to(t,"spec","scenarios")),n=P0e(t),i=I0e(to(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function Hc(t,e){let r=to(t,"spec.yaml");if(!pf(r))return;let n=WI(r,"utf8"),i=R0e(n,e);i!==n&&qK(r,i)}function R0e(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`,` last_synced: ${JSON.stringify(e.last_synced??"")}`],s=d=>r===`\r @@ -249,20 +249,20 @@ ${o.join(` `)}let a=i;a>0&&/Auto-maintained by `clad sync`/.test(n[a-1])&&(a-=1);let c=i+1;for(;ci+1);)c++;let l=n.slice(0,a),u=n.slice(c);for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();return l.push(""),s([...l,...o,"",...u.filter((d,f)=>!(f===0&&d.trim()===""))].join(` `).replace(/\n{3,}/g,` -`))}function aa(t="."){let e=to(t,"spec","features");if(!ff(e))return!1;let r=[];for(let i of VI(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,mv.parse)(GI(to(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` +`))}function ca(t="."){let e=to(t,"spec","features");if(!pf(e))return!1;let r=[];for(let i of KI(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,gv.parse)(WI(to(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` -`;return zK(to(t,"spec","index.yaml"),n,"utf8"),!0}var mv,pf=y(()=>{"use strict";mv=$t(rr(),1)});import{existsSync as LK,readFileSync as UK,readdirSync as T0e}from"node:fs";import{join as WI}from"node:path";function O0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=Ho(e),i=r.inventory;if(!i){let s=qK.filter(([c])=>(n[c]??0)>0);if(s.length===0)return KI(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...KI(e),{detector:mf,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of qK){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:mf,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...KI(e)),o}function KI(t){let e=WI(t,"spec","index.yaml"),r=WI(t,"spec","features");if(!LK(e)||!LK(r))return[];let n=new Map;try{for(let l of UK(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of T0e(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=UK(WI(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:mf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:mf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var mf,qK,BK,HK=y(()=>{"use strict";pf();lt();mf="INVENTORY_DRIFT",qK=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];BK={name:mf,run:O0e}});import{existsSync as I0e,readFileSync as P0e}from"node:fs";import{join as R0e}from"node:path";function D0e(t){let{cwd:e="."}=t,r=R0e(e,"src","spec","schema.json"),n=[];if(I0e(r)){let i;try{i=JSON.parse(P0e(r,"utf8"))}catch(o){n.push({detector:hf,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of C0e)i.required?.includes(o)||n.push({detector:hf,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:hf,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=J(e);i.schema!==ZK&&n.push({detector:hf,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${ZK}'`})}catch{}return n}var hf,C0e,ZK,GK,VK=y(()=>{"use strict";lt();hf="META_INTEGRITY",C0e=["schema","project","features"],ZK="0.1";GK={name:hf,run:D0e}});function N0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];return WK(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),WK((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function WK(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:KK,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var KK,JK,YK=y(()=>{"use strict";lt();KK="SLUG_CONFLICT";JK={name:KK,run:N0e}});import{existsSync as j0e}from"node:fs";import{join as M0e}from"node:path";function F0e(t){let{cwd:e="."}=t;return pe(e,JI,r=>z0e(r,e))}function z0e(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=M0e(e,i);j0e(o)||r.push({detector:JI,severity:"error",path:i,message:`feature ${n.id} declares module '${i}' but the file does not exist`})}return r}var JI,hv,YI=y(()=>{"use strict";_t();JI="MISSING_IMPLEMENTATION";hv={name:JI,run:F0e}});function L0e(t){let{cwd:e="."}=t;return pe(e,XI,U0e)}function U0e(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:XI,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var XI,gv,QI=y(()=>{"use strict";_t();XI="MISSING_TESTS";gv={name:XI,run:L0e}});import{existsSync as q0e,readFileSync as B0e}from"node:fs";import{join as XK}from"node:path";function QK(t){if(q0e(t))try{return JSON.parse(B0e(t,"utf8"))}catch{return}}function V0e(t){let{cwd:e="."}=t,r=QK(XK(e,H0e)),n=QK(XK(e,Z0e));if(!r||!n)return[{detector:eP,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>G0e&&i.push({detector:eP,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var eP,H0e,Z0e,G0e,e3,t3=y(()=>{"use strict";eP="PERFORMANCE_DRIFT",H0e="perf/baseline.json",Z0e="perf/current.json",G0e=10;e3={name:eP,run:V0e}});import{existsSync as W0e}from"node:fs";import{join as K0e}from"node:path";function Y0e(t){let{cwd:e="."}=t;return pe(e,tP,r=>eke(r,e))}function X0e(){return J0e}function Q0e(t,e){return(t.modules??[]).some(r=>W0e(K0e(e,r)))}function eke(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||Q0e(s,e)||r.push(s.id);let n=X0e();if(r.length<=n)return[];let i=r.slice(0,r3).join(", "),o=r.length>r3?", \u2026":"";return[{detector:tP,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var tP,J0e,r3,n3,i3=y(()=>{"use strict";_t();tP="PLANNED_BACKLOG",J0e=5,r3=8;n3={name:tP,run:Y0e}});import{existsSync as tke,readFileSync as rke}from"node:fs";import{join as nke}from"node:path";function ske(t){let{cwd:e="."}=t;return pe(e,rP,r=>cke(r,e))}function ake(){return ike}function cke(t,e){if(t.features.lengthn.includes(i))?[{detector:rP,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Refine it with \`clad refine\` or by hand.`}]:[]}var rP,ike,oke,o3,s3=y(()=>{"use strict";_t();rP="PROJECT_CONTEXT_DRIFT",ike=8,oke=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];o3={name:rP,run:ske}});function a3(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:yv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function lke(t){let{cwd:e="."}=t;return pe(e,yv,uke)}function uke(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...a3(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:yv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...a3(e,n.features,`scenario ${n.id}.features`));return r}var yv,_v,nP=y(()=>{"use strict";_t();yv="REFERENCE_INTEGRITY";_v={name:yv,run:lke}});import{existsSync as dke,readdirSync as fke,readFileSync as pke,statSync as mke,writeFileSync as hke}from"node:fs";import{dirname as gke,join as gf,normalize as yke,relative as _ke}from"node:path";function xke(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function c3(t){return t.split("\\").join("/")}function $ke(t){return vke.some(e=>t===e||t.startsWith(`${e}/`))}function kke(t){let e=gf(t,"docs");if(!dke(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=fke(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=gf(i,s),c;try{c=mke(a)}catch{continue}let l=c3(_ke(t,a));$ke(l)||(c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l))}}return r.sort()}function Eke(t,e){if(/^[a-z]+:/i.test(e))return null;let r=yke(gf(gke(t),e));return c3(r)}function yf(t="."){let e=[];for(let r of kke(t)){let n;try{n=pke(gf(t,r),"utf8")}catch{continue}let i=n.includes(bke),o=xke(n),s=i?[]:[...new Set(o.match(Ske)??[])].sort(),a=new Set;for(let c of o.matchAll(wke)){let l=Eke(r,c[1]);l&&a.add(l)}e.push({doc:r,features:s,doc_links:[...a].sort()})}return{docs:e}}function l3(t="."){let e=yf(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return hke(gf(t,"spec","_doc-links.yaml"),`${r.join(` +`;return qK(to(t,"spec","index.yaml"),n,"utf8"),!0}var gv,mf=y(()=>{"use strict";gv=$t(rr(),1)});import{existsSync as BK,readFileSync as HK,readdirSync as C0e}from"node:fs";import{join as JI}from"node:path";function D0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=Zo(e),i=r.inventory;if(!i){let s=ZK.filter(([c])=>(n[c]??0)>0);if(s.length===0)return YI(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...YI(e),{detector:hf,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of ZK){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:hf,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...YI(e)),o}function YI(t){let e=JI(t,"spec","index.yaml"),r=JI(t,"spec","features");if(!BK(e)||!BK(r))return[];let n=new Map;try{for(let l of HK(e,"utf8").split(` +`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of C0e(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=HK(JI(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:hf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:hf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var hf,ZK,GK,VK=y(()=>{"use strict";mf();lt();hf="INVENTORY_DRIFT",ZK=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];GK={name:hf,run:D0e}});import{existsSync as N0e,readFileSync as j0e}from"node:fs";import{join as M0e}from"node:path";function z0e(t){let{cwd:e="."}=t,r=M0e(e,"src","spec","schema.json"),n=[];if(N0e(r)){let i;try{i=JSON.parse(j0e(r,"utf8"))}catch(o){n.push({detector:gf,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of F0e)i.required?.includes(o)||n.push({detector:gf,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:gf,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=J(e);i.schema!==WK&&n.push({detector:gf,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${WK}'`})}catch{}return n}var gf,F0e,WK,KK,JK=y(()=>{"use strict";lt();gf="META_INTEGRITY",F0e=["schema","project","features"],WK="0.1";KK={name:gf,run:z0e}});function L0e(t){let{cwd:e="."}=t,r;try{r=J(e)}catch{return[]}let n=[];return YK(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),YK((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function YK(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:XK,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var XK,QK,e3=y(()=>{"use strict";lt();XK="SLUG_CONFLICT";QK={name:XK,run:L0e}});import{existsSync as U0e}from"node:fs";import{join as q0e}from"node:path";function B0e(t){let{cwd:e="."}=t;return pe(e,XI,r=>H0e(r,e))}function H0e(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=q0e(e,i);U0e(o)||r.push({detector:XI,severity:"error",path:i,message:`feature ${n.id} declares module '${i}' but the file does not exist`})}return r}var XI,yv,QI=y(()=>{"use strict";_t();XI="MISSING_IMPLEMENTATION";yv={name:XI,run:B0e}});function Z0e(t){let{cwd:e="."}=t;return pe(e,eP,G0e)}function G0e(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:eP,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var eP,_v,tP=y(()=>{"use strict";_t();eP="MISSING_TESTS";_v={name:eP,run:Z0e}});import{existsSync as V0e,readFileSync as W0e}from"node:fs";import{join as t3}from"node:path";function r3(t){if(V0e(t))try{return JSON.parse(W0e(t,"utf8"))}catch{return}}function X0e(t){let{cwd:e="."}=t,r=r3(t3(e,K0e)),n=r3(t3(e,J0e));if(!r||!n)return[{detector:rP,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>Y0e&&i.push({detector:rP,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var rP,K0e,J0e,Y0e,n3,i3=y(()=>{"use strict";rP="PERFORMANCE_DRIFT",K0e="perf/baseline.json",J0e="perf/current.json",Y0e=10;n3={name:rP,run:X0e}});import{existsSync as Q0e}from"node:fs";import{join as eke}from"node:path";function rke(t){let{cwd:e="."}=t;return pe(e,nP,r=>oke(r,e))}function nke(){return tke}function ike(t,e){return(t.modules??[]).some(r=>Q0e(eke(e,r)))}function oke(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||ike(s,e)||r.push(s.id);let n=nke();if(r.length<=n)return[];let i=r.slice(0,o3).join(", "),o=r.length>o3?", \u2026":"";return[{detector:nP,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var nP,tke,o3,s3,a3=y(()=>{"use strict";_t();nP="PLANNED_BACKLOG",tke=5,o3=8;s3={name:nP,run:rke}});import{existsSync as ske,readFileSync as ake}from"node:fs";import{join as cke}from"node:path";function dke(t){let{cwd:e="."}=t;return pe(e,iP,r=>pke(r,e))}function fke(){return lke}function pke(t,e){if(t.features.lengthn.includes(i))?[{detector:iP,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Refine it with \`clad refine\` or by hand.`}]:[]}var iP,lke,uke,c3,l3=y(()=>{"use strict";_t();iP="PROJECT_CONTEXT_DRIFT",lke=8,uke=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];c3={name:iP,run:dke}});function u3(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:vv,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function mke(t){let{cwd:e="."}=t;return pe(e,vv,hke)}function hke(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...u3(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:vv,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...u3(e,n.features,`scenario ${n.id}.features`));return r}var vv,bv,oP=y(()=>{"use strict";_t();vv="REFERENCE_INTEGRITY";bv={name:vv,run:mke}});import{existsSync as gke,readdirSync as yke,readFileSync as _ke,statSync as vke,writeFileSync as bke}from"node:fs";import{dirname as Ske,join as yf,normalize as wke,relative as xke}from"node:path";function Tke(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function d3(t){return t.split("\\").join("/")}function Oke(t){return $ke.some(e=>t===e||t.startsWith(`${e}/`))}function Ike(t){let e=yf(t,"docs");if(!gke(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=yke(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=yf(i,s),c;try{c=vke(a)}catch{continue}let l=d3(xke(t,a));Oke(l)||(c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l))}}return r.sort()}function Pke(t,e){if(/^[a-z]+:/i.test(e))return null;let r=wke(yf(Ske(t),e));return d3(r)}function _f(t="."){let e=[];for(let r of Ike(t)){let n;try{n=_ke(yf(t,r),"utf8")}catch{continue}let i=n.includes(kke),o=Tke(n),s=i?[]:[...new Set(o.match(Eke)??[])].sort(),a=new Set;for(let c of o.matchAll(Ake)){let l=Pke(r,c[1]);l&&a.add(l)}e.push({doc:r,features:s,doc_links:[...a].sort()})}return{docs:e}}function f3(t="."){let e=_f(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return bke(yf(t,"spec","_doc-links.yaml"),`${r.join(` `)} -`,"utf8"),!0}var vke,bke,Ske,wke,vv=y(()=>{"use strict";vke=["docs/ab-evaluation","docs/ab-evaluation-extended","docs/dogfood","docs/benchmarks"],bke="clad-doc-links: ignore",Ske=/\bF-[0-9a-f]{6,8}\b/g,wke=/\]\(\s*([^)\s]+?\.md)(?:#[^)]*)?\s*\)/g});import{existsSync as Ake}from"node:fs";import{join as Tke}from"node:path";function Oke(t){let{cwd:e="."}=t;return pe(e,bv,r=>Ike(r,e))}function Ike(t,e){let r=new Set((t.features??[]).map(i=>i.id)),n=[];for(let i of yf(e).docs){for(let o of i.doc_links)Ake(Tke(e,o))||n.push({detector:bv,severity:"error",path:i.doc,message:`doc '${i.doc}' links to missing file '${o}'`});for(let o of i.features)r.has(o)||n.push({detector:bv,severity:"warn",path:i.doc,message:`doc '${i.doc}' references unknown feature '${o}' \u2014 archived/renamed? If it is an illustrative example, add a \`clad-doc-links: ignore\` marker to the doc.`})}return n}var bv,Sv,iP=y(()=>{"use strict";vv();_t();bv="DOC_LINK_INTEGRITY";Sv={name:bv,run:Oke}});function Rke(t){let{cwd:e="."}=t;return pe(e,_f,r=>Dke(r))}function Cke(){return Pke}function Dke(t){let e=[],r=t.features.length,n=t.scenarios??[];r>=Cke()&&n.length===0&&e.push({detector:_f,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let o of n)(o.features??[]).length===0&&e.push({detector:_f,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let i=new Map(t.features.filter(o=>typeof o.slug=="string"&&o.slug.length>0).map(o=>[o.slug,o.id]));for(let o of n){if(!o.flow)continue;let s=new Set(o.features??[]),a=new Map;for(let c of o.flow.matchAll(/\(([^)]+)\)/g))for(let l of c[1].split(/[,/·]/)){let u=l.trim(),d=i.get(u);d&&!s.has(d)&&a.set(u,d)}if(a.size>0){let c=[...a].map(([l,u])=>`${l} (${u})`).join(", ");e.push({detector:_f,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} flow references ${c} but features[] does not bind ${a.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var _f,Pke,u3,d3=y(()=>{"use strict";_t();_f="SCENARIO_COVERAGE",Pke=8;u3={name:_f,run:Rke}});import{createHash as Nke}from"node:crypto";function jke(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function vf(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??f3),sample:jke(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(f3),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function bf(t){return(t.features??[]).filter(e=>e.status==="done").length}function Mke(t,e){return e<=0?!1:e>=1?!0:parseInt(Nke("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var f3,wv=y(()=>{"use strict";f3=["unwanted"]});import{existsSync as Fke,readdirSync as zke}from"node:fs";import{join as m3}from"node:path";import h3 from"node:process";function Lke(t){let e=!1,r=n=>{for(let i of zke(n,{withFileTypes:!0})){if(e)return;let o=m3(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function oP(t={}){let{cwd:e="."}=t,r=m3(e,Zo);if(!Fke(r)||!Lke(r))return{stage:xv,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${Zo}/ \u2014 skipped`};let n=pt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:xv,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o=Qe(i.cmd,[...i.args,Zo],{cwd:e,reject:!1}),s=Ft(xv,i.cmd,o);return s||nr(xv,o)}var xv,Zo,Uke,sP=y(()=>{"use strict";Ar();mn();hn();xv="stage_2.3",Zo="tests/oracle";Uke=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${h3.argv[1]}`;if(Uke){let t=oP();console.log(JSON.stringify(t)),h3.exit(t.exitCode)}});import{existsSync as qke}from"node:fs";import{join as Bke}from"node:path";function Hke(t){let{cwd:e="."}=t;return pe(e,Un,r=>Zke(r,e))}function Zke(t,e){let r=[],n=vf(t.project,bf(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?gn(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(Sf(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:Un,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${Zo}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!qke(Bke(e,f))){r.push({detector:Un,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${Zo}/`)||r.push({detector:Un,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${Zo}/ \u2014 stage_2.3 only runs ${Zo}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:Un,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:Un,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:Un,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad drive history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:Un,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:Un,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:Un,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var Un,g3,y3=y(()=>{"use strict";Ln();wv();sP();_t();Un="SPEC_CONFORMANCE";g3={name:Un,run:Hke}});function Gke(t){let{cwd:e="."}=t,r=gn(e);if(r.length===0)return[{detector:aP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>_3&&i.push({detector:aP,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${_3})`})}return i}var aP,_3,v3,b3=y(()=>{"use strict";Ln();aP="STALE_EVIDENCE",_3=90;v3={name:aP,run:Gke}});import{existsSync as S3}from"node:fs";import{join as w3}from"node:path";function Vke(t){let{cwd:e="."}=t;return pe(e,Hc,r=>Wke(r,e))}function Wke(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Hc,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Hc,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>S3(w3(e,o)));i.length>0&&r.push({detector:Hc,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}(n.status==="planned"||n.status==="in_progress")&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>S3(w3(e,i)))&&r.push({detector:Hc,severity:"warn",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) but none exist on disk \u2014 consider archiving`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:"all declared modules vanished from disk"}}})}return r}var Hc,$v,cP=y(()=>{"use strict";_t();Hc="STALE_SPECIFICATION";$v={name:Hc,run:Vke}});import{existsSync as x3,statSync as $3}from"node:fs";import{join as k3}from"node:path";function Jke(t,e){let r=0;for(let n of e){let i=k3(t,n);if(!x3(i))continue;let o=$3(i).mtimeMs;o>r&&(r=o)}return r}function Yke(t){let{cwd:e="."}=t;return pe(e,lP,r=>Xke(r,e))}function Xke(t,e){let r=mi(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=Jke(e,n);if(i===0)return[];let o=Bo([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=k3(e,a);if(!x3(c))continue;let l=$3(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>Kke&&s.push({detector:lP,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var lP,Kke,kv,uP=y(()=>{"use strict";uf();Fc();_t();lP="STALE_TESTS",Kke=30;kv={name:lP,run:Yke}});import{existsSync as Qke}from"node:fs";import{join as eEe}from"node:path";function tEe(t){let{cwd:e="."}=t;return pe(e,wf,r=>rEe(r,e))}function rEe(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:wf,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!Qke(eEe(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:wf,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:wf,severity:"warn",message:`feature ${n.id} status='in_progress' but every declared module is missing \u2014 likely a stale start`}))}return r}var wf,Ev,dP=y(()=>{"use strict";_t();wf="STATUS_DRIFT";Ev={name:wf,run:tEe}});function nEe(t){let{cwd:e="."}=t;return pe(e,Av,r=>iEe(r,e))}function iEe(t,e){let r=pt(e).language;return r==="unknown"?[{detector:Av,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:Av,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var Av,E3,A3=y(()=>{"use strict";mn();_t();Av="TECH_STACK_MISMATCH";E3={name:Av,run:nEe}});function cEe(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function lEe(t){let{cwd:e="."}=t;return pe(e,fP,r=>uEe(r,e))}function uEe(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=Bo([...cEe(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:fP,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var fP,T3,oEe,sEe,aEe,Tv,pP=y(()=>{"use strict";uf();NI();_t();fP="UNMAPPED_ARTIFACT",T3=["src/stages/**/*.ts","src/spec/**/*.ts"],oEe={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},sEe={kotlin:"src/main/kotlin"},aEe=8;Tv={name:fP,run:lEe}});import{existsSync as O3}from"node:fs";import{join as I3}from"node:path";function fEe(t){return dEe.some(e=>t.startsWith(e))}function pEe(t){let{cwd:e="."}=t;return pe(e,mP,r=>mEe(r,e))}function mEe(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(fEe(o))continue;let s=o.split("#",1)[0];O3(I3(e,o))||s&&O3(I3(e,s))||r.push({detector:mP,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: +`}function KS(t){return`${JSON.stringify(t,null,2)} +`}function oX(t){let e=new Map(t.nodes.map(s=>[s.id,s])),r=new Map,n=new Map;for(let s of t.edges)(r.get(s.from)??r.set(s.from,[]).get(s.from)).push({other:s.to,kind:s.kind}),(n.get(s.to)??n.set(s.to,[]).get(s.to)).push({other:s.from,kind:s.kind});let i=s=>{let a=e.get(s);return a?`[[${tX(a)}|${a.label}]]`:`[[${s}]]`},o=new Map;for(let s of t.nodes){let a=["---",`kind: ${s.kind}`,...s.tier?[`tier: ${s.tier}`]:[],...s.status?[`status: ${s.status}`]:[],`id: ${JSON.stringify(s.id)}`,"---",`# ${s.label}`,""],c=(r.get(s.id)??[]).slice().sort(rX);if(c.length>0){a.push("## Links");for(let u of c)a.push(`- ${u.kind} \u2192 ${i(u.other)}`);a.push("")}let l=(n.get(s.id)??[]).slice().sort(rX);if(l.length>0){a.push("## Backlinks");for(let u of l)a.push(`- ${i(u.other)} \u2192 ${u.kind}`);a.push("")}o.set(`${s.kind}/${tX(s)}.md`,`${a.join(` +`)}`)}return o}function rX(t,e){return t.kind.localeCompare(e.kind)||t.other.localeCompare(e.other)}import{readFileSync as _Ne}from"node:fs";import{dirname as vNe,join as eD}from"node:path";import{fileURLToPath as bNe}from"node:url";var tD=vNe(bNe(import.meta.url));function sX(t){for(let e of[eD(tD,"viewer",t),eD(tD,"..","graph","viewer",t),eD(tD,"..","..","dist","viewer",t)])try{return _Ne(e,"utf8")}catch{}throw new Error(`cladding: viewer asset not found: ${t}`)}function aX(t){return JSON.stringify(t).replace(/0?` `:"";return` @@ -699,21 +699,21 @@ ${r} ${o} -`}LI();iP();YI();QI();nP();zI();uP();dP();pP();hP();Cp();var gNe=[gv,Ov,hv,Tv,_v,Sv,uv,Ev,kv,lv],yNe=/\bF-(?:\d{3,}|[a-f0-9]{6,8})\b/;function _Ne(t,e){if(t.path){let n=t.path.split("#")[0].trim();for(let i of[Fe.module(n),Fe.test(n),Fe.doc(n)])if(e.has(i))return i}let r=yNe.exec(t.message??"");return r&&e.has(Fe.feature(r[0]))?Fe.feature(r[0]):null}function KS(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};for(let o of gNe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s){if(a.severity!=="error"&&a.severity!=="warn")continue;let c=_Ne(a,r);if(!c)continue;let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}function oX(t,e=10){let r={};for(let s of t.nodes)r[s.kind]=(r[s.kind]??0)+1;let n={},i=new Map;for(let s of t.edges)n[s.kind]=(n[s.kind]??0)+1,i.set(s.from,(i.get(s.from)??0)+1),i.set(s.to,(i.get(s.to)??0)+1);let o=t.nodes.map(s=>({id:s.id,kind:s.kind,label:s.label,degree:i.get(s.id)??0})).sort((s,a)=>a.degree-s.degree||s.id.localeCompare(a.id)).slice(0,e);return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodesByKind:r,edgesByKind:n,hubs:o}}function sX(t){let e=n=>Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join(" ");return`${[`nodes: ${t.nodeCount} (${e(t.nodesByKind)})`,`edges: ${t.edgeCount} (${e(t.edgesByKind)})`,"hubs (top by degree):",...t.hubs.map((n,i)=>` ${String(i+1).padStart(2)}. [${n.kind}] ${n.label} \u2014 degree ${n.degree}`)].join(` +`}qI();sP();QI();tP();oP();UI();fP();pP();hP();yP();Dp();var SNe=[_v,Pv,yv,Iv,bv,xv,fv,Tv,Av,dv],wNe=/\bF-(?:\d{3,}|[a-f0-9]{6,8})\b/;function xNe(t,e){if(t.path){let n=t.path.split("#")[0].trim();for(let i of[Fe.module(n),Fe.test(n),Fe.doc(n)])if(e.has(i))return i}let r=wNe.exec(t.message??"");return r&&e.has(Fe.feature(r[0]))?Fe.feature(r[0]):null}function YS(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};for(let o of SNe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s){if(a.severity!=="error"&&a.severity!=="warn")continue;let c=xNe(a,r);if(!c)continue;let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}function cX(t,e=10){let r={};for(let s of t.nodes)r[s.kind]=(r[s.kind]??0)+1;let n={},i=new Map;for(let s of t.edges)n[s.kind]=(n[s.kind]??0)+1,i.set(s.from,(i.get(s.from)??0)+1),i.set(s.to,(i.get(s.to)??0)+1);let o=t.nodes.map(s=>({id:s.id,kind:s.kind,label:s.label,degree:i.get(s.id)??0})).sort((s,a)=>a.degree-s.degree||s.id.localeCompare(a.id)).slice(0,e);return{nodeCount:t.nodes.length,edgeCount:t.edges.length,nodesByKind:r,edgesByKind:n,hubs:o}}function lX(t){let e=n=>Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join(" ");return`${[`nodes: ${t.nodeCount} (${e(t.nodesByKind)})`,`edges: ${t.edgeCount} (${e(t.edgesByKind)})`,"hubs (top by degree):",...t.hubs.map((n,i)=>` ${String(i+1).padStart(2)}. [${n.kind}] ${n.label} \u2014 degree ${n.degree}`)].join(` `)} -`}lt();No();function aX(t={}){try{let e=t.format??"mermaid",r=J(),n=Ea(r,".");if(t.focus){let o=HS(r,n,t.focus);if(!o){H("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let s=t.depth!==void 0?Number(t.depth):1/0;n=BS(n,o,s)}if(e==="obsidian"){let o=t.out??".cladding/graph",s=rX(n);for(let[a,c]of s){let l=vNe(o,a);eD(rD(l),{recursive:!0}),tD(l,c,"utf8")}H("pass","graph",`wrote ${s.size} note(s) to ${o} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(e==="html"){if(!t.out){H("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let o=WS(n,KS(n,"."));eD(rD(t.out),{recursive:!0}),tD(t.out,o,"utf8"),H("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let i=e==="dot"?tX(n):e==="json"?VS(n):eX(n);t.out?(eD(rD(t.out),{recursive:!0}),tD(t.out,i,"utf8"),H("pass","graph",`wrote ${e} graph to ${t.out}`),process.exit(0)):process.stdout.write(i,()=>process.exit(0))}catch(e){H("fail","graph",e.message),process.exit(1)}}function cX(){try{let t=Ea(J(),".");process.stdout.write(sX(oX(t)),()=>process.exit(0))}catch(t){H("fail","graph",t.message),process.exit(1)}}Cp();import{createServer as bNe}from"node:http";import{existsSync as SNe,watch as wNe}from"node:fs";import{join as xNe}from"node:path";lt();No();function $Ne(t={}){let e=t.cwd??".",r=new Set,n=()=>Ea(J(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh +`}lt();jo();function uX(t={}){try{let e=t.format??"mermaid",r=J(),n=Aa(r,".");if(t.focus){let o=GS(r,n,t.focus);if(!o){H("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let s=t.depth!==void 0?Number(t.depth):1/0;n=ZS(n,o,s)}if(e==="obsidian"){let o=t.out??".cladding/graph",s=oX(n);for(let[a,c]of s){let l=$Ne(o,a);rD(iD(l),{recursive:!0}),nD(l,c,"utf8")}H("pass","graph",`wrote ${s.size} note(s) to ${o} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(e==="html"){if(!t.out){H("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let o=JS(n,YS(n,"."));rD(iD(t.out),{recursive:!0}),nD(t.out,o,"utf8"),H("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let i=e==="dot"?iX(n):e==="json"?KS(n):nX(n);t.out?(rD(iD(t.out),{recursive:!0}),nD(t.out,i,"utf8"),H("pass","graph",`wrote ${e} graph to ${t.out}`),process.exit(0)):process.stdout.write(i,()=>process.exit(0))}catch(e){H("fail","graph",e.message),process.exit(1)}}function dX(){try{let t=Aa(J(),".");process.stdout.write(lX(cX(t)),()=>process.exit(0))}catch(t){H("fail","graph",t.message),process.exit(1)}}Dp();import{createServer as kNe}from"node:http";import{existsSync as ENe,watch as ANe}from"node:fs";import{join as TNe}from"node:path";lt();jo();function ONe(t={}){let e=t.cwd??".",r=new Set,n=()=>Aa(J(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh -`)}catch{r.delete(u)}},o=bNe((u,d)=>{let f=(u.url??"/").split("?")[0];try{if(f==="/graph.json"){d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(VS(n()));return}if(f==="/health.json"){d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(JSON.stringify(KS(n(),e)));return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected +`)}catch{r.delete(u)}},o=kNe((u,d)=>{let f=(u.url??"/").split("?")[0];try{if(f==="/graph.json"){d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(KS(n()));return}if(f==="/health.json"){d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(JSON.stringify(YS(n(),e)));return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected -`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(WS(n()));return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(p){d.headersSent||d.writeHead(500,{"Content-Type":"text/plain"});try{d.end(p.message)}catch{}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=xNe(e,u);if(SNe(d))try{c.push(wNe(d,{recursive:!0},a))}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive +`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(JS(n()));return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(p){d.headersSent||d.writeHead(500,{"Content-Type":"text/plain"});try{d.end(p.message)}catch{}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=TNe(e,u);if(ENe(d))try{c.push(ANe(d,{recursive:!0},a))}catch{}}let l=setInterval(()=>{for(let u of r)try{u.write(`: keep-alive -`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise(u=>{o.listen(t.port??0,"127.0.0.1",()=>{let d=o.address(),f=typeof d=="object"&&d?d.port:t.port??0;u({port:f,broadcast:i,close:()=>new Promise(p=>{s&&clearTimeout(s),clearInterval(l);for(let m of c)try{m.close()}catch{}for(let m of r)try{m.end()}catch{}r.clear(),o.close(()=>p()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function lX(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await $Ne({port:e,cwd:t.cwd??"."});H("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){H("fail","graph",r.message),process.exit(1)}}var kNe=["stage_1.1","stage_2.1","stage_2.3"];function ENe(t){return(t.features??[]).filter(e=>e.status==="done")}function ANe(t,e){let r=ENe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function uX(t,e){let r=[];for(let n of kNe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=ANe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}J_();import dX from"node:process";function TNe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function JS(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=TNe(n,t);i.pass||r.push(i)}return r}Ln();var nD="stage_4.1";function iD(t={}){let{cwd:e="."}=t,r=gn(e);if(r.length===0)return{stage:nD,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=JS(r);if(n.length===0)return{stage:nD,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:nD,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var ONe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${dX.argv[1]}`;if(ONe){let t=iD();console.log(JSON.stringify(t)),dX.exit(t.exitCode)}Ar();import fX from"node:process";var YS="stage_1.4";function oD(t={}){let{cwd:e="."}=t,r;try{r=Qe("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:YS,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:YS,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:YS,pass:!0,exitCode:0}:{stage:YS,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var INe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${fX.argv[1]}`;if(INe){let t=oD();console.log(JSON.stringify(t)),fX.exit(t.exitCode)}Ar();Dp();hn();import pX from"node:process";var XS="stage_2.2";function sD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=ns("coverage",t))}catch(a){return{stage:XS,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:XS,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=Qe(r,[...n],{cwd:e,reject:!1}),s=Ft(XS,r,o);return s||nr(XS,o)}var CNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${pX.argv[1]}`;if(CNe){let t=sD();console.log(JSON.stringify(t)),pX.exit(t.exitCode)}Pv();aD();Ar();mn();hn();import hX from"node:process";var ew="stage_3.2";function cD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:ew,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Mc(e,o[o.length-1]))return{stage:ew,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=Qe(i,[...o],{cwd:e,reject:!1}),a=Ft(ew,i,s);return a||nr(ew,s)}var NNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hX.argv[1]}`;if(NNe){let t=cD();console.log(JSON.stringify(t)),hX.exit(t.exitCode)}Ar();lt();hn();import{existsSync as jNe}from"node:fs";import{resolve as gX}from"node:path";import yX from"node:process";var Gt="stage_2.4",_X=5e3;function lD(t={}){let{cwd:e="."}=t,r,n=[],i=!1;try{let f=J(e);r=f.project.deliverable,n=f.project.smoke??[],i=f.features.some(p=>p.status==="done")}catch{return{stage:Gt,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return MNe(e,n[0],i);if(!r)return{stage:Gt,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:Gt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:Gt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let o=gX(e,r.path);if(!jNe(o))return{stage:Gt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let s=r.timeout_ms??_X,a;try{a=Qe(o,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:s})}catch(f){a=f}let c=Ft(Gt,r.path,a);if(c)return c;if(a.timedOut)return{stage:Gt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${s}ms (hung or too slow)`};let l=r.expect_exit??0,u=a.exitCode??1;if(u===l)return{stage:Gt,pass:!0,exitCode:0,disposition:"liveness"};let d=String(a.stderr??"").trim()||String(a.stdout??"").trim();return{stage:Gt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${u}, expected ${l}${d?` \u2014 ${d.slice(0,200)}`:""}`}}function MNe(t,e,r){if(e.kind==="none")return{stage:Gt,pass:!0,exitCode:0,disposition:"na"};if(!r)return{stage:Gt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 smoke probe skipped"};let n=e.run??[];if(n.length===0)return{stage:Gt,pass:!1,exitCode:2,stderr:"cli smoke probe has no run argv \u2014 skipped"};let[i,...o]=n,s=i.startsWith(".")||i.startsWith("/")?gX(t,i):i,a=_X,c;try{c=Qe(s,[...o],{cwd:t,reject:!1,timeout:a})}catch(p){c=p}let l=Ft(Gt,i,c);if(l)return l;if(c.timedOut)return{stage:Gt,pass:!1,exitCode:1,stderr:`smoke probe '${n.join(" ")}' timed out after ${a}ms`};let u=e.expect?.exit??0,d=c.exitCode??1;if(d!==u){let p=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:Gt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe exited ${d}, expected ${u}${p?` \u2014 ${p.slice(0,200)}`:""}`}}let f=e.expect?.token;return f?String(c.stdout??"").includes(f)?{stage:Gt,pass:!0,exitCode:0,disposition:"pass"}:{stage:Gt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe ran (exit ${d}) but stdout did not contain the AC token ${JSON.stringify(f)}`}:{stage:Gt,pass:!0,exitCode:0,disposition:"liveness"}}var FNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${yX.argv[1]}`;if(FNe){let t=lD();console.log(JSON.stringify(t)),yX.exit(t.exitCode)}Ar();mn();hn();import vX from"node:process";var tw="stage_3.1";function uD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:tw,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Mc(e,o[o.length-1]))return{stage:tw,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=Qe(i,[...o],{cwd:e,reject:!1}),a=Ft(tw,i,s);return a||nr(tw,s)}var zNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${vX.argv[1]}`;if(zNe){let t=uD();console.log(JSON.stringify(t)),vX.exit(t.exitCode)}sP();dD();fD();Ar();Dp();hn();import wX from"node:process";var iw="stage_2.1";function pD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=ns("test",t))}catch(a){return{stage:iw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:iw,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${i}'`};let o=Qe(r,[...n],{cwd:e,reject:!1}),s=Ft(iw,r,o);return s||nr(iw,o)}var qNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wX.argv[1]}`;if(qNe){let t=pD();console.log(JSON.stringify(t)),wX.exit(t.exitCode)}Ar();mn();hn();import xX from"node:process";var ow="stage_3.3";function mD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:ow,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Mc(e,o[o.length-1]))return{stage:ow,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=Qe(i,[...o],{cwd:e,reject:!1}),a=Ft(ow,i,s);return a||nr(ow,s)}var BNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${xX.argv[1]}`;if(BNe){let t=mD();console.log(JSON.stringify(t)),xX.exit(t.exitCode)}var HNe=new Set(["fail","pending_env","advisory"]);function Aa(t){return HNe.has(t)}function $X(t){return t.disposition??(t.pass?"pass":t.exitCode===2?"skip":"fail")}function kX(t,e){return Aa(e)?t.disposition?1:t.exitCode:0}cP();gD();_D();pf();vv();var DX=$t(rr(),1);import{existsSync as vD,readFileSync as aje,readdirSync as CX,statSync as cje,writeFileSync as lje}from"node:fs";import{basename as Fp,join as zp,relative as RX}from"node:path";var uje=["self-dogfood:","fixture:","derived:"],NX=/\.(test|spec)\.[jt]sx?$/;function jX(t,e=t,r=[]){let n;try{n=CX(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=zp(e,i);try{cje(o).isDirectory()?jX(t,o,r):NX.test(i)&&r.push(o)}catch{continue}}return r}function MX(t="."){let e=zp(t,"spec","features"),r=zp(t,"tests"),n=[],i=[];if(!vD(e)||!vD(r))return{repaired:n,suggested:i};let o=jX(r),s=new Map;for(let a of o){let c=RX(t,a).split("\\").join("/"),l=s.get(Fp(a))??[];l.push(c),s.set(Fp(a),l)}for(let a of CX(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=zp(e,a),l,u;try{l=aje(c,"utf8"),u=(0,DX.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(uje.some(w=>g.startsWith(w)))continue;let v=g.split("#",1)[0];if(vD(zp(t,v)))continue;let _=s.get(Fp(v))??[];if(_.length!==1)continue;let S=g.replace(v,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>Fp(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>RX(t,h).split("\\").join("/")).find(h=>{let g=Fp(h).replace(NX,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),v=l.match(g);if(!v)continue;let _=v[2]+" ";l=l.replace(g,`$1 +`)}catch{r.delete(u)}},3e4);return typeof l.unref=="function"&&l.unref(),new Promise(u=>{o.listen(t.port??0,"127.0.0.1",()=>{let d=o.address(),f=typeof d=="object"&&d?d.port:t.port??0;u({port:f,broadcast:i,close:()=>new Promise(p=>{s&&clearTimeout(s),clearInterval(l);for(let m of c)try{m.close()}catch{}for(let m of r)try{m.end()}catch{}r.clear(),o.close(()=>p()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function fX(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await ONe({port:e,cwd:t.cwd??"."});H("pass","graph",`live graph at http://localhost:${r.port} \u2014 edit spec/ or docs/ and the view auto-reloads (Ctrl-C to stop)`)}catch(r){H("fail","graph",r.message),process.exit(1)}}var INe=["stage_1.1","stage_2.1","stage_2.3"];function PNe(t){return(t.features??[]).filter(e=>e.status==="done")}function RNe(t,e){let r=PNe(t);switch(e){case"stage_1.1":return!t.project?.language||r.length===0?null:`project.language is '${t.project.language}' and ${r.length} feature(s) are done, but the type checker did not run (skipped) \u2014 type safety of shipped code was never verified. Install the language toolchain; under --strict, an unverifiable 'done' is not GREEN.`;case"stage_2.1":{let n=r.filter(i=>(i.acceptance_criteria??[]).some(o=>(o.test_refs??[]).length>0)).length;return n===0?null:`${n} done feature(s) declare tests but the test runner did not run (skipped) \u2014 the implementation was never verified. Install the test framework; under --strict, an unverifiable 'done' is not GREEN.`}case"stage_2.3":{let n=r.flatMap(i=>i.acceptance_criteria??[]).filter(i=>(i.oracle_refs??[]).length>0).length;return n===0?null:`${n} done AC(s) declare oracle_refs but the conformance runner did not run (skipped) \u2014 the declared oracles never executed. Under --strict, declared-but-unrun verification is not GREEN.`}}}function pX(t,e){let r=[];for(let n of INe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=RNe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}X_();import mX from"node:process";function CNe(t,e){let r=e.filter(i=>i.acId===t),n=r.filter(i=>i.identity.author==="human");return n.length===0?{acId:t,pass:!1,totalEvidence:r.length,humanEvidence:0,reason:r.length===0?"no evidence at all":`${r.length} tool/LLM evidence but 0 human \u2014 anti-self-cert guard blocks`}:{acId:t,pass:!0,totalEvidence:r.length,humanEvidence:n.length}}function XS(t){let e=new Set;for(let n of t)n.acId&&e.add(n.acId);let r=[];for(let n of e){let i=CNe(n,t);i.pass||r.push(i)}return r}Ln();var oD="stage_4.1";function sD(t={}){let{cwd:e="."}=t,r=gn(e);if(r.length===0)return{stage:oD,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=XS(r);if(n.length===0)return{stage:oD,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:oD,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var DNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${mX.argv[1]}`;if(DNe){let t=sD();console.log(JSON.stringify(t)),mX.exit(t.exitCode)}Ar();import hX from"node:process";var QS="stage_1.4";function aD(t={}){let{cwd:e="."}=t,r;try{r=Ve("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:QS,pass:!1,exitCode:2,stderr:"git binary not found"};throw i}if(r.exitCode!==0){let i=(r.stderr??"").toString().trim()||"not a git repository";return{stage:QS,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:QS,pass:!0,exitCode:0}:{stage:QS,pass:!1,exitCode:1,stderr:`working tree dirty: +${n}`}}var NNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hX.argv[1]}`;if(NNe){let t=aD();console.log(JSON.stringify(t)),hX.exit(t.exitCode)}Ar();Np();import _X from"node:process";import{resolve as FNe}from"node:path";var El=null;function cD(t){El=t?new Map:null}function gX(){return El!==null}function ew(t,e){if(!El)return e();let r=FNe(t);if(El.has(r))return El.get(r);let n=e();return El.set(r,n),n}function yX(t){return!t||t.missingTool?"fallback":t.exitCode===0?"reuse-pass":"fallback"}hn();var tw="stage_2.2";function lD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=lo("coverage",t))}catch(a){return{stage:tw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:tw,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=ew(e,()=>Ve(r,[...n],{cwd:e,reject:!1})),s=Ft(tw,r,o);return s||nr(tw,o)}var zNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${_X.argv[1]}`;if(zNe){let t=lD();console.log(JSON.stringify(t)),_X.exit(t.exitCode)}Cv();uD();Ar();mn();hn();import bX from"node:process";var nw="stage_3.2";function dD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:nw,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Fc(e,o[o.length-1]))return{stage:nw,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=Ve(i,[...o],{cwd:e,reject:!1}),a=Ft(nw,i,s);return a||nr(nw,s)}var UNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${bX.argv[1]}`;if(UNe){let t=dD();console.log(JSON.stringify(t)),bX.exit(t.exitCode)}Ar();lt();hn();import{existsSync as qNe}from"node:fs";import{resolve as SX}from"node:path";import wX from"node:process";var Gt="stage_2.4",xX=5e3;function fD(t={}){let{cwd:e="."}=t,r,n=[],i=!1;try{let f=J(e);r=f.project.deliverable,n=f.project.smoke??[],i=f.features.some(p=>p.status==="done")}catch{return{stage:Gt,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return BNe(e,n[0],i);if(!r)return{stage:Gt,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:Gt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:Gt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let o=SX(e,r.path);if(!qNe(o))return{stage:Gt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let s=r.timeout_ms??xX,a;try{a=Ve(o,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:s})}catch(f){a=f}let c=Ft(Gt,r.path,a);if(c)return c;if(a.timedOut)return{stage:Gt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${s}ms (hung or too slow)`};let l=r.expect_exit??0,u=a.exitCode??1;if(u===l)return{stage:Gt,pass:!0,exitCode:0,disposition:"liveness"};let d=String(a.stderr??"").trim()||String(a.stdout??"").trim();return{stage:Gt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${u}, expected ${l}${d?` \u2014 ${d.slice(0,200)}`:""}`}}function BNe(t,e,r){if(e.kind==="none")return{stage:Gt,pass:!0,exitCode:0,disposition:"na"};if(!r)return{stage:Gt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 smoke probe skipped"};let n=e.run??[];if(n.length===0)return{stage:Gt,pass:!1,exitCode:2,stderr:"cli smoke probe has no run argv \u2014 skipped"};let[i,...o]=n,s=i.startsWith(".")||i.startsWith("/")?SX(t,i):i,a=xX,c;try{c=Ve(s,[...o],{cwd:t,reject:!1,timeout:a})}catch(p){c=p}let l=Ft(Gt,i,c);if(l)return l;if(c.timedOut)return{stage:Gt,pass:!1,exitCode:1,stderr:`smoke probe '${n.join(" ")}' timed out after ${a}ms`};let u=e.expect?.exit??0,d=c.exitCode??1;if(d!==u){let p=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:Gt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe exited ${d}, expected ${u}${p?` \u2014 ${p.slice(0,200)}`:""}`}}let f=e.expect?.token;return f?String(c.stdout??"").includes(f)?{stage:Gt,pass:!0,exitCode:0,disposition:"pass"}:{stage:Gt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe ran (exit ${d}) but stdout did not contain the AC token ${JSON.stringify(f)}`}:{stage:Gt,pass:!0,exitCode:0,disposition:"liveness"}}var HNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wX.argv[1]}`;if(HNe){let t=fD();console.log(JSON.stringify(t)),wX.exit(t.exitCode)}Ar();mn();hn();import $X from"node:process";var iw="stage_3.1";function pD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:iw,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Fc(e,o[o.length-1]))return{stage:iw,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=Ve(i,[...o],{cwd:e,reject:!1}),a=Ft(iw,i,s);return a||nr(iw,s)}var ZNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${$X.argv[1]}`;if(ZNe){let t=pD();console.log(JSON.stringify(t)),$X.exit(t.exitCode)}cP();mD();hD();Ar();Np();import AX from"node:process";hn();var zp="stage_2.1";function WNe(t,e){try{let{cmd:r,args:n}=lo(t,e);return r&&n?{cmd:r,args:n}:null}catch{return null}}function gD(t={}){let{cwd:e="."}=t;if(gX()){let a=WNe("coverage",t);if(a){let c=ew(e,()=>Ve(a.cmd,[...a.args],{cwd:e,reject:!1}));if(yX({exitCode:c.exitCode,missingTool:na(c)})==="reuse-pass")return{stage:zp,pass:!0,exitCode:0}}}let r,n,i;try{({cmd:r,args:n,language:i}=lo("test",t))}catch(a){return{stage:zp,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:zp,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${i}'`};let o=Ve(r,[...n],{cwd:e,reject:!1}),s=Ft(zp,r,o);return s||nr(zp,o)}var KNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${AX.argv[1]}`;if(KNe){let t=gD();console.log(JSON.stringify(t)),AX.exit(t.exitCode)}Ar();mn();hn();import TX from"node:process";var aw="stage_3.3";function yD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:aw,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Fc(e,o[o.length-1]))return{stage:aw,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=Ve(i,[...o],{cwd:e,reject:!1}),a=Ft(aw,i,s);return a||nr(aw,s)}var JNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${TX.argv[1]}`;if(JNe){let t=yD();console.log(JSON.stringify(t)),TX.exit(t.exitCode)}var YNe=new Set(["fail","pending_env","advisory"]);function Ta(t){return YNe.has(t)}function OX(t){return t.disposition??(t.pass?"pass":t.exitCode===2?"skip":"fail")}function IX(t,e){return Ta(e)?t.disposition?1:t.exitCode:0}uP();vD();SD();mf();Sv();var zX=$t(rr(),1);import{existsSync as wD,readFileSync as mje,readdirSync as FX,statSync as hje,writeFileSync as gje}from"node:fs";import{basename as Lp,join as Up,relative as MX}from"node:path";var yje=["self-dogfood:","fixture:","derived:"],LX=/\.(test|spec)\.[jt]sx?$/;function UX(t,e=t,r=[]){let n;try{n=FX(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=Up(e,i);try{hje(o).isDirectory()?UX(t,o,r):LX.test(i)&&r.push(o)}catch{continue}}return r}function qX(t="."){let e=Up(t,"spec","features"),r=Up(t,"tests"),n=[],i=[];if(!wD(e)||!wD(r))return{repaired:n,suggested:i};let o=UX(r),s=new Map;for(let a of o){let c=MX(t,a).split("\\").join("/"),l=s.get(Lp(a))??[];l.push(c),s.set(Lp(a),l)}for(let a of FX(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=Up(e,a),l,u;try{l=mje(c,"utf8"),u=(0,zX.parse)(l)}catch{continue}if(!u||u.status!=="done")continue;let d=!1;for(let h of u.acceptance_criteria??[])for(let g of h.test_refs??[]){if(yje.some(w=>g.startsWith(w)))continue;let v=g.split("#",1)[0];if(wD(Up(t,v)))continue;let _=s.get(Lp(v))??[];if(_.length!==1)continue;let S=g.replace(v,_[0]);S!==g&&l.includes(g)&&(l=l.split(g).join(S),n.push({shard:a,from:g,to:S}),d=!0)}let f=u.slug??"",p=(u.modules??[]).map(h=>Lp(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>MX(t,h).split("\\").join("/")).find(h=>{let g=Lp(h).replace(LX,"");return f!==""&&g===f||p.includes(g)});if(m)for(let h of u.acceptance_criteria??[]){if((h.test_refs?.length??0)>0||(h.evidence_refs?.length??0)>0||!h.id)continue;let g=new RegExp(`^(([ ]+)- id: ${h.id}\\b.*)$`,"m"),v=l.match(g);if(!v)continue;let _=v[2]+" ";l=l.replace(g,`$1 ${_}test_refs: -${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&lje(c,l,"utf8")}return{repaired:n,suggested:i}}Cd();import{existsSync as dje,readFileSync as fje}from"node:fs";import{join as pje}from"node:path";function mje(t,e){let r=pje(t,e);if(!dje(r))return[];let n=[];for(let i of fje(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function FX(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>mje(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function zX(t){let e=[];e.push(`# Spec-conformance oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` -`)}wv();lt();No();Ln();Cd();var hje={ALL_FEATURES_DONE:"All work complete.",MAX_ITERATIONS:"Stopped \u2014 reached the iteration limit.",WALL_CLOCK:"Stopped \u2014 exceeded the time budget.",BUDGET_EXCEEDED:"Stopped \u2014 budget exhausted.",BLOCKED_FEATURE:"Stopped \u2014 a feature is blocked by dependencies.",RETRY_THRESHOLD:"Stopped \u2014 a feature failed too many times.",GATE_NO_PROGRESS:"Stopped \u2014 gates are not making progress.",HUMAN_REQUIRED:"Paused \u2014 needs human sign-off.",TRANSPORT_AUTH_FAILED:"Stopped \u2014 agent rejected the credentials. Check your API key.",TRANSPORT_RATE_LIMITED:"Stopped \u2014 agent is rate-limited. Try again after the cooldown.",TRANSPORT_NETWORK:"Stopped \u2014 could not reach the agent over the network.",LLM_UNAVAILABLE:"Stopped \u2014 could not reach the agent.",UNCAUGHT_ERROR:"Stopped \u2014 unexpected error."},gje={"stage_1.1":"Type","stage_1.2":"Lint","stage_1.3":"Drift","stage_1.4":"Commit","stage_1.5":"Architecture","stage_1.6":"Secret","stage_2.1":"Unit tests","stage_2.2":"Coverage","stage_2.3":"Spec conformance","stage_2.4":"Deliverable smoke","stage_3.1":"Smoke","stage_3.2":"Performance","stage_3.3":"Visual","stage_4.1":"Audit","stage_4.2":"UAT"};function bD(t,e){let r=e.features.find(n=>n.id===t);return r&&r.title?r.title:t}function LX(t,e){let r=hje[t.class]??"Stopped.",n=yje(t.detail,e);return n?`${r} ${n}`:r}function fw(t){return gje[t]??t}function yje(t,e){return t?t.replace(/\bF-\d{3,}\b/g,r=>{let n=bD(r,e);return n===r?r:`"${n}"`}):""}var UX=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"];function _je(t,e,r){if(e.startsWith("stage_4")){let n=gn(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return JS(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function vje(t,e,r){let n=t.modules??[];if(t.status!=="done"||n.length===0)return"\xB7";if(e===null)return"-";let i=e.get(t.id);return i===void 0?"!":i===Rd(r,n)?"\u2713":"!"}function qX(t,e=".",r={}){let n=r.internal??!1,i=gc(e),o=[...UX.map(l=>n?l.replace("stage_",""):bje(l)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,c=t.features.map(l=>({featureId:l.id,title:l.title||l.id,cells:[...UX.map(u=>_je(l,u,e)),vje(l,i,e)]})).map(l=>{let u=l.cells.join(" ");return n?`${l.featureId.padEnd(12)} ${u} ${l.title}`:`${l.title.padEnd(35).slice(0,35)} ${u}`});return[s,...c].join(` -`)}function bje(t){return fw(t).slice(0,3)}async function RZe(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(Hse(),Bse)),Promise.resolve().then(()=>(Kse(),Wse)),Promise.resolve().then(()=>(If(),HJ))]),i=e({cwd:t.cwd});n(i.server);let o=new r;K.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} -`),await i.connect(o)}async function CZe(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await zY({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});for(let o of n.created)H("pass",`created ${o}`);for(let o of n.skipped)H("skip",o);for(let o of n.proposals??[])H("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(H("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){K.stdout.write(` +${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&gje(c,l,"utf8")}return{repaired:n,suggested:i}}Nd();import{existsSync as _je,readFileSync as vje}from"node:fs";import{join as bje}from"node:path";function Sje(t,e){let r=bje(t,e);if(!_je(r))return[];let n=[];for(let i of vje(r,"utf8").split(/\r?\n/)){let o=i.trim();if(!/^export\s+(?:async\s+)?(?:abstract\s+)?(?:function|const|let|class|interface|type|enum)\b/.test(o))continue;let s=o.replace(/\s*[{=].*$/s,"").trim();s&&n.push(s)}return n}function BX(t,e,r,n){let i=t.features.find(c=>c.id===e);if(!i)return null;let o=(i.acceptance_criteria??[]).filter(c=>!r||c.id===r),s=i.modules??[],a=s.flatMap(c=>Sje(n,c).map(l=>`${c}: ${l}`));return{featureId:e,featureTitle:i.title,acs:o.map(c=>({id:c.id,ears:c.ears,condition:c.condition,action:c.action,response:c.response,text:c.text})),modules:s,signatures:a,readManifest:[...s.map(c=>`signatures-of:${c}`),"spec:acceptance_criteria"]}}function HX(t){let e=[];e.push(`# Spec-conformance oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` +`)}$v();lt();jo();Ln();Nd();var wje={ALL_FEATURES_DONE:"All work complete.",MAX_ITERATIONS:"Stopped \u2014 reached the iteration limit.",WALL_CLOCK:"Stopped \u2014 exceeded the time budget.",BUDGET_EXCEEDED:"Stopped \u2014 budget exhausted.",BLOCKED_FEATURE:"Stopped \u2014 a feature is blocked by dependencies.",RETRY_THRESHOLD:"Stopped \u2014 a feature failed too many times.",GATE_NO_PROGRESS:"Stopped \u2014 gates are not making progress.",HUMAN_REQUIRED:"Paused \u2014 needs human sign-off.",TRANSPORT_AUTH_FAILED:"Stopped \u2014 agent rejected the credentials. Check your API key.",TRANSPORT_RATE_LIMITED:"Stopped \u2014 agent is rate-limited. Try again after the cooldown.",TRANSPORT_NETWORK:"Stopped \u2014 could not reach the agent over the network.",LLM_UNAVAILABLE:"Stopped \u2014 could not reach the agent.",UNCAUGHT_ERROR:"Stopped \u2014 unexpected error."},xje={"stage_1.1":"Type","stage_1.2":"Lint","stage_1.3":"Drift","stage_1.4":"Commit","stage_1.5":"Architecture","stage_1.6":"Secret","stage_2.1":"Unit tests","stage_2.2":"Coverage","stage_2.3":"Spec conformance","stage_2.4":"Deliverable smoke","stage_3.1":"Smoke","stage_3.2":"Performance","stage_3.3":"Visual","stage_4.1":"Audit","stage_4.2":"UAT"};function xD(t,e){let r=e.features.find(n=>n.id===t);return r&&r.title?r.title:t}function ZX(t,e){let r=wje[t.class]??"Stopped.",n=$je(t.detail,e);return n?`${r} ${n}`:r}function mw(t){return xje[t]??t}function $je(t,e){return t?t.replace(/\bF-\d{3,}\b/g,r=>{let n=xD(r,e);return n===r?r:`"${n}"`}):""}var GX=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"];function kje(t,e,r){if(e.startsWith("stage_4")){let n=gn(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return XS(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function Eje(t,e,r){let n=t.modules??[];if(t.status!=="done"||n.length===0)return"\xB7";if(e===null)return"-";let i=e.get(t.id);return i===void 0?"!":i===Dd(r,n)?"\u2713":"!"}function VX(t,e=".",r={}){let n=r.internal??!1,i=yc(e),o=[...GX.map(l=>n?l.replace("stage_",""):Aje(l)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,c=t.features.map(l=>({featureId:l.id,title:l.title||l.id,cells:[...GX.map(u=>kje(l,u,e)),Eje(l,i,e)]})).map(l=>{let u=l.cells.join(" ");return n?`${l.featureId.padEnd(12)} ${u} ${l.title}`:`${l.title.padEnd(35).slice(0,35)} ${u}`});return[s,...c].join(` +`)}function Aje(t){return mw(t).slice(0,3)}async function zZe(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(Kse(),Wse)),Promise.resolve().then(()=>(eae(),Qse)),Promise.resolve().then(()=>(Pf(),VJ))]),i=e({cwd:t.cwd});n(i.server);let o=new r;K.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} +`),await i.connect(o)}async function LZe(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await qY({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});for(let o of n.created)H("pass",`created ${o}`);for(let o of n.skipped)H("skip",o);for(let o of n.proposals??[])H("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(H("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){K.stdout.write(` \u{1F4A1} \uB2E4\uC74C \uC815\uBCF4\uAC00 \uC788\uC73C\uBA74 \uB354 \uC815\uD655\uD55C \uC2A4\uD399\uC774 \uB429\uB2C8\uB2E4: `);for(let[o,s]of n.clarifyingQuestions.entries())K.stdout.write(` ${o+1}. ${s} `);K.stdout.write(` @@ -723,30 +723,30 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&lje(c,l,"u `),K.stdout.write(` \uC608: clad init \uACB0\uC81C SaaS for B2B `),K.stdout.write(` \uAE30\uC874 seeds \uB294 .cladding/scan/*.proposal \uB85C \uBD84\uAE30\uB429\uB2C8\uB2E4. -`));K.exit(0)}async function DZe(t,e){H("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(bae(),vae)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)H(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),K.stdout.write(`${JSON.stringify(n,null,2)} -`);else{let s=J(e.cwd??"."),a=n.featuresTouched.map(l=>bD(l,s)),c=`${LX(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;H(i,"run",c),a.length>0&&K.stdout.write(`Touched: ${a.join(", ")} -`)}let o=n.stubsCreated.length>0;o&&H("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),K.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function NZe(t={}){try{let e=J(),r=Ho(".");Bc(".",r),aa("."),l3(".");let n=MX(".");for(let o of n.repaired)H("note","test_refs",`repaired ${o.from} \u2192 ${o.to} (${o.shard})`);for(let o of n.suggested)H("note","test_refs",`suggested ${o.ref} (${o.shard}) \u2014 confirm by removing the 'derived:' prefix`);let i=dw(".");if(i&&H("note","deliverable",`auto-detected entry '${i.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`),t.proposeArchive){let s=$v.run({cwd:"."}).filter(a=>a.suggestion?.action==="propose-archive");if(s.length===0){H("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),K.exit(0);return}for(let a of s){let c=a.suggestion?.args??{},l=String(c.featureId??"?"),u=String(c.reason??a.message);H("note",`propose-archive \xB7 ${l}`,u)}H("pass","sync",`${e.features.length} features \xB7 ${s.length} archive candidate(s)`),K.exit(0);return}H("pass","sync",`${e.features.length} features valid`),K.exit(0)}catch(e){H("fail","sync",e.message),K.exit(1)}}function jZe(t){if(!t){H("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),K.exit(2);return}let e=sw(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";H("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),K.exit(0)}function MZe(t,e={}){if(!t){H("fail","rollback","feature id required (e.g. clad rollback F-001)"),K.exit(2);return}let r=aw(".",t);if(!r){H("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),K.exit(1);return}cw(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";H("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?K.stdout.write(`Run: git checkout ${r.gitHead} +`));K.exit(0)}async function UZe(t,e){H("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(kae(),$ae)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)H(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),K.stdout.write(`${JSON.stringify(n,null,2)} +`);else{let s=J(e.cwd??"."),a=n.featuresTouched.map(l=>xD(l,s)),c=`${ZX(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;H(i,"run",c),a.length>0&&K.stdout.write(`Touched: ${a.join(", ")} +`)}let o=n.stubsCreated.length>0;o&&H("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),K.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function qZe(t={}){try{let e=J(),r=Zo(".");Hc(".",r),ca("."),f3(".");let n=qX(".");for(let o of n.repaired)H("note","test_refs",`repaired ${o.from} \u2192 ${o.to} (${o.shard})`);for(let o of n.suggested)H("note","test_refs",`suggested ${o.ref} (${o.shard}) \u2014 confirm by removing the 'derived:' prefix`);let i=pw(".");if(i&&H("note","deliverable",`auto-detected entry '${i.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`),t.proposeArchive){let s=Ev.run({cwd:"."}).filter(a=>a.suggestion?.action==="propose-archive");if(s.length===0){H("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),K.exit(0);return}for(let a of s){let c=a.suggestion?.args??{},l=String(c.featureId??"?"),u=String(c.reason??a.message);H("note",`propose-archive \xB7 ${l}`,u)}H("pass","sync",`${e.features.length} features \xB7 ${s.length} archive candidate(s)`),K.exit(0);return}H("pass","sync",`${e.features.length} features valid`),K.exit(0)}catch(e){H("fail","sync",e.message),K.exit(1)}}function BZe(t){if(!t){H("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),K.exit(2);return}let e=cw(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";H("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),K.exit(0)}function HZe(t,e={}){if(!t){H("fail","rollback","feature id required (e.g. clad rollback F-001)"),K.exit(2);return}let r=lw(".",t);if(!r){H("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),K.exit(1);return}uw(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";H("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?K.stdout.write(`Run: git checkout ${r.gitHead} `):K.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. -`),K.exit(0)}async function FZe(t){let e=await U1({force:t.force,quiet:t.quiet});K.exit(e.errors.length>0?1:0)}async function zZe(){H("note","update","reconciling the current project after the engine upgrade");let t=await uJ(".",{wireHosts:async()=>(await U1({quiet:!0})).errors.length});if(H(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),!t.isProject){H("skip","spec","no spec.yaml here \u2014 run `clad init` to put this project under cladding"),K.exit(t.code);return}H("pass","spec",`inventory synced \xB7 ${t.features} features`),H(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),H(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)H("note","deprecated",r);K.stdout.write(` +`),K.exit(0)}async function ZZe(t){let e=await B1({force:t.force,quiet:t.quiet});K.exit(e.errors.length>0?1:0)}async function GZe(){H("note","update","reconciling the current project after the engine upgrade");let t=await pJ(".",{wireHosts:async()=>(await B1({quiet:!0})).errors.length});if(H(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),!t.isProject){H("skip","spec","no spec.yaml here \u2014 run `clad init` to put this project under cladding"),K.exit(t.code);return}H("pass","spec",`inventory synced \xB7 ${t.features} features`),H(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),H(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)H("note","deprecated",r);K.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): -`),O2({tier:"pre-commit",strict:!0}).anyFailed?K.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):H("pass","drift","clean against the stricter detectors"),K.exit(t.code)}var LZe={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function O2(t){let e=t.tier??"all",r=LZe[e];if(!r)return t.json?K.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} -`):H("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0};let n={focusModules:t.focusModules},o=[["stage_1.1",()=>jp(n)],["stage_1.2",()=>Np(n)],["stage_1.3",()=>ro({...n,strict:t.strict})],["stage_1.4",oD],["stage_1.5",na],["stage_1.6",$f],["stage_2.1",()=>pD(n)],["stage_2.2",()=>sD(n)],["stage_2.3",oP],["stage_2.4",lD],["stage_3.1",uD],["stage_3.2",cD],["stage_3.3",mD],["stage_4.1",iD],["stage_4.2",Mp]].filter(([u])=>r.includes(u)),s=0,a=!1,c=u=>u==="pass"?"pass":u==="liveness"?"note":u==="na"?"skip":Aa(u)?"fail":"skip",l=[];for(let[u,d]of o){let f=d({}),p=t.internal?u:fw(u),m=$X(f);Aa(m)&&(a=!0,s=Math.max(s,kX(f,m))),l.push({stage:u,label:p,status:m,exitCode:f.exitCode,stderr:f.stderr,findings:f.findings}),t.json||(H(c(m),p),Aa(m)&&WZe(f))}if(t.strict)try{let u=J();for(let d of uX(u,l))s=Math.max(s,1),a=!0,l.push({stage:d.stage,label:d.label,status:"fail",exitCode:1,stderr:d.message}),t.json||H("fail",d.label,d.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let u=l.find(m=>m.stage==="stage_1.3"),d=(u?.findings??[]).filter(m=>m.severity==="error"||m.severity==="warn"),f=u?.status==="fail"&&d.length>0&&d.every(m=>m.detector==="STALE_ATTESTATION"),p=l.every(m=>m.stage==="stage_1.3"||!Aa(m.status));if(f&&p&&u&&(u.status="pass",u.exitCode=0,u.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",a=l.some(m=>Aa(m.status)),s=a?Math.max(1,s):0,t.json||H("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!a)try{p6(".",J())&&(t.json||H("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json?K.stdout.write(`${JSON.stringify({tier:e,worst:s,anyFailed:a,stages:l},null,2)} -`):a&&K.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),Zi(".","gate_run",{tier:e,strict:t.strict===!0,worst:s,anyFailed:a}),{worst:s,anyFailed:a}}function UZe(t){try{let e=J(),r=xl(e,t);K.stdout.write(`${JSON.stringify(r,null,2)} -`),K.exit("not_found"in r?1:0)}catch(e){H("fail","context",e.message),K.exit(1)}}function qZe(t,e={}){try{let r=J(),n=e.depth!==void 0?Number(e.depth):void 0,i=gi(r,t,{depth:n});K.stdout.write(`${JSON.stringify(i,null,2)} -`),K.exit("not_found"in i?1:0)}catch(r){H("fail","impact",r.message),K.exit(1)}}function BZe(t={}){try{let e=J(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=Iv(e,o=>{try{return wae(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});K.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} -`),K.exit(0)}catch(e){H("fail","infer-deps",e.message),K.exit(1)}}function HZe(t={}){try{let e=J(),n=JY(e,i=>{try{return wae(i,"utf8")}catch{return null}},".");if(t.json)K.stdout.write(`${JSON.stringify(n,null,2)} +`),R2({tier:"pre-commit",strict:!0}).anyFailed?K.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):H("pass","drift","clean against the stricter detectors"),K.exit(t.code)}var VZe={"pre-commit":["stage_1.3","stage_1.5","stage_1.6"],"pre-push":["stage_1.1","stage_1.2","stage_1.3","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4"],all:["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_2.3","stage_2.4","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"]};function R2(t){let e=t.tier??"all",r=VZe[e];if(!r)return t.json?K.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} +`):H("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0};let n={focusModules:t.focusModules},o=[["stage_1.1",()=>Mp(n)],["stage_1.2",()=>jp(n)],["stage_1.3",()=>ro({...n,strict:t.strict})],["stage_1.4",aD],["stage_1.5",ia],["stage_1.6",kf],["stage_2.1",()=>gD(n)],["stage_2.2",()=>lD(n)],["stage_2.3",aP],["stage_2.4",fD],["stage_3.1",pD],["stage_3.2",dD],["stage_3.3",yD],["stage_4.1",sD],["stage_4.2",Fp]].filter(([u])=>r.includes(u)),s=0,a=!1,c=u=>u==="pass"?"pass":u==="liveness"?"note":u==="na"?"skip":Ta(u)?"fail":"skip",l=[];cD(!0);try{for(let[u,d]of o){let f=d({}),p=t.internal?u:mw(u),m=OX(f);Ta(m)&&(a=!0,s=Math.max(s,IX(f,m))),l.push({stage:u,label:p,status:m,exitCode:f.exitCode,stderr:f.stderr,findings:f.findings}),t.json||(H(c(m),p),Ta(m)&&tGe(f))}}finally{cD(!1)}if(t.strict)try{let u=J();for(let d of pX(u,l))s=Math.max(s,1),a=!0,l.push({stage:d.stage,label:d.label,status:"fail",exitCode:1,stderr:d.message}),t.json||H("fail",d.label,d.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let u=l.find(m=>m.stage==="stage_1.3"),d=(u?.findings??[]).filter(m=>m.severity==="error"||m.severity==="warn"),f=u?.status==="fail"&&d.length>0&&d.every(m=>m.detector==="STALE_ATTESTATION"),p=l.every(m=>m.stage==="stage_1.3"||!Ta(m.status));if(f&&p&&u&&(u.status="pass",u.exitCode=0,u.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",a=l.some(m=>Ta(m.status)),s=a?Math.max(1,s):0,t.json||H("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!a)try{g6(".",J())&&(t.json||H("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json?K.stdout.write(`${JSON.stringify({tier:e,worst:s,anyFailed:a,stages:l},null,2)} +`):a&&K.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),Zi(".","gate_run",{tier:e,strict:t.strict===!0,worst:s,anyFailed:a}),{worst:s,anyFailed:a}}function WZe(t){try{let e=J(),r=$l(e,t);K.stdout.write(`${JSON.stringify(r,null,2)} +`),K.exit("not_found"in r?1:0)}catch(e){H("fail","context",e.message),K.exit(1)}}function KZe(t,e={}){try{let r=J(),n=e.depth!==void 0?Number(e.depth):void 0,i=gi(r,t,{depth:n});K.stdout.write(`${JSON.stringify(i,null,2)} +`),K.exit("not_found"in i?1:0)}catch(r){H("fail","impact",r.message),K.exit(1)}}function JZe(t={}){try{let e=J(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=Rv(e,o=>{try{return Aae(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});K.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} +`),K.exit(0)}catch(e){H("fail","infer-deps",e.message),K.exit(1)}}function YZe(t={}){try{let e=J(),n=QY(e,i=>{try{return Aae(i,"utf8")}catch{return null}},".");if(t.json)K.stdout.write(`${JSON.stringify(n,null,2)} `);else{let i=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${n.context.medianSliceTokens} tok vs naive ${n.context.medianNaiveTokens} tok = ${n.context.medianShrinkFactor}x smaller (median)`,` search: median ${n.search.medianDepth} hop(s) resolved (p95 ${n.search.p95Depth}), median ${n.search.medianEdges} edge(s)/feature (max hub ${n.search.maxEdges})`,` stability: median blast-radius coverage ${n.stability.medianCoverage}, median ${n.stability.medianRegressionTests} regression test(s) surfaced; stops ${JSON.stringify(n.stability.byStopReason)}`," (deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"];K.stdout.write(`${i.join(` `)} -`)}K.exit(0)}catch(e){H("fail","measure",e.message),K.exit(1)}}function ZZe(t){let e;if(t.feature)try{let n=(J().features??[]).find(i=>i.id===t.feature||i.slug===t.feature);n||(H("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),K.exit(1)),e=n.modules}catch(r){H("fail","check",r.message),K.exit(1)}K.exit(O2({...t,focusModules:e}).worst)}function GZe(t){let e=v6(".",t,{checkStages:O2,onIndex:aa});H(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),K.exit(e.code)}function VZe(t,e={}){let r=e.cwd??".",n;try{n=J(r)}catch(o){H("fail","oracle",`spec not loaded: ${o.message}`),K.exit(1);return}if(e.required){t&&K.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') -`);let o=p3(n);if(o.length===0){K.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. +`)}K.exit(0)}catch(e){H("fail","measure",e.message),K.exit(1)}}function XZe(t){let e;if(t.feature)try{let n=(J().features??[]).find(i=>i.id===t.feature||i.slug===t.feature);n||(H("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),K.exit(1)),e=n.modules}catch(r){H("fail","check",r.message),K.exit(1)}K.exit(R2({...t,focusModules:e}).worst)}function QZe(t){let e=w6(".",t,{checkStages:R2,onIndex:ca});H(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),K.exit(e.code)}function eGe(t,e={}){let r=e.cwd??".",n;try{n=J(r)}catch(o){H("fail","oracle",`spec not loaded: ${o.message}`),K.exit(1);return}if(e.required){t&&K.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') +`);let o=g3(n);if(o.length===0){K.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. `),K.exit(0);return}let s=o.filter(a=>!a.hasOracle);for(let a of o){let c=a.hasOracle?"\u2713":"\xB7",l=a.hasOracle?"":" \u2190 needs an impl-blind oracle";K.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} `)}K.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. -`),K.exit(s.length>0?1:0);return}if(!t){H("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),K.exit(1);return}let i=FX(n,t,e.ac,r);if(!i||i.acs.length===0){H("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),K.exit(1);return}K.stdout.write(`${zX(i)} -`),K.exit(0)}function WZe(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=i.path?` ${i.path}`:"";K.stdout.write(` [${i.detector}]${o} \u2014 ${Sae(i.message,140)} +`),K.exit(s.length>0?1:0);return}if(!t){H("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),K.exit(1);return}let i=BX(n,t,e.ac,r);if(!i||i.acs.length===0){H("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),K.exit(1);return}K.stdout.write(`${HX(i)} +`),K.exit(0)}function tGe(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=i.path?` ${i.path}`:"";K.stdout.write(` [${i.detector}]${o} \u2014 ${Eae(i.message,140)} `)}n.length>3&&K.stdout.write(` \u2026 and ${n.length-3} more finding(s) `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` -`).find(r=>r.trim().length>0);e&&K.stdout.write(` ${Sae(e.trim(),160)} -`)}}function Sae(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function KZe(t){let e=J();K.stdout.write(`${qX(e,".",{internal:t.internal})} -`),K.exit(0)}function JZe(t){let e=Qk(t);H("note",`route \u2192 ${e}`,t),K.exit(e==="unknown"?1:0)}var YZe={refine:"clarify",panel:"status",drive:"run"};function XZe(t){let e=t?YZe[t]:void 0;e&&K.stderr.write(`cladding: '${t}' is now '${e}' \u2014 the old verb is removed in 0.7 -`)}function QZe(){let t=new B2;t.name("clad").description("Reference Ironclad CLI").version("0.7.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init \uACB0\uC81C SaaS for B2B`) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").action(CZe),t.command("run [goal]").alias("drive").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(DZe),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(NZe),t.command("setup").description("Wire cladding into installed AI tool host channels (Claude Code / Codex / Gemini)").option("--force","overwrite directory-copy wires (Windows fallback) even when changes detected").option("--quiet","suppress stdout output").action(FZe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: re-wire hosts + sync inventory + refresh the managed CLAUDE.md/AGENTS.md section, then report (without blocking) what the now-stricter detectors flag").action(zZe),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(ZZe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(jZe),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(GZe),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>VZe(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(MZe),t.command("status").alias("panel").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").action(KZe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(UZe),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>qZe(r,n)),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>BZe(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full per-feature report as JSON").action(r=>HZe(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>aX(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>cX()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{lX(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").action(r=>a6(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(JZe),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(nJ),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(RZe),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").action(g6),t.command("clarify [answer...]").alias("refine").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, e.g. `clad clarify \uBC95\uC778 \uC0AC\uC5C5\uC790\uB9CC`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(ZY),t}var eGe=!!globalThis.__CLADDING_BUNDLED,tGe=eGe||import.meta.url===`file://${K.argv[1]}`;tGe&&(XZe(K.argv[2]),QZe().parse());export{YZe as RENAMED_VERBS,LZe as TIER_STAGES,QZe as createProgram,XZe as printVerbDeprecationNotice,ZZe as runCheckCommand,O2 as runCheckStages,jZe as runCheckpointCommand,UZe as runContextCommand,GZe as runDoneCommand,qZe as runImpactCommand,BZe as runInferDepsCommand,CZe as runInitCommand,HZe as runMeasureCommand,VZe as runOracleCommand,MZe as runRollbackCommand,JZe as runRouteCommand,DZe as runRunCommand,RZe as runServeCommand,FZe as runSetupCommand,KZe as runStatusCommand,NZe as runSyncCommand,zZe as runUpdateCommand}; +`).find(r=>r.trim().length>0);e&&K.stdout.write(` ${Eae(e.trim(),160)} +`)}}function Eae(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function rGe(t){let e=J();K.stdout.write(`${VX(e,".",{internal:t.internal})} +`),K.exit(0)}function nGe(t){let e=tE(t);H("note",`route \u2192 ${e}`,t),K.exit(e==="unknown"?1:0)}var iGe={refine:"clarify",panel:"status",drive:"run"};function oGe(t){let e=t?iGe[t]:void 0;e&&K.stderr.write(`cladding: '${t}' is now '${e}' \u2014 the old verb is removed in 0.7 +`)}function sGe(){let t=new G2;t.name("clad").description("Reference Ironclad CLI").version("0.7.0"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init \uACB0\uC81C SaaS for B2B`) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").action(LZe),t.command("run [goal]").alias("drive").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(UZe),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(qZe),t.command("setup").description("Wire cladding into installed AI tool host channels (Claude Code / Codex / Gemini)").option("--force","overwrite directory-copy wires (Windows fallback) even when changes detected").option("--quiet","suppress stdout output").action(ZZe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: re-wire hosts + sync inventory + refresh the managed CLAUDE.md/AGENTS.md section, then report (without blocking) what the now-stricter detectors flag").action(GZe),t.command("check").description("Run every Iron Law stage and the drift detector suite").option("--internal","show stage codes (`stage_1.1`) instead of names (`Type`)").option("--strict","promote warn-severity drift findings to errors (CI / pre-publish gate)").option("--tier ","run only the stages for a trigger: pre-commit (drift/arch/secret) | pre-push (+ type/lint/unit/cov/spec-conformance/deliverable-smoke) | all (default; full 15-stage gate, used by CI)").option("--json","emit structured per-stage results (machine-readable: findings with file/line/suggestion, untruncated) \u2014 for agents/CI; cuts RED\u2192fix round-trips").option("--feature ","scope the gate to this feature's modules[] (Gradle monorepos): runs only :project: tasks instead of the root aggregate. No-op for non-Gradle repos or modules-less features").action(XZe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(BZe),t.command("done ").description("Mark a feature done ONLY if `clad check --tier=pre-push --strict` is GREEN (flip \u2192 gate \u2192 revert-on-red). Keeps `done` honest.").action(QZe),t.command("oracle [featureId]").description("Print the impl-blind oracle authoring brief (acceptance criteria + signatures, never the implementation). Hand it to a fresh blind sub-agent; record the result with clad_author_oracle. cladding calls no LLM. Use --required to list which done ACs the project policy needs an oracle for.").option("--ac ","restrict the brief to a single acceptance criterion").option("--required","list the done ACs the oracle_policy / require_oracles requires an oracle for (worklist), instead of a brief").option("--cwd ","project root (defaults to .)").action((r,n)=>eGe(r,n)),t.command("rollback ").description("Record a rollback event and print the maintainer-runnable git command for the latest checkpoint").option("-r, --reason ","optional free-text reason recorded on the event payload").action(HZe),t.command("status").alias("panel").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").action(rGe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(WZe),t.command("impact ").description("Print the blast radius for a change \u2014 what depends on a feature/file + the tests to re-run (F-7794a6bc)").option("--depth ","bound the dependent walk to N hops (default: the full transitive radius)").action((r,n)=>KZe(r,n)),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>JZe(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full per-feature report as JSON").action(r=>YZe(r));let e=t.command("graph").description("Render the spec\u2194code\u2194doc knowledge graph for a viewer, or report its shape (F-569f4b37)");return e.command("export").description("Export the graph: mermaid/dot/json to stdout, or an Obsidian vault to --out").option("--format ","mermaid | dot | json | obsidian | html (default: mermaid). html = a single self-contained offline viewer (requires --out)").option("--focus ","restrict to a feature/file node\u2019s neighborhood (id, slug, or module path)").option("--depth ","neighborhood radius around --focus (default: unbounded)").option("--out ","write to a file (or, for obsidian, a vault dir \u2014 default .cladding/graph)").action(r=>uX(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>dX()),e.command("serve").description("Serve a LIVE graph at localhost \u2014 recomputes on each load + auto-reloads on spec/doc changes (F-64a5c159)").option("--port ","port to listen on (default 3000)").action(r=>{fX(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").action(r=>u6(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(nGe),t.command("hook ").description("Host hook protocol adapter \u2014 consume one host lifecycle event (SessionStart | UserPromptSubmit | PreToolUse | PostToolUse | Stop) as stdin JSON and print the protocol response on stdout. Always exits 0 so a hook failure never bricks the host session.").action(sJ),t.command("serve").description("Run cladding as an MCP server over stdio \u2014 tools/resources/prompts for any MCP client").option("--cwd ","project directory exposed to the client (default cwd)").action(zZe),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").action(v6),t.command("clarify [answer...]").alias("refine").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, e.g. `clad clarify \uBC95\uC778 \uC0AC\uC5C5\uC790\uB9CC`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(WY),t}var aGe=!!globalThis.__CLADDING_BUNDLED,cGe=aGe||import.meta.url===`file://${K.argv[1]}`;cGe&&(oGe(K.argv[2]),sGe().parse());export{iGe as RENAMED_VERBS,VZe as TIER_STAGES,sGe as createProgram,oGe as printVerbDeprecationNotice,XZe as runCheckCommand,R2 as runCheckStages,BZe as runCheckpointCommand,WZe as runContextCommand,QZe as runDoneCommand,KZe as runImpactCommand,JZe as runInferDepsCommand,LZe as runInitCommand,YZe as runMeasureCommand,eGe as runOracleCommand,HZe as runRollbackCommand,nGe as runRouteCommand,UZe as runRunCommand,zZe as runServeCommand,ZZe as runSetupCommand,rGe as runStatusCommand,qZe as runSyncCommand,GZe as runUpdateCommand}; diff --git a/spec.yaml b/spec.yaml index 738776f3..cd27bd0a 100644 --- a/spec.yaml +++ b/spec.yaml @@ -49,8 +49,8 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 200 + features: 201 scenarios: 2 capabilities: 6 - test_files: 171 + test_files: 172 last_synced: "2026-07-02" diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 778fd537..688ffb69 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -26,11 +26,11 @@ attested: F-018: a4c997fd2e8a8a22 F-019: 722e8bf2c8e0b41c F-020: 2c5f4a94e3e57e9b - F-021: 8a1a82a59a1c45c7 + F-021: 3038583c9be2dac3 F-022: 8f596a1c737f6d42 - F-02343cd1: 77875ee09a7ea3bf + F-02343cd1: 4898c10c8112933b F-023: c347678282dafd98 - F-024: f67a86816b06f8ee + F-024: 8e94295e3bdf989f F-025: 187339b684896b8e F-026: bb35faf43ba582cb F-027: 7f4b1a055f141bb7 @@ -46,17 +46,17 @@ attested: F-037: 7f811c5c8bc0e8e3 F-038: 1338100beadb15a6 F-039: 2e60f3d899b72d7f - F-040: f678671ad6613fd8 + F-040: f657b518e8c95b9f F-041: cddb50fc41e49066 F-042: d1f661281bb9fb6e F-043: 2c5f4a94e3e57e9b - F-044: 95085e0995009f41 + F-044: b66f25667a92e6cb F-045: b494c9a80442ac20 F-046: 4b563fce74b6bb4b F-047: baf5a2dbb9bb5a4b - F-048: 30dcf0786717f873 + F-048: 0908b3efde759da9 F-049: 444a75986c1c3430 - F-051: 1c6cf231cc139640 + F-051: 15166184e6321e6a F-052: 61e043371b9f7c71 F-053: 13a90cd08aec07ae F-054: 5f5d30500bd8cd7f @@ -69,7 +69,7 @@ attested: F-061: c16123610e8fe7fc F-062: 0ab83282a7f7b1ef F-063: 76a719993cc71fa8 - F-064: e176668e53f61c6e + F-064: ae2257aa0a9a82f5 F-065: e6ed3ef916201947 F-066: 512896be3294c6e4 F-067: 6e6dbd05bf314b56 @@ -79,84 +79,85 @@ attested: F-070: e50bb5d3addc7720 F-071: 3183a483a8015d4c F-072: 44e1d39139c816cc - F-073: 47be139281e7940a + F-073: ca0128a8f26b448e F-074: a4cc2b9bf66c77ac - F-075: f8242e8d7fdc0488 + F-075: 4eb010b3597b6980 F-076: 0061ab2d4b4991a8 F-077: 7aac44757146b695 F-078: c6af3d128b98f4e6 - F-079: f3188948e53e942f + F-079: 21f71d692ea02449 F-080: 1c19da74d32894e6 F-081: 248f9660cfb1b02b F-098d3b: 42d61bf806ce462b - F-09d68b: dca7938bcf6fa47e + F-09d68b: 5786f607fd02cd58 F-0ed2db: f94e2f45a16ff99c - F-0f2984d0: b852882d00177ef9 + F-0f2984d0: c91aa249ed795b43 F-12d740: 84ad71574d306c81 F-15999130: 894b484b7a93690c - F-16138071: c8b73555d47cfdd7 + F-16138071: 66d6c10dfabf57f8 F-16746b: 2f98a1261b9b1fc2 F-17df0a: 915d13b33258d3fc F-18e951: d907c170a230e052 F-1c9166: c72ece4c25cc4748 - F-1d23a6: 8edadd4a7f136330 + F-1d23a6: 4c61a2e3f46e7c0f F-1edb38: 64283112a3ab96ce F-24062d: 7d0f890c1b7c68d0 F-245bd5: a8372aeb83acc411 - F-2be3e3bb: b852882d00177ef9 + F-2be3e3bb: c91aa249ed795b43 F-2de65d: 84ad71574d306c81 F-315fd7: c3b042c80fa7c187 F-31eeb8: d88a9880d29ae411 - F-32b1e0: 4cc7240778eaae75 + F-32b1e0: 628a367abff37a63 F-3788c2: af9778dea8687b29 F-37b4a8: e067655bad681488 - F-3a5339: 7d790460b97b35a7 + F-3a5339: 524214cca460245d F-3b3690: 6a36aad282d36f3a F-40327b: 8295358f7b813c8a - F-417ff0: 0cc5eeefc5e08377 + F-417ff0: f58a04fcfb16a6d5 F-42af48: 7702447a407758a1 F-43d8e3: bbea25941e2b675d F-4747ef: c255a18b6849d002 F-4db939: b2c386ca4e18c117 F-50ff43: fac674314685a912 F-551a1c: 305488fada044107 - F-569f4b37: 6ad74b9c3113817a - F-56abaa: a8863eff906b4d73 + F-569f4b37: 458a8c15b5c85801 + F-56abaa: f7fee17336e46647 F-570a3f: 3f60012b22c9b715 F-59f093: 26735424fba6308c F-5b188856: 92b72281c248eba3 - F-5b9f9f: cad717b88efe592a + F-5b9f9f: 5ab050d64334fb33 F-5d3ed2: 9452eac28760fb99 F-5f6b45: 15323c4f5b619de7 - F-64a5c159: adedb516a257c7ec + F-64a5c159: 4d3e31d490fe3f69 F-65814a: 2136c8b8c94ef535 - F-67d2e9: 03dc30dc995da728 + F-67d2e9: e8ea664fe48a10d8 F-67e33f: c8f84d2f7b3971aa F-6d943d: e02e71ed007aded2 F-6f80e7: 0c0e5b71ae22cc26 F-7076f7: 7e819e0d440f3ffe - F-7794a6bc: 4d075a1a19bf4ba5 + F-7794a6bc: 8b3c5cc9ecca721a F-77f7ead0: 3f8cd4feeece1abd F-78b50d: 688e6afe2352a034 F-7afbd4: 18ce48352bee0fce - F-7ce18e: 42fe8057bc8e250b + F-7ce18e: ba2b90adc41ec0ec F-7fa4a7: 19b7709a0b2202e3 - F-80d19d: 6e03a098269ce4c3 + F-80d19d: 648a6e72fbd5c4ae F-836a90: a0d57b88aafbe6e8 F-8f419e: f3473746f4e252bc - F-904495a5: 56b5bb4bf3c35ddf - F-9064ff: b586e3aa6bc24aac + F-904495a5: e92154cd232d9967 + F-9064ff: 529abc9fab019e21 F-94dda4: 8dfb0267c45534f9 F-95a096: 4c7b844669411617 F-96250595: 846ab496e40cdd48 F-96700032: 5ae97b4c82c14acc + F-97abf5db: d07f7000f8fab9d7 F-99c6e5: 8a8724852f1d6059 F-9a3b61: 786eeefef2d25138 - F-9b643e: 1c68e95890f2671e + F-9b643e: efbde82cde97020d F-9d168287: 6a3dc163c77b9e15 F-a04cd9: e65d87671306d305 F-a4b512: d136f2a1bbc4383a - F-a5228c: 4a9f641497c37b67 + F-a5228c: bfea6820a138828c F-aa7197: 7f561e4f3c902716 F-ae61c1: 7c3c8622e5375754 F-aee1da: a6d7525a6c547877 @@ -166,35 +167,35 @@ attested: F-b2094740: 2ea89b77e7c8e740 F-b43066: 9402b630adcf1eae F-b61449: 7095ce00662e987d - F-b84c38: 61a41c3f765e8a92 - F-b99577: b3de7411ed1f21aa + F-b84c38: 7c1b0ae30a9a5331 + F-b99577: 2c07a912992e8cf7 F-ba2e05: 158e77c8af32514a F-ba4b7a: c282e0e915ed547c - F-bb15e6: 9b629bd8910007fa + F-bb15e6: 1778a14f423295cb F-bd07d7: 4bf7e1baddf5d754 - F-bdcd90: 826853f7885a5a08 + F-bdcd90: 74978de6d70b5954 F-bfe14aac: 2ea89b77e7c8e740 - F-c037ae: 6a58cdcfd0474e5f - F-c2c996: 5c73fa010b1502fa - F-c48eb2: 6a581a63e255c279 + F-c037ae: a37a0f9651e182b0 + F-c2c996: c4f65193958987e4 + F-c48eb2: a707eb6db729a91a F-c4c5ae: 18200d79542ae22e F-c8aef8: 02e07f929a1d0ded F-cd0415: 9cf6ce40e2a8b381 F-cfba0c: 077c03b8a96f562b F-d12edf: c19aa5d1007e0b8f - F-d2c806: b3d8668905855a6c + F-d2c806: e7b19d6e2f6ec583 F-d3bde4: 915d13b33258d3fc - F-d49585: 11e3ac2dce796fc6 - F-d6b93648: 2acbd4024d0f37ca + F-d49585: e09f480b54fed368 + F-d6b93648: 8606146965a4ade3 F-d7312b: 000237d094145b6a F-d8223c: 0501e9564231899b F-d980359c: 8f1559276afc5c03 F-dd51b42c: 30b7e2a656892648 F-dddb89: f5625354e55eba9b - F-e0f6c7: fe68521cda464f23 + F-e0f6c7: 7b2a2d98b2486c8a F-eb732f: d8abb536ff850a7a F-ee47fc2b: adb87c97b8ccf6e1 - F-ee5f643e: 7c61f35852f093ca + F-ee5f643e: 70b5f822272e14e7 F-ef2fd9: b3a1dcd1e750a714 F-f334fa: 5207f35968a0c9b2 F-f44d1b: 62e0779d9c0ef11f diff --git a/spec/features/test-run-dedup-97abf5db.yaml b/spec/features/test-run-dedup-97abf5db.yaml new file mode 100644 index 00000000..86fde26f --- /dev/null +++ b/spec/features/test-run-dedup-97abf5db.yaml @@ -0,0 +1,38 @@ +id: F-97abf5db +slug: test-run-dedup +title: "Test-run dedup — run the suite ONCE per gate (coverage run shared with the unit stage), sound attribution on failure" +status: done +modules: + - src/stages/test-run-cache.ts + - src/stages/unit.ts + - src/stages/cov.ts + - src/cli/clad.ts +acceptance_criteria: + - id: AC-ccb4e6dc + ears: event + condition: "when both the unit (2.1) and coverage (2.2) stages run in a primed gate pass" + action: "execute the test suite only ONCE via a shared memoized coverage run, reused across both stages" + response: "test-run-cache.ts memoizes the coverage run by cwd; the unit stage triggers it and the coverage stage gets a cache hit, so vitest runs once instead of twice" + text: "When both test stages run in a primed gate, the suite shall execute once." + test_refs: ["tests/stages/test-run-dedup.test.ts"] + - id: AC-1cd3923c + ears: state + condition: "while the shared coverage run is GREEN (exit 0)" + action: "report the unit stage as pass without re-running the suite" + response: "a green coverage run proves all tests passed, so the unit stage reuses it (the common, speed-critical green path saves the duplicate ~9.5s run)" + text: "While the shared coverage run is green, the unit stage shall pass without re-running." + test_refs: ["tests/stages/test-run-dedup.test.ts"] + - id: AC-81e95cc4 + ears: unwanted + condition: "if the shared coverage run is non-green" + action: "run the tests-only command for the unit stage so failure is attributed precisely" + response: "a real test failure fails BOTH stages; a coverage-threshold-only miss (tests pass) fails coverage but the unit stage's tests-only fallback passes — correct attribution, never a false unit pass on a real test failure" + text: "If the shared coverage run is non-green, then the unit stage shall re-run tests-only for precise attribution." + test_refs: ["tests/stages/test-run-dedup.test.ts"] + - id: AC-32ddd2a8 + ears: state + condition: "while no cache is primed (standalone stage call / MCP) or the project has no coverage runner" + action: "run each stage's own command exactly as before" + response: "the dedup is a primed-gate optimization; unprimed or coverage-less projects keep byte-for-byte the prior per-stage behavior" + text: "While unprimed or coverage-less, each stage shall run its own command unchanged." + test_refs: ["tests/stages/test-run-dedup.test.ts"] diff --git a/spec/index.yaml b/spec/index.yaml index 1f9c16ab..470ebb5a 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -151,6 +151,7 @@ features: F-95a096: {slug: ops-visibility-polish, status: done, modules: 3} F-96250595: {slug: iterative-impact-slice, status: done, modules: 2} F-96700032: {slug: unverified-ac-junit, status: done, modules: 4} + F-97abf5db: {slug: test-run-dedup, status: done, modules: 4} F-99c6e5: {slug: cladding-self-fixes, status: done, modules: 13} F-9a3b61: {slug: ab-ext-uncommit-demos, status: done, modules: 3} F-9b643e: {slug: scan-conventions, status: done, modules: 5} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index b2ec6d0d..dd23dd53 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -33,6 +33,7 @@ import {runAudit} from '../stages/audit.js'; import {runCommit} from '../stages/commit.js'; import {runCov} from '../stages/cov.js'; import {runDrift} from '../stages/drift.js'; +import {primeTestRunCache} from '../stages/test-run-cache.js'; import {runLint} from '../stages/lint.js'; import {runPerf} from '../stages/perf.js'; import {runSecret} from '../stages/secret.js'; @@ -466,6 +467,11 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier const pulseKindOf = (s: GateStatus): PulseKind => s === 'pass' ? 'pass' : s === 'liveness' ? 'note' : s === 'na' ? 'skip' : isBlocking(s) ? 'fail' : 'skip'; const collected: {stage: string; label: string; status: GateStatus; exitCode: number; stderr?: string; findings?: readonly DriftFinding[]}[] = []; + // Test-run dedup (F-97abf5db): share ONE suite run across the unit + coverage + // stages within this gate pass. Cleared in finally so the long-lived MCP + // server never reuses a test result across runs. + primeTestRunCache(true); + try { for (const [name, run] of stages) { const r = run({}) as { pass: boolean; @@ -492,6 +498,9 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier if (isBlocking(status)) printStageDetails(r); } } + } finally { + primeTestRunCache(false); + } // STRICT SKIP-POLICY (F-67d2e9, generalizes the 0.5.x unit-only guard). // Under --strict, a skipped stage the spec DEMANDS is a fail: 1.1 when a // declared language ships done features, 2.1 when done features declare diff --git a/src/stages/cov.ts b/src/stages/cov.ts index 5d2a485f..d9de9483 100644 --- a/src/stages/cov.ts +++ b/src/stages/cov.ts @@ -14,6 +14,7 @@ import process from 'node:process'; import {execaSync} from 'execa'; import {resolveStageCommand} from './toolchain/scoped-command.js'; +import {memoizeTestRun} from './test-run-cache.js'; import type {CommandStageOptions, StageResult} from './types.js'; import {missingToolSkip, ranToolResult} from './util.js'; @@ -37,7 +38,9 @@ export function runCov(opts: CommandStageOptions = {}): StageResult { stderr: `no coverage runner registered for language '${language}'`, }; } - const proc = execaSync(cmd, [...args], {cwd, reject: false}); + // Shared suite run (F-97abf5db): memoized by cwd so the unit stage (which ran + // first in a primed gate) and this stage execute the coverage suite only once. + const proc = memoizeTestRun(cwd, () => execaSync(cmd, [...args], {cwd, reject: false})); // execaSync(reject:false) RETURNS (does not throw) on a missing binary; // detect ENOENT on the result so a missing tool skips, not false-fails. const skip = missingToolSkip(STAGE, cmd, proc); diff --git a/src/stages/test-run-cache.ts b/src/stages/test-run-cache.ts new file mode 100644 index 00000000..14aa891b --- /dev/null +++ b/src/stages/test-run-cache.ts @@ -0,0 +1,59 @@ +// Cladding · gate-scoped test-run dedup (F-97abf5db). +// +// pre-push runs BOTH the unit stage (`vitest run`) and the coverage stage +// (`vitest run --coverage`) — the full suite executes TWICE (~9.5s + ~10.7s). +// But the coverage run already runs every test, so the unit run is redundant. +// +// This shares ONE coverage run across both stages, keyed by cwd, primed around +// the gate's stage loop (mirrors the run-scoped spec cache F-cd0415). The unit +// stage (2.1) runs first, triggers + caches the coverage run; the coverage +// stage (2.2) gets a cache hit. Sound by construction (see unitActionFromCoverage): +// a GREEN coverage run proves every test passed, so the unit stage reuses it; a +// NON-green run sends the unit stage to a tests-only fallback so a coverage- +// threshold miss is never mis-attributed as a unit-test failure. +// +// Pass-through when no cache is primed (standalone stage call / MCP) → behavior +// is byte-for-byte unchanged. A fresh Map per gate run; the long-lived MCP +// server never serves a stale test result across runs. + +import {resolve} from 'node:path'; + +let cache: Map | null = null; + +export function primeTestRunCache(on: boolean): void { + cache = on ? new Map() : null; +} + +export function isTestRunPrimed(): boolean { + return cache !== null; +} + +/** + * Run the shared suite memoized by cwd within a primed gate; pass-through when + * unprimed. Generic so callers get back their full runner result (exitCode, + * stderr, …) — the cache just dedups the expensive execution. + */ +export function memoizeTestRun(cwd: string, run: () => T): T { + if (!cache) return run(); + const key = resolve(cwd); + if (cache.has(key)) return cache.get(key) as T; + const r = run(); + cache.set(key, r); + return r; +} + +/** + * Decide what the unit stage should do given the shared coverage run: + * - `reuse-pass` — the coverage run was GREEN (exit 0), proving every test + * passed; the unit stage reports pass WITHOUT re-running the suite. + * - `fallback` — no coverage runner, the tool was missing, or the run was + * non-green; the unit stage must run the tests-only command so a real test + * failure is caught and a coverage-threshold-only miss is NOT mis-charged + * to the unit stage. + */ +export function unitActionFromCoverage( + cov: {readonly exitCode?: number; readonly missingTool: boolean} | null, +): 'reuse-pass' | 'fallback' { + if (!cov || cov.missingTool) return 'fallback'; + return cov.exitCode === 0 ? 'reuse-pass' : 'fallback'; +} diff --git a/src/stages/unit.ts b/src/stages/unit.ts index d5d8903d..dc739b93 100644 --- a/src/stages/unit.ts +++ b/src/stages/unit.ts @@ -13,11 +13,22 @@ import process from 'node:process'; import {execaSync} from 'execa'; import {resolveStageCommand} from './toolchain/scoped-command.js'; +import {isTestRunPrimed, memoizeTestRun, unitActionFromCoverage} from './test-run-cache.js'; import type {CommandStageOptions, StageResult} from './types.js'; -import {missingToolSkip, ranToolResult} from './util.js'; +import {isMissingBinary, missingToolSkip, ranToolResult} from './util.js'; const STAGE = 'stage_2.1'; +/** Resolve a stage command without throwing — returns null on any failure/absence. */ +function tryResolve(stage: 'test' | 'coverage', opts: CommandStageOptions): {cmd: string; args: readonly string[]} | null { + try { + const {cmd, args} = resolveStageCommand(stage, opts); + return cmd && args ? {cmd, args} : null; + } catch { + return null; + } +} + /** * Runs the project's unit-test suite and returns an Ironclad-shaped result. * @@ -28,6 +39,19 @@ const STAGE = 'stage_2.1'; */ export function runUnit(opts: CommandStageOptions = {}): StageResult { const {cwd = '.'} = opts; + // Test-run dedup (F-97abf5db): in a primed gate, the coverage stage will run + // the full suite anyway. Share that one run — trigger it here (the unit stage + // runs first) and reuse on GREEN. A non-green coverage run falls through to a + // tests-only run below, so a coverage-threshold miss is never mis-attributed + // to the unit stage. Unprimed (standalone / MCP) skips this entirely. + if (isTestRunPrimed()) { + const cov = tryResolve('coverage', opts); + if (cov) { + const covProc = memoizeTestRun(cwd, () => execaSync(cov.cmd, [...cov.args], {cwd, reject: false})); + const action = unitActionFromCoverage({exitCode: covProc.exitCode, missingTool: isMissingBinary(covProc)}); + if (action === 'reuse-pass') return {stage: STAGE, pass: true, exitCode: 0}; + } + } let cmd: string | undefined; let args: readonly string[] | undefined; let language: string; diff --git a/tests/stages/test-run-dedup.test.ts b/tests/stages/test-run-dedup.test.ts new file mode 100644 index 00000000..4ccad3ed --- /dev/null +++ b/tests/stages/test-run-dedup.test.ts @@ -0,0 +1,146 @@ +import {afterEach, describe, expect, it} from 'vitest'; +import { + primeTestRunCache, + isTestRunPrimed, + memoizeTestRun, + unitActionFromCoverage, +} from '../../src/stages/test-run-cache.js'; + +// Blind oracle for F-97abf5db: the gate-scoped memo that makes the unit + +// coverage stages run the test suite once. Authored from the spec brief only. + +afterEach(() => primeTestRunCache(false)); + +describe('isTestRunPrimed / primeTestRunCache', () => { + it('installs and clears a cache', () => { + primeTestRunCache(true); + expect(isTestRunPrimed()).toBe(true); + primeTestRunCache(false); + expect(isTestRunPrimed()).toBe(false); + }); +}); + +describe('memoizeTestRun', () => { + it('1. unprimed → pass-through: run invoked on every call', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + // no prime installed + expect(isTestRunPrimed()).toBe(false); + const a = memoizeTestRun('/tmp/x', run); + const b = memoizeTestRun('/tmp/x', run); + expect(n).toBe(2); + expect(a).toBe(1); + expect(b).toBe(2); + }); + + it('2. primed, same cwd → cached: run invoked once, same value returned', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + primeTestRunCache(true); + const a = memoizeTestRun('/tmp/x', run); + const b = memoizeTestRun('/tmp/x', run); + expect(n).toBe(1); + expect(a).toBe(1); + expect(b).toBe(1); + }); + + it('3. primed, different cwd → independent: run invoked twice', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + primeTestRunCache(true); + const a = memoizeTestRun('/tmp/a', run); + const b = memoizeTestRun('/tmp/b', run); + expect(n).toBe(2); + expect(a).toBe(1); + expect(b).toBe(2); + }); + + it('4. key is resolved path: /tmp/x and /tmp/x/../x share one entry', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + primeTestRunCache(true); + const a = memoizeTestRun('/tmp/x', run); + const b = memoizeTestRun('/tmp/x/../x', run); + expect(n).toBe(1); + expect(a).toBe(1); + expect(b).toBe(1); + }); + + it('5. re-priming installs a fresh cache (forgets prior entry)', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + primeTestRunCache(true); + const a = memoizeTestRun('/tmp/x', run); + expect(n).toBe(1); + expect(a).toBe(1); + primeTestRunCache(true); // fresh empty cache + const b = memoizeTestRun('/tmp/x', run); + expect(n).toBe(2); + expect(b).toBe(2); + }); + + it('6. clearing restores pass-through', () => { + let n = 0; + const run = () => { + n++; + return n; + }; + primeTestRunCache(true); + memoizeTestRun('/tmp/x', run); + expect(n).toBe(1); + primeTestRunCache(false); // clear + expect(isTestRunPrimed()).toBe(false); + const a = memoizeTestRun('/tmp/x', run); + const b = memoizeTestRun('/tmp/x', run); + expect(n).toBe(3); // 1 (primed) + 2 (pass-through) + expect(a).toBe(2); + expect(b).toBe(3); + }); +}); + +describe('unitActionFromCoverage (soundness contract)', () => { + // SOUNDNESS: `reuse-pass` is returned ONLY for an explicitly green (exitCode 0) + // coverage run. Any non-zero / undefined exitCode ⇒ `fallback`, so a failing + // test suite (non-zero) can NEVER be reported as a unit pass via reuse — the + // unit stage re-runs tests-only instead. exitCode !== 0 ⇒ fallback is the guard. + it('null → fallback (no coverage runner)', () => { + expect(unitActionFromCoverage(null)).toBe('fallback'); + }); + + it('missingTool: true (any exitCode) → fallback', () => { + expect(unitActionFromCoverage({missingTool: true})).toBe('fallback'); + expect(unitActionFromCoverage({exitCode: 0, missingTool: true})).toBe('fallback'); + expect(unitActionFromCoverage({exitCode: 1, missingTool: true})).toBe('fallback'); + }); + + it('exitCode 0, missingTool false → reuse-pass', () => { + expect(unitActionFromCoverage({exitCode: 0, missingTool: false})).toBe('reuse-pass'); + }); + + it('exitCode 1, missingTool false → fallback', () => { + expect(unitActionFromCoverage({exitCode: 1, missingTool: false})).toBe('fallback'); + }); + + it('exitCode 2, missingTool false → fallback', () => { + expect(unitActionFromCoverage({exitCode: 2, missingTool: false})).toBe('fallback'); + }); + + it('exitCode undefined, missingTool false → fallback (only explicit 0 reuses)', () => { + expect(unitActionFromCoverage({exitCode: undefined, missingTool: false})).toBe('fallback'); + }); +});