diff --git a/README.html b/README.html index d41efef..adc7392 100644 --- a/README.html +++ b/README.html @@ -235,7 +235,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -566,7 +566,7 @@

Status

tests
-
2953/2953
+
2981/2981
all pass
diff --git a/README.ja.md b/README.ja.md index 928dcd6..8f281c3 100644 --- a/README.ja.md +++ b/README.ja.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -347,7 +347,7 @@ clad update # 3. プロジェクト接続と派生状態を更新 | Version | 準拠レベル | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.4(2026-08) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2953 / 2953 | 15 段階 · 41 detectors | 277(273 done) | +| v0.9.4(2026-08) | L4 · [自己申告](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2981 / 2981 | 15 段階 · 41 detectors | 277(273 done) | 253 test files · capability 6 個 · カバレッジ低下は COVERAGE_DROP detector がブロック diff --git a/README.ko.html b/README.ko.html index 1657460..b296e70 100644 --- a/README.ko.html +++ b/README.ko.html @@ -277,7 +277,7 @@

cladding

ironclad spec - tests + tests detectors license

@@ -600,7 +600,7 @@

Status

tests
-
2953/2953
+
2981/2981
all pass
diff --git a/README.ko.md b/README.ko.md index ead5a59..00663bb 100644 --- a/README.ko.md +++ b/README.ko.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -346,7 +346,7 @@ clad update # 3. 프로젝트 연결과 파생 데이터를 함께 | version | 준수 등급 | tests | gate | features | |---|---|---|---|---| -| v0.9.4 · 2026-08 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2953 / 2953 · all pass | 15 단계 · 41 detectors | 277 · 273 done · 자기 스펙 | +| v0.9.4 · 2026-08 | L4 · [L0–L4 중 최고 · 자가 선언](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2981 / 2981 · all pass | 15 단계 · 41 detectors | 277 · 273 done · 자기 스펙 | 253 test files · capability 6개 · coverage는 COVERAGE_DROP detector가 하락 차단 diff --git a/README.md b/README.md index e5b9803..5ad5e6a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -360,7 +360,7 @@ Reconcile the drift the update flagged. | Version | Conformance | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.4 (2026-08) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2953 / 2953 | 15 stages · 41 detectors | 277 (273 done) | +| v0.9.4 (2026-08) | L4 · [self-declared](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2981 / 2981 | 15 stages · 41 detectors | 277 (273 done) | 253 test files · 6 capabilities · coverage drop blocked by the COVERAGE_DROP detector diff --git a/README.zh.md b/README.zh.md index fd79596..fb2bb88 100644 --- a/README.zh.md +++ b/README.zh.md @@ -12,7 +12,7 @@

ironclad spec - tests + tests detectors license

@@ -343,7 +343,7 @@ clad update # 3. 刷新项目连接和派生状态 | 版本 | 一致性 | Tests | Gate | Features | |---|---|---|---|---| -| v0.9.4(2026-08) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2953 / 2953 | 15 阶段 · 41 检测器 | 277(273 done) | +| v0.9.4(2026-08) | L4 · [自我声明](https://github.com/qwerfunch/ironclad/blob/main/GOVERNANCE.md) | 2981 / 2981 | 15 阶段 · 41 检测器 | 277(273 done) | 253 个测试文件 · 6 项 capability · 覆盖率下降由 COVERAGE_DROP 检测器拦下 diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 4303468..4460b1e 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -184,7 +184,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus `)}function wl(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"} | ${H_e(l,r)} |`)}return n.join(` `)}function H_e(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 q_e)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${L_e(z_e(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function xl(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),cG(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)cG(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` `)}function cG(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=UT(r);n&&t.push(`- ${n}`)}t.push("")}var U_e,q_e,Z_=y(()=>{"use strict";Kf();G_();_l();U_e={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};q_e=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as B_e}from"node:fs";function Ri(t="./spec.yaml"){let e=B_e(t,"utf8");return(0,uG.parse)(e)}var uG,V_=y(()=>{"use strict";uG=wt(tr(),1)});var cs=v((Lr,cR)=>{"use strict";var oR=Lr.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+fG(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()};oR.prototype.toString=function(){return this.property+" "+this.message};var W_=Lr.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};W_.prototype.addError=function(e){var r;if(typeof e=="string")r=new oR(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 oR(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Ea(this);if(this.throwError)throw r;return r};W_.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function G_e(t,e){return e+": "+t.toString()+` -`}W_.prototype.toString=function(e){return this.errors.map(G_e).join("")};Object.defineProperty(W_.prototype,"valid",{get:function(){return!this.errors.length}});cR.exports.ValidatorResultError=Ea;function Ea(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ea),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Ea.prototype=new Error;Ea.prototype.constructor=Ea;Ea.prototype.name="Validation Error";var dG=Lr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};dG.prototype=Object.create(Error.prototype,{constructor:{value:dG,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var sR=Lr.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+fG(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};sR.prototype.resolve=function(e){return pG(this.base,e)};sR.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=pG(this.base,i||"");var s=new sR(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var ti=Lr.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]+$/};ti.regexp=ti.regex;ti.pattern=ti.regex;ti.ipv4=ti["ip-address"];Lr.isFormat=function(e,r,n){if(typeof e=="string"&&ti[r]!==void 0){if(ti[r]instanceof RegExp)return ti[r].test(e);if(typeof ti[r]=="function")return ti[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var fG=Lr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Lr.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 Z_e(t,e,r,n){typeof r=="object"?e[n]=aR(t[n],r):t.indexOf(r)===-1&&e.push(r)}function V_e(t,e,r){e[r]=t[r]}function W_e(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=aR(t[n],e[n]):r[n]=e[n]}function aR(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Z_e.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(V_e.bind(null,t,n)),Object.keys(e).forEach(W_e.bind(null,t,e,n))),n}cR.exports.deepMerge=aR;Lr.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 K_e(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Lr.encodePath=function(e){return e.map(K_e).join("")};Lr.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};Lr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var pG=Lr.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 yG=v((xet,gG)=>{"use strict";var sn=cs(),Le=sn.ValidatorResult,ls=sn.SchemaError,lR={};lR.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=lR.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(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 uR(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}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new ls("anyOf must be an array");if(!r.anyOf.some(uR.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};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new ls("allOf must be an array");var o=new Le(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};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new ls("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(uR.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};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!sn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=uR.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!sn.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(!sn.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 dR(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]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!sn.isSchema(s))throw new ls('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(dR(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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 ls('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=dR(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 mG(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)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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 ls('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&&mG.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)mG.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(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}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!sn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(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}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(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}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(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}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(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}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(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}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(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}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(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 J_e(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var fR=cs();pR.exports.SchemaScanResult=_G;function _G(t,e){this.id=t,this.ref=e}pR.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=fR.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=fR.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!fR.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 bG=yG(),us=cs(),vG=K_().scan,SG=us.ValidatorResult,Y_e=us.ValidatorResultError,Jf=us.SchemaError,wG=us.SchemaContext,X_e="/",Yt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ii),this.attributes=Object.create(bG.validators)};Yt.prototype.customFormats={};Yt.prototype.schemas=null;Yt.prototype.types=null;Yt.prototype.attributes=null;Yt.prototype.unresolvedRefs=null;Yt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=vG(r||X_e,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]};Yt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=us.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Jf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Yt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Jf('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 Ii=Yt.prototype.types={};Ii.string=function(e){return typeof e=="string"};Ii.number=function(e){return typeof e=="number"&&isFinite(e)};Ii.integer=function(e){return typeof e=="number"&&e%1===0};Ii.boolean=function(e){return typeof e=="boolean"};Ii.array=function(e){return Array.isArray(e)};Ii.null=function(e){return e===null};Ii.date=function(e){return e instanceof Date};Ii.any=function(e){return!0};Ii.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};$G.exports=Yt});var EG=v((Eet,yo)=>{"use strict";var Q_e=yo.exports.Validator=kG();yo.exports.ValidatorResult=cs().ValidatorResult;yo.exports.ValidatorResultError=cs().ValidatorResultError;yo.exports.ValidationError=cs().ValidationError;yo.exports.SchemaError=cs().SchemaError;yo.exports.SchemaScanResult=K_().SchemaScanResult;yo.exports.scan=K_().scan;yo.exports.validate=function(t,e,r){var n=new Q_e;return n.validate(t,e,r)}});import{readFileSync as ebe}from"node:fs";import{dirname as tbe,join as rbe}from"node:path";import{fileURLToPath as nbe}from"node:url";function cbe(t){let e=abe.validate(t,sbe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function OG(t){let e=cbe(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`}W_.prototype.toString=function(e){return this.errors.map(G_e).join("")};Object.defineProperty(W_.prototype,"valid",{get:function(){return!this.errors.length}});cR.exports.ValidatorResultError=Ea;function Ea(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ea),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Ea.prototype=new Error;Ea.prototype.constructor=Ea;Ea.prototype.name="Validation Error";var dG=Lr.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};dG.prototype=Object.create(Error.prototype,{constructor:{value:dG,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var sR=Lr.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+fG(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};sR.prototype.resolve=function(e){return pG(this.base,e)};sR.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=pG(this.base,i||"");var s=new sR(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var ti=Lr.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]+$/};ti.regexp=ti.regex;ti.pattern=ti.regex;ti.ipv4=ti["ip-address"];Lr.isFormat=function(e,r,n){if(typeof e=="string"&&ti[r]!==void 0){if(ti[r]instanceof RegExp)return ti[r].test(e);if(typeof ti[r]=="function")return ti[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var fG=Lr.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Lr.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 Z_e(t,e,r,n){typeof r=="object"?e[n]=aR(t[n],r):t.indexOf(r)===-1&&e.push(r)}function V_e(t,e,r){e[r]=t[r]}function W_e(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=aR(t[n],e[n]):r[n]=e[n]}function aR(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Z_e.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(V_e.bind(null,t,n)),Object.keys(e).forEach(W_e.bind(null,t,e,n))),n}cR.exports.deepMerge=aR;Lr.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 K_e(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Lr.encodePath=function(e){return e.map(K_e).join("")};Lr.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};Lr.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var pG=Lr.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 yG=v(($et,gG)=>{"use strict";var sn=cs(),Le=sn.ValidatorResult,ls=sn.SchemaError,lR={};lR.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=lR.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Le(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 uR(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}ze.anyOf=function(e,r,n,i){if(e===void 0)return null;var o=new Le(e,r,n,i),s=new Le(e,r,n,i);if(!Array.isArray(r.anyOf))throw new ls("anyOf must be an array");if(!r.anyOf.some(uR.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};ze.allOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.allOf))throw new ls("allOf must be an array");var o=new Le(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};ze.oneOf=function(e,r,n,i){if(e===void 0)return null;if(!Array.isArray(r.oneOf))throw new ls("oneOf must be an array");var o=new Le(e,r,n,i),s=new Le(e,r,n,i),a=r.oneOf.filter(uR.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};ze.if=function(e,r,n,i){if(e===void 0)return null;if(!sn.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=uR.call(this,e,n,i,null,r.if),s=new Le(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!sn.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(!sn.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 dR(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]}}ze.propertyNames=function(e,r,n,i){if(this.types.object(e)){var o=new Le(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!sn.isSchema(s))throw new ls('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(dR(e,a)!==void 0){var c=this.validateSchema(a,s,n,i.makeChild(s));o.importErrors(c)}return o}};ze.properties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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 ls('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=dR(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 mG(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)}}ze.patternProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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 ls('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&&mG.call(this,e,r,n,i,a,o)}return o}};ze.additionalProperties=function(e,r,n,i){if(this.types.object(e)){if(r.patternProperties)return null;var o=new Le(e,r,n,i);for(var s in e)mG.call(this,e,r,n,i,s,o);return o}};ze.minProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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}};ze.maxProperties=function(e,r,n,i){if(this.types.object(e)){var o=new Le(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}};ze.items=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.items!==void 0){var s=new Le(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}};ze.contains=function(e,r,n,i){var o=this;if(this.types.array(e)&&r.contains!==void 0){if(!sn.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Le(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}};ze.minimum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(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}};ze.maximum=function(e,r,n,i){if(this.types.number(e)){var o=new Le(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}};ze.exclusiveMaximum=function(e,r,n,i){if(typeof r.exclusiveMaximum!="boolean"&&this.types.number(e)){var o=new Le(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}};ze.maxLength=function(e,r,n,i){if(this.types.string(e)){var o=new Le(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}};ze.minItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(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}};ze.maxItems=function(e,r,n,i){if(this.types.array(e)){var o=new Le(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 J_e(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var fR=cs();pR.exports.SchemaScanResult=_G;function _G(t,e){this.id=t,this.ref=e}pR.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=fR.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=fR.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!fR.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 bG=yG(),us=cs(),vG=K_().scan,SG=us.ValidatorResult,Y_e=us.ValidatorResultError,Jf=us.SchemaError,wG=us.SchemaContext,X_e="/",Yt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(Ii),this.attributes=Object.create(bG.validators)};Yt.prototype.customFormats={};Yt.prototype.schemas=null;Yt.prototype.types=null;Yt.prototype.attributes=null;Yt.prototype.unresolvedRefs=null;Yt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=vG(r||X_e,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]};Yt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=us.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Jf("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Yt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Jf('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 Ii=Yt.prototype.types={};Ii.string=function(e){return typeof e=="string"};Ii.number=function(e){return typeof e=="number"&&isFinite(e)};Ii.integer=function(e){return typeof e=="number"&&e%1===0};Ii.boolean=function(e){return typeof e=="boolean"};Ii.array=function(e){return Array.isArray(e)};Ii.null=function(e){return e===null};Ii.date=function(e){return e instanceof Date};Ii.any=function(e){return!0};Ii.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};$G.exports=Yt});var EG=v((Aet,yo)=>{"use strict";var Q_e=yo.exports.Validator=kG();yo.exports.ValidatorResult=cs().ValidatorResult;yo.exports.ValidatorResultError=cs().ValidatorResultError;yo.exports.ValidationError=cs().ValidationError;yo.exports.SchemaError=cs().SchemaError;yo.exports.SchemaScanResult=K_().SchemaScanResult;yo.exports.scan=K_().scan;yo.exports.validate=function(t,e,r){var n=new Q_e;return n.validate(t,e,r)}});import{readFileSync as ebe}from"node:fs";import{dirname as tbe,join as rbe}from"node:path";import{fileURLToPath as nbe}from"node:url";function cbe(t){let e=abe.validate(t,sbe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function OG(t){let e=cbe(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` `)}`)}var AG,ibe,obe,sbe,abe,TG=y(()=>{"use strict";AG=wt(EG(),1),ibe=tbe(nbe(import.meta.url)),obe=rbe(ibe,"schema.json"),sbe=JSON.parse(ebe(obe,"utf8")),abe=new AG.Validator});import{existsSync as mR,readdirSync as lbe}from"node:fs";import{dirname as ube,join as Aa,resolve as IG}from"node:path";function RG(t){return mR(t)?lbe(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>Ri(Aa(t,r))):[]}function Oa(t,e){J_=e?{cwd:IG(t),spec:e}:null}function q(t=".",e="spec.yaml"){return J_&&e==="spec.yaml"&&IG(t)===J_.cwd?J_.spec:dbe(t,e)}function dbe(t,e){let r=Aa(t,e),n=Ri(r),i=Aa(t,ube(e),"spec");if(!n.features||n.features.length===0){let o=RG(Aa(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=RG(Aa(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Aa(i,"architecture.yaml");mR(o)&&(n.architecture=Ri(o))}if(!n.capabilities||n.capabilities.length===0){let o=Aa(i,"capabilities.yaml");if(mR(o)){let s=Ri(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return OG(n),n}var J_,Ue=y(()=>{"use strict";V_();TG();J_=null});import $l from"node:process";function yR(){return!!$l.stdout.isTTY}function L(t,e,r=""){let n=PG[t],i=r?` ${r}`:"";yR()?$l.stdout.write(`${hR[t]}${n}${gR} ${e}${i} `):$l.stdout.write(`${n} ${e}${i} @@ -225,10 +225,10 @@ attested_features: 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]},TR=t=>{if(t==="all")return t;if(Pn.includes(t))return Pn.indexOf(t);let e=_ve.exec(t);if(e!==null)return Number(e[1])},_ve=/^fd(\d+)$/,bve=(t,e)=>t.map(r=>r===void 0?Sve[e]:r),vve=fve("execa").enabled?"full":"none",Sve={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:vve,stripFinalNewline:!0},RR=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],wo=(t,e)=>e==="ipc"?t.at(-1):t[e]});var Rl,Il,SZ,IR,wve,ab,cb,ps=y(()=>{xo();Rl=({verbose:t},e)=>IR(t,e)!=="none",Il=({verbose:t},e)=>!["none","short"].includes(IR(t,e)),SZ=({verbose:t},e)=>{let r=IR(t,e);return ab(r)?r:void 0},IR=(t,e)=>e===void 0?wve(t):wo(t,e),wve=t=>t.find(e=>ab(e))??cb.findLast(e=>t.includes(e)),ab=t=>typeof t=="function",cb=["none","short","full"]});import{platform as xve}from"node:process";import{stripVTControlCharacters as $ve}from"node:util";var wZ,ep,xZ,kve,Eve,Ave,Ove,Tve,Rve,Ive,lb=y(()=>{wZ=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Rve(xZ(o))).join(" ");return{command:n,escapedCommand:i}},ep=t=>$ve(t).split(` `).map(e=>xZ(e)).join(` -`),xZ=t=>t.replaceAll(Ave,e=>kve(e)),kve=t=>{let e=Ove[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Tve?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Eve=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Ave=Eve(),Ove={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Tve=65535,Rve=t=>Ive.test(t)?t:xve==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Ive=/^[\w./-]+$/});import $Z from"node:process";function PR(){let{env:t}=$Z,{TERM:e,TERM_PROGRAM:r}=t;return $Z.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 kZ=y(()=>{});var EZ,AZ,Pve,Cve,Dve,Nve,jve,ub,Ctt,OZ=y(()=>{kZ();EZ={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"},AZ={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"},Pve={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"},Cve={...EZ,...AZ},Dve={...EZ,...Pve},Nve=PR(),jve=Nve?Cve:Dve,ub=jve,Ctt=Object.entries(AZ)});import Mve from"node:tty";var Fve,ve,jtt,TZ,Mtt,Ftt,Ltt,ztt,Utt,qtt,Htt,Btt,Gtt,Ztt,Vtt,Wtt,Ktt,Jtt,Ytt,db,Xtt,Qtt,ert,trt,rrt,nrt,irt,ort,srt,RZ,art,IZ,crt,lrt,urt,drt,frt,prt,mrt,hrt,grt,yrt,_rt,CR=y(()=>{Fve=Mve?.WriteStream?.prototype?.hasColors?.()??!1,ve=(t,e)=>{if(!Fve)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}},jtt=ve(0,0),TZ=ve(1,22),Mtt=ve(2,22),Ftt=ve(3,23),Ltt=ve(4,24),ztt=ve(53,55),Utt=ve(7,27),qtt=ve(8,28),Htt=ve(9,29),Btt=ve(30,39),Gtt=ve(31,39),Ztt=ve(32,39),Vtt=ve(33,39),Wtt=ve(34,39),Ktt=ve(35,39),Jtt=ve(36,39),Ytt=ve(37,39),db=ve(90,39),Xtt=ve(40,49),Qtt=ve(41,49),ert=ve(42,49),trt=ve(43,49),rrt=ve(44,49),nrt=ve(45,49),irt=ve(46,49),ort=ve(47,49),srt=ve(100,49),RZ=ve(91,39),art=ve(92,39),IZ=ve(93,39),crt=ve(94,39),lrt=ve(95,39),urt=ve(96,39),drt=ve(97,39),frt=ve(101,49),prt=ve(102,49),mrt=ve(103,49),hrt=ve(104,49),grt=ve(105,49),yrt=ve(106,49),_rt=ve(107,49)});var PZ=y(()=>{CR();CR()});var NZ,zve,fb,CZ,Uve,DZ,qve,jZ=y(()=>{OZ();PZ();NZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=zve(r),c=Uve[t]({failed:o,reject:s,piped:n}),l=qve[t]({reject:s});return`${db(`[${a}]`)} ${db(`[${i}]`)} ${l(c)} ${l(e)}`},zve=t=>`${fb(t.getHours(),2)}:${fb(t.getMinutes(),2)}:${fb(t.getSeconds(),2)}.${fb(t.getMilliseconds(),3)}`,fb=(t,e)=>String(t).padStart(e,"0"),CZ=({failed:t,reject:e})=>t?e?ub.cross:ub.warning:ub.tick,Uve={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:CZ,duration:CZ},DZ=t=>t,qve={command:()=>TZ,output:()=>DZ,ipc:()=>DZ,error:({reject:t})=>t?RZ:IZ,duration:()=>db}});var MZ,Hve,Bve,FZ=y(()=>{ps();MZ=(t,e,r)=>{let n=SZ(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Hve(i,o,n)).filter(i=>i!==void 0).map(i=>Bve(i)).join("")},Hve=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Bve=t=>t.endsWith(` +`),xZ=t=>t.replaceAll(Ave,e=>kve(e)),kve=t=>{let e=Ove[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Tve?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Eve=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Ave=Eve(),Ove={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Tve=65535,Rve=t=>Ive.test(t)?t:xve==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Ive=/^[\w./-]+$/});import $Z from"node:process";function PR(){let{env:t}=$Z,{TERM:e,TERM_PROGRAM:r}=t;return $Z.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 kZ=y(()=>{});var EZ,AZ,Pve,Cve,Dve,Nve,jve,ub,Dtt,OZ=y(()=>{kZ();EZ={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"},AZ={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"},Pve={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"},Cve={...EZ,...AZ},Dve={...EZ,...Pve},Nve=PR(),jve=Nve?Cve:Dve,ub=jve,Dtt=Object.entries(AZ)});import Mve from"node:tty";var Fve,ve,Mtt,TZ,Ftt,Ltt,ztt,Utt,qtt,Htt,Btt,Gtt,Ztt,Vtt,Wtt,Ktt,Jtt,Ytt,Xtt,db,Qtt,ert,trt,rrt,nrt,irt,ort,srt,art,RZ,crt,IZ,lrt,urt,drt,frt,prt,mrt,hrt,grt,yrt,_rt,brt,CR=y(()=>{Fve=Mve?.WriteStream?.prototype?.hasColors?.()??!1,ve=(t,e)=>{if(!Fve)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}},Mtt=ve(0,0),TZ=ve(1,22),Ftt=ve(2,22),Ltt=ve(3,23),ztt=ve(4,24),Utt=ve(53,55),qtt=ve(7,27),Htt=ve(8,28),Btt=ve(9,29),Gtt=ve(30,39),Ztt=ve(31,39),Vtt=ve(32,39),Wtt=ve(33,39),Ktt=ve(34,39),Jtt=ve(35,39),Ytt=ve(36,39),Xtt=ve(37,39),db=ve(90,39),Qtt=ve(40,49),ert=ve(41,49),trt=ve(42,49),rrt=ve(43,49),nrt=ve(44,49),irt=ve(45,49),ort=ve(46,49),srt=ve(47,49),art=ve(100,49),RZ=ve(91,39),crt=ve(92,39),IZ=ve(93,39),lrt=ve(94,39),urt=ve(95,39),drt=ve(96,39),frt=ve(97,39),prt=ve(101,49),mrt=ve(102,49),hrt=ve(103,49),grt=ve(104,49),yrt=ve(105,49),_rt=ve(106,49),brt=ve(107,49)});var PZ=y(()=>{CR();CR()});var NZ,zve,fb,CZ,Uve,DZ,qve,jZ=y(()=>{OZ();PZ();NZ=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=zve(r),c=Uve[t]({failed:o,reject:s,piped:n}),l=qve[t]({reject:s});return`${db(`[${a}]`)} ${db(`[${i}]`)} ${l(c)} ${l(e)}`},zve=t=>`${fb(t.getHours(),2)}:${fb(t.getMinutes(),2)}:${fb(t.getSeconds(),2)}.${fb(t.getMilliseconds(),3)}`,fb=(t,e)=>String(t).padStart(e,"0"),CZ=({failed:t,reject:e})=>t?e?ub.cross:ub.warning:ub.tick,Uve={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:CZ,duration:CZ},DZ=t=>t,qve={command:()=>TZ,output:()=>DZ,ipc:()=>DZ,error:({reject:t})=>t?RZ:IZ,duration:()=>db}});var MZ,Hve,Bve,FZ=y(()=>{ps();MZ=(t,e,r)=>{let n=SZ(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Hve(i,o,n)).filter(i=>i!==void 0).map(i=>Bve(i)).join("")},Hve=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Bve=t=>t.endsWith(` `)?t:`${t} `});import{inspect as Gve}from"node:util";var Ci,Zve,Vve,Wve,pb,Kve,Pl=y(()=>{lb();jZ();FZ();Ci=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Zve({type:t,result:i,verboseInfo:n}),s=Vve(e,o),a=MZ(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Zve=({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}),Vve=(t,e)=>t.split(` -`).map(r=>Wve({...e,message:r})),Wve=t=>({verboseLine:NZ(t),verboseObject:t}),pb=t=>{let e=typeof t=="string"?t:Gve(t);return ep(e).replaceAll(" "," ".repeat(Kve))},Kve=2});var LZ,zZ=y(()=>{ps();Pl();LZ=(t,e)=>{Rl(e)&&Ci({type:"command",verboseMessage:t,verboseInfo:e})}});var UZ,Jve,Yve,Xve,qZ=y(()=>{ps();UZ=(t,e,r)=>{Xve(t);let n=Jve(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Jve=t=>Rl({verbose:t})?Yve++:void 0,Yve=0n,Xve=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(!cb.includes(e)&&!ab(e)){let r=cb.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as HZ}from"node:process";var mb,DR,hb=y(()=>{mb=()=>HZ.bigint(),DR=t=>Number(HZ.bigint()-t)/1e6});var gb,NR=y(()=>{zZ();qZ();hb();lb();xo();gb=(t,e,r)=>{let n=mb(),{command:i,escapedCommand:o}=wZ(t,e),s=OR(r,"verbose"),a=UZ(s,o,{...r});return LZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var WZ=v((Brt,VZ)=>{VZ.exports=ZZ;ZZ.sync=eSe;var BZ=Ze("fs");function Qve(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{XZ.exports=JZ;JZ.sync=tSe;var KZ=Ze("fs");function JZ(t,e,r){KZ.stat(t,function(n,i){r(n,n?!1:YZ(i,e))})}function tSe(t,e){return YZ(KZ.statSync(t),e)}function YZ(t,e){return t.isFile()&&rSe(t,e)}function rSe(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 tV=v((Vrt,eV)=>{var Zrt=Ze("fs"),yb;process.platform==="win32"||global.TESTING_WINDOWS?yb=WZ():yb=QZ();eV.exports=jR;jR.sync=nSe;function jR(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){jR(t,e||{},function(o,s){o?i(o):n(s)})})}yb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function nSe(t,e){try{return yb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var cV=v((Wrt,aV)=>{var Cl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",rV=Ze("path"),iSe=Cl?";":":",nV=tV(),iV=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),oV=(t,e)=>{let r=e.colon||iSe,n=t.match(/\//)||Cl&&t.match(/\\/)?[""]:[...Cl?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Cl?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Cl?i.split(r):[""];return Cl&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},sV=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=oV(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(iV(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=rV.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];nV(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)},oSe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=oV(t,e),o=[];for(let s=0;s{"use strict";var lV=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};MR.exports=lV;MR.exports.default=lV});var mV=v((Jrt,pV)=>{"use strict";var dV=Ze("path"),sSe=cV(),aSe=uV();function fV(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=sSe.sync(t.command,{path:r[aSe({env:r})],pathExt:e?dV.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=dV.resolve(i?t.options.cwd:"",s)),s}function cSe(t){return fV(t)||fV(t,!0)}pV.exports=cSe});var hV=v((Yrt,LR)=>{"use strict";var FR=/([()\][%!^"`<>&|;, *?])/g;function lSe(t){return t=t.replace(FR,"^$1"),t}function uSe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(FR,"^$1"),e&&(t=t.replace(FR,"^$1")),t}LR.exports.command=lSe;LR.exports.argument=uSe});var yV=v((Xrt,gV)=>{"use strict";gV.exports=/^#!(.*)/});var bV=v((Qrt,_V)=>{"use strict";var dSe=yV();_V.exports=(t="")=>{let e=t.match(dSe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var SV=v((ent,vV)=>{"use strict";var zR=Ze("fs"),fSe=bV();function pSe(t){let r=Buffer.alloc(150),n;try{n=zR.openSync(t,"r"),zR.readSync(n,r,0,150,0),zR.closeSync(n)}catch{}return fSe(r.toString())}vV.exports=pSe});var kV=v((tnt,$V)=>{"use strict";var mSe=Ze("path"),wV=mV(),xV=hV(),hSe=SV(),gSe=process.platform==="win32",ySe=/\.(?:com|exe)$/i,_Se=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function bSe(t){t.file=wV(t);let e=t.file&&hSe(t.file);return e?(t.args.unshift(t.file),t.command=e,wV(t)):t.file}function vSe(t){if(!gSe)return t;let e=bSe(t),r=!ySe.test(e);if(t.options.forceShell||r){let n=_Se.test(e);t.command=mSe.normalize(t.command),t.command=xV.command(t.command),t.args=t.args.map(o=>xV.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 SSe(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:vSe(n)}$V.exports=SSe});var OV=v((rnt,AV)=>{"use strict";var UR=process.platform==="win32";function qR(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 wSe(t,e){if(!UR)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=EV(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function EV(t,e){return UR&&t===1&&!e.file?qR(e.original,"spawn"):null}function xSe(t,e){return UR&&t===1&&!e.file?qR(e.original,"spawnSync"):null}AV.exports={hookChildProcess:wSe,verifyENOENT:EV,verifyENOENTSync:xSe,notFoundError:qR}});var IV=v((nnt,Dl)=>{"use strict";var TV=Ze("child_process"),HR=kV(),BR=OV();function RV(t,e,r){let n=HR(t,e,r),i=TV.spawn(n.command,n.args,n.options);return BR.hookChildProcess(i,n),i}function $Se(t,e,r){let n=HR(t,e,r),i=TV.spawnSync(n.command,n.args,n.options);return i.error=i.error||BR.verifyENOENTSync(i.status,n),i}Dl.exports=RV;Dl.exports.spawn=RV;Dl.exports.sync=$Se;Dl.exports._parse=HR;Dl.exports._enoent=BR});function _b(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 PV=y(()=>{});var CV=y(()=>{});import{promisify as kSe}from"node:util";import{execFile as ESe,execFileSync as cnt}from"node:child_process";import DV from"node:path";import{fileURLToPath as ASe}from"node:url";function bb(t){return t instanceof URL?ASe(t):t}function NV(t){return{*[Symbol.iterator](){let e=DV.resolve(bb(t)),r;for(;r!==e;)yield e,r=e,e=DV.resolve(e,"..")}}}var dnt,fnt,jV=y(()=>{CV();dnt=kSe(ESe);fnt=10*1024*1024});import vb from"node:process";import Ca from"node:path";var OSe,TSe,RSe,MV,FV=y(()=>{PV();jV();OSe=({cwd:t=vb.cwd(),path:e=vb.env[_b()],preferLocal:r=!0,execPath:n=vb.execPath,addExecPath:i=!0}={})=>{let o=Ca.resolve(bb(t)),s=[],a=e.split(Ca.delimiter);return r&&TSe(s,a,o),i&&RSe(s,a,n,o),e===""||e===Ca.delimiter?`${s.join(Ca.delimiter)}${e}`:[...s,e].join(Ca.delimiter)},TSe=(t,e,r)=>{for(let n of NV(r)){let i=Ca.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},RSe=(t,e,r,n)=>{let i=Ca.resolve(n,bb(r),"..");e.includes(i)||t.push(i)},MV=({env:t=vb.env,...e}={})=>{t={...t};let r=_b({env:t});return e.path=t[r],t[r]=OSe(e),t}});var LV,ni,zV,UV,qV,Sb,tp,rp,Da=y(()=>{LV=(t,e,r)=>{let n=r?rp:tp,i=t instanceof ni?{}:{cause:t};return new n(e,i)},ni=class extends Error{},zV=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,qV,{value:!0,writable:!1,enumerable:!1,configurable:!1})},UV=t=>Sb(t)&&qV in t,qV=Symbol("isExecaError"),Sb=t=>Object.prototype.toString.call(t)==="[object Error]",tp=class extends Error{};zV(tp,tp.name);rp=class extends Error{};zV(rp,rp.name)});var HV,ISe,BV,GV,ZV=y(()=>{HV=()=>{let t=GV-BV+1;return Array.from({length:t},ISe)},ISe=(t,e)=>({name:`SIGRT${e+1}`,number:BV+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),BV=34,GV=64});var VV,WV=y(()=>{VV=[{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 PSe}from"node:os";var GR,CSe,KV=y(()=>{WV();ZV();GR=()=>{let t=HV();return[...VV,...t].map(CSe)},CSe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=PSe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as DSe}from"node:os";var NSe,jSe,JV,MSe,FSe,LSe,Tnt,YV=y(()=>{KV();NSe=()=>{let t=GR();return Object.fromEntries(t.map(jSe))},jSe=({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}],JV=NSe(),MSe=()=>{let t=GR(),e=65,r=Array.from({length:e},(n,i)=>FSe(i,t));return Object.assign({},...r)},FSe=(t,e)=>{let r=LSe(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}}},LSe=(t,e)=>{let r=e.find(({name:n})=>DSe.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},Tnt=MSe()});import{constants as np}from"node:os";var QV,e9,t9,zSe,USe,XV,qSe,ZR,HSe,BSe,wb,ip=y(()=>{YV();QV=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return t9(t,e)},e9=t=>t===0?t:t9(t,"`subprocess.kill()`'s argument"),t9=(t,e)=>{if(Number.isInteger(t))return zSe(t,e);if(typeof t=="string")return qSe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +`).map(r=>Wve({...e,message:r})),Wve=t=>({verboseLine:NZ(t),verboseObject:t}),pb=t=>{let e=typeof t=="string"?t:Gve(t);return ep(e).replaceAll(" "," ".repeat(Kve))},Kve=2});var LZ,zZ=y(()=>{ps();Pl();LZ=(t,e)=>{Rl(e)&&Ci({type:"command",verboseMessage:t,verboseInfo:e})}});var UZ,Jve,Yve,Xve,qZ=y(()=>{ps();UZ=(t,e,r)=>{Xve(t);let n=Jve(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Jve=t=>Rl({verbose:t})?Yve++:void 0,Yve=0n,Xve=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(!cb.includes(e)&&!ab(e)){let r=cb.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as HZ}from"node:process";var mb,DR,hb=y(()=>{mb=()=>HZ.bigint(),DR=t=>Number(HZ.bigint()-t)/1e6});var gb,NR=y(()=>{zZ();qZ();hb();lb();xo();gb=(t,e,r)=>{let n=mb(),{command:i,escapedCommand:o}=wZ(t,e),s=OR(r,"verbose"),a=UZ(s,o,{...r});return LZ(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var WZ=v((Grt,VZ)=>{VZ.exports=ZZ;ZZ.sync=eSe;var BZ=Ze("fs");function Qve(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{XZ.exports=JZ;JZ.sync=tSe;var KZ=Ze("fs");function JZ(t,e,r){KZ.stat(t,function(n,i){r(n,n?!1:YZ(i,e))})}function tSe(t,e){return YZ(KZ.statSync(t),e)}function YZ(t,e){return t.isFile()&&rSe(t,e)}function rSe(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 tV=v((Wrt,eV)=>{var Vrt=Ze("fs"),yb;process.platform==="win32"||global.TESTING_WINDOWS?yb=WZ():yb=QZ();eV.exports=jR;jR.sync=nSe;function jR(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){jR(t,e||{},function(o,s){o?i(o):n(s)})})}yb(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function nSe(t,e){try{return yb.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var cV=v((Krt,aV)=>{var Cl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",rV=Ze("path"),iSe=Cl?";":":",nV=tV(),iV=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),oV=(t,e)=>{let r=e.colon||iSe,n=t.match(/\//)||Cl&&t.match(/\\/)?[""]:[...Cl?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Cl?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Cl?i.split(r):[""];return Cl&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},sV=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=oV(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(iV(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=rV.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];nV(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)},oSe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=oV(t,e),o=[];for(let s=0;s{"use strict";var lV=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};MR.exports=lV;MR.exports.default=lV});var mV=v((Yrt,pV)=>{"use strict";var dV=Ze("path"),sSe=cV(),aSe=uV();function fV(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=sSe.sync(t.command,{path:r[aSe({env:r})],pathExt:e?dV.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=dV.resolve(i?t.options.cwd:"",s)),s}function cSe(t){return fV(t)||fV(t,!0)}pV.exports=cSe});var hV=v((Xrt,LR)=>{"use strict";var FR=/([()\][%!^"`<>&|;, *?])/g;function lSe(t){return t=t.replace(FR,"^$1"),t}function uSe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(FR,"^$1"),e&&(t=t.replace(FR,"^$1")),t}LR.exports.command=lSe;LR.exports.argument=uSe});var yV=v((Qrt,gV)=>{"use strict";gV.exports=/^#!(.*)/});var bV=v((ent,_V)=>{"use strict";var dSe=yV();_V.exports=(t="")=>{let e=t.match(dSe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var SV=v((tnt,vV)=>{"use strict";var zR=Ze("fs"),fSe=bV();function pSe(t){let r=Buffer.alloc(150),n;try{n=zR.openSync(t,"r"),zR.readSync(n,r,0,150,0),zR.closeSync(n)}catch{}return fSe(r.toString())}vV.exports=pSe});var kV=v((rnt,$V)=>{"use strict";var mSe=Ze("path"),wV=mV(),xV=hV(),hSe=SV(),gSe=process.platform==="win32",ySe=/\.(?:com|exe)$/i,_Se=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function bSe(t){t.file=wV(t);let e=t.file&&hSe(t.file);return e?(t.args.unshift(t.file),t.command=e,wV(t)):t.file}function vSe(t){if(!gSe)return t;let e=bSe(t),r=!ySe.test(e);if(t.options.forceShell||r){let n=_Se.test(e);t.command=mSe.normalize(t.command),t.command=xV.command(t.command),t.args=t.args.map(o=>xV.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 SSe(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:vSe(n)}$V.exports=SSe});var OV=v((nnt,AV)=>{"use strict";var UR=process.platform==="win32";function qR(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 wSe(t,e){if(!UR)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=EV(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function EV(t,e){return UR&&t===1&&!e.file?qR(e.original,"spawn"):null}function xSe(t,e){return UR&&t===1&&!e.file?qR(e.original,"spawnSync"):null}AV.exports={hookChildProcess:wSe,verifyENOENT:EV,verifyENOENTSync:xSe,notFoundError:qR}});var IV=v((int,Dl)=>{"use strict";var TV=Ze("child_process"),HR=kV(),BR=OV();function RV(t,e,r){let n=HR(t,e,r),i=TV.spawn(n.command,n.args,n.options);return BR.hookChildProcess(i,n),i}function $Se(t,e,r){let n=HR(t,e,r),i=TV.spawnSync(n.command,n.args,n.options);return i.error=i.error||BR.verifyENOENTSync(i.status,n),i}Dl.exports=RV;Dl.exports.spawn=RV;Dl.exports.sync=$Se;Dl.exports._parse=HR;Dl.exports._enoent=BR});function _b(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 PV=y(()=>{});var CV=y(()=>{});import{promisify as kSe}from"node:util";import{execFile as ESe,execFileSync as lnt}from"node:child_process";import DV from"node:path";import{fileURLToPath as ASe}from"node:url";function bb(t){return t instanceof URL?ASe(t):t}function NV(t){return{*[Symbol.iterator](){let e=DV.resolve(bb(t)),r;for(;r!==e;)yield e,r=e,e=DV.resolve(e,"..")}}}var fnt,pnt,jV=y(()=>{CV();fnt=kSe(ESe);pnt=10*1024*1024});import vb from"node:process";import Ca from"node:path";var OSe,TSe,RSe,MV,FV=y(()=>{PV();jV();OSe=({cwd:t=vb.cwd(),path:e=vb.env[_b()],preferLocal:r=!0,execPath:n=vb.execPath,addExecPath:i=!0}={})=>{let o=Ca.resolve(bb(t)),s=[],a=e.split(Ca.delimiter);return r&&TSe(s,a,o),i&&RSe(s,a,n,o),e===""||e===Ca.delimiter?`${s.join(Ca.delimiter)}${e}`:[...s,e].join(Ca.delimiter)},TSe=(t,e,r)=>{for(let n of NV(r)){let i=Ca.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},RSe=(t,e,r,n)=>{let i=Ca.resolve(n,bb(r),"..");e.includes(i)||t.push(i)},MV=({env:t=vb.env,...e}={})=>{t={...t};let r=_b({env:t});return e.path=t[r],t[r]=OSe(e),t}});var LV,ni,zV,UV,qV,Sb,tp,rp,Da=y(()=>{LV=(t,e,r)=>{let n=r?rp:tp,i=t instanceof ni?{}:{cause:t};return new n(e,i)},ni=class extends Error{},zV=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,qV,{value:!0,writable:!1,enumerable:!1,configurable:!1})},UV=t=>Sb(t)&&qV in t,qV=Symbol("isExecaError"),Sb=t=>Object.prototype.toString.call(t)==="[object Error]",tp=class extends Error{};zV(tp,tp.name);rp=class extends Error{};zV(rp,rp.name)});var HV,ISe,BV,GV,ZV=y(()=>{HV=()=>{let t=GV-BV+1;return Array.from({length:t},ISe)},ISe=(t,e)=>({name:`SIGRT${e+1}`,number:BV+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),BV=34,GV=64});var VV,WV=y(()=>{VV=[{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 PSe}from"node:os";var GR,CSe,KV=y(()=>{WV();ZV();GR=()=>{let t=HV();return[...VV,...t].map(CSe)},CSe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=PSe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as DSe}from"node:os";var NSe,jSe,JV,MSe,FSe,LSe,Rnt,YV=y(()=>{KV();NSe=()=>{let t=GR();return Object.fromEntries(t.map(jSe))},jSe=({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}],JV=NSe(),MSe=()=>{let t=GR(),e=65,r=Array.from({length:e},(n,i)=>FSe(i,t));return Object.assign({},...r)},FSe=(t,e)=>{let r=LSe(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}}},LSe=(t,e)=>{let r=e.find(({name:n})=>DSe.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},Rnt=MSe()});import{constants as np}from"node:os";var QV,e9,t9,zSe,USe,XV,qSe,ZR,HSe,BSe,wb,ip=y(()=>{YV();QV=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return t9(t,e)},e9=t=>t===0?t:t9(t,"`subprocess.kill()`'s argument"),t9=(t,e)=>{if(Number.isInteger(t))return zSe(t,e);if(typeof t=="string")return qSe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. ${ZR()}`)},zSe=(t,e)=>{if(XV.has(t))return XV.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. ${ZR()}`)},USe=()=>new Map(Object.entries(np.signals).reverse().map(([t,e])=>[e,t])),XV=USe(),qSe=(t,e)=>{if(t in np.signals)return t;throw t.toUpperCase()in np.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. ${ZR()}`)},ZR=()=>`Available signal names: ${HSe()}. @@ -261,11 +261,11 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu `,LF:` `,concatBytes:RI},M0e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},F0e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:M0e}});import{Buffer as L0e}from"node:buffer";var SK,z0e,wK,U0e,q0e,xK,$K=y(()=>{an();SK=(t,e)=>t?void 0:z0e.bind(void 0,e),z0e=function*(t,e){if(typeof e!="string"&&!qt(e)&&!L0e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},wK=(t,e)=>t?U0e.bind(void 0,e):q0e.bind(void 0,e),U0e=function*(t,e){xK(t,e),yield e},q0e=function*(t,e){if(xK(t,e),typeof e!="string"&&!qt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},xK=(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 H0e}from"node:buffer";import{StringDecoder as B0e}from"node:string_decoder";var uv,G0e,Z0e,V0e,PI=y(()=>{an();uv=(t,e,r)=>{if(r)return;if(t)return{transform:G0e.bind(void 0,new TextEncoder)};let n=new B0e(e);return{transform:Z0e.bind(void 0,n),final:V0e.bind(void 0,n)}},G0e=function*(t,e){H0e.isBuffer(e)?yield vo(e):typeof e=="string"?yield t.encode(e):yield e},Z0e=function*(t,e){yield qt(e)?t.write(e):e},V0e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as kK}from"node:util";var CI,dv,EK,W0e,AK,K0e,OK=y(()=>{CI=kK(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),dv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=K0e}=e[r];for await(let i of n(t))yield*dv(i,e,r+1)},EK=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*W0e(r,Number(e),t)},W0e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*dv(n,r,e+1)},AK=kK(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),K0e=function*(t){yield t}});var DI,TK,Ua,hp,J0e,Y0e,NI=y(()=>{DI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},TK=(t,e)=>[...e.flatMap(r=>[...Ua(r,t,0)]),...hp(t)],Ua=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Y0e}=e[r];for(let i of n(t))yield*Ua(i,e,r+1)},hp=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*J0e(r,Number(e),t)},J0e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ua(n,r,e+1)},Y0e=function*(t){yield t}});import{Transform as X0e,getDefaultHighWaterMark as RK}from"node:stream";var jI,fv,IK,pv=y(()=>{$r();lv();$K();PI();OK();NI();jI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=IK(t,s,o),l=za(e),u=za(r),d=l?CI.bind(void 0,dv,a):DI.bind(void 0,Ua),f=l||u?CI.bind(void 0,EK,a):DI.bind(void 0,hp),p=l||u?AK.bind(void 0,a):void 0;return{stream:new X0e({writableObjectMode:n,writableHighWaterMark:RK(n),readableObjectMode:i,readableHighWaterMark:RK(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},fv=(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=IK(s,r,a);t=TK(c,t)}return t},IK=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:SK(n,a)},uv(r,s,n),cv(r,o,n,c),{transform:t,final:e},{transform:wK(i,a)},vK({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var PK,Q0e,e$e,t$e,r$e,CK=y(()=>{pv();an();$r();PK=(t,e)=>{for(let r of Q0e(t))e$e(t,r,e)},Q0e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),e$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 ${ys[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>t$e(a,n));r.input=Qf(s)},t$e=(t,e)=>{let r=fv(t,e,"utf8",!0);return r$e(r),Qf(r)},r$e=t=>{let e=t.find(r=>typeof r!="string"&&!qt(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 mv,n$e,i$e,DK,NK,o$e,jK,MI=y(()=>{ja();$r();Pl();ps();mv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Il(r,n)&&!cn.has(e)&&n$e(n)&&(t.some(({type:i,value:o})=>i==="native"&&i$e.has(o))||t.every(({type:i})=>Cn.has(i))),n$e=t=>t===1||t===2,i$e=new Set(["pipe","overlapped"]),DK=async(t,e,r,n)=>{for await(let i of t)o$e(e)||jK(i,r,n)},NK=(t,e,r)=>{for(let n of t)jK(n,e,r)},o$e=t=>t._readableState.pipes.length>0,jK=(t,e,r)=>{let n=pb(t);Ci({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as s$e,appendFileSync as a$e}from"node:fs";var MK,c$e,l$e,u$e,d$e,f$e,FK=y(()=>{MI();pv();lv();an();$r();La();MK=({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)=>c$e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},c$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=wW(t,o,d),p=vo(f),{stdioItems:m,objectMode:h}=e[r],g=l$e([p],m,c,n),{serializedResult:b,finalResult:_=b}=u$e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});d$e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&f$e(b,m,i),S}catch(x){return n.error=x,S}},l$e=(t,e,r,n)=>{try{return fv(t,e,r,!1)}catch(i){return n.error=i,t}},u$e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Qf(t)};let s=fZ(t,r);return n[o]?{serializedResult:s,finalResult:II(s,!i[o],e)}:{serializedResult:s}},d$e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!mv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=II(t,!1,s);try{NK(a,e,n)}catch(c){r.error??=c}},f$e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>ov.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?a$e(n,t):(r.add(o),s$e(n,t))}}});var LK,zK=y(()=>{an();mp();LK=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ko(e,r,"all")]:Array.isArray(e)?[ko(t,r,"all"),...e]:qt(t)&&qt(e)?ER([t,e]):`${t}${e}`}});import{once as FI}from"node:events";var UK,p$e,qK,HK,m$e,LI,zI=y(()=>{Da();UK=async(t,e)=>{let[r,n]=await p$e(t);return e.isForcefullyTerminated??=!1,[r,n]},p$e=async t=>{let[e,r]=await Promise.allSettled([FI(t,"spawn"),FI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qK(t):r.value},qK=async t=>{try{return await FI(t,"exit")}catch{return qK(t)}},HK=async t=>{let[e,r]=await t;if(!m$e(e,r)&&LI(e,r))throw new ni;return[e,r]},m$e=(t,e)=>t===void 0&&e===void 0,LI=(t,e)=>t!==0||e!==null});var BK,h$e,GK=y(()=>{Da();La();zI();BK=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=h$e(t,e,r),s=o?.code==="ETIMEDOUT",a=SW(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},h$e=(t,e,r)=>t!==void 0?t:LI(e,r)?new ni:void 0});import{spawnSync as g$e}from"node:child_process";var ZK,y$e,_$e,b$e,hv,v$e,S$e,w$e,x$e,VK=y(()=>{NR();lI();uI();pp();rv();yK();mp();CK();FK();La();zK();GK();ZK=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=y$e(t,e,r),d=v$e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Hl(d,c,l)},y$e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=gb(t,e,r),a=_$e(r),{file:c,commandArguments:l,options:u}=Hb(t,e,a);b$e(u);let d=hK(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},_$e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,b$e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&hv("ipcInput"),t&&hv("ipc: true"),r&&hv("detached: true"),n&&hv("cancelSignal")},hv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},v$e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=S$e({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}=BK(c,r),{output:m,error:h=l}=MK({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>ko(_,r,S)),b=ko(LK(m,r),r,"all");return x$e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},S$e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{PK(o,r);let a=w$e(r);return g$e(...Bb(t,e,a))}catch(a){return ql({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},w$e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:ev(e)}),x$e=({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?tv({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):fp({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 UI,on as $$e}from"node:events";var WK,k$e,E$e,A$e,O$e,KK=y(()=>{Ml();ap();sp();WK=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Nl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:jb(t)}),k$e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),k$e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{Tb(e,i);let o=gs(t,e,r),s=new AbortController;try{return await Promise.race([E$e(o,n,s),A$e(o,r,s),O$e(o,r,s)])}catch(a){throw jl(t),a}finally{s.abort(),Rb(e,i)}},E$e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await UI(t,"message",{signal:r});return n}for await(let[n]of $$e(t,"message",{signal:r}))if(e(n))return n},A$e=async(t,e,{signal:r})=>{await UI(t,"disconnect",{signal:r}),s9(e)},O$e=async(t,e,{signal:r})=>{let[n]=await UI(t,"strict:error",{signal:r});throw kb(n,e)}});import{once as YK,on as T$e}from"node:events";var XK,qI,R$e,I$e,P$e,JK,HI=y(()=>{Ml();ap();sp();XK=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>qI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),qI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Nl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:jb(t)}),Tb(e,o);let s=gs(t,e,r),a=new AbortController,c={};return R$e(t,s,a),I$e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),P$e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},R$e=async(t,e,r)=>{try{await YK(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},I$e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await YK(t,"strict:error",{signal:r.signal});n.error=kb(i,e),r.abort()}catch{}},P$e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of T$e(r,"message",{signal:o.signal}))JK(s),yield c}catch{JK(s)}finally{o.abort(),Rb(e,a),n||jl(t),i&&await t}},JK=({error:t})=>{if(t)throw t}});import QK from"node:process";var e3,t3,r3,BI=y(()=>{Ub();KK();HI();Db();e3=(t,{ipc:e})=>{Object.assign(t,r3(t,!1,e))},t3=()=>{let t=QK,e=!0,r=QK.channel!==void 0;return{...r3(t,e,r),getCancelSignal:D9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},r3=(t,e,r)=>({sendMessage:zb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:WK.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:XK.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as C$e}from"node:child_process";import{PassThrough as D$e,Readable as N$e,Writable as j$e,Duplex as M$e}from"node:stream";var n3,F$e,gp,L$e,z$e,U$e,q$e,i3=y(()=>{av();pp();rv();n3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{OI(n);let a=new C$e;F$e(a,n),Object.assign(a,{readable:L$e,writable:z$e,duplex:U$e});let c=ql({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=q$e(c,s,i);return{subprocess:a,promise:l}},F$e=(t,e)=>{let r=gp(),n=gp(),i=gp(),o=Array.from({length:e.length-3},gp),s=gp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},gp=()=>{let t=new D$e;return t.end(),t},L$e=()=>new N$e({read(){}}),z$e=()=>new j$e({write(){}}),U$e=()=>new M$e({read(){},write(){}}),q$e=async(t,e,r)=>Hl(t,e,r)});import{createReadStream as o3,createWriteStream as s3}from"node:fs";import{Buffer as H$e}from"node:buffer";import{Readable as yp,Writable as B$e,Duplex as G$e}from"node:stream";var c3,_p,a3,Z$e,l3=y(()=>{pv();av();$r();c3=(t,e)=>sv(Z$e,t,e,!1),_p=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ys[t]}.`)},a3={fileNumber:_p,generator:jI,asyncGenerator:jI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:G$e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Z$e={input:{...a3,fileUrl:({value:t})=>({stream:o3(t)}),filePath:({value:{file:t}})=>({stream:o3(t)}),webStream:({value:t})=>({stream:yp.fromWeb(t)}),iterable:({value:t})=>({stream:yp.from(t)}),asyncIterable:({value:t})=>({stream:yp.from(t)}),string:({value:t})=>({stream:yp.from(t)}),uint8Array:({value:t})=>({stream:yp.from(H$e.from(t))})},output:{...a3,fileUrl:({value:t})=>({stream:s3(t)}),filePath:({value:{file:t,append:e}})=>({stream:s3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:B$e.fromWeb(t)}),iterable:_p,asyncIterable:_p,string:_p,uint8Array:_p}}});import{on as V$e,once as u3}from"node:events";import{PassThrough as W$e,getDefaultHighWaterMark as K$e}from"node:stream";import{finished as p3}from"node:stream/promises";function qa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)ZI(i);let e=t.some(({readableObjectMode:i})=>i),r=J$e(t,e),n=new GI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var J$e,GI,Y$e,X$e,Q$e,ZI,eke,tke,rke,nke,ike,m3,h3,VI,g3,oke,gv,d3,f3,yv=y(()=>{J$e=(t,e)=>{if(t.length===0)return K$e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},GI=class extends W$e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(ZI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Y$e(this,this.#t,this.#o);let r=eke({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(ZI(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)}},Y$e=async(t,e,r)=>{gv(t,d3);let n=new AbortController;try{await Promise.race([X$e(t,n),Q$e(t,e,r,n)])}finally{n.abort(),gv(t,-d3)}},X$e=async(t,{signal:e})=>{try{await p3(t,{signal:e,cleanup:!0})}catch(r){throw m3(t,r),r}},Q$e=async(t,e,r,{signal:n})=>{for await(let[i]of V$e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},ZI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},eke=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{gv(t,f3);let a=new AbortController;try{await Promise.race([tke(o,e,a),rke({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),nke({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),gv(t,-f3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?VI(t):ike(t))},tke=async(t,e,{signal:r})=>{try{await t,r.aborted||VI(e)}catch(n){r.aborted||m3(e,n)}},rke=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await p3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;h3(s)?i.add(e):g3(t,s)}},nke=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await u3(t,i,{signal:o}),!t.readable)return u3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},ike=t=>{t.writable&&t.end()},m3=(t,e)=>{h3(e)?VI(t):g3(t,e)},h3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",VI=t=>{(t.readable||t.writable)&&t.destroy()},g3=(t,e)=>{t.destroyed||(t.once("error",oke),t.destroy(e))},oke=()=>{},gv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},d3=2,f3=1});import{finished as y3}from"node:stream/promises";var Gl,ske,WI,ake,KI,_v=y(()=>{So();Gl=(t,e)=>{t.pipe(e),ske(t,e),ake(t,e)},ske=async(t,e)=>{if(!(ri(t)||ri(e))){try{await y3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}WI(e)}},WI=t=>{t.writable&&t.end()},ake=async(t,e)=>{if(!(ri(t)||ri(e))){try{await y3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}KI(t)}},KI=t=>{t.readable&&t.destroy()}});var _3,cke,lke,uke,dke,fke,b3=y(()=>{yv();So();Ob();$r();_v();_3=(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})=>Cn.has(c)))cke(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Cn.has(c)))uke({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]:qa(o);Gl(s,i)}},cke=(t,e,r,n)=>{r==="output"?Gl(t.stdio[n],e):Gl(e,t.stdio[n]);let i=lke[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},lke=["stdin","stdout","stderr"],uke=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;dke(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},dke=(t,{signal:e})=>{ri(t)&&Na(t,fke,e)},fke=2});var Ha,v3=y(()=>{Ha=[];Ha.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ha.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ha.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var bv,JI,YI,pke,XI,vv,mke,QI,eP,tP,S3,flt,plt,w3=y(()=>{v3();bv=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",JI=Symbol.for("signal-exit emitter"),YI=globalThis,pke=Object.defineProperty.bind(Object),XI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(YI[JI])return YI[JI];pke(YI,JI,{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}},vv=class{},mke=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),QI=class extends vv{onExit(){return()=>{}}load(){}unload(){}},eP=class extends vv{#t=tP.platform==="win32"?"SIGINT":"SIGHUP";#r=new XI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of Ha)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(!bv(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 Ha)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,Ha.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 bv(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"&&bv(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)}},tP=globalThis.process,{onExit:S3,load:flt,unload:plt}=mke(bv(tP)?new eP(tP):new QI)});import{addAbortListener as hke}from"node:events";var x3,$3=y(()=>{w3();x3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=S3(()=>{t.kill()});hke(n,()=>{i()})}});var E3,gke,yke,k3,_ke,A3=y(()=>{kR();hb();hs();Tl();E3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=mb(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=gke(r,n,i),{sourceStream:d,sourceError:f}=_ke(t,l),{options:p,fileDescriptors:m}=Ni.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},gke=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=yke(t,e,...r),a=Ab(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},yke=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(k3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||xR(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]=nb(r,...n);return{destination:e(k3)(i,o,s),pipeOptions:s}}if(Ni.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}`)},k3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),_ke=(t,e)=>{try{return{sourceStream:Ll(t,e)}}catch(r){return{sourceError:r}}}});var T3,bke,rP,O3,nP=y(()=>{pp();_v();T3=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=bke({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw rP({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},bke=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return KI(t),n;if(e!==void 0)return WI(r),e},rP=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>ql({error:t,command:O3,escapedCommand:O3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),O3="source.pipe(destination)"});var R3,I3=y(()=>{R3=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 vke}from"node:stream/promises";var P3,Ske,wke,xke,Sv,$ke,kke,C3=y(()=>{yv();Ob();_v();P3=(t,e,r)=>{let n=Sv.has(e)?wke(t,e):Ske(t,e);return Na(t,$ke,r.signal),Na(e,kke,r.signal),xke(e),n},Ske=(t,e)=>{let r=qa([t]);return Gl(r,e),Sv.set(e,r),r},wke=(t,e)=>{let r=Sv.get(e);return r.add(t),r},xke=async t=>{try{await vke(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Sv.delete(t)},Sv=new WeakMap,$ke=2,kke=1});import{aborted as Eke}from"node:util";var D3,Ake,N3=y(()=>{nP();D3=(t,e)=>t===void 0?[]:[Ake(t,e)],Ake=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await Eke(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw rP({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var wv,Oke,Tke,j3=y(()=>{bo();A3();nP();I3();C3();N3();wv=(t,...e)=>{if(Tt(e[0]))return wv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=E3(t,...e),i=Oke({...n,destination:r});return i.pipe=wv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Oke=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=Tke(t,i);T3({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=P3(e,o,d);return await Promise.race([R3(u),...D3(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Tke=(t,e)=>Promise.allSettled([t,e])});import{on as Rke}from"node:events";import{getDefaultHighWaterMark as Ike}from"node:stream";var xv,Pke,iP,Cke,F3,oP,M3,Dke,Nke,$v=y(()=>{PI();lv();NI();xv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return Pke(e,s),F3({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},Pke=async(t,e)=>{try{await t}catch{}finally{e.abort()}},iP=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;Cke(e,s,t);let a=t.readableObjectMode&&!o;return F3({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},Cke=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},F3=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=Rke(t,"data",{signal:e.signal,highWaterMark:M3,highWatermark:M3});return Dke({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},oP=Ike(!0),M3=oP,Dke=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=Nke({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ua(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*hp(a)}},Nke=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[uv(t,r,!e),cv(t,i,!n,{})].filter(Boolean)});import{setImmediate as jke}from"node:timers/promises";var L3,Mke,Fke,Lke,sP,z3,aP=y(()=>{Qb();an();MI();$v();La();mp();L3=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=Mke({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([Fke(t),d]);return}let f=TI(c,r),p=iP({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([Lke({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},Mke=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!mv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=iP({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await DK(a,t,r,o)},Fke=async t=>{await jke(),t.readableFlowing===null&&t.resume()},Lke=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Kb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Jb(r,{maxBuffer:o})):await Xb(r,{maxBuffer:o})}catch(a){return z3(_W({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},sP=async t=>{try{return await t}catch(e){return z3(e)}},z3=({bufferedData:t})=>uZ(t)?new Uint8Array(t):t});import{finished as zke}from"node:stream/promises";var bp,Uke,qke,Hke,Bke,Gke,cP,kv,U3,Ev=y(()=>{bp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Uke(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],zke(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Bke(a,e,r,n)}finally{s.abort()}},Uke=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&qke(t,r,n),n},qke=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{Hke(e,r),n.call(t,...i)}},Hke=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Bke=(t,e,r,n)=>{if(!Gke(t,e,r,n))throw t},Gke=(t,e,r,n=!0)=>r.propagating?U3(t)||kv(t):(r.propagating=!0,cP(r,e)===n?U3(t):kv(t)),cP=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",kv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",U3=t=>t?.code==="EPIPE"});var q3,lP,uP=y(()=>{aP();Ev();q3=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>lP({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),lP=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=bp(t,e,l);if(cP(l,e)){await u;return}let[d]=await Promise.all([L3({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 H3,B3,Zke,Vke,dP=y(()=>{yv();uP();H3=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?qa([t,e].filter(Boolean)):void 0,B3=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>lP({...Zke(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Vke(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Zke=({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}},Vke=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var G3,Z3,V3=y(()=>{Pl();ps();G3=t=>Il(t,"ipc"),Z3=(t,e)=>{let r=pb(t);Ci({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var W3,K3,J3=y(()=>{La();V3();xo();HI();W3=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=G3(o),a=wo(e,"ipc"),c=wo(r,"ipc");for await(let l of qI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(bW(t,i,c),i.push(l)),s&&Z3(l,o);return i},K3=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Wke}from"node:events";var Y3,Kke,Jke,Yke,X3=y(()=>{Fa();iI();KR();nI();So();$r();aP();J3();sI();dP();uP();zI();Ev();Y3=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:b})=>{let _=UK(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=q3({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=B3({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),R=[],A=W3({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),O=Kke(h,t,S),D=Jke(m,S);try{return await Promise.race([Promise.all([{},HK(_),Promise.all(x),w,A,B9(t,d),...O,...D]),g,Yke(t,b),...L9(t,o,f,b),...o9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...M9({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(x.map(ae=>sP(ae))),sP(w),K3(A,R),Promise.allSettled(O),Promise.allSettled(D)])}},Kke=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:bp(n,i,r)),Jke=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>oi(o,{checkOpen:!1})&&!ri(o)).map(({type:i,value:o,stream:s=o})=>bp(s,n,e,{isSameDirection:Cn.has(i),stopOnExit:i==="native"}))),Yke=async(t,{signal:e})=>{let[r]=await Wke(t,"error",{signal:e});throw r}});var Q3,vp,Zl,Av=y(()=>{Fl();Q3=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),vp=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Di();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Zl=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 eJ}from"node:stream/promises";var fP,tJ,pP,mP,Ov,Tv,hP=y(()=>{Ev();fP=async t=>{if(t!==void 0)try{await pP(t)}catch{}},tJ=async t=>{if(t!==void 0)try{await mP(t)}catch{}},pP=async t=>{await eJ(t,{cleanup:!0,readable:!1,writable:!0})},mP=async t=>{await eJ(t,{cleanup:!0,readable:!0,writable:!1})},Ov=async(t,e)=>{if(await t,e)throw e},Tv=(t,e,r)=>{r&&!kv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Xke}from"node:stream";import{callbackify as Qke}from"node:util";var rJ,gP,yP,_P,eEe,bP,vP,nJ,SP=y(()=>{ja();hs();$v();Fl();Av();hP();rJ=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||cn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=gP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=yP(a,s),{read:f,onStdoutDataDone:p}=_P({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Xke({read:f,destroy:Qke(vP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return bP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},gP=(t,e,r)=>{let n=Ll(t,e),i=vp(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},yP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:oP},_P=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Di(),s=xv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){eEe(this,s,o)},onStdoutDataDone:o}},eEe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},bP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await mP(t),await n,await fP(i),await e,r.readable&&r.push(null)}catch(o){await fP(i),nJ(r,o)}},vP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Zl(r,e)&&(nJ(t,n),await Ov(e,n))},nJ=(t,e)=>{Tv(t,t.readable,e)}});import{Writable as tEe}from"node:stream";import{callbackify as iJ}from"node:util";var oJ,wP,xP,rEe,nEe,$P,kP,sJ,EP=y(()=>{hs();Av();hP();oJ=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=wP(t,r,e),s=new tEe({...xP(n,t,i),destroy:iJ(kP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return $P(n,s),s},wP=(t,e,r)=>{let n=Ab(t,e),i=vp(r,n,"writableFinal"),o=vp(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},xP=(t,e,r)=>({write:rEe.bind(void 0,t),final:iJ(nEe.bind(void 0,t,e,r))}),rEe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},nEe=async(t,e,r)=>{await Zl(r,e)&&(t.writable&&t.end(),await e)},$P=async(t,e,r)=>{try{await pP(t),e.writable&&e.end()}catch(n){await tJ(r),sJ(e,n)}},kP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Zl(r,e),await Zl(n,e)&&(sJ(t,i),await Ov(e,i))},sJ=(t,e)=>{Tv(t,t.writable,e)}});import{Duplex as iEe}from"node:stream";import{callbackify as oEe}from"node:util";var aJ,sEe,cJ=y(()=>{ja();SP();EP();aJ=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||cn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=gP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=wP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=yP(c,a),{read:g,onStdoutDataDone:b}=_P({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new iEe({read:g,...xP(u,t,d),destroy:oEe(sEe.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 bP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),$P(u,_,c),_},sEe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([vP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),kP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var AP,aEe,lJ=y(()=>{ja();hs();$v();AP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||cn.has(e),s=Ll(t,r),a=xv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return aEe(a,s,t)},aEe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var uJ,dJ=y(()=>{Av();SP();EP();cJ();lJ();uJ=(t,{encoding:e})=>{let r=Q3();t.readable=rJ.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=oJ.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=aJ.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=AP.bind(void 0,t,e),t[Symbol.asyncIterator]=AP.bind(void 0,t,e,{})}});var fJ,cEe,lEe,pJ=y(()=>{fJ=(t,e)=>{for(let[r,n]of lEe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},cEe=(async()=>{})().constructor.prototype,lEe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(cEe,t)])});import{setMaxListeners as uEe}from"node:events";import{spawn as dEe}from"node:child_process";var mJ,fEe,pEe,mEe,hEe,gEe,hJ=y(()=>{Qb();NR();lI();hs();uI();BI();pp();rv();i3();l3();mp();b3();xb();$3();j3();dP();X3();dJ();Fl();pJ();mJ=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=fEe(t,e,r),{subprocess:f,promise:p}=mEe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=wv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),fJ(f,p),Ni.set(f,{options:u,fileDescriptors:d}),f},fEe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=gb(t,e,r),{file:a,commandArguments:c,options:l}=Hb(t,e,r),u=pEe(l),d=c3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},pEe=({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}},mEe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=dEe(...Bb(t,e,r))}catch(m){return n3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;uEe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];_3(c,a,l),x3(c,r,l);let d={},f=Di();c.kill=n9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=H3(c,r),uJ(c,r),e3(c,r);let p=hEe({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}},hEe=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 Y3({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>ko(x,e,w)),_=ko(h,e,"all"),S=gEe({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Hl(S,n,e)},gEe=({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?fp({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 ji,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):tv({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var Rv,yEe,_Ee,gJ=y(()=>{bo();xo();Rv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,yEe(n,t[n],i)]));return{...t,...r}},yEe=(t,e,r)=>_Ee.has(t)&&Tt(e)&&Tt(r)?{...e,...r}:r,_Ee=new Set(["env",...RR])});var _s,bEe,vEe,yJ=y(()=>{bo();kR();_Z();VK();hJ();gJ();_s=(t,e,r,n)=>{let i=(s,a,c)=>_s(s,a,r,c),o=(...s)=>bEe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},bEe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Tt(o))return i(t,Rv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=vEe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?ZK(a,c,l):mJ(a,c,l,i)},vEe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=gZ(e)?yZ(e,r):[e,...r],[s,a,c]=nb(...o),l=Rv(Rv(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 _J,bJ,vJ,SEe,wEe,SJ=y(()=>{_J=({file:t,commandArguments:e})=>vJ(t,e),bJ=({file:t,commandArguments:e})=>({...vJ(t,e),isSync:!0}),vJ=(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]=SEe(t);return{file:r,commandArguments:n}},SEe=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(wEe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},wEe=/ +/g});var wJ,xJ,xEe,$J,$Ee,kJ,EJ=y(()=>{wJ=(t,e,r)=>{t.sync=e(xEe,r),t.s=t.sync},xJ=({options:t})=>$J(t),xEe=({options:t})=>({...$J(t),isSync:!0}),$J=t=>({options:{...$Ee(t),...t}}),$Ee=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},kJ={preferLocal:!0}});var rft,Ke,nft,ift,oft,sft,aft,cft,lft,uft,zr=y(()=>{yJ();SJ();oI();EJ();BI();rft=_s(()=>({})),Ke=_s(()=>({isSync:!0})),nft=_s(_J),ift=_s(bJ),oft=_s(U9),sft=_s(xJ,{},kJ,wJ),{sendMessage:aft,getOneMessage:cft,getEachMessage:lft,getCancelSignal:uft}=t3()});import{existsSync as Iv,statSync as kEe}from"node:fs";import{dirname as OP,extname as EEe,isAbsolute as AJ,join as TP,relative as RP,resolve as Pv,sep as AEe}from"node:path";function Cv(t){return t==="./gradlew"||t==="gradle"}function OEe(t){return(Iv(TP(t,"build.gradle.kts"))||Iv(TP(t,"build.gradle")))&&Iv(TP(t,"gradle.properties"))}function TEe(t,e){let n=RP(t,e).split(AEe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function bs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function REe(t,e){let r=Pv(t,e),n=r;Iv(r)?kEe(r).isFile()&&(n=OP(r)):EEe(r)!==""&&(n=OP(r));let i=RP(t,n);if(i.startsWith("..")||AJ(i))return null;let o=n;for(;;){if(OEe(o))return o;if(Pv(o)===Pv(t))return null;let s=OP(o);if(s===o)return null;let a=RP(t,s);if(a.startsWith("..")||AJ(a))return null;o=s}}function Dv(t,e){let r=Pv(t),n=new Map,i=[];for(let o of e){let s=REe(r,o);if(!s){i.push(o);continue}let a=TEe(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 Nv=y(()=>{"use strict"});import{existsSync as PP,readFileSync as IEe}from"node:fs";import{join as Vl}from"node:path";function Wl(t="."){let e=Vl(t,".cladding","config.yaml");if(!PP(e))return IP;try{let n=(0,OJ.parse)(IEe(e,"utf8"))?.gate;if(!n)return IP;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 PEe){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 IP}}function TJ(t="."){let e=Wl(t).testReport,r=e?[e,...CP]:CP;return[...new Set(r.map(n=>Vl(t,n)))]}function RJ(t="."){let e=Wl(t).testReport;if(e){let r=Vl(t,e);return PP(r)?r:null}return CP.map(r=>Vl(t,r)).find(r=>PP(r))??null}function IJ(t,e){let r=[],n=!1;for(let i of t){let o=CEe.exec(i);if(o){n=!0;for(let s of e)r.push(bs(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 OJ,PEe,IP,CP,CEe,Sp=y(()=>{"use strict";OJ=wt(tr(),1);Nv();PEe=["type","lint","test","coverage"],IP={scope:"feature"},CP=["test-report.junit.xml",Vl("coverage","junit.xml"),Vl(".cladding","test-report.junit.xml")];CEe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as NP,readFileSync as PJ,readdirSync as DEe,statSync as NEe}from"node:fs";import{join as jv}from"node:path";function FP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=jv(t,e);if(NP(r))try{if(CJ.test(PJ(r,"utf8")))return!0}catch{}}return!1}function DJ(t){try{return NP(t)&&CJ.test(PJ(t,"utf8"))}catch{return!1}}function NJ(t,e=0){if(e>4||!NP(t))return!1;let r;try{r=DEe(t)}catch{return!1}for(let n of r){let i=jv(t,n),o=!1;try{o=NEe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(NJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&DJ(i))return!0}return!1}function FEe(t){if(FP(t))return!0;for(let e of jEe)if(DJ(jv(t,e)))return!0;for(let e of MEe)if(NJ(jv(t,e)))return!0;return!1}function jJ(t="."){let e=Wl(t).coverage;return e||(FEe(t)?"kover":"jacoco")}function MJ(t="."){return jP[jJ(t)]}function FJ(t="."){return DP[jJ(t)]}var jP,DP,MP,CJ,jEe,MEe,Mv=y(()=>{"use strict";Sp();jP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},DP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},MP=[DP.kover,DP.jacoco],CJ=/kover/i;jEe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],MEe=["buildSrc","build-logic"]});import{existsSync as xp,readFileSync as zP,readdirSync as zJ,statSync as LEe}from"node:fs";import{dirname as zEe,join as kr,resolve as UEe}from"node:path";import Kl from"node:process";function UP(t){return xp(kr(t,"gradlew"))?"./gradlew":"gradle"}function qEe(t){let e=UP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[MJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function HEe(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(zP(kr(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function GEe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function WEe(t,e){for(let r of e)if(xp(kr(t,r)))return r}function KEe(t,e){try{return zJ(t).find(n=>n.endsWith(e))}catch{return}}function QEe(t){let e=[],r=Kl.platform==="win32";r||e.push(kr("/etc","madge","config"),kr("/etc","madgerc"));let n=r?Kl.env.USERPROFILE:Kl.env.HOME;n&&e.push(kr(n,".config","madge","config"),kr(n,".config","madge"),kr(n,".madge","config"),kr(n,".madgerc"));for(let o=UEe(t);;){e.push(kr(o,".madgerc"));let s=zEe(o);if(s===o)break;o=s}let i=Kl.env.MADGE_config??Kl.env.madge_config;return i&&e.push(i),e}function eAe(){for(let[t,e]of Object.entries(Kl.env))if(/^madge_excluderegexp/i.test(t)&&typeof e=="string"&&e.trim().length>0)return!0;return!1}function UJ(t){return Array.isArray(t)?t.length>0:typeof t=="string"&&t.trim().length>0}function rAe(t){try{return LEe(t).isFile()}catch{return!1}}function nAe(t){let e;try{e=zP(t,"utf8")}catch{return!0}try{return UJ(JSON.parse(e).excludeRegExp)}catch{return tAe.test(e)}}function iAe(t,e){let r=e.madge;return r&&typeof r=="object"&&UJ(r.excludeRegExp)||eAe()?!0:QEe(t).some(n=>rAe(n)&&nAe(n))}function oAe(t){try{return JSON.parse(zP(kr(t,"package.json"),"utf8").replace(/^\uFEFF/,""))}catch{return{}}}function wp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function LJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function sAe(t,e,r){if(iAe(t,r))return e;let n=[...e.args];return n.splice(n.length-1,0,"--exclude",XEe),{...e,args:n}}function aAe(t,e,r){if(wp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of JEe)if(n.configs.some(i=>xp(kr(t,i))))return n.gate;if(YEe.some(n=>xp(kr(t,n)))||r.eslintConfig!==void 0)return e}function lAe(t,e){return cAe.some(r=>xp(kr(t,r)))?!0:e.jest!==void 0}function uAe(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function LP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function dAe(t,e){let r=oAe(t),n=e.lint?aAe(t,e.lint,r):void 0,i=e.arch?{...e,arch:sAe(t,e.arch,r)}:e,o=n?{...i,lint:n}:LP(i,"lint"),s=wp(r,"test"),a=s?uAe(s):void 0;return s&&!a?(o=LP(o,"coverage"),{...o,test:{cmd:"npm",args:["test"]},...wp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):a==="jest"||!s&&lAe(t,r)?{...o,test:{cmd:"npx",args:[...Fi,"jest"]},coverage:{cmd:"npx",args:[...Fi,"jest","--coverage"]}}:(a==="vitest"&&!wp(r,"coverage")&&!LJ(r,"@vitest/coverage-v8")&&!LJ(r,"@vitest/coverage-istanbul")?o=LP(o,"coverage"):a==="vitest"&&wp(r,"coverage")&&(o={...o,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),o)}function _t(t="."){for(let e of ZEe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=KEe(t,o):r=WEe(t,[o]),r)break;if(!r||e.requiresSource&&!GEe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?dAe(t,n):n;return{language:e.language,manifest:r,gates:i}}return VEe}var Fi,BEe,ZEe,VEe,JEe,YEe,XEe,tAe,cAe,Dn=y(()=>{"use strict";Mv();Fi=["--offline","--no-install"];BEe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);ZEe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Fi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Fi,"eslint","."]},test:{cmd:"npx",args:[...Fi,"vitest","run"]},coverage:{cmd:"npx",args:[...Fi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Fi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Fi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},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:qEe},{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"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:HEe}],VEe={language:"unknown",manifest:"",gates:{}};JEe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Fi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Fi,"oxlint"]}}],YEe=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"],XEe="(^|/)(dist|coverage|\\.next|\\.nuxt|\\.output|\\.svelte-kit|\\.vite)/|^(build|out|target)/";tAe=/^[ \t]*excludeRegExp[ \t]*(?:\[[^\]]*\])?[ \t]*=[ \t]*(\S.*?)[ \t]*$/m;cAe=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as fAe,readFileSync as pAe}from"node:fs";import{join as mAe}from"node:path";function Ba(t){return t.code==="ENOENT"}function Fv(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=[s,o].filter(c=>c.length>0).join(` -`).slice(0,2e3)||`exit ${i}`;return qJ.test(o)||qJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(Ba(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`};let i=`${String(r.stderr??"")} -${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline"}:null}function Xt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=[String(e.stdout??"").trim(),String(e.stderr??"").trim()].filter(i=>i.length>0).join(` + if (condition) { yield value; }`)}});import{Buffer as H0e}from"node:buffer";import{StringDecoder as B0e}from"node:string_decoder";var uv,G0e,Z0e,V0e,PI=y(()=>{an();uv=(t,e,r)=>{if(r)return;if(t)return{transform:G0e.bind(void 0,new TextEncoder)};let n=new B0e(e);return{transform:Z0e.bind(void 0,n),final:V0e.bind(void 0,n)}},G0e=function*(t,e){H0e.isBuffer(e)?yield vo(e):typeof e=="string"?yield t.encode(e):yield e},Z0e=function*(t,e){yield qt(e)?t.write(e):e},V0e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as kK}from"node:util";var CI,dv,EK,W0e,AK,K0e,OK=y(()=>{CI=kK(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),dv=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=K0e}=e[r];for await(let i of n(t))yield*dv(i,e,r+1)},EK=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*W0e(r,Number(e),t)},W0e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*dv(n,r,e+1)},AK=kK(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),K0e=function*(t){yield t}});var DI,TK,Ua,hp,J0e,Y0e,NI=y(()=>{DI=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},TK=(t,e)=>[...e.flatMap(r=>[...Ua(r,t,0)]),...hp(t)],Ua=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=Y0e}=e[r];for(let i of n(t))yield*Ua(i,e,r+1)},hp=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*J0e(r,Number(e),t)},J0e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Ua(n,r,e+1)},Y0e=function*(t){yield t}});import{Transform as X0e,getDefaultHighWaterMark as RK}from"node:stream";var jI,fv,IK,pv=y(()=>{$r();lv();$K();PI();OK();NI();jI=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=IK(t,s,o),l=za(e),u=za(r),d=l?CI.bind(void 0,dv,a):DI.bind(void 0,Ua),f=l||u?CI.bind(void 0,EK,a):DI.bind(void 0,hp),p=l||u?AK.bind(void 0,a):void 0;return{stream:new X0e({writableObjectMode:n,writableHighWaterMark:RK(n),readableObjectMode:i,readableHighWaterMark:RK(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},fv=(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=IK(s,r,a);t=TK(c,t)}return t},IK=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:SK(n,a)},uv(r,s,n),cv(r,o,n,c),{transform:t,final:e},{transform:wK(i,a)},vK({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var PK,Q0e,e$e,t$e,r$e,CK=y(()=>{pv();an();$r();PK=(t,e)=>{for(let r of Q0e(t))e$e(t,r,e)},Q0e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),e$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 ${ys[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>t$e(a,n));r.input=Qf(s)},t$e=(t,e)=>{let r=fv(t,e,"utf8",!0);return r$e(r),Qf(r)},r$e=t=>{let e=t.find(r=>typeof r!="string"&&!qt(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 mv,n$e,i$e,DK,NK,o$e,jK,MI=y(()=>{ja();$r();Pl();ps();mv=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Il(r,n)&&!cn.has(e)&&n$e(n)&&(t.some(({type:i,value:o})=>i==="native"&&i$e.has(o))||t.every(({type:i})=>Cn.has(i))),n$e=t=>t===1||t===2,i$e=new Set(["pipe","overlapped"]),DK=async(t,e,r,n)=>{for await(let i of t)o$e(e)||jK(i,r,n)},NK=(t,e,r)=>{for(let n of t)jK(n,e,r)},o$e=t=>t._readableState.pipes.length>0,jK=(t,e,r)=>{let n=pb(t);Ci({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as s$e,appendFileSync as a$e}from"node:fs";var MK,c$e,l$e,u$e,d$e,f$e,FK=y(()=>{MI();pv();lv();an();$r();La();MK=({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)=>c$e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},c$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=wW(t,o,d),p=vo(f),{stdioItems:m,objectMode:h}=e[r],g=l$e([p],m,c,n),{serializedResult:b,finalResult:_=b}=u$e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});d$e({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?_:void 0;try{return n.error===void 0&&f$e(b,m,i),S}catch(x){return n.error=x,S}},l$e=(t,e,r,n)=>{try{return fv(t,e,r,!1)}catch(i){return n.error=i,t}},u$e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Qf(t)};let s=fZ(t,r);return n[o]?{serializedResult:s,finalResult:II(s,!i[o],e)}:{serializedResult:s}},d$e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!mv({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=II(t,!1,s);try{NK(a,e,n)}catch(c){r.error??=c}},f$e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>ov.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?a$e(n,t):(r.add(o),s$e(n,t))}}});var LK,zK=y(()=>{an();mp();LK=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ko(e,r,"all")]:Array.isArray(e)?[ko(t,r,"all"),...e]:qt(t)&&qt(e)?ER([t,e]):`${t}${e}`}});import{once as FI}from"node:events";var UK,p$e,qK,HK,m$e,LI,zI=y(()=>{Da();UK=async(t,e)=>{let[r,n]=await p$e(t);return e.isForcefullyTerminated??=!1,[r,n]},p$e=async t=>{let[e,r]=await Promise.allSettled([FI(t,"spawn"),FI(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qK(t):r.value},qK=async t=>{try{return await FI(t,"exit")}catch{return qK(t)}},HK=async t=>{let[e,r]=await t;if(!m$e(e,r)&&LI(e,r))throw new ni;return[e,r]},m$e=(t,e)=>t===void 0&&e===void 0,LI=(t,e)=>t!==0||e!==null});var BK,h$e,GK=y(()=>{Da();La();zI();BK=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=h$e(t,e,r),s=o?.code==="ETIMEDOUT",a=SW(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},h$e=(t,e,r)=>t!==void 0?t:LI(e,r)?new ni:void 0});import{spawnSync as g$e}from"node:child_process";var ZK,y$e,_$e,b$e,hv,v$e,S$e,w$e,x$e,VK=y(()=>{NR();lI();uI();pp();rv();yK();mp();CK();FK();La();zK();GK();ZK=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=y$e(t,e,r),d=v$e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Hl(d,c,l)},y$e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=gb(t,e,r),a=_$e(r),{file:c,commandArguments:l,options:u}=Hb(t,e,a);b$e(u);let d=hK(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},_$e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,b$e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&hv("ipcInput"),t&&hv("ipc: true"),r&&hv("detached: true"),n&&hv("cancelSignal")},hv=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},v$e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=S$e({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}=BK(c,r),{output:m,error:h=l}=MK({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>ko(_,r,S)),b=ko(LK(m,r),r,"all");return x$e({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},S$e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{PK(o,r);let a=w$e(r);return g$e(...Bb(t,e,a))}catch(a){return ql({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},w$e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:ev(e)}),x$e=({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?tv({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):fp({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 UI,on as $$e}from"node:events";var WK,k$e,E$e,A$e,O$e,KK=y(()=>{Ml();ap();sp();WK=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Nl({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:jb(t)}),k$e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),k$e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{Tb(e,i);let o=gs(t,e,r),s=new AbortController;try{return await Promise.race([E$e(o,n,s),A$e(o,r,s),O$e(o,r,s)])}catch(a){throw jl(t),a}finally{s.abort(),Rb(e,i)}},E$e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await UI(t,"message",{signal:r});return n}for await(let[n]of $$e(t,"message",{signal:r}))if(e(n))return n},A$e=async(t,e,{signal:r})=>{await UI(t,"disconnect",{signal:r}),s9(e)},O$e=async(t,e,{signal:r})=>{let[n]=await UI(t,"strict:error",{signal:r});throw kb(n,e)}});import{once as YK,on as T$e}from"node:events";var XK,qI,R$e,I$e,P$e,JK,HI=y(()=>{Ml();ap();sp();XK=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>qI({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),qI=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Nl({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:jb(t)}),Tb(e,o);let s=gs(t,e,r),a=new AbortController,c={};return R$e(t,s,a),I$e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),P$e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},R$e=async(t,e,r)=>{try{await YK(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},I$e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await YK(t,"strict:error",{signal:r.signal});n.error=kb(i,e),r.abort()}catch{}},P$e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of T$e(r,"message",{signal:o.signal}))JK(s),yield c}catch{JK(s)}finally{o.abort(),Rb(e,a),n||jl(t),i&&await t}},JK=({error:t})=>{if(t)throw t}});import QK from"node:process";var e3,t3,r3,BI=y(()=>{Ub();KK();HI();Db();e3=(t,{ipc:e})=>{Object.assign(t,r3(t,!1,e))},t3=()=>{let t=QK,e=!0,r=QK.channel!==void 0;return{...r3(t,e,r),getCancelSignal:D9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},r3=(t,e,r)=>({sendMessage:zb.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:WK.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:XK.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as C$e}from"node:child_process";import{PassThrough as D$e,Readable as N$e,Writable as j$e,Duplex as M$e}from"node:stream";var n3,F$e,gp,L$e,z$e,U$e,q$e,i3=y(()=>{av();pp();rv();n3=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{OI(n);let a=new C$e;F$e(a,n),Object.assign(a,{readable:L$e,writable:z$e,duplex:U$e});let c=ql({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=q$e(c,s,i);return{subprocess:a,promise:l}},F$e=(t,e)=>{let r=gp(),n=gp(),i=gp(),o=Array.from({length:e.length-3},gp),s=gp(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},gp=()=>{let t=new D$e;return t.end(),t},L$e=()=>new N$e({read(){}}),z$e=()=>new j$e({write(){}}),U$e=()=>new M$e({read(){},write(){}}),q$e=async(t,e,r)=>Hl(t,e,r)});import{createReadStream as o3,createWriteStream as s3}from"node:fs";import{Buffer as H$e}from"node:buffer";import{Readable as yp,Writable as B$e,Duplex as G$e}from"node:stream";var c3,_p,a3,Z$e,l3=y(()=>{pv();av();$r();c3=(t,e)=>sv(Z$e,t,e,!1),_p=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${ys[t]}.`)},a3={fileNumber:_p,generator:jI,asyncGenerator:jI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:G$e.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Z$e={input:{...a3,fileUrl:({value:t})=>({stream:o3(t)}),filePath:({value:{file:t}})=>({stream:o3(t)}),webStream:({value:t})=>({stream:yp.fromWeb(t)}),iterable:({value:t})=>({stream:yp.from(t)}),asyncIterable:({value:t})=>({stream:yp.from(t)}),string:({value:t})=>({stream:yp.from(t)}),uint8Array:({value:t})=>({stream:yp.from(H$e.from(t))})},output:{...a3,fileUrl:({value:t})=>({stream:s3(t)}),filePath:({value:{file:t,append:e}})=>({stream:s3(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:B$e.fromWeb(t)}),iterable:_p,asyncIterable:_p,string:_p,uint8Array:_p}}});import{on as V$e,once as u3}from"node:events";import{PassThrough as W$e,getDefaultHighWaterMark as K$e}from"node:stream";import{finished as p3}from"node:stream/promises";function qa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)ZI(i);let e=t.some(({readableObjectMode:i})=>i),r=J$e(t,e),n=new GI({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var J$e,GI,Y$e,X$e,Q$e,ZI,eke,tke,rke,nke,ike,m3,h3,VI,g3,oke,gv,d3,f3,yv=y(()=>{J$e=(t,e)=>{if(t.length===0)return K$e(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},GI=class extends W$e{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(ZI(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Y$e(this,this.#t,this.#o);let r=eke({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(ZI(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)}},Y$e=async(t,e,r)=>{gv(t,d3);let n=new AbortController;try{await Promise.race([X$e(t,n),Q$e(t,e,r,n)])}finally{n.abort(),gv(t,-d3)}},X$e=async(t,{signal:e})=>{try{await p3(t,{signal:e,cleanup:!0})}catch(r){throw m3(t,r),r}},Q$e=async(t,e,r,{signal:n})=>{for await(let[i]of V$e(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},ZI=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},eke=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{gv(t,f3);let a=new AbortController;try{await Promise.race([tke(o,e,a),rke({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),nke({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),gv(t,-f3)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?VI(t):ike(t))},tke=async(t,e,{signal:r})=>{try{await t,r.aborted||VI(e)}catch(n){r.aborted||m3(e,n)}},rke=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await p3(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;h3(s)?i.add(e):g3(t,s)}},nke=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await u3(t,i,{signal:o}),!t.readable)return u3(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},ike=t=>{t.writable&&t.end()},m3=(t,e)=>{h3(e)?VI(t):g3(t,e)},h3=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",VI=t=>{(t.readable||t.writable)&&t.destroy()},g3=(t,e)=>{t.destroyed||(t.once("error",oke),t.destroy(e))},oke=()=>{},gv=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},d3=2,f3=1});import{finished as y3}from"node:stream/promises";var Gl,ske,WI,ake,KI,_v=y(()=>{So();Gl=(t,e)=>{t.pipe(e),ske(t,e),ake(t,e)},ske=async(t,e)=>{if(!(ri(t)||ri(e))){try{await y3(t,{cleanup:!0,readable:!0,writable:!1})}catch{}WI(e)}},WI=t=>{t.writable&&t.end()},ake=async(t,e)=>{if(!(ri(t)||ri(e))){try{await y3(e,{cleanup:!0,readable:!1,writable:!0})}catch{}KI(t)}},KI=t=>{t.readable&&t.destroy()}});var _3,cke,lke,uke,dke,fke,b3=y(()=>{yv();So();Ob();$r();_v();_3=(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})=>Cn.has(c)))cke(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Cn.has(c)))uke({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]:qa(o);Gl(s,i)}},cke=(t,e,r,n)=>{r==="output"?Gl(t.stdio[n],e):Gl(e,t.stdio[n]);let i=lke[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},lke=["stdin","stdout","stderr"],uke=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;dke(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},dke=(t,{signal:e})=>{ri(t)&&Na(t,fke,e)},fke=2});var Ha,v3=y(()=>{Ha=[];Ha.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Ha.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Ha.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var bv,JI,YI,pke,XI,vv,mke,QI,eP,tP,S3,plt,mlt,w3=y(()=>{v3();bv=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",JI=Symbol.for("signal-exit emitter"),YI=globalThis,pke=Object.defineProperty.bind(Object),XI=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(YI[JI])return YI[JI];pke(YI,JI,{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}},vv=class{},mke=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),QI=class extends vv{onExit(){return()=>{}}load(){}unload(){}},eP=class extends vv{#t=tP.platform==="win32"?"SIGINT":"SIGHUP";#r=new XI;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of Ha)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(!bv(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 Ha)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,Ha.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 bv(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"&&bv(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)}},tP=globalThis.process,{onExit:S3,load:plt,unload:mlt}=mke(bv(tP)?new eP(tP):new QI)});import{addAbortListener as hke}from"node:events";var x3,$3=y(()=>{w3();x3=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=S3(()=>{t.kill()});hke(n,()=>{i()})}});var E3,gke,yke,k3,_ke,A3=y(()=>{kR();hb();hs();Tl();E3=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=mb(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=gke(r,n,i),{sourceStream:d,sourceError:f}=_ke(t,l),{options:p,fileDescriptors:m}=Ni.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},gke=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=yke(t,e,...r),a=Ab(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},yke=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(k3,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||xR(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]=nb(r,...n);return{destination:e(k3)(i,o,s),pipeOptions:s}}if(Ni.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}`)},k3=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),_ke=(t,e)=>{try{return{sourceStream:Ll(t,e)}}catch(r){return{sourceError:r}}}});var T3,bke,rP,O3,nP=y(()=>{pp();_v();T3=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=bke({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw rP({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},bke=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return KI(t),n;if(e!==void 0)return WI(r),e},rP=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>ql({error:t,command:O3,escapedCommand:O3,fileDescriptors:e,options:r,startTime:n,isSync:!1}),O3="source.pipe(destination)"});var R3,I3=y(()=>{R3=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 vke}from"node:stream/promises";var P3,Ske,wke,xke,Sv,$ke,kke,C3=y(()=>{yv();Ob();_v();P3=(t,e,r)=>{let n=Sv.has(e)?wke(t,e):Ske(t,e);return Na(t,$ke,r.signal),Na(e,kke,r.signal),xke(e),n},Ske=(t,e)=>{let r=qa([t]);return Gl(r,e),Sv.set(e,r),r},wke=(t,e)=>{let r=Sv.get(e);return r.add(t),r},xke=async t=>{try{await vke(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Sv.delete(t)},Sv=new WeakMap,$ke=2,kke=1});import{aborted as Eke}from"node:util";var D3,Ake,N3=y(()=>{nP();D3=(t,e)=>t===void 0?[]:[Ake(t,e)],Ake=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await Eke(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw rP({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var wv,Oke,Tke,j3=y(()=>{bo();A3();nP();I3();C3();N3();wv=(t,...e)=>{if(Tt(e[0]))return wv.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=E3(t,...e),i=Oke({...n,destination:r});return i.pipe=wv.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},Oke=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=Tke(t,i);T3({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=P3(e,o,d);return await Promise.race([R3(u),...D3(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Tke=(t,e)=>Promise.allSettled([t,e])});import{on as Rke}from"node:events";import{getDefaultHighWaterMark as Ike}from"node:stream";var xv,Pke,iP,Cke,F3,oP,M3,Dke,Nke,$v=y(()=>{PI();lv();NI();xv=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return Pke(e,s),F3({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},Pke=async(t,e)=>{try{await t}catch{}finally{e.abort()}},iP=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;Cke(e,s,t);let a=t.readableObjectMode&&!o;return F3({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},Cke=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},F3=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=Rke(t,"data",{signal:e.signal,highWaterMark:M3,highWatermark:M3});return Dke({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},oP=Ike(!0),M3=oP,Dke=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=Nke({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Ua(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*hp(a)}},Nke=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[uv(t,r,!e),cv(t,i,!n,{})].filter(Boolean)});import{setImmediate as jke}from"node:timers/promises";var L3,Mke,Fke,Lke,sP,z3,aP=y(()=>{Qb();an();MI();$v();La();mp();L3=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=Mke({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([Fke(t),d]);return}let f=TI(c,r),p=iP({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([Lke({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},Mke=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!mv({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=iP({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await DK(a,t,r,o)},Fke=async t=>{await jke(),t.readableFlowing===null&&t.resume()},Lke=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Kb(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Jb(r,{maxBuffer:o})):await Xb(r,{maxBuffer:o})}catch(a){return z3(_W({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},sP=async t=>{try{return await t}catch(e){return z3(e)}},z3=({bufferedData:t})=>uZ(t)?new Uint8Array(t):t});import{finished as zke}from"node:stream/promises";var bp,Uke,qke,Hke,Bke,Gke,cP,kv,U3,Ev=y(()=>{bp=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Uke(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],zke(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Bke(a,e,r,n)}finally{s.abort()}},Uke=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&qke(t,r,n),n},qke=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{Hke(e,r),n.call(t,...i)}},Hke=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Bke=(t,e,r,n)=>{if(!Gke(t,e,r,n))throw t},Gke=(t,e,r,n=!0)=>r.propagating?U3(t)||kv(t):(r.propagating=!0,cP(r,e)===n?U3(t):kv(t)),cP=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",kv=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",U3=t=>t?.code==="EPIPE"});var q3,lP,uP=y(()=>{aP();Ev();q3=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>lP({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),lP=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=bp(t,e,l);if(cP(l,e)){await u;return}let[d]=await Promise.all([L3({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 H3,B3,Zke,Vke,dP=y(()=>{yv();uP();H3=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?qa([t,e].filter(Boolean)):void 0,B3=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>lP({...Zke(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Vke(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Zke=({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}},Vke=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var G3,Z3,V3=y(()=>{Pl();ps();G3=t=>Il(t,"ipc"),Z3=(t,e)=>{let r=pb(t);Ci({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var W3,K3,J3=y(()=>{La();V3();xo();HI();W3=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=G3(o),a=wo(e,"ipc"),c=wo(r,"ipc");for await(let l of qI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(bW(t,i,c),i.push(l)),s&&Z3(l,o);return i},K3=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Wke}from"node:events";var Y3,Kke,Jke,Yke,X3=y(()=>{Fa();iI();KR();nI();So();$r();aP();J3();sI();dP();uP();zI();Ev();Y3=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:b})=>{let _=UK(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=q3({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=B3({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),R=[],A=W3({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),O=Kke(h,t,S),D=Jke(m,S);try{return await Promise.race([Promise.all([{},HK(_),Promise.all(x),w,A,B9(t,d),...O,...D]),g,Yke(t,b),...L9(t,o,f,b),...o9({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...M9({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(E){return f.terminationReason??="other",Promise.all([{error:E},_,Promise.all(x.map(ae=>sP(ae))),sP(w),K3(A,R),Promise.allSettled(O),Promise.allSettled(D)])}},Kke=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:bp(n,i,r)),Jke=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>oi(o,{checkOpen:!1})&&!ri(o)).map(({type:i,value:o,stream:s=o})=>bp(s,n,e,{isSameDirection:Cn.has(i),stopOnExit:i==="native"}))),Yke=async(t,{signal:e})=>{let[r]=await Wke(t,"error",{signal:e});throw r}});var Q3,vp,Zl,Av=y(()=>{Fl();Q3=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),vp=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=Di();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Zl=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 eJ}from"node:stream/promises";var fP,tJ,pP,mP,Ov,Tv,hP=y(()=>{Ev();fP=async t=>{if(t!==void 0)try{await pP(t)}catch{}},tJ=async t=>{if(t!==void 0)try{await mP(t)}catch{}},pP=async t=>{await eJ(t,{cleanup:!0,readable:!1,writable:!0})},mP=async t=>{await eJ(t,{cleanup:!0,readable:!0,writable:!1})},Ov=async(t,e)=>{if(await t,e)throw e},Tv=(t,e,r)=>{r&&!kv(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Xke}from"node:stream";import{callbackify as Qke}from"node:util";var rJ,gP,yP,_P,eEe,bP,vP,nJ,SP=y(()=>{ja();hs();$v();Fl();Av();hP();rJ=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||cn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=gP(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=yP(a,s),{read:f,onStdoutDataDone:p}=_P({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Xke({read:f,destroy:Qke(vP.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return bP({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},gP=(t,e,r)=>{let n=Ll(t,e),i=vp(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},yP=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:oP},_P=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=Di(),s=xv({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){eEe(this,s,o)},onStdoutDataDone:o}},eEe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},bP=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await mP(t),await n,await fP(i),await e,r.readable&&r.push(null)}catch(o){await fP(i),nJ(r,o)}},vP=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Zl(r,e)&&(nJ(t,n),await Ov(e,n))},nJ=(t,e)=>{Tv(t,t.readable,e)}});import{Writable as tEe}from"node:stream";import{callbackify as iJ}from"node:util";var oJ,wP,xP,rEe,nEe,$P,kP,sJ,EP=y(()=>{hs();Av();hP();oJ=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=wP(t,r,e),s=new tEe({...xP(n,t,i),destroy:iJ(kP.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return $P(n,s),s},wP=(t,e,r)=>{let n=Ab(t,e),i=vp(r,n,"writableFinal"),o=vp(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},xP=(t,e,r)=>({write:rEe.bind(void 0,t),final:iJ(nEe.bind(void 0,t,e,r))}),rEe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},nEe=async(t,e,r)=>{await Zl(r,e)&&(t.writable&&t.end(),await e)},$P=async(t,e,r)=>{try{await pP(t),e.writable&&e.end()}catch(n){await tJ(r),sJ(e,n)}},kP=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Zl(r,e),await Zl(n,e)&&(sJ(t,i),await Ov(e,i))},sJ=(t,e)=>{Tv(t,t.writable,e)}});import{Duplex as iEe}from"node:stream";import{callbackify as oEe}from"node:util";var aJ,sEe,cJ=y(()=>{ja();SP();EP();aJ=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||cn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=gP(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=wP(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=yP(c,a),{read:g,onStdoutDataDone:b}=_P({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new iEe({read:g,...xP(u,t,d),destroy:oEe(sEe.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 bP({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),$P(u,_,c),_},sEe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([vP({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),kP({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var AP,aEe,lJ=y(()=>{ja();hs();$v();AP=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||cn.has(e),s=Ll(t,r),a=xv({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return aEe(a,s,t)},aEe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var uJ,dJ=y(()=>{Av();SP();EP();cJ();lJ();uJ=(t,{encoding:e})=>{let r=Q3();t.readable=rJ.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=oJ.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=aJ.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=AP.bind(void 0,t,e),t[Symbol.asyncIterator]=AP.bind(void 0,t,e,{})}});var fJ,cEe,lEe,pJ=y(()=>{fJ=(t,e)=>{for(let[r,n]of lEe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},cEe=(async()=>{})().constructor.prototype,lEe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(cEe,t)])});import{setMaxListeners as uEe}from"node:events";import{spawn as dEe}from"node:child_process";var mJ,fEe,pEe,mEe,hEe,gEe,hJ=y(()=>{Qb();NR();lI();hs();uI();BI();pp();rv();i3();l3();mp();b3();xb();$3();j3();dP();X3();dJ();Fl();pJ();mJ=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=fEe(t,e,r),{subprocess:f,promise:p}=mEe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=wv.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),fJ(f,p),Ni.set(f,{options:u,fileDescriptors:d}),f},fEe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=gb(t,e,r),{file:a,commandArguments:c,options:l}=Hb(t,e,r),u=pEe(l),d=c3(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},pEe=({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}},mEe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=dEe(...Bb(t,e,r))}catch(m){return n3({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;uEe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];_3(c,a,l),x3(c,r,l);let d={},f=Di();c.kill=n9.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=H3(c,r),uJ(c,r),e3(c,r);let p=hEe({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}},hEe=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 Y3({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let b=m.map((x,w)=>ko(x,e,w)),_=ko(h,e,"all"),S=gEe({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Hl(S,n,e)},gEe=({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?fp({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 ji,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):tv({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var Rv,yEe,_Ee,gJ=y(()=>{bo();xo();Rv=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,yEe(n,t[n],i)]));return{...t,...r}},yEe=(t,e,r)=>_Ee.has(t)&&Tt(e)&&Tt(r)?{...e,...r}:r,_Ee=new Set(["env",...RR])});var _s,bEe,vEe,yJ=y(()=>{bo();kR();_Z();VK();hJ();gJ();_s=(t,e,r,n)=>{let i=(s,a,c)=>_s(s,a,r,c),o=(...s)=>bEe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},bEe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Tt(o))return i(t,Rv(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=vEe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?ZK(a,c,l):mJ(a,c,l,i)},vEe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=gZ(e)?yZ(e,r):[e,...r],[s,a,c]=nb(...o),l=Rv(Rv(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 _J,bJ,vJ,SEe,wEe,SJ=y(()=>{_J=({file:t,commandArguments:e})=>vJ(t,e),bJ=({file:t,commandArguments:e})=>({...vJ(t,e),isSync:!0}),vJ=(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]=SEe(t);return{file:r,commandArguments:n}},SEe=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(wEe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},wEe=/ +/g});var wJ,xJ,xEe,$J,$Ee,kJ,EJ=y(()=>{wJ=(t,e,r)=>{t.sync=e(xEe,r),t.s=t.sync},xJ=({options:t})=>$J(t),xEe=({options:t})=>({...$J(t),isSync:!0}),$J=t=>({options:{...$Ee(t),...t}}),$Ee=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},kJ={preferLocal:!0}});var nft,Ke,ift,oft,sft,aft,cft,lft,uft,dft,zr=y(()=>{yJ();SJ();oI();EJ();BI();nft=_s(()=>({})),Ke=_s(()=>({isSync:!0})),ift=_s(_J),oft=_s(bJ),sft=_s(U9),aft=_s(xJ,{},kJ,wJ),{sendMessage:cft,getOneMessage:lft,getEachMessage:uft,getCancelSignal:dft}=t3()});import{existsSync as Iv,statSync as kEe}from"node:fs";import{dirname as OP,extname as EEe,isAbsolute as AJ,join as TP,relative as RP,resolve as Pv,sep as AEe}from"node:path";function Cv(t){return t==="./gradlew"||t==="gradle"}function OEe(t){return(Iv(TP(t,"build.gradle.kts"))||Iv(TP(t,"build.gradle")))&&Iv(TP(t,"gradle.properties"))}function TEe(t,e){let n=RP(t,e).split(AEe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function bs(t,e){return t===":"?`:${e}`:`${t}:${e}`}function REe(t,e){let r=Pv(t,e),n=r;Iv(r)?kEe(r).isFile()&&(n=OP(r)):EEe(r)!==""&&(n=OP(r));let i=RP(t,n);if(i.startsWith("..")||AJ(i))return null;let o=n;for(;;){if(OEe(o))return o;if(Pv(o)===Pv(t))return null;let s=OP(o);if(s===o)return null;let a=RP(t,s);if(a.startsWith("..")||AJ(a))return null;o=s}}function Dv(t,e){let r=Pv(t),n=new Map,i=[];for(let o of e){let s=REe(r,o);if(!s){i.push(o);continue}let a=TEe(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 Nv=y(()=>{"use strict"});import{existsSync as PP,readFileSync as IEe}from"node:fs";import{join as Vl}from"node:path";function Wl(t="."){let e=Vl(t,".cladding","config.yaml");if(!PP(e))return IP;try{let n=(0,OJ.parse)(IEe(e,"utf8"))?.gate;if(!n)return IP;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 PEe){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 IP}}function TJ(t="."){let e=Wl(t).testReport,r=e?[e,...CP]:CP;return[...new Set(r.map(n=>Vl(t,n)))]}function RJ(t="."){let e=Wl(t).testReport;if(e){let r=Vl(t,e);return PP(r)?r:null}return CP.map(r=>Vl(t,r)).find(r=>PP(r))??null}function IJ(t,e){let r=[],n=!1;for(let i of t){let o=CEe.exec(i);if(o){n=!0;for(let s of e)r.push(bs(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 OJ,PEe,IP,CP,CEe,Sp=y(()=>{"use strict";OJ=wt(tr(),1);Nv();PEe=["type","lint","test","coverage"],IP={scope:"feature"},CP=["test-report.junit.xml",Vl("coverage","junit.xml"),Vl(".cladding","test-report.junit.xml")];CEe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as NP,readFileSync as PJ,readdirSync as DEe,statSync as NEe}from"node:fs";import{join as jv}from"node:path";function FP(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=jv(t,e);if(NP(r))try{if(CJ.test(PJ(r,"utf8")))return!0}catch{}}return!1}function DJ(t){try{return NP(t)&&CJ.test(PJ(t,"utf8"))}catch{return!1}}function NJ(t,e=0){if(e>4||!NP(t))return!1;let r;try{r=DEe(t)}catch{return!1}for(let n of r){let i=jv(t,n),o=!1;try{o=NEe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(NJ(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&DJ(i))return!0}return!1}function FEe(t){if(FP(t))return!0;for(let e of jEe)if(DJ(jv(t,e)))return!0;for(let e of MEe)if(NJ(jv(t,e)))return!0;return!1}function jJ(t="."){let e=Wl(t).coverage;return e||(FEe(t)?"kover":"jacoco")}function MJ(t="."){return jP[jJ(t)]}function FJ(t="."){return DP[jJ(t)]}var jP,DP,MP,CJ,jEe,MEe,Mv=y(()=>{"use strict";Sp();jP={kover:"koverXmlReport",jacoco:"jacocoTestReport"},DP={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},MP=[DP.kover,DP.jacoco],CJ=/kover/i;jEe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],MEe=["buildSrc","build-logic"]});import{existsSync as xp,readFileSync as zP,readdirSync as zJ,statSync as LEe}from"node:fs";import{dirname as zEe,join as kr,resolve as UEe}from"node:path";import Kl from"node:process";function UP(t){return xp(kr(t,"gradlew"))?"./gradlew":"gradle"}function qEe(t){let e=UP(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[MJ(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function HEe(t){let e=!1;try{e=/(^|\n)\s*flutter\s*:|sdk:\s*flutter/.test(zP(kr(t,"pubspec.yaml"),"utf8"))}catch{}let r={cmd:"dart",args:["format","--output=none","--set-exit-if-changed","."]},n={cmd:"gitleaks",args:["detect","--no-banner"]};return e?{type:{cmd:"flutter",args:["analyze"]},lint:r,test:{cmd:"flutter",args:["test"]},coverage:{cmd:"flutter",args:["test","--coverage"]},secret:n}:{type:{cmd:"dart",args:["analyze"]},lint:r,test:{cmd:"dart",args:["test"]},coverage:{cmd:"dart",args:["test","--coverage=coverage"]},secret:n}}function GEe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function WEe(t,e){for(let r of e)if(xp(kr(t,r)))return r}function KEe(t,e){try{return zJ(t).find(n=>n.endsWith(e))}catch{return}}function QEe(t){let e=[],r=Kl.platform==="win32";r||e.push(kr("/etc","madge","config"),kr("/etc","madgerc"));let n=r?Kl.env.USERPROFILE:Kl.env.HOME;n&&e.push(kr(n,".config","madge","config"),kr(n,".config","madge"),kr(n,".madge","config"),kr(n,".madgerc"));for(let o=UEe(t);;){e.push(kr(o,".madgerc"));let s=zEe(o);if(s===o)break;o=s}let i=Kl.env.MADGE_config??Kl.env.madge_config;return i&&e.push(i),e}function eAe(){for(let[t,e]of Object.entries(Kl.env))if(/^madge_excluderegexp/i.test(t)&&typeof e=="string"&&e.trim().length>0)return!0;return!1}function UJ(t){return Array.isArray(t)?t.length>0:typeof t=="string"&&t.trim().length>0}function rAe(t){try{return LEe(t).isFile()}catch{return!1}}function nAe(t){let e;try{e=zP(t,"utf8")}catch{return!0}try{return UJ(JSON.parse(e).excludeRegExp)}catch{return tAe.test(e)}}function iAe(t,e){let r=e.madge;return r&&typeof r=="object"&&UJ(r.excludeRegExp)||eAe()?!0:QEe(t).some(n=>rAe(n)&&nAe(n))}function oAe(t){try{return JSON.parse(zP(kr(t,"package.json"),"utf8").replace(/^\uFEFF/,""))}catch{return{}}}function wp(t,e){let r=t.scripts?.[e];return typeof r=="string"&&r.trim().length>0?r.trim():void 0}function LJ(t,e){return[t.dependencies,t.devDependencies,t.optionalDependencies,t.peerDependencies].some(r=>r?.[e]!==void 0)}function sAe(t,e,r){if(iAe(t,r))return e;let n=[...e.args];return n.splice(n.length-1,0,"--exclude",XEe),{...e,args:n}}function aAe(t,e,r){if(wp(r,"lint"))return{cmd:"npm",args:["run","--silent","lint"]};for(let n of JEe)if(n.configs.some(i=>xp(kr(t,i))))return n.gate;if(YEe.some(n=>xp(kr(t,n)))||r.eslintConfig!==void 0)return e}function lAe(t,e){return cAe.some(r=>xp(kr(t,r)))?!0:e.jest!==void 0}function uAe(t){if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?vitest(?:\s+run)?$/i.test(t))return"vitest";if(/^(?:(?:npx|npm exec)\s+(?:--offline\s+)?(?:--no-install\s+)?(?:--\s+)?)?jest$/i.test(t))return"jest"}function LP(t,e){let r={...t};return e==="lint"?delete r.lint:delete r.coverage,r}function dAe(t,e){let r=oAe(t),n=e.lint?aAe(t,e.lint,r):void 0,i=e.arch?{...e,arch:sAe(t,e.arch,r)}:e,o=n?{...i,lint:n}:LP(i,"lint"),s=wp(r,"test"),a=s?uAe(s):void 0;return s&&!a?(o=LP(o,"coverage"),{...o,test:{cmd:"npm",args:["test"]},...wp(r,"coverage")?{coverage:{cmd:"npm",args:["run","--silent","coverage"]}}:{}}):a==="jest"||!s&&lAe(t,r)?{...o,test:{cmd:"npx",args:[...Fi,"jest"]},coverage:{cmd:"npx",args:[...Fi,"jest","--coverage"]}}:(a==="vitest"&&!wp(r,"coverage")&&!LJ(r,"@vitest/coverage-v8")&&!LJ(r,"@vitest/coverage-istanbul")?o=LP(o,"coverage"):a==="vitest"&&wp(r,"coverage")&&(o={...o,coverage:{cmd:"npm",args:["run","--silent","coverage"]}}),o)}function _t(t="."){for(let e of ZEe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=KEe(t,o):r=WEe(t,[o]),r)break;if(!r||e.requiresSource&&!GEe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"?dAe(t,n):n;return{language:e.language,manifest:r,gates:i}}return VEe}var Fi,BEe,ZEe,VEe,JEe,YEe,XEe,tAe,cAe,Dn=y(()=>{"use strict";Mv();Fi=["--offline","--no-install"];BEe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);ZEe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:[...Fi,"tsc","--noEmit"]},lint:{cmd:"npx",args:[...Fi,"eslint","."]},test:{cmd:"npx",args:[...Fi,"vitest","run"]},coverage:{cmd:"npx",args:[...Fi,"vitest","run","--coverage"]},secret:{cmd:"npx",args:[...Fi,"secretlint","**/*"]},arch:{cmd:"npx",args:[...Fi,"madge","--circular","--extensions","ts,tsx,js,jsx","."]},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:qEe},{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"]}}},{language:"swift",manifests:["Package.swift"],gates:{type:{cmd:"swift",args:["build"]},lint:{cmd:"swiftlint",args:["lint"]},test:{cmd:"swift",args:["test"]},coverage:{cmd:"swift",args:["test","--enable-code-coverage"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"dart",manifests:["pubspec.yaml"],gates:HEe}],VEe={language:"unknown",manifest:"",gates:{}};JEe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:[...Fi,"biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:[...Fi,"oxlint"]}}],YEe=["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts",".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"],XEe="(^|/)(dist|coverage|\\.next|\\.nuxt|\\.output|\\.svelte-kit|\\.vite)/|^(build|out|target)/";tAe=/^[ \t]*excludeRegExp[ \t]*(?:\[[^\]]*\])?[ \t]*=[ \t]*(\S.*?)[ \t]*$/m;cAe=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs","jest.config.json"]});import{existsSync as fAe,readFileSync as pAe}from"node:fs";import{join as mAe}from"node:path";function Ba(t){return t.code==="ENOENT"}function Fv(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=[s,o].filter(c=>c.length>0).join(` +`).slice(0,2e3)||`exit ${i}`;return qJ.test(o)||qJ.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function Nt(t,e,r,n=[]){if(Ba(r))return{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`,skipReason:"tool-missing"};let i=`${String(r.stderr??"")} +${String(r.stdout??"")}`,o=/ENOTCACHED|ENOTFOUND|EAI_AGAIN|canceled due to missing packages|could not determine executable/i.test(i),a=n.find(l=>l!=="--"&&!l.startsWith("-"))?.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=r.exitCode===127&&a!==void 0&&new RegExp(`(?:^|[\\s:])${a}: (?:command )?not found\\b`,"i").test(i);return e==="npx"&&(o||c)?{stage:t,pass:!1,exitCode:2,stderr:"setup gap: 'npx' could not resolve the configured tool without installing it; the inferred tool is not installed or unavailable offline",skipReason:"tool-missing"}:null}function Xt(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=[String(e.stdout??"").trim(),String(e.stderr??"").trim()].filter(i=>i.length>0).join(` `);return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Jl(t,e){let r=mAe(t,"package.json");if(!fAe(r))return!1;try{return!!JSON.parse(pAe(r,"utf8")).scripts?.[e]}catch{return!1}}var qJ,Nn=y(()=>{"use strict";qJ=/config (is |file )?not found|no such file|ENOENT|ENOTCACHED|ENOTFOUND|EAI_AGAIN|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 hAe(t){let{cwd:e="."}=t,r=_t(e),n=r.gates.arch;if(!n)return[{detector:Lv,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=Ke(n.cmd,[...n.args],{cwd:e,reject:!1});return Ba(i)?[{detector:Lv,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:Fv(i,Lv,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Lv,Ga,zv=y(()=>{"use strict";zr();Dn();Nn();Lv="ARCHITECTURE_VIOLATION";Ga={name:Lv,subprocess:!0,run:hAe}});function gAe(t){let{cwd:e="."}=t,r=_t(e),n=r.gates.secret;if(!n)return[{detector:Uv,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=Ke(n.cmd,[...n.args],{cwd:e,reject:!1});return Ba(i)?[{detector:Uv,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:Fv(i,Uv,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var Uv,Za,qv=y(()=>{"use strict";zr();Dn();Nn();Uv="HARDCODED_SECRET";Za={name:Uv,subprocess:!0,run:gAe}});import{existsSync as qP,readdirSync as HJ}from"node:fs";import{join as Hv}from"node:path";function _Ae(t,e){let r=Hv(t,e.path);if(!qP(r))return!0;if(e.isDirectory)try{return HJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function bAe(t){let{cwd:e="."}=t,r=[];for(let i of yAe)_Ae(e,i)&&r.push({detector:$p,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=Hv(e,"spec.yaml");if(qP(n)){let i=wAe(n),o=i?null:vAe(e);if(i)r.push({detector:$p,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:$p,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=SAe(e);s&&r.push({detector:$p,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 vAe(t){for(let e of["spec/features","spec/scenarios"]){let r=Hv(t,e);if(!qP(r))continue;let n;try{n=HJ(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{Ri(Hv(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function SAe(t){try{return q(t),null}catch(e){return e.message}}function wAe(t){let e;try{e=Ri(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var $p,yAe,BJ,GJ=y(()=>{"use strict";Ue();V_();$p="ABSENCE_OF_GOVERNANCE",yAe=[{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}];BJ={name:$p,run:bAe}});function Bv(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function HP(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=Bv(r)==="while",o=$Ae.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 '${Bv(r)}'`}let n=xAe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:Bv(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${Bv(r)}'`:null}function kAe(t,e){let r=HP(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function ZJ(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...kAe(r,n));return e}var xAe,$Ae,BP=y(()=>{"use strict";xAe={event:"when",state:"while",optional:"where",unwanted:"if"},$Ae=/\bwhen\b/i});function ye(t,e,r){let n;try{n=q(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var xt=y(()=>{"use strict";Ue()});function EAe(t){let{cwd:e="."}=t;return ye(e,Gv,AAe)}function AAe(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:Gv,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 ZJ(t.features))e.push({detector:Gv,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var Gv,VJ,WJ=y(()=>{"use strict";BP();xt();Gv="AC_DRIFT";VJ={name:Gv,run:EAe}});function Li(t=".",e){let n=(e??"").trim().toLowerCase()||_t(t).language;return JJ[n]??KJ}var OAe,TAe,RAe,KJ,IAe,PAe,JJ,CAe,YJ,Va=y(()=>{"use strict";Dn();OAe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,TAe=/^[ \t]*import\s+([\w.]+)/gm,RAe=/^[ \t]*(?:from|import)\s+([\w.]+)/gm,KJ={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:OAe,importStyle:"relative"},IAe={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:TAe,importStyle:"dotted"},PAe={ext:"py",extensions:[".py"],sourceRoots:["."],mainRoot:"src",testGlobs:["tests/test_*.py","tests/**/test_*.py","tests/**/*_test.py"],coverageSummary:"coverage.xml",coverageFormat:"cobertura-xml",importMatcher:RAe,importStyle:"dotted"},JJ={typescript:KJ,kotlin:IAe,python:PAe},CAe=[".js",".jsx",".mts",".cts",".rs",".go",".java",".rb",".php",".cs",".fs",".ex",".exs"],YJ=new Set([...Object.values(JJ).flatMap(t=>t?.extensions??[]),...CAe].map(t=>t.toLowerCase()))});import{existsSync as DAe,readFileSync as NAe,readdirSync as jAe,statSync as MAe}from"node:fs";import{join as QJ,relative as XJ}from"node:path";function FAe(t,e){if(!DAe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=jAe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=QJ(i,s),c;try{c=MAe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function LAe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function UAe(t){return zAe.test(t)}function qAe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=Li(e,r.project?.language),o=i.sourceRoots.flatMap(a=>FAe(QJ(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=NAe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";Ue();Va();e8="AI_HINTS_FORBIDDEN_PATTERN";zAe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;t8={name:e8,run:qAe}});function HAe(t){let{cwd:e="."}=t,r;try{r=q(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:n8,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var n8,i8,o8=y(()=>{"use strict";Ue();n8="AC_DUPLICATE_WITHIN_FEATURE";i8={name:n8,run:HAe}});import{createRequire as BAe}from"module";import{basename as GAe,dirname as ZP,normalize as ZAe,relative as VAe,resolve as WAe,sep as c8}from"path";import*as KAe from"fs";function JAe(t){let e=ZAe(t);return e.length>1&&e[e.length-1]===c8&&(e=e.substring(0,e.length-1)),e}function l8(t,e){return t.replace(YAe,e)}function QAe(t){return t==="/"||XAe.test(t)}function GP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=WAe(t)),(n||o)&&(t=JAe(t)),t===".")return"";let s=t[t.length-1]!==i;return l8(s?t+i:t,i)}function u8(t,e){return e+t}function eOe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:l8(VAe(t,n),e.pathSeparator)+e.pathSeparator+r}}function tOe(t){return t}function rOe(t,e,r){return e+t+r}function nOe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?eOe(t,e):n?u8:tOe}function iOe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function oOe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function lOe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?oOe(t):iOe(t):n&&n.length?aOe:sOe:cOe}function hOe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?mOe:r&&r.length?n?uOe:dOe:n?fOe:pOe}function _Oe(t){return t.group?yOe:gOe}function SOe(t){return t.group?bOe:vOe}function $Oe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?xOe:wOe}function d8(t,e,r){if(r.options.useRealPaths)return kOe(e,r);let n=ZP(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=ZP(n)}return r.symlinks.set(t,e),i>1}function kOe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Zv(t,e,r,n){e(t&&!n?t:null,r)}function DOe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?EOe:ROe:n?e?AOe:COe:i?e?TOe:POe:e?OOe:IOe}function MOe(t){return t?jOe:NOe}function UOe(t,e){return new Promise((r,n)=>{m8(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function m8(t,e,r){new p8(t,e,r).start()}function qOe(t,e){return new p8(t,e).start()}var s8,YAe,XAe,sOe,aOe,cOe,uOe,dOe,fOe,pOe,mOe,gOe,yOe,bOe,vOe,wOe,xOe,EOe,AOe,OOe,TOe,ROe,IOe,POe,COe,f8,NOe,jOe,FOe,LOe,zOe,p8,a8,h8,g8,y8=y(()=>{s8=BAe(import.meta.url);YAe=/[\\/]/g;XAe=/^[a-z]:[\\/]$/i;sOe=(t,e)=>{e.push(t||".")},aOe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},cOe=()=>{};uOe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},dOe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},fOe=(t,e,r,n)=>{r.files++},pOe=(t,e)=>{e.push(t)},mOe=()=>{};gOe=t=>t,yOe=()=>[""].slice(0,0);bOe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},vOe=()=>{};wOe=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()&&d8(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},xOe=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()&&d8(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};EOe=t=>t.counts,AOe=t=>t.groups,OOe=t=>t.paths,TOe=t=>t.paths.slice(0,t.options.maxFiles),ROe=(t,e,r)=>(Zv(e,r,t.counts,t.options.suppressErrors),null),IOe=(t,e,r)=>(Zv(e,r,t.paths,t.options.suppressErrors),null),POe=(t,e,r)=>(Zv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),COe=(t,e,r)=>(Zv(e,r,t.groups,t.options.suppressErrors),null);f8={withFileTypes:!0},NOe=(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||".",f8,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},jOe=(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||".",f8)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};FOe=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))}},LOe=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}},zOe=class{aborted=!1;abort(){this.aborted=!0}},p8=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=DOe(e,this.isSynchronous),this.root=GP(t,e),this.state={root:QAe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new LOe,options:e,queue:new FOe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new zOe,fs:e.fs||KAe},this.joinPath=nOe(this.root,e),this.pushDirectory=lOe(this.root,e),this.pushFile=hOe(e),this.getArray=_Oe(e),this.groupFiles=SOe(e),this.resolveSymlink=$Oe(e,this.isSynchronous),this.walkDirectory=MOe(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(b.isDirectory()){if(_=GP(_,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=GAe(_),x=GP(ZP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};a8=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return UOe(this.root,this.options)}withCallback(t){m8(this.root,this.options,t)}sync(){return qOe(this.root,this.options)}},h8=null;try{s8.resolve("picomatch"),h8=s8("picomatch")}catch{}g8=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:c8,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 a8(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new a8(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||h8;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 kp=v((mpt,w8)=>{"use strict";var _8="[^\\\\/]",HOe="(?=.)",b8="[^/]",VP="(?:\\/|$)",v8="(?:^|\\/)",WP=`\\.{1,2}${VP}`,BOe="(?!\\.)",GOe=`(?!${v8}${WP})`,ZOe=`(?!\\.{0,1}${VP})`,VOe=`(?!${WP})`,WOe="[^.\\/]",KOe=`${b8}*?`,JOe="/",S8={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:HOe,QMARK:b8,END_ANCHOR:VP,DOTS_SLASH:WP,NO_DOT:BOe,NO_DOTS:GOe,NO_DOT_SLASH:ZOe,NO_DOTS_SLASH:VOe,QMARK_NO_DOT:WOe,STAR:KOe,START_ANCHOR:v8,SEP:JOe},YOe={...S8,SLASH_LITERAL:"[\\\\/]",QMARK:_8,STAR:`${_8}*?`,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:"\\"},XOe={__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"};w8.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:XOe,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?YOe:S8}}});var Ep=v(Ur=>{"use strict";var{REGEX_BACKSLASH:QOe,REGEX_REMOVE_BACKSLASH:eTe,REGEX_SPECIAL_CHARS:tTe,REGEX_SPECIAL_CHARS_GLOBAL:rTe}=kp();Ur.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ur.hasRegexChars=t=>tTe.test(t);Ur.isRegexChar=t=>t.length===1&&Ur.hasRegexChars(t);Ur.escapeRegex=t=>t.replace(rTe,"\\$1");Ur.toPosixSlashes=t=>t.replace(QOe,"/");Ur.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};Ur.removeBackslashes=t=>t.replace(eTe,e=>e==="\\"?"":e);Ur.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Ur.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Ur.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ur.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Ur.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var R8=v((gpt,T8)=>{"use strict";var x8=Ep(),{CHAR_ASTERISK:KP,CHAR_AT:nTe,CHAR_BACKWARD_SLASH:Ap,CHAR_COMMA:iTe,CHAR_DOT:JP,CHAR_EXCLAMATION_MARK:YP,CHAR_FORWARD_SLASH:O8,CHAR_LEFT_CURLY_BRACE:XP,CHAR_LEFT_PARENTHESES:QP,CHAR_LEFT_SQUARE_BRACKET:oTe,CHAR_PLUS:sTe,CHAR_QUESTION_MARK:$8,CHAR_RIGHT_CURLY_BRACE:aTe,CHAR_RIGHT_PARENTHESES:k8,CHAR_RIGHT_SQUARE_BRACKET:cTe}=kp(),E8=t=>t===O8||t===Ap,A8=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},lTe=(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,b=!1,_=!1,S=!1,x=!1,w=!1,R=0,A,O,D={value:"",depth:0,isGlob:!1},E=()=>l>=n,ae=()=>c.charCodeAt(l+1),X=()=>(A=O,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),J&&m===!0&&d>0?(J=c.slice(0,d),C=c.slice(d)):m===!0?(J="",C=c):J=c,J&&J!==""&&J!=="/"&&J!==c&&E8(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(C&&(C=x8.removeBackslashes(C)),J&&_===!0&&(J=x8.removeBackslashes(J)));let dr={prefix:P,input:t,start:u,base:J,glob:C,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(dr.maxDepth=0,E8(O)||s.push(D),dr.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var Op=kp(),ln=Ep(),{MAX_LENGTH:Vv,POSIX_REGEX_SOURCE:uTe,REGEX_NON_SPECIAL_CHARS:dTe,REGEX_SPECIAL_CHARS_BACKREF:fTe,REPLACEMENTS:I8}=Op,pTe=(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=>ln.escapeRegex(i)).join("..")}return r},Yl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,P8=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},mTe=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},tC=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(mTe(e))return e.replace(/\\(.)/g,"$1")},hTe=t=>{let e=t.map(tC).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}}}}},gTe=t=>`${t.length===1?ln.escapeRegex(t[0]):`[${t.map(r=>ln.escapeRegex(r)).join("")}]`}*`,yTe=t=>{let e=0,r=[];for(;es.trim());if(i.length!==1)return;let o=tC(i[0]);if(!o||o.length!==1)return;r.push(o),e+=n.end+1}if(!(r.length<1))return r},_Te=t=>{let e=0,r=t.trim(),n=eC(r);for(;n;)e++,r=n.body.trim(),n=eC(r);return e},bTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Op.DEFAULT_MAX_EXTGLOB_RECURSION,n=P8(t).map(a=>a.trim());if(n.length>1&&(n.some(a=>a==="")||n.some(a=>/^[*?]+$/.test(a))||hTe(n)))return{risky:!0};let i=[],o=!1,s=!0;for(let a of n){let c=yTe(a);if(c){o=!0,i.push(...c);continue}let l=tC(a);if(l&&l.length===1){i.push(l);continue}if(s=!1,_Te(a)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:gTe([...new Set(i)])}:{risky:!0}:{risky:!1}},rC=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=I8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Vv,r.maxLength):Vv,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=Op.globChars(r.windows),l=Op.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:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,R=G=>`(${a}(?:(?!${w}${G.dot?m:u}).)*?)`,A=r.dot?"":h,O=r.dot?_:S,D=r.bash===!0?R(r):x;r.capture&&(D=`(${D})`),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=ln.removePrefix(t,E),i=t.length;let ae=[],X=[],J=[],P=o,C,dr=()=>E.index===i-1,se=E.peek=(G=1)=>t[E.index+G],Ce=E.advance=()=>t[++E.index]||"",Kt=()=>t.slice(E.index+1),fr=(G="",ht=0)=>{E.consumed+=G,E.index+=ht},Qt=G=>{E.output+=G.output!=null?G.output:G.value,fr(G.value)},fo=()=>{let G=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),E.start++,G++;return G%2===0?!1:(E.negated=!0,E.start++,!0)},ki=G=>{E[G]++,J.push(G)},tn=G=>{E[G]--,J.pop()},fe=G=>{if(P.type==="globstar"){let ht=E.braces>0&&(G.type==="comma"||G.type==="brace"),B=G.extglob===!0||ae.length&&(G.type==="pipe"||G.type==="paren");G.type!=="slash"&&G.type!=="paren"&&!ht&&!B&&(E.output=E.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=D,E.output+=P.output)}if(ae.length&&G.type!=="paren"&&(ae[ae.length-1].inner+=G.value),(G.value||G.output)&&Qt(G),P&&P.type==="text"&&G.type==="text"){P.output=(P.output||P.value)+G.value,P.value+=G.value;return}G.prev=P,s.push(G),P=G},po=(G,ht)=>{let B={...l[ht],conditions:1,inner:""};B.prev=P,B.parens=E.parens,B.output=E.output,B.startIndex=E.index,B.tokensIndex=s.length;let Te=(r.capture?"(":"")+B.open;ki("parens"),fe({type:G,value:ht,output:E.output?"":p}),fe({type:"paren",extglob:!0,value:Ce(),output:Te}),ae.push(B)},Nfe=G=>{let ht=t.slice(G.startIndex,E.index+1),B=t.slice(G.startIndex+2,E.index),Te=bTe(B,r);if((G.type==="plus"||G.type==="star")&&Te.risky){let ut=Te.safeOutput?(G.output?"":p)+(r.capture?`(${Te.safeOutput})`:Te.safeOutput):void 0,Ei=s[G.tokensIndex];Ei.type="text",Ei.value=ht,Ei.output=ut||ln.escapeRegex(ht);for(let Ai=G.tokensIndex+1;Ai1&&G.inner.includes("/")&&(ut=R(r)),(ut!==D||dr()||/^\)+$/.test(Kt()))&&(dt=G.close=`)$))${ut}`),G.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let Ei=rC(zt,{...e,fastpaths:!1}).output;dt=G.close=`)${Ei})${ut})`}G.prev.type==="bos"&&(E.negatedExtglob=!0)}fe({type:"paren",extglob:!0,value:C,output:dt}),tn("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let G=!1,ht=t.replace(fTe,(B,Te,dt,zt,ut,Ei)=>zt==="\\"?(G=!0,B):zt==="?"?Te?Te+zt+(ut?_.repeat(ut.length):""):Ei===0?O+(ut?_.repeat(ut.length):""):_.repeat(dt.length):zt==="."?u.repeat(dt.length):zt==="*"?Te?Te+zt+(ut?D:""):D:Te?B:`\\${B}`);return G===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ht===t&&r.contains===!0?(E.output=t,E):(E.output=ln.wrapOutput(ht,E,e),E)}for(;!dr();){if(C=Ce(),C==="\0")continue;if(C==="\\"){let B=se();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){C+="\\",fe({type:"text",value:C});continue}let Te=/^\\+/.exec(Kt()),dt=0;if(Te&&Te[0].length>2&&(dt=Te[0].length,E.index+=dt,dt%2!==0&&(C+="\\")),r.unescape===!0?C=Ce():C+=Ce(),E.brackets===0){fe({type:"text",value:C});continue}}if(E.brackets>0&&(C!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&C===":"){let B=P.value.slice(1);if(B.includes("[")&&(P.posix=!0,B.includes(":"))){let Te=P.value.lastIndexOf("["),dt=P.value.slice(0,Te),zt=P.value.slice(Te+2),ut=uTe[zt];if(ut){P.value=dt+ut,E.backtrack=!0,Ce(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(C==="["&&se()!==":"||C==="-"&&se()==="]")&&(C=`\\${C}`),C==="]"&&(P.value==="["||P.value==="[^")&&(C=`\\${C}`),r.posix===!0&&C==="!"&&P.value==="["&&(C="^"),P.value+=C,Qt({value:C});continue}if(E.quotes===1&&C!=='"'){C=ln.escapeRegex(C),P.value+=C,Qt({value:C});continue}if(C==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&fe({type:"text",value:C});continue}if(C==="("){ki("parens"),fe({type:"paren",value:C});continue}if(C===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Yl("opening","("));let B=ae[ae.length-1];if(B&&E.parens===B.parens+1){Nfe(ae.pop());continue}fe({type:"paren",value:C,output:E.parens?")":"\\)"}),tn("parens");continue}if(C==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Yl("closing","]"));C=`\\${C}`}else ki("brackets");fe({type:"bracket",value:C});continue}if(C==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){fe({type:"text",value:C,output:`\\${C}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Yl("opening","["));fe({type:"text",value:C,output:`\\${C}`});continue}tn("brackets");let B=P.value.slice(1);if(P.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(C=`/${C}`),P.value+=C,Qt({value:C}),r.literalBrackets===!1||ln.hasRegexChars(B))continue;let Te=ln.escapeRegex(P.value);if(E.output=E.output.slice(0,-P.value.length),r.literalBrackets===!0){E.output+=Te,P.value=Te;continue}P.value=`(${a}${Te}|${P.value})`,E.output+=P.value;continue}if(C==="{"&&r.nobrace!==!0){ki("braces");let B={type:"brace",value:C,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};X.push(B),fe(B);continue}if(C==="}"){let B=X[X.length-1];if(r.nobrace===!0||!B){fe({type:"text",value:C,output:C});continue}let Te=")";if(B.dots===!0){let dt=s.slice(),zt=[];for(let ut=dt.length-1;ut>=0&&(s.pop(),dt[ut].type!=="brace");ut--)dt[ut].type!=="dots"&&zt.unshift(dt[ut].value);Te=pTe(zt,r),E.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let dt=E.output.slice(0,B.outputIndex),zt=E.tokens.slice(B.tokensIndex);B.value=B.output="\\{",C=Te="\\}",E.output=dt;for(let ut of zt)E.output+=ut.output||ut.value}fe({type:"brace",value:C,output:Te}),tn("braces"),X.pop();continue}if(C==="|"){ae.length>0&&ae[ae.length-1].conditions++,fe({type:"text",value:C});continue}if(C===","){let B=C,Te=X[X.length-1];Te&&J[J.length-1]==="braces"&&(Te.comma=!0,B="|"),fe({type:"comma",value:C,output:B});continue}if(C==="/"){if(P.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),P=o;continue}fe({type:"slash",value:C,output:f});continue}if(C==="."){if(E.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let B=X[X.length-1];P.type="dots",P.output+=C,P.value+=C,B.dots=!0;continue}if(E.braces+E.parens===0&&P.type!=="bos"&&P.type!=="slash"){fe({type:"text",value:C,output:u});continue}fe({type:"dot",value:C,output:u});continue}if(C==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){po("qmark",C);continue}if(P&&P.type==="paren"){let Te=se(),dt=C;(P.value==="("&&!/[!=<:]/.test(Te)||Te==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(dt=`\\${C}`),fe({type:"text",value:C,output:dt});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){fe({type:"qmark",value:C,output:S});continue}fe({type:"qmark",value:C,output:_});continue}if(C==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){po("negate",C);continue}if(r.nonegate!==!0&&E.index===0){fo();continue}}if(C==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){po("plus",C);continue}if(P&&P.value==="("||r.regex===!1){fe({type:"plus",value:C,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||E.parens>0){fe({type:"plus",value:C});continue}fe({type:"plus",value:d});continue}if(C==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){fe({type:"at",extglob:!0,value:C,output:""});continue}fe({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let B=dTe.exec(Kt());B&&(C+=B[0],E.index+=B[0].length),fe({type:"text",value:C});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=C,P.output=D,E.backtrack=!0,E.globstar=!0,fr(C);continue}let G=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(G)){po("star",C);continue}if(P.type==="star"){if(r.noglobstar===!0){fr(C);continue}let B=P.prev,Te=B.prev,dt=B.type==="slash"||B.type==="bos",zt=Te&&(Te.type==="star"||Te.type==="globstar");if(r.bash===!0&&(!dt||G[0]&&G[0]!=="/")){fe({type:"star",value:C,output:""});continue}let ut=E.braces>0&&(B.type==="comma"||B.type==="brace"),Ei=ae.length&&(B.type==="pipe"||B.type==="paren");if(!dt&&B.type!=="paren"&&!ut&&!Ei){fe({type:"star",value:C,output:""});continue}for(;G.slice(0,3)==="/**";){let Ai=t[E.index+4];if(Ai&&Ai!=="/")break;G=G.slice(3),fr("/**",3)}if(B.type==="bos"&&dr()){P.type="globstar",P.value+=C,P.output=R(r),E.output=P.output,E.globstar=!0,fr(C);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!zt&&dr()){E.output=E.output.slice(0,-(B.output+P.output).length),B.output=`(?:${B.output}`,P.type="globstar",P.output=R(r)+(r.strictSlashes?")":"|$)"),P.value+=C,E.globstar=!0,E.output+=B.output+P.output,fr(C);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&G[0]==="/"){let Ai=G[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(B.output+P.output).length),B.output=`(?:${B.output}`,P.type="globstar",P.output=`${R(r)}${f}|${f}${Ai})`,P.value+=C,E.output+=B.output+P.output,E.globstar=!0,fr(C+Ce()),fe({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&G[0]==="/"){P.type="globstar",P.value+=C,P.output=`(?:^|${f}|${R(r)}${f})`,E.output=P.output,E.globstar=!0,fr(C+Ce()),fe({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-P.output.length),P.type="globstar",P.output=R(r),P.value+=C,E.output+=P.output,E.globstar=!0,fr(C);continue}let ht={type:"star",value:C,output:D};if(r.bash===!0){ht.output=".*?",(P.type==="bos"||P.type==="slash")&&(ht.output=A+ht.output),fe(ht);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){ht.output=C,fe(ht);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+=b,P.output+=b):(E.output+=A,P.output+=A),se()!=="*"&&(E.output+=p,P.output+=p)),fe(ht)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing","]"));E.output=ln.escapeLast(E.output,"["),tn("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing",")"));E.output=ln.escapeLast(E.output,"("),tn("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing","}"));E.output=ln.escapeLast(E.output,"{"),tn("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${f}?`}),E.backtrack===!0){E.output="";for(let G of E.tokens)E.output+=G.output!=null?G.output:G.value,G.suffix&&(E.output+=G.suffix)}return E};rC.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Vv,r.maxLength):Vv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=I8[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}=Op.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=A=>A.noglobstar===!0?_:`(${g}(?:(?!${p}${A.dot?c:o}).)*?)`,x=A=>{switch(A){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 O=/^(.*?)\.(\w+)$/.exec(A);if(!O)return;let D=x(O[1]);return D?D+o+O[2]:void 0}}},w=ln.removePrefix(t,b),R=x(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};C8.exports=rC});var M8=v((_pt,j8)=>{"use strict";var vTe=R8(),nC=D8(),N8=Ep(),STe=kp(),wTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=wTe(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?Rt.compileRe(t,e):Rt.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=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.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};Rt.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?N8.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=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r,n=r&&r.windows)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(N8.basename(t,{windows:n}));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):nC(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>vTe(t,e);Rt.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=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.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=nC.fastpaths(t,e)),i.output||(i=nC(t,e)),Rt.compileRe(i,e,r,n)};Rt.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/$^/}};Rt.constants=STe;j8.exports=Rt});var U8=v((bpt,z8)=>{"use strict";var F8=M8(),xTe=Ep();function L8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:xTe.isWindows()}),F8(t,e,r)}Object.assign(L8,F8);z8.exports=L8});import{readdir as $Te,readdirSync as kTe,realpath as ETe,realpathSync as ATe,stat as OTe,statSync as TTe}from"fs";import{isAbsolute as RTe,posix as Wa,resolve as ITe}from"path";import{fileURLToPath as PTe}from"url";function jTe(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]===".."&&NTe.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=>Wa.relative(t,n)||".":n=>Wa.relative(t,`${e}/${n}`)||"."}function LTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Wa.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function H8(t){return t.replace(DTe,e=>`${e}/`)}function V8(t){var e;let r=Xl.default.scan(t,zTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function ZTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Xl.default.scan(t);return r.isGlob||r.negated}function Tp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function W8(t){return typeof t=="string"?[t]:t??[]}function iC(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=GTe(o);s=RTe(s.replace(WTe,""))?Wa.relative(a,s):Wa.normalize(s);let c=(i=VTe.exec(s))===null||i===void 0?void 0:i[0],l=V8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=H8(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?Wa.join(o,...d):o)}return s}function KTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(iC(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(iC(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(iC(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function JTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=KTe(t,e,n);t.debug&&Tp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(G8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Xl.default)(i.match,f),m=(0,Xl.default)(i.ignore,f),h=jTe(i.match,f),g=q8(r,d,o),b=o?g:q8(r,d,!0),_=(w,R)=>{let A=b(R,!0);return A!=="."&&!h(A)||m(A)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new g8({filters:[a?(w,R)=>{let A=g(w,R),O=p(A)&&!m(A);return O&&Tp(`matched ${A}`),O}:(w,R)=>{let A=g(w,R);return p(A)&&!m(A)}],exclude:a?(w,R)=>{let A=_(w,R);return Tp(`${A?"skipped":"crawling"} ${R}`),A}:_,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&&Tp("internal properties:",{...n,root:d}),[x,r!==d&&!o&<e(r,d)]}function YTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function XTe(t){let e=Object.assign({},t);for(let r in B8)e[r]===void 0&&Object.assign(e,{[r]:B8[r]});return e.cwd=(e.cwd instanceof URL?PTe(e.cwd):ITe(e.cwd||process.cwd())).replace(G8,"/"),e.ignore=W8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||$Te,readdirSync:e.fs.readdirSync||kTe,realpath:e.fs.realpath||ETe,realpathSync:e.fs.realpathSync||ATe,stat:e.fs.stat||OTe,statSync:e.fs.statSync||TTe}),e.debug&&Tp("globbing with options:",e),e}function QTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=CTe(t)||typeof t=="string",i=W8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=XTe(n?e:t);return i.length>0?JTe(o,i):[]}function vs(t,e){let[r,n]=QTe(t,e);return r?YTe(r.sync(),n):[]}var Xl,CTe,G8,DTe,Z8,NTe,MTe,FTe,zTe,UTe,qTe,HTe,BTe,GTe,VTe,WTe,B8,Rp=y(()=>{y8();Xl=wt(U8(),1),CTe=Array.isArray,G8=/\\/g,DTe=/^[A-Za-z]:$/,Z8=process.platform==="win32",NTe=/^(\/?\.\.)+$/;MTe=/^[A-Z]:\/$/i,FTe=Z8?t=>MTe.test(t):t=>t==="/";zTe={parts:!0};UTe=/(?t.replace(UTe,"\\$&"),BTe=t=>t.replace(qTe,"\\$&"),GTe=Z8?BTe:HTe;VTe=/^(\/?\.\.)+/,WTe=/\\(?=[()[\]{}!*+?@|])/g;B8={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Ip,readFileSync as eRe,readdirSync as tRe,statSync as K8}from"node:fs";import{join as Ka}from"node:path";function rRe(t){let{cwd:e="."}=t,r,n;try{let c=q(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Li(e,n),o=[],{layers:s,forbiddenImports:a}=oC(r);return(s.size>0||a.length>0)&&!Ip(Ka(e,i.mainRoot))?[{detector:Pp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(nRe(e,i,s,o),iRe(e,i,s,o)),a.length>0&&oRe(e,i,a,o),o)}function oC(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 nRe(t,e,r,n){let i=e.mainRoot,o=Ka(t,i);if(Ip(o))for(let s of tRe(o)){let a=Ka(o,s);K8(a).isDirectory()&&(r.has(s)||n.push({detector:Pp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function iRe(t,e,r,n){let i=e.mainRoot,o=Ka(t,i);if(Ip(o))for(let s of r){let a=Ka(o,s);Ip(a)&&K8(a).isDirectory()||n.push({detector:Pp,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 oRe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ka(t,i,s.from);if(!Ip(a))continue;let c=vs([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ka(a,l),d;try{d=eRe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];sRe(p,s.to,e.importStyle)&&n.push({detector:Pp,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 sRe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var Pp,J8,sC=y(()=>{"use strict";Rp();Ue();Va();Pp="ARCHITECTURE_FROM_SPEC";J8={name:Pp,run:rRe}});import{existsSync as aRe,readFileSync as cRe}from"node:fs";import{join as lRe}from"node:path";function dRe(t){let{cwd:e="."}=t,r=lRe(e,"spec/capabilities.yaml");if(!aRe(r))return[];let n;try{let u=cRe(r,"utf8"),d=Y8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=q(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";Y8=wt(tr(),1);Ue();Wv="CAPABILITIES_FEATURE_MAPPING",uRe=8;X8={name:Wv,run:dRe}});import{existsSync as fRe,readFileSync as pRe}from"node:fs";import{join as mRe}from"node:path";function hRe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function gRe(t){let{cwd:e="."}=t;return ye(e,aC,r=>yRe(r,e))}function yRe(t,e){let r=Li(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=mRe(e,o);if(!fRe(s))continue;let a=pRe(s,"utf8");hRe(a)||n.push({detector:aC,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var aC,e5,t5=y(()=>{"use strict";Va();xt();aC="CONVENTION_DRIFT";e5={name:aC,run:gRe}});import{existsSync as cC,readFileSync as r5}from"node:fs";import{join as Kv}from"node:path";function _Re(t){return JSON.parse(t).total?.lines?.pct??0}function n5(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function SRe(t,e){if(!Cv(_t(t).gates.coverage?.cmd))return null;let r;try{r=Dv(t,e)}catch(c){return[{detector:Eo,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=MP.find(d=>cC(Kv(c.dir,d)));if(!l){s.push(c.path);continue}let u=n5(r5(Kv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Eo,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=i5(n,i);return a0?[{detector:Eo,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function wRe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=SRe(e,t.focusModules);if(a)return a}let r;try{r=q(e).project?.language}catch{}let n=Li(e,r),i=_t(e).language==="kotlin"?MP.find(a=>cC(Kv(e,a)))??FJ(e):n.coverageSummary,o=Kv(e,i);if(!cC(o))return[{detector:Eo,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=r5(o,"utf8");s=n.coverageFormat==="jacoco-xml"?bRe(a):n.coverageFormat==="cobertura-xml"?vRe(a):_Re(a)}catch(a){return[{detector:Eo,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:Eo,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Jv?[]:[{detector:Eo,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Jv}%`}]}var Eo,Jv,o5,s5=y(()=>{"use strict";Ue();Mv();Va();Nv();Dn();Eo="COVERAGE_DROP",Jv=70;o5={name:Eo,run:wRe}});import{existsSync as xRe}from"node:fs";import{join as $Re}from"node:path";function ERe(t){let{cwd:e="."}=t;return ye(e,Yv,r=>ARe(r,e))}function ARe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";xt();Yv="DELIVERABLE_INTEGRITY",kRe=8;a5={name:Yv,run:ERe}});function ORe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Xv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function TRe(t){let e=ORe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Xv,severity:"warn",path:"spec.yaml",message:`${r.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 RRe(t){let{cwd:e="."}=t;return ye(e,Xv,r=>TRe(r))}var Xv,l5,u5=y(()=>{"use strict";xt();Xv="SMOKE_PROBE_DEMAND";l5={name:Xv,run:RRe}});function IRe(t){let{cwd:e="."}=t;return ye(e,Qv,r=>PRe(r,e))}function PRe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=ds(e);if(n===null)return[{detector:Qv,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=Q_(n,e,o);s.state!=="fresh"&&i.push({detector:Qv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${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.`:s.module?`${o.id}'s module ${s.module} 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.`:`${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 Qv,eS,lC=y(()=>{"use strict";El();xt();Qv="STALE_ATTESTATION";eS={name:Qv,run:IRe}});function CRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}return DRe(r)}function DRe(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:d5,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 d5,tS,uC=y(()=>{"use strict";Ue();d5="DEPENDENCY_CYCLE";tS={name:d5,run:CRe}});import{appendFileSync as NRe,existsSync as f5,mkdirSync as jRe,readFileSync as MRe}from"node:fs";import{dirname as FRe,join as LRe}from"node:path";function p5(t){return LRe(t,zRe,URe)}function m5(t){return dC.add(t),()=>dC.delete(t)}function Ja(t,e){let r=p5(t),n=FRe(r);f5(n)||jRe(n,{recursive:!0}),NRe(r,`${JSON.stringify(e)} +`);for(let u=0;u{"use strict";Ue();Va();e8="AI_HINTS_FORBIDDEN_PATTERN";zAe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;t8={name:e8,run:qAe}});function HAe(t){let{cwd:e="."}=t,r;try{r=q(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:n8,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var n8,i8,o8=y(()=>{"use strict";Ue();n8="AC_DUPLICATE_WITHIN_FEATURE";i8={name:n8,run:HAe}});import{createRequire as BAe}from"module";import{basename as GAe,dirname as ZP,normalize as ZAe,relative as VAe,resolve as WAe,sep as c8}from"path";import*as KAe from"fs";function JAe(t){let e=ZAe(t);return e.length>1&&e[e.length-1]===c8&&(e=e.substring(0,e.length-1)),e}function l8(t,e){return t.replace(YAe,e)}function QAe(t){return t==="/"||XAe.test(t)}function GP(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=WAe(t)),(n||o)&&(t=JAe(t)),t===".")return"";let s=t[t.length-1]!==i;return l8(s?t+i:t,i)}function u8(t,e){return e+t}function eOe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:l8(VAe(t,n),e.pathSeparator)+e.pathSeparator+r}}function tOe(t){return t}function rOe(t,e,r){return e+t+r}function nOe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?eOe(t,e):n?u8:tOe}function iOe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function oOe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function lOe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?oOe(t):iOe(t):n&&n.length?aOe:sOe:cOe}function hOe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?mOe:r&&r.length?n?uOe:dOe:n?fOe:pOe}function _Oe(t){return t.group?yOe:gOe}function SOe(t){return t.group?bOe:vOe}function $Oe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?xOe:wOe}function d8(t,e,r){if(r.options.useRealPaths)return kOe(e,r);let n=ZP(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=ZP(n)}return r.symlinks.set(t,e),i>1}function kOe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Zv(t,e,r,n){e(t&&!n?t:null,r)}function DOe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?EOe:ROe:n?e?AOe:COe:i?e?TOe:POe:e?OOe:IOe}function MOe(t){return t?jOe:NOe}function UOe(t,e){return new Promise((r,n)=>{m8(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function m8(t,e,r){new p8(t,e,r).start()}function qOe(t,e){return new p8(t,e).start()}var s8,YAe,XAe,sOe,aOe,cOe,uOe,dOe,fOe,pOe,mOe,gOe,yOe,bOe,vOe,wOe,xOe,EOe,AOe,OOe,TOe,ROe,IOe,POe,COe,f8,NOe,jOe,FOe,LOe,zOe,p8,a8,h8,g8,y8=y(()=>{s8=BAe(import.meta.url);YAe=/[\\/]/g;XAe=/^[a-z]:[\\/]$/i;sOe=(t,e)=>{e.push(t||".")},aOe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},cOe=()=>{};uOe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},dOe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},fOe=(t,e,r,n)=>{r.files++},pOe=(t,e)=>{e.push(t)},mOe=()=>{};gOe=t=>t,yOe=()=>[""].slice(0,0);bOe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},vOe=()=>{};wOe=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()&&d8(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},xOe=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()&&d8(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};EOe=t=>t.counts,AOe=t=>t.groups,OOe=t=>t.paths,TOe=t=>t.paths.slice(0,t.options.maxFiles),ROe=(t,e,r)=>(Zv(e,r,t.counts,t.options.suppressErrors),null),IOe=(t,e,r)=>(Zv(e,r,t.paths,t.options.suppressErrors),null),POe=(t,e,r)=>(Zv(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),COe=(t,e,r)=>(Zv(e,r,t.groups,t.options.suppressErrors),null);f8={withFileTypes:!0},NOe=(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||".",f8,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},jOe=(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||".",f8)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};FOe=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))}},LOe=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}},zOe=class{aborted=!1;abort(){this.aborted=!0}},p8=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=DOe(e,this.isSynchronous),this.root=GP(t,e),this.state={root:QAe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new LOe,options:e,queue:new FOe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new zOe,fs:e.fs||KAe},this.joinPath=nOe(this.root,e),this.pushDirectory=lOe(this.root,e),this.pushFile=hOe(e),this.getArray=_Oe(e),this.groupFiles=SOe(e),this.resolveSymlink=$Oe(e,this.isSynchronous),this.walkDirectory=MOe(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(b.isDirectory()){if(_=GP(_,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=GAe(_),x=GP(ZP(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};a8=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return UOe(this.root,this.options)}withCallback(t){m8(this.root,this.options,t)}sync(){return qOe(this.root,this.options)}},h8=null;try{s8.resolve("picomatch"),h8=s8("picomatch")}catch{}g8=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:c8,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 a8(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new a8(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||h8;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 kp=v((hpt,w8)=>{"use strict";var _8="[^\\\\/]",HOe="(?=.)",b8="[^/]",VP="(?:\\/|$)",v8="(?:^|\\/)",WP=`\\.{1,2}${VP}`,BOe="(?!\\.)",GOe=`(?!${v8}${WP})`,ZOe=`(?!\\.{0,1}${VP})`,VOe=`(?!${WP})`,WOe="[^.\\/]",KOe=`${b8}*?`,JOe="/",S8={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:HOe,QMARK:b8,END_ANCHOR:VP,DOTS_SLASH:WP,NO_DOT:BOe,NO_DOTS:GOe,NO_DOT_SLASH:ZOe,NO_DOTS_SLASH:VOe,QMARK_NO_DOT:WOe,STAR:KOe,START_ANCHOR:v8,SEP:JOe},YOe={...S8,SLASH_LITERAL:"[\\\\/]",QMARK:_8,STAR:`${_8}*?`,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:"\\"},XOe={__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"};w8.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:XOe,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?YOe:S8}}});var Ep=v(Ur=>{"use strict";var{REGEX_BACKSLASH:QOe,REGEX_REMOVE_BACKSLASH:eTe,REGEX_SPECIAL_CHARS:tTe,REGEX_SPECIAL_CHARS_GLOBAL:rTe}=kp();Ur.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ur.hasRegexChars=t=>tTe.test(t);Ur.isRegexChar=t=>t.length===1&&Ur.hasRegexChars(t);Ur.escapeRegex=t=>t.replace(rTe,"\\$1");Ur.toPosixSlashes=t=>t.replace(QOe,"/");Ur.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};Ur.removeBackslashes=t=>t.replace(eTe,e=>e==="\\"?"":e);Ur.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Ur.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Ur.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ur.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Ur.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var R8=v((ypt,T8)=>{"use strict";var x8=Ep(),{CHAR_ASTERISK:KP,CHAR_AT:nTe,CHAR_BACKWARD_SLASH:Ap,CHAR_COMMA:iTe,CHAR_DOT:JP,CHAR_EXCLAMATION_MARK:YP,CHAR_FORWARD_SLASH:O8,CHAR_LEFT_CURLY_BRACE:XP,CHAR_LEFT_PARENTHESES:QP,CHAR_LEFT_SQUARE_BRACKET:oTe,CHAR_PLUS:sTe,CHAR_QUESTION_MARK:$8,CHAR_RIGHT_CURLY_BRACE:aTe,CHAR_RIGHT_PARENTHESES:k8,CHAR_RIGHT_SQUARE_BRACKET:cTe}=kp(),E8=t=>t===O8||t===Ap,A8=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},lTe=(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,b=!1,_=!1,S=!1,x=!1,w=!1,R=0,A,O,D={value:"",depth:0,isGlob:!1},E=()=>l>=n,ae=()=>c.charCodeAt(l+1),X=()=>(A=O,c.charCodeAt(++l));for(;l0&&(P=c.slice(0,u),c=c.slice(u),d-=u),J&&m===!0&&d>0?(J=c.slice(0,d),C=c.slice(d)):m===!0?(J="",C=c):J=c,J&&J!==""&&J!=="/"&&J!==c&&E8(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(C&&(C=x8.removeBackslashes(C)),J&&_===!0&&(J=x8.removeBackslashes(J)));let dr={prefix:P,input:t,start:u,base:J,glob:C,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&(dr.maxDepth=0,E8(O)||s.push(D),dr.tokens=s),r.parts===!0||r.tokens===!0){let se;for(let Ce=0;Ce{"use strict";var Op=kp(),ln=Ep(),{MAX_LENGTH:Vv,POSIX_REGEX_SOURCE:uTe,REGEX_NON_SPECIAL_CHARS:dTe,REGEX_SPECIAL_CHARS_BACKREF:fTe,REPLACEMENTS:I8}=Op,pTe=(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=>ln.escapeRegex(i)).join("..")}return r},Yl=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,P8=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},mTe=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},tC=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(mTe(e))return e.replace(/\\(.)/g,"$1")},hTe=t=>{let e=t.map(tC).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}}}}},gTe=t=>`${t.length===1?ln.escapeRegex(t[0]):`[${t.map(r=>ln.escapeRegex(r)).join("")}]`}*`,yTe=t=>{let e=0,r=[];for(;es.trim());if(i.length!==1)return;let o=tC(i[0]);if(!o||o.length!==1)return;r.push(o),e+=n.end+1}if(!(r.length<1))return r},_Te=t=>{let e=0,r=t.trim(),n=eC(r);for(;n;)e++,r=n.body.trim(),n=eC(r);return e},bTe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Op.DEFAULT_MAX_EXTGLOB_RECURSION,n=P8(t).map(a=>a.trim());if(n.length>1&&(n.some(a=>a==="")||n.some(a=>/^[*?]+$/.test(a))||hTe(n)))return{risky:!0};let i=[],o=!1,s=!0;for(let a of n){let c=yTe(a);if(c){o=!0,i.push(...c);continue}let l=tC(a);if(l&&l.length===1){i.push(l);continue}if(s=!1,_Te(a)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:gTe([...new Set(i)])}:{risky:!0}:{risky:!1}},rC=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=I8[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Vv,r.maxLength):Vv,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=Op.globChars(r.windows),l=Op.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:b,QMARK:_,QMARK_NO_DOT:S,STAR:x,START_ANCHOR:w}=c,R=G=>`(${a}(?:(?!${w}${G.dot?m:u}).)*?)`,A=r.dot?"":h,O=r.dot?_:S,D=r.bash===!0?R(r):x;r.capture&&(D=`(${D})`),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=ln.removePrefix(t,E),i=t.length;let ae=[],X=[],J=[],P=o,C,dr=()=>E.index===i-1,se=E.peek=(G=1)=>t[E.index+G],Ce=E.advance=()=>t[++E.index]||"",Kt=()=>t.slice(E.index+1),fr=(G="",ht=0)=>{E.consumed+=G,E.index+=ht},Qt=G=>{E.output+=G.output!=null?G.output:G.value,fr(G.value)},fo=()=>{let G=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)Ce(),E.start++,G++;return G%2===0?!1:(E.negated=!0,E.start++,!0)},ki=G=>{E[G]++,J.push(G)},tn=G=>{E[G]--,J.pop()},fe=G=>{if(P.type==="globstar"){let ht=E.braces>0&&(G.type==="comma"||G.type==="brace"),B=G.extglob===!0||ae.length&&(G.type==="pipe"||G.type==="paren");G.type!=="slash"&&G.type!=="paren"&&!ht&&!B&&(E.output=E.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=D,E.output+=P.output)}if(ae.length&&G.type!=="paren"&&(ae[ae.length-1].inner+=G.value),(G.value||G.output)&&Qt(G),P&&P.type==="text"&&G.type==="text"){P.output=(P.output||P.value)+G.value,P.value+=G.value;return}G.prev=P,s.push(G),P=G},po=(G,ht)=>{let B={...l[ht],conditions:1,inner:""};B.prev=P,B.parens=E.parens,B.output=E.output,B.startIndex=E.index,B.tokensIndex=s.length;let Te=(r.capture?"(":"")+B.open;ki("parens"),fe({type:G,value:ht,output:E.output?"":p}),fe({type:"paren",extglob:!0,value:Ce(),output:Te}),ae.push(B)},Nfe=G=>{let ht=t.slice(G.startIndex,E.index+1),B=t.slice(G.startIndex+2,E.index),Te=bTe(B,r);if((G.type==="plus"||G.type==="star")&&Te.risky){let ut=Te.safeOutput?(G.output?"":p)+(r.capture?`(${Te.safeOutput})`:Te.safeOutput):void 0,Ei=s[G.tokensIndex];Ei.type="text",Ei.value=ht,Ei.output=ut||ln.escapeRegex(ht);for(let Ai=G.tokensIndex+1;Ai1&&G.inner.includes("/")&&(ut=R(r)),(ut!==D||dr()||/^\)+$/.test(Kt()))&&(dt=G.close=`)$))${ut}`),G.inner.includes("*")&&(zt=Kt())&&/^\.[^\\/.]+$/.test(zt)){let Ei=rC(zt,{...e,fastpaths:!1}).output;dt=G.close=`)${Ei})${ut})`}G.prev.type==="bos"&&(E.negatedExtglob=!0)}fe({type:"paren",extglob:!0,value:C,output:dt}),tn("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let G=!1,ht=t.replace(fTe,(B,Te,dt,zt,ut,Ei)=>zt==="\\"?(G=!0,B):zt==="?"?Te?Te+zt+(ut?_.repeat(ut.length):""):Ei===0?O+(ut?_.repeat(ut.length):""):_.repeat(dt.length):zt==="."?u.repeat(dt.length):zt==="*"?Te?Te+zt+(ut?D:""):D:Te?B:`\\${B}`);return G===!0&&(r.unescape===!0?ht=ht.replace(/\\/g,""):ht=ht.replace(/\\+/g,B=>B.length%2===0?"\\\\":B?"\\":"")),ht===t&&r.contains===!0?(E.output=t,E):(E.output=ln.wrapOutput(ht,E,e),E)}for(;!dr();){if(C=Ce(),C==="\0")continue;if(C==="\\"){let B=se();if(B==="/"&&r.bash!==!0||B==="."||B===";")continue;if(!B){C+="\\",fe({type:"text",value:C});continue}let Te=/^\\+/.exec(Kt()),dt=0;if(Te&&Te[0].length>2&&(dt=Te[0].length,E.index+=dt,dt%2!==0&&(C+="\\")),r.unescape===!0?C=Ce():C+=Ce(),E.brackets===0){fe({type:"text",value:C});continue}}if(E.brackets>0&&(C!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&C===":"){let B=P.value.slice(1);if(B.includes("[")&&(P.posix=!0,B.includes(":"))){let Te=P.value.lastIndexOf("["),dt=P.value.slice(0,Te),zt=P.value.slice(Te+2),ut=uTe[zt];if(ut){P.value=dt+ut,E.backtrack=!0,Ce(),!o.output&&s.indexOf(P)===1&&(o.output=p);continue}}}(C==="["&&se()!==":"||C==="-"&&se()==="]")&&(C=`\\${C}`),C==="]"&&(P.value==="["||P.value==="[^")&&(C=`\\${C}`),r.posix===!0&&C==="!"&&P.value==="["&&(C="^"),P.value+=C,Qt({value:C});continue}if(E.quotes===1&&C!=='"'){C=ln.escapeRegex(C),P.value+=C,Qt({value:C});continue}if(C==='"'){E.quotes=E.quotes===1?0:1,r.keepQuotes===!0&&fe({type:"text",value:C});continue}if(C==="("){ki("parens"),fe({type:"paren",value:C});continue}if(C===")"){if(E.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Yl("opening","("));let B=ae[ae.length-1];if(B&&E.parens===B.parens+1){Nfe(ae.pop());continue}fe({type:"paren",value:C,output:E.parens?")":"\\)"}),tn("parens");continue}if(C==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Yl("closing","]"));C=`\\${C}`}else ki("brackets");fe({type:"bracket",value:C});continue}if(C==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){fe({type:"text",value:C,output:`\\${C}`});continue}if(E.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Yl("opening","["));fe({type:"text",value:C,output:`\\${C}`});continue}tn("brackets");let B=P.value.slice(1);if(P.posix!==!0&&B[0]==="^"&&!B.includes("/")&&(C=`/${C}`),P.value+=C,Qt({value:C}),r.literalBrackets===!1||ln.hasRegexChars(B))continue;let Te=ln.escapeRegex(P.value);if(E.output=E.output.slice(0,-P.value.length),r.literalBrackets===!0){E.output+=Te,P.value=Te;continue}P.value=`(${a}${Te}|${P.value})`,E.output+=P.value;continue}if(C==="{"&&r.nobrace!==!0){ki("braces");let B={type:"brace",value:C,output:"(",outputIndex:E.output.length,tokensIndex:E.tokens.length};X.push(B),fe(B);continue}if(C==="}"){let B=X[X.length-1];if(r.nobrace===!0||!B){fe({type:"text",value:C,output:C});continue}let Te=")";if(B.dots===!0){let dt=s.slice(),zt=[];for(let ut=dt.length-1;ut>=0&&(s.pop(),dt[ut].type!=="brace");ut--)dt[ut].type!=="dots"&&zt.unshift(dt[ut].value);Te=pTe(zt,r),E.backtrack=!0}if(B.comma!==!0&&B.dots!==!0){let dt=E.output.slice(0,B.outputIndex),zt=E.tokens.slice(B.tokensIndex);B.value=B.output="\\{",C=Te="\\}",E.output=dt;for(let ut of zt)E.output+=ut.output||ut.value}fe({type:"brace",value:C,output:Te}),tn("braces"),X.pop();continue}if(C==="|"){ae.length>0&&ae[ae.length-1].conditions++,fe({type:"text",value:C});continue}if(C===","){let B=C,Te=X[X.length-1];Te&&J[J.length-1]==="braces"&&(Te.comma=!0,B="|"),fe({type:"comma",value:C,output:B});continue}if(C==="/"){if(P.type==="dot"&&E.index===E.start+1){E.start=E.index+1,E.consumed="",E.output="",s.pop(),P=o;continue}fe({type:"slash",value:C,output:f});continue}if(C==="."){if(E.braces>0&&P.type==="dot"){P.value==="."&&(P.output=u);let B=X[X.length-1];P.type="dots",P.output+=C,P.value+=C,B.dots=!0;continue}if(E.braces+E.parens===0&&P.type!=="bos"&&P.type!=="slash"){fe({type:"text",value:C,output:u});continue}fe({type:"dot",value:C,output:u});continue}if(C==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&se()==="("&&se(2)!=="?"){po("qmark",C);continue}if(P&&P.type==="paren"){let Te=se(),dt=C;(P.value==="("&&!/[!=<:]/.test(Te)||Te==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(dt=`\\${C}`),fe({type:"text",value:C,output:dt});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){fe({type:"qmark",value:C,output:S});continue}fe({type:"qmark",value:C,output:_});continue}if(C==="!"){if(r.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){po("negate",C);continue}if(r.nonegate!==!0&&E.index===0){fo();continue}}if(C==="+"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){po("plus",C);continue}if(P&&P.value==="("||r.regex===!1){fe({type:"plus",value:C,output:d});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||E.parens>0){fe({type:"plus",value:C});continue}fe({type:"plus",value:d});continue}if(C==="@"){if(r.noextglob!==!0&&se()==="("&&se(2)!=="?"){fe({type:"at",extglob:!0,value:C,output:""});continue}fe({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let B=dTe.exec(Kt());B&&(C+=B[0],E.index+=B[0].length),fe({type:"text",value:C});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=C,P.output=D,E.backtrack=!0,E.globstar=!0,fr(C);continue}let G=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(G)){po("star",C);continue}if(P.type==="star"){if(r.noglobstar===!0){fr(C);continue}let B=P.prev,Te=B.prev,dt=B.type==="slash"||B.type==="bos",zt=Te&&(Te.type==="star"||Te.type==="globstar");if(r.bash===!0&&(!dt||G[0]&&G[0]!=="/")){fe({type:"star",value:C,output:""});continue}let ut=E.braces>0&&(B.type==="comma"||B.type==="brace"),Ei=ae.length&&(B.type==="pipe"||B.type==="paren");if(!dt&&B.type!=="paren"&&!ut&&!Ei){fe({type:"star",value:C,output:""});continue}for(;G.slice(0,3)==="/**";){let Ai=t[E.index+4];if(Ai&&Ai!=="/")break;G=G.slice(3),fr("/**",3)}if(B.type==="bos"&&dr()){P.type="globstar",P.value+=C,P.output=R(r),E.output=P.output,E.globstar=!0,fr(C);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&!zt&&dr()){E.output=E.output.slice(0,-(B.output+P.output).length),B.output=`(?:${B.output}`,P.type="globstar",P.output=R(r)+(r.strictSlashes?")":"|$)"),P.value+=C,E.globstar=!0,E.output+=B.output+P.output,fr(C);continue}if(B.type==="slash"&&B.prev.type!=="bos"&&G[0]==="/"){let Ai=G[1]!==void 0?"|$":"";E.output=E.output.slice(0,-(B.output+P.output).length),B.output=`(?:${B.output}`,P.type="globstar",P.output=`${R(r)}${f}|${f}${Ai})`,P.value+=C,E.output+=B.output+P.output,E.globstar=!0,fr(C+Ce()),fe({type:"slash",value:"/",output:""});continue}if(B.type==="bos"&&G[0]==="/"){P.type="globstar",P.value+=C,P.output=`(?:^|${f}|${R(r)}${f})`,E.output=P.output,E.globstar=!0,fr(C+Ce()),fe({type:"slash",value:"/",output:""});continue}E.output=E.output.slice(0,-P.output.length),P.type="globstar",P.output=R(r),P.value+=C,E.output+=P.output,E.globstar=!0,fr(C);continue}let ht={type:"star",value:C,output:D};if(r.bash===!0){ht.output=".*?",(P.type==="bos"||P.type==="slash")&&(ht.output=A+ht.output),fe(ht);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){ht.output=C,fe(ht);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+=b,P.output+=b):(E.output+=A,P.output+=A),se()!=="*"&&(E.output+=p,P.output+=p)),fe(ht)}for(;E.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing","]"));E.output=ln.escapeLast(E.output,"["),tn("brackets")}for(;E.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing",")"));E.output=ln.escapeLast(E.output,"("),tn("parens")}for(;E.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Yl("closing","}"));E.output=ln.escapeLast(E.output,"{"),tn("braces")}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${f}?`}),E.backtrack===!0){E.output="";for(let G of E.tokens)E.output+=G.output!=null?G.output:G.value,G.suffix&&(E.output+=G.suffix)}return E};rC.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Vv,r.maxLength):Vv,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=I8[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}=Op.globChars(r.windows),m=r.dot?u:l,h=r.dot?d:l,g=r.capture?"":"?:",b={negated:!1,prefix:""},_=r.bash===!0?".*?":f;r.capture&&(_=`(${_})`);let S=A=>A.noglobstar===!0?_:`(${g}(?:(?!${p}${A.dot?c:o}).)*?)`,x=A=>{switch(A){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 O=/^(.*?)\.(\w+)$/.exec(A);if(!O)return;let D=x(O[1]);return D?D+o+O[2]:void 0}}},w=ln.removePrefix(t,b),R=x(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};C8.exports=rC});var M8=v((bpt,j8)=>{"use strict";var vTe=R8(),nC=D8(),N8=Ep(),STe=kp(),wTe=t=>t&&typeof t=="object"&&!Array.isArray(t),Rt=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>Rt(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=wTe(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?Rt.compileRe(t,e):Rt.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=Rt(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=Rt.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};Rt.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?N8.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=Rt.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Rt.matchBase=(t,e,r,n=r&&r.windows)=>(e instanceof RegExp?e:Rt.makeRe(e,r)).test(N8.basename(t,{windows:n}));Rt.isMatch=(t,e,r)=>Rt(e,r)(t);Rt.parse=(t,e)=>Array.isArray(t)?t.map(r=>Rt.parse(r,e)):nC(t,{...e,fastpaths:!1});Rt.scan=(t,e)=>vTe(t,e);Rt.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=Rt.toRegex(a,e);return n===!0&&(c.state=t),c};Rt.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=nC.fastpaths(t,e)),i.output||(i=nC(t,e)),Rt.compileRe(i,e,r,n)};Rt.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/$^/}};Rt.constants=STe;j8.exports=Rt});var U8=v((vpt,z8)=>{"use strict";var F8=M8(),xTe=Ep();function L8(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:xTe.isWindows()}),F8(t,e,r)}Object.assign(L8,F8);z8.exports=L8});import{readdir as $Te,readdirSync as kTe,realpath as ETe,realpathSync as ATe,stat as OTe,statSync as TTe}from"fs";import{isAbsolute as RTe,posix as Wa,resolve as ITe}from"path";import{fileURLToPath as PTe}from"url";function jTe(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]===".."&&NTe.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=>Wa.relative(t,n)||".":n=>Wa.relative(t,`${e}/${n}`)||"."}function LTe(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=Wa.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function H8(t){return t.replace(DTe,e=>`${e}/`)}function V8(t){var e;let r=Xl.default.scan(t,zTe);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function ZTe(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Xl.default.scan(t);return r.isGlob||r.negated}function Tp(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function W8(t){return typeof t=="string"?[t]:t??[]}function iC(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=GTe(o);s=RTe(s.replace(WTe,""))?Wa.relative(a,s):Wa.normalize(s);let c=(i=VTe.exec(s))===null||i===void 0?void 0:i[0],l=V8(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=H8(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?Wa.join(o,...d):o)}return s}function KTe(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(iC(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(iC(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(iC(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function JTe(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=KTe(t,e,n);t.debug&&Tp("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(G8,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Xl.default)(i.match,f),m=(0,Xl.default)(i.ignore,f),h=jTe(i.match,f),g=q8(r,d,o),b=o?g:q8(r,d,!0),_=(w,R)=>{let A=b(R,!0);return A!=="."&&!h(A)||m(A)},S;t.deep!==void 0&&(S=Math.round(t.deep-n.depthOffset));let x=new g8({filters:[a?(w,R)=>{let A=g(w,R),O=p(A)&&!m(A);return O&&Tp(`matched ${A}`),O}:(w,R)=>{let A=g(w,R);return p(A)&&!m(A)}],exclude:a?(w,R)=>{let A=_(w,R);return Tp(`${A?"skipped":"crawling"} ${R}`),A}:_,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&&Tp("internal properties:",{...n,root:d}),[x,r!==d&&!o&<e(r,d)]}function YTe(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function XTe(t){let e=Object.assign({},t);for(let r in B8)e[r]===void 0&&Object.assign(e,{[r]:B8[r]});return e.cwd=(e.cwd instanceof URL?PTe(e.cwd):ITe(e.cwd||process.cwd())).replace(G8,"/"),e.ignore=W8(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||$Te,readdirSync:e.fs.readdirSync||kTe,realpath:e.fs.realpath||ETe,realpathSync:e.fs.realpathSync||ATe,stat:e.fs.stat||OTe,statSync:e.fs.statSync||TTe}),e.debug&&Tp("globbing with options:",e),e}function QTe(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=CTe(t)||typeof t=="string",i=W8((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=XTe(n?e:t);return i.length>0?JTe(o,i):[]}function vs(t,e){let[r,n]=QTe(t,e);return r?YTe(r.sync(),n):[]}var Xl,CTe,G8,DTe,Z8,NTe,MTe,FTe,zTe,UTe,qTe,HTe,BTe,GTe,VTe,WTe,B8,Rp=y(()=>{y8();Xl=wt(U8(),1),CTe=Array.isArray,G8=/\\/g,DTe=/^[A-Za-z]:$/,Z8=process.platform==="win32",NTe=/^(\/?\.\.)+$/;MTe=/^[A-Z]:\/$/i,FTe=Z8?t=>MTe.test(t):t=>t==="/";zTe={parts:!0};UTe=/(?t.replace(UTe,"\\$&"),BTe=t=>t.replace(qTe,"\\$&"),GTe=Z8?BTe:HTe;VTe=/^(\/?\.\.)+/,WTe=/\\(?=[()[\]{}!*+?@|])/g;B8={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as Ip,readFileSync as eRe,readdirSync as tRe,statSync as K8}from"node:fs";import{join as Ka}from"node:path";function rRe(t){let{cwd:e="."}=t,r,n;try{let c=q(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=Li(e,n),o=[],{layers:s,forbiddenImports:a}=oC(r);return(s.size>0||a.length>0)&&!Ip(Ka(e,i.mainRoot))?[{detector:Pp,severity:"info",path:`${i.mainRoot}/`,message:`architecture layers declared but ${i.mainRoot}/ not found \u2014 layer checks skipped (flat layout not yet supported)`}]:(s.size>0&&(nRe(e,i,s,o),iRe(e,i,s,o)),a.length>0&&oRe(e,i,a,o),o)}function oC(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 nRe(t,e,r,n){let i=e.mainRoot,o=Ka(t,i);if(Ip(o))for(let s of tRe(o)){let a=Ka(o,s);K8(a).isDirectory()&&(r.has(s)||n.push({detector:Pp,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function iRe(t,e,r,n){let i=e.mainRoot,o=Ka(t,i);if(Ip(o))for(let s of r){let a=Ka(o,s);Ip(a)&&K8(a).isDirectory()||n.push({detector:Pp,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 oRe(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Ka(t,i,s.from);if(!Ip(a))continue;let c=vs([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Ka(a,l),d;try{d=eRe(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];sRe(p,s.to,e.importStyle)&&n.push({detector:Pp,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 sRe(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var Pp,J8,sC=y(()=>{"use strict";Rp();Ue();Va();Pp="ARCHITECTURE_FROM_SPEC";J8={name:Pp,run:rRe}});import{existsSync as aRe,readFileSync as cRe}from"node:fs";import{join as lRe}from"node:path";function dRe(t){let{cwd:e="."}=t,r=lRe(e,"spec/capabilities.yaml");if(!aRe(r))return[];let n;try{let u=cRe(r,"utf8"),d=Y8.default.parse(u);if(!d||typeof d!="object")return[];n=d}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o,s=!1;try{let u=q(e);o=new Set(u.features.map(d=>d.id)),s=u.project.onboarding_seeded===!0}catch{return[]}let a=[],c=new Set,l=s&&o.size{"use strict";Y8=wt(tr(),1);Ue();Wv="CAPABILITIES_FEATURE_MAPPING",uRe=8;X8={name:Wv,run:dRe}});import{existsSync as fRe,readFileSync as pRe}from"node:fs";import{join as mRe}from"node:path";function hRe(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("#")||e.startsWith('"""')||e.startsWith("'''")}function gRe(t){let{cwd:e="."}=t;return ye(e,aC,r=>yRe(r,e))}function yRe(t,e){let r=Li(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=mRe(e,o);if(!fRe(s))continue;let a=pRe(s,"utf8");hRe(a)||n.push({detector:aC,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var aC,e5,t5=y(()=>{"use strict";Va();xt();aC="CONVENTION_DRIFT";e5={name:aC,run:gRe}});import{existsSync as cC,readFileSync as r5}from"node:fs";import{join as Kv}from"node:path";function _Re(t){return JSON.parse(t).total?.lines?.pct??0}function n5(t){let e=/]*\bline-rate="([0-9]*\.?[0-9]+)"/.exec(t);return e?Number(e[1])*100:null}function SRe(t,e){if(!Cv(_t(t).gates.coverage?.cmd))return null;let r;try{r=Dv(t,e)}catch(c){return[{detector:Eo,severity:"error",message:c.message}]}let n=0,i=0,o=0,s=[];for(let c of r){let l=MP.find(d=>cC(Kv(c.dir,d)));if(!l){s.push(c.path);continue}let u=n5(r5(Kv(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:Eo,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=i5(n,i);return a0?[{detector:Eo,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function wRe(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let a=SRe(e,t.focusModules);if(a)return a}let r;try{r=q(e).project?.language}catch{}let n=Li(e,r),i=_t(e).language==="kotlin"?MP.find(a=>cC(Kv(e,a)))??FJ(e):n.coverageSummary,o=Kv(e,i);if(!cC(o))return[{detector:Eo,severity:"info",message:`${i} not present \u2014 run stage_2.2 first`}];let s;try{let a=r5(o,"utf8");s=n.coverageFormat==="jacoco-xml"?bRe(a):n.coverageFormat==="cobertura-xml"?vRe(a):_Re(a)}catch(a){return[{detector:Eo,severity:"warn",message:`${i} unparseable: ${a.message}`}]}return s===null?n.coverageFormat==="cobertura-xml"?[]:[{detector:Eo,severity:"warn",message:`${i} contained no line-coverage counter`}]:s>=Jv?[]:[{detector:Eo,severity:"warn",message:`line coverage ${s.toFixed(1)}% < floor ${Jv}%`}]}var Eo,Jv,o5,s5=y(()=>{"use strict";Ue();Mv();Va();Nv();Dn();Eo="COVERAGE_DROP",Jv=70;o5={name:Eo,run:wRe}});import{existsSync as xRe}from"node:fs";import{join as $Re}from"node:path";function ERe(t){let{cwd:e="."}=t;return ye(e,Yv,r=>ARe(r,e))}function ARe(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);if(!r){if(n.length===0)return[];let i=t.project.onboarding_seeded===!0&&t.features.length{"use strict";xt();Yv="DELIVERABLE_INTEGRITY",kRe=8;a5={name:Yv,run:ERe}});function ORe(t){let e=new Set((t.features??[]).map(n=>n.id)),r=[];for(let n of t.project?.smoke??[]){let i=n.feature;if(i===void 0||e.has(i))continue;let o=(n.run??[]).join(" ")||`kind:${n.kind}`;r.push({detector:Xv,severity:"warn",path:"spec.yaml",message:`smoke probe '${o}' binds feature ${i}, which is not in the spec \u2014 a dangling binding is annotation drift (the bound feature was renamed, archived, or never existed). Fix the id or drop the binding.`})}return r}function TRe(t){let e=ORe(t),r=(t.features??[]).filter(o=>o.status==="done");return r.length===0||!!!t.project?.deliverable||(t.project?.smoke??[]).length>0?e:[...e,{detector:Xv,severity:"warn",path:"spec.yaml",message:`${r.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 RRe(t){let{cwd:e="."}=t;return ye(e,Xv,r=>TRe(r))}var Xv,l5,u5=y(()=>{"use strict";xt();Xv="SMOKE_PROBE_DEMAND";l5={name:Xv,run:RRe}});function IRe(t){let{cwd:e="."}=t;return ye(e,Qv,r=>PRe(r,e))}function PRe(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=ds(e);if(n===null)return[{detector:Qv,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=Q_(n,e,o);s.state!=="fresh"&&i.push({detector:Qv,severity:"warn",path:"spec/attestation.yaml",message:s.state==="unattested"?`${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.`:s.module?`${o.id}'s module ${s.module} 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.`:`${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 Qv,eS,lC=y(()=>{"use strict";El();xt();Qv="STALE_ATTESTATION";eS={name:Qv,run:IRe}});function CRe(t){let{cwd:e="."}=t,r;try{r=q(e)}catch{return[]}return DRe(r)}function DRe(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:d5,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 d5,tS,uC=y(()=>{"use strict";Ue();d5="DEPENDENCY_CYCLE";tS={name:d5,run:CRe}});import{appendFileSync as NRe,existsSync as f5,mkdirSync as jRe,readFileSync as MRe}from"node:fs";import{dirname as FRe,join as LRe}from"node:path";function p5(t){return LRe(t,zRe,URe)}function m5(t){return dC.add(t),()=>dC.delete(t)}function Ja(t,e){let r=p5(t),n=FRe(r);f5(n)||jRe(n,{recursive:!0}),NRe(r,`${JSON.stringify(e)} `,"utf8");for(let i of dC)try{i(t,e)}catch{}}function pr(t){let e=p5(t);if(!f5(e))return[];let r=MRe(e,"utf8").trim();return r.length===0?[]:r.split(` `).filter(n=>n.length>0).map(n=>JSON.parse(n))}var zRe,URe,dC,un=y(()=>{"use strict";zRe=".cladding",URe="audit.log.jsonl";dC=new Set});import{existsSync as qRe}from"node:fs";import{join as HRe}from"node:path";function BRe(t){let{cwd:e="."}=t,r=pr(e);if(r.length===0)return[{detector:fC,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&&(qRe(HRe(e,i.artifact))||n.push({detector:fC,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var fC,h5,g5=y(()=>{"use strict";un();fC="EVIDENCE_MISMATCH";h5={name:fC,run:BRe}});import{existsSync as GRe,readFileSync as ZRe}from"node:fs";import{join as VRe}from"node:path";function WRe(t){let e=VRe(t,v5);if(!GRe(e))return null;try{let n=((0,b5.parse)(ZRe(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*_5(t,e){for(let r of t??[])r.startsWith(y5)&&(yield{ref:r,name:r.slice(y5.length),field:e})}function KRe(t){let{cwd:e="."}=t,r=WRe(e);if(r===null)return[];let n;try{n=q(e)}catch(o){return[{detector:pC,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=[..._5(s.evidence_refs,"evidence_refs"),..._5(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:pC,severity:"warn",path:v5,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var b5,pC,y5,v5,S5,w5=y(()=>{"use strict";b5=wt(tr(),1);Ue();pC="FIXTURE_REFERENCE_INVALID",y5="fixture:",v5="conformance/fixtures.yaml";S5={name:pC,run:KRe}});import{existsSync as Ql,readFileSync as mC}from"node:fs";import{join as Ya}from"node:path";function JRe(t){return vs(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec|spec-first-window)\.ts$/.test(r)).length}function Cp(t){if(!Ql(t))return null;try{return JSON.parse(mC(t,"utf8"))}catch{return null}}function YRe(t,e){let r=Ya(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(mC(r,"utf8"))}catch(c){e.push({detector:Ao,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:Ao,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=JRe(t);s!==a&&e.push({detector:Ao,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function XRe(t,e){for(let r of x5){let n=Ya(t,r.path);if(!Ql(n))continue;let i=Cp(n);if(!i){e.push({detector:Ao,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:Ao,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function QRe(t,e){let r=Cp(Ya(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of x5){let s=Ya(t,o.path);if(!Ql(s))continue;let a=Cp(s);a?.version&&a.version!==n&&e.push({detector:Ao,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=Ya(t,".claude-plugin","marketplace.json");if(Ql(i)){let o=Cp(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:Ao,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 eIe(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function tIe(t,e){let r=Ya(t,"src","cli","clad.ts"),n=Ya(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Ql(r)||!Ql(n))return;let i=eIe(mC(r,"utf8"));if(i.length===0)return;let s=Cp(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:Ao,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 rIe(t){let{cwd:e="."}=t,r=[];return YRe(e,r),tIe(e,r),XRe(e,r),QRe(e,r),r}var Ao,x5,$5,k5=y(()=>{"use strict";Rp();Ao="HARNESS_INTEGRITY",x5=[{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"]}];$5={name:Ao,run:rIe}});import{existsSync as nIe,readFileSync as iIe}from"node:fs";import{join as oIe}from"node:path";function aIe(t){let{cwd:e="."}=t;return ye(e,rS,r=>lIe(r,e))}function cIe(t){let e=oIe(t,"spec/capabilities.yaml");if(!nIe(e))return!1;try{let r=E5.default.parse(iIe(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function lIe(t,e){let r=t.features.length;if(r{"use strict";E5=wt(tr(),1);xt();rS="HOLLOW_GOVERNANCE",sIe=8;A5={name:rS,run:aIe}});function uIe(t,e){let r=t.slice(0,e).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function dIe(t,e,r){let n=t.split(/\r\n|\n|\r/g),i="",o=(Math.log10(e+1)|0)+1;for(let s=e-1;s<=e+1;s++){let a=n[s-1];a&&(i+=s.toString().padEnd(o," "),i+=": ",i+=a,i+=` `,s===e&&(i+=" ".repeat(o+r+2),i+=`^ @@ -380,13 +380,13 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `,1)[0]??"",n=B4e.exec(r);if(n)return n[1]}catch{}return G4e.get(t)}function Ac(t,e="."){let r=new Map,n=new Set,i=[],o=l=>{r.has(l.id)||r.set(l.id,l)},s=(l,u,d)=>{let f=`${d}\0${l}\0${u}`;n.has(f)||(n.add(f),i.push({from:l,to:u,kind:d}))};for(let l of t.features??[])o({id:qe.feature(l.id),kind:"feature",label:l.slug??l.title??l.id,status:l.status,tier:"A",...l.title?{detail:l.title}:{}});for(let l of t.features??[]){let u=qe.feature(l.id);for(let d of l.depends_on??[])r.has(qe.feature(d))&&s(u,qe.feature(d),"depends_on");for(let d of l.modules??[])o({id:qe.module(d),kind:q4e(d)?"skill":"module",label:d}),s(u,qe.module(d),"touches");for(let d of l.acceptance_criteria??[])for(let f of d.test_refs??[]){let p=H4e(f);p&&(o({id:qe.test(p),kind:"test",label:p}),s(u,qe.test(p),"covers"))}}for(let l of t.scenarios??[]){o({id:qe.scenario(l.id),kind:"scenario",label:l.title??l.id,tier:"A"});for(let u of l.features??[])r.has(qe.feature(u))&&s(qe.scenario(l.id),qe.feature(u),"binds")}for(let l of t.capabilities??[]){o({id:qe.capability(l.id),kind:"capability",label:l.title??l.id,tier:"B"});for(let u of l.features??[])r.has(qe.feature(u))&&s(qe.capability(l.id),qe.feature(u),"implements")}for(let l of Zp(e).docs){let u=qe.doc(l.doc);if(l.features.length===0&&l.doc_links.length===0)continue;let d=Qte(l.doc,e);o({id:u,kind:"doc",label:l.doc,...d?{tier:d}:{}});for(let f of l.features)r.has(qe.feature(f))&&s(u,qe.feature(f),"references");for(let f of l.doc_links){let p=Qte(f,e);o({id:qe.doc(f),kind:"doc",label:f,...p?{tier:p}:{}}),s(u,qe.doc(f),"links")}}let a=[...r.values()].sort((l,u)=>l.id.localeCompare(u.id)),c=i.sort((l,u)=>l.kind.localeCompare(u.kind)||l.from.localeCompare(u.from)||l.to.localeCompare(u.to));return{nodes:a,edges:c}}function Bx(t,e,r=1/0){let n=new Set(t.nodes.map(l=>l.id)),i=(typeof e=="string"?[e]:e).filter(l=>n.has(l));if(i.length===0)return{nodes:[],edges:[]};let o=new Map;for(let l of t.edges)(o.get(l.from)??o.set(l.from,new Set).get(l.from)).add(l.to),(o.get(l.to)??o.set(l.to,new Set).get(l.to)).add(l.from);let s=new Set(i),a=[...i],c=0;for(;a.length>0&&cs.has(l.id)),edges:t.edges.filter(l=>s.has(l.from)&&s.has(l.to))}}function Gx(t,e,r){let n=t.features??[],i=n.find(a=>a.id===r)??n.find(a=>a.slug===r);if(i)return[qe.feature(i.id)];let o=[qe.module(r),qe.doc(r),qe.test(r),qe.scenario(r),r],s=new Set(e.nodes.map(a=>a.id));return o.filter(a=>s.has(a))}var U4e,qe,B4e,G4e,oh=y(()=>{"use strict";_S();U4e=["derived:","fixture:","script:","self-dogfood:"];qe={feature:t=>`feature:${t}`,module:t=>`module:${t}`,test:t=>`test:${t}`,scenario:t=>`scenario:${t}`,capability:t=>`capability:${t}`,doc:t=>`doc:${t}`},B4e=/^\s*(?:#|";function dQ(t){let e=t.conventions,r=t.examples.map(a=>`### ${a.layer} \u2014 ${a.modulePath} +`):void 0})}return e.sort((r,n)=>r.layer.localeCompare(n.layer)),e}import{existsSync as pn,readFileSync as WD,readdirSync as oQ,statSync as ks}from"node:fs";import{basename as sQ,dirname as Jvt,join as Er,relative as KD,sep as JD}from"node:path";var wMe=["src","lib","app","pkg","cmd","internal"],xMe=["packages","apps","crates"];function YD(t){if(t.override&&t.override.length>0)return t.override.map(n=>Ui(t.cwd,n,void 0,"cli-override")).filter(n=>n!==null);let e=$Me(t.cwd);if(e.length>0)return e;let r=RMe(t.cwd);return r.length>0?r:[]}function Ui(t,e,r,n){let i=Er(t,e);return!pn(i)||!ks(i).isDirectory()?null:{absPath:i,relPath:KD(t,i).split(JD).join("/"),workspaceName:r,source:n}}function $Me(t){let e=[];return e.push(...EMe(t)),e.push(...AMe(t)),e.push(...OMe(t)),e.push(...TMe(t)),e.push(...kMe(t)),XD(e)}function kMe(t){if(!["build.gradle.kts","build.gradle","pom.xml"].some(n=>pn(Er(t,n))))return[];let r=[];for(let n of["src/main/kotlin","src/main/java","src/test/kotlin","src/test/java"]){let i=Ui(t,n,void 0,"manifest");i&&r.push(i)}return r}function EMe(t){let e=Er(t,"package.json");if(!pn(e))return[];let r;try{r=JSON.parse(WD(e,"utf8"))}catch{return[]}let n=Array.isArray(r.workspaces)?r.workspaces:r.workspaces&&typeof r.workspaces=="object"&&"packages"in r.workspaces?r.workspaces.packages??[]:[];if(n.length===0)return[];let i=[];for(let o of n){let s=IMe(t,o);for(let a of s){let c=Er(a.abs,"src"),l=pn(c)&&ks(c).isDirectory()?c:a.abs,u=Ui(t,KD(t,l).split(JD).join("/"),a.name,"manifest");u&&i.push(u)}}return i}function AMe(t){let e=Er(t,"pyproject.toml");if(!pn(e))return[];let r=WD(e,"utf8"),n=[];for(let i of r.matchAll(/include\s*=\s*['"]([\w./-]+)['"]/g)){let o=Ui(t,i[1],void 0,"manifest");o&&n.push(o)}for(let i of r.matchAll(/packages\s*=\s*\[([^\]]*)\]/g))for(let o of i[1].matchAll(/['"]([\w./-]+)['"]/g)){let s=Ui(t,o[1],void 0,"manifest");s&&n.push(s)}return XD(n)}function OMe(t){let e=Er(t,"Cargo.toml");if(!pn(e))return[];let r=WD(e,"utf8"),n=[],i=r.match(/\[workspace\][\s\S]*?members\s*=\s*\[([^\]]*)\]/);if(i){for(let s of i[1].matchAll(/['"]([\w./-]+)['"]/g)){let a=s[1],c=Er(t,a,"src"),l=pn(c)?`${a}/src`:a,u=Ui(t,l,sQ(a),"manifest");u&&n.push(u)}return n}let o=Ui(t,"src",void 0,"manifest");return o?[o]:[]}function TMe(t){let e=Er(t,"go.mod");if(!pn(e))return[];let r=[];for(let n of["cmd","internal","pkg"]){let i=Ui(t,n,void 0,"manifest");i&&r.push(i)}return r}function RMe(t){let e=[];for(let r of wMe){let n=Ui(t,r,void 0,"heuristic");n&&e.push(n)}for(let r of xMe){let n=Er(t,r);if(!(!pn(n)||!ks(n).isDirectory()))for(let i of oQ(n)){if(i.startsWith("."))continue;let o=Er(n,i);if(!ks(o).isDirectory())continue;let s=Er(o,"src"),a=pn(s)&&ks(s).isDirectory()?s:o,c=KD(t,a).split(JD).join("/"),l=Ui(t,c,i,"heuristic");l&&e.push(l)}}return XD(e)}function XD(t){let e=new Set,r=[];for(let n of t)e.has(n.absPath)||(e.add(n.absPath),r.push(n));return r}function IMe(t,e){if(!e.includes("*")){let a=Er(t,e);return!pn(a)||!ks(a).isDirectory()?[]:[{abs:a,name:sQ(a)}]}let r=e.split("/"),n=r.findIndex(a=>a.includes("*"));if(n===-1)return[];let i=Er(t,...r.slice(0,n));if(!pn(i)||!ks(i).isDirectory())return[];let o=r.slice(n+1).join("/"),s=[];for(let a of oQ(i)){if(a.startsWith("."))continue;let c=o?Er(i,a,o):Er(i,a);!pn(c)||!ks(c).isDirectory()||s.push({abs:c,name:a})}return s}function aQ(t){return[]}import{extname as cQ}from"node:path";function lQ(t,e){let r={};for(let i of t){let o=ic[cQ(i.path)]??"other";r[o]=(r[o]??0)+1}let n=null;for(let i of Object.entries(r))(!n||i[1]>n[1])&&(n=i);return{filesScanned:t.length,languagesSeen:Array.from(new Set(t.map(i=>cQ(i.path)))).sort(),languageCounts:r,dominantLanguage:n?.[0]??"unknown",sourceRoot:e}}Fr();function am(t,e){if(t)try{rn(t,nn("sentinel_miss",e))}catch{}}var uQ="";function dQ(t){let e=t.conventions,r=t.examples.map(a=>`### ${a.layer} \u2014 ${a.modulePath} \`\`\` ${a.moduleContent} @@ -934,9 +934,9 @@ ${o} `),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=Jx(n());d.writeHead(200,{"Content-Type":"text/html; charset=utf-8","Cache-Control":"no-store"}),d.end(m);return}d.writeHead(404,{"Content-Type":"text/plain"}),d.end("not found")}catch(m){if(d.headersSent)try{d.end()}catch{}else{d.writeHead(503,{"Content-Type":"application/json","Cache-Control":"no-store"});try{d.end(JSON.stringify({error:m.message}))}catch{}}}}),s=null,a=()=>{s&&clearTimeout(s),s=setTimeout(i,400)},c=[];for(let u of["spec","docs"]){let d=iHe(e,u);if(rHe(d))try{let f=nHe(d,{recursive:!0},a);f.on("error",()=>{try{f.close()}catch{}}),c.push(f)}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,d)=>{o.on("error",d),o.listen(t.port??0,"127.0.0.1",()=>{let f=o.address(),p=typeof f=="object"&&f?f.port:t.port??0;u({port:p,broadcast:i,close:()=>new Promise(m=>{s&&clearTimeout(s),clearInterval(l);for(let h of c)try{h.close()}catch{}for(let h of r)try{h.end()}catch{}r.clear(),o.close(()=>m()),typeof o.closeAllConnections=="function"&&o.closeAllConnections()})})})})}async function ure(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await oHe({port:e,cwd:t.cwd??"."});L("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){L("fail","graph",r.message),process.exit(1)}}var sHe=["stage_1.1","stage_2.1","stage_2.3"];function aHe(t){return(t.features??[]).filter(e=>e.status==="done")}function cHe(t,e){let r=aHe(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 dre(t,e){let r=[];for(let n of sHe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=cHe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}NS();import fre from"node:process";function lHe(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 Qx(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=lHe(n,t);i.pass||r.push(i)}return r}un();var Qj="stage_4.1";function eM(t={}){let{cwd:e="."}=t,r=pr(e);if(r.length===0)return{stage:Qj,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=Qx(r);if(n.length===0)return{stage:Qj,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:Qj,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var uHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${fre.argv[1]}`;if(uHe){let t=eM();console.log(JSON.stringify(t)),fre.exit(t.exitCode)}Al();import{randomBytes as dHe}from"node:crypto";import{unlinkSync as fHe}from"node:fs";import{tmpdir as pHe}from"node:os";import{join as mHe,resolve as tM}from"node:path";import hHe from"node:process";var Gr=null;function pre(t){Gr={cwd:tM(t),run:null,jsonFile:null}}function rM(){return Gr!==null}function nM(t,e){if(!Gr||Gr.cwd!==tM(t))return null;if(Gr.run)return Gr.run;let r=mHe(pHe(),`clad-shared-vitest-${hHe.pid}-${dHe(6).toString("hex")}.json`);Gr.jsonFile=r;let n=e(r);return Gr.run={proc:n,jsonFile:r},Gr.run}function mre(t){return!Gr||Gr.cwd!==tM(t)?null:Gr.run}function iM(t){return t.pass&&t.exitCode===0?"reuse-pass":"fallback"}function hre(){let t=Gr?.jsonFile;if(Gr=null,t)try{fHe(t)}catch{}}zr();import gre from"node:process";var e0="stage_1.4";function oM(t={}){let{cwd:e="."}=t,r;try{r=Ke("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:e0,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:e0,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:e0,pass:!0,exitCode:0}:{stage:e0,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var gHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gre.argv[1]}`;if(gHe){let t=oM();console.log(JSON.stringify(t)),gre.exit(t.exitCode)}zr();import yre from"node:process";sh();Nn();var t0="stage_2.2";function sM(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Xi("coverage",t))}catch(c){return{stage:t0,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:t0,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=mre(e),s=o?o.proc:Ke(r,[...n],{cwd:e,reject:!1}),a=Nt(t0,r,s,n);return a||Xt(t0,s)}var bHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${yre.argv[1]}`;if(bHe){let t=sM();console.log(JSON.stringify(t)),yre.exit(t.exitCode)}Qp();aD();aM();zr();Dn();Nn();import bre from"node:process";var i0="stage_3.2";function cM(t={}){let{cwd:e="."}=t,r=_t(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:i0,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Jl(e,o[o.length-1]))return{stage:i0,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=Ke(i,[...o],{cwd:e,reject:!1}),a=Nt(i0,i,s,o);return a||Xt(i0,s)}var LHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${bre.argv[1]}`;if(LHe){let t=cM();console.log(JSON.stringify(t)),bre.exit(t.exitCode)}zr();Ue();Nn();import{existsSync as zHe}from"node:fs";import{resolve as Sre}from"node:path";import wre from"node:process";var fi="stage_2.4",lM=5e3,UHe=3e4;function uM(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=q(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:fi,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return HHe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:fi,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:fi,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:fi,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=Sre(e,r.path);if(!zHe(s))return{stage:fi,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??lM,c;try{c=Ke(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(fi,r.path,c);if(l)return l;if(c.timedOut)return{stage:fi,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:fi,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:fi,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var vre={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},qHe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function HHe(t,e,r){let n=Math.min(e.length*lM,UHe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(BHe(t,s,r))}return GHe(o)}function BHe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?Sre(t,a):a,u=lM,d;try{d=Ke(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(Ba(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function GHe(t){let e="skip";for(let o of t)vre[o.disposition]>vre[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${qHe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` +${n}`}}var gHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${gre.argv[1]}`;if(gHe){let t=oM();console.log(JSON.stringify(t)),gre.exit(t.exitCode)}zr();import yre from"node:process";sh();Nn();var t0="stage_2.2";function sM(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=Xi("coverage",t))}catch(c){return{stage:t0,pass:!1,exitCode:1,stderr:c.message}}if(!r||!n)return{stage:t0,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`,skipReason:"no-runner"};let o=mre(e),s=o?o.proc:Ke(r,[...n],{cwd:e,reject:!1}),a=Nt(t0,r,s,n);return a||Xt(t0,s)}var bHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${yre.argv[1]}`;if(bHe){let t=sM();console.log(JSON.stringify(t)),yre.exit(t.exitCode)}Qp();aD();aM();zr();Dn();Nn();import bre from"node:process";var i0="stage_3.2";function cM(t={}){let{cwd:e="."}=t,r=_t(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:i0,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Jl(e,o[o.length-1]))return{stage:i0,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=Ke(i,[...o],{cwd:e,reject:!1}),a=Nt(i0,i,s,o);return a||Xt(i0,s)}var LHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${bre.argv[1]}`;if(LHe){let t=cM();console.log(JSON.stringify(t)),bre.exit(t.exitCode)}zr();Ue();Nn();import{existsSync as zHe}from"node:fs";import{resolve as Sre}from"node:path";import wre from"node:process";var fi="stage_2.4",lM=5e3,UHe=3e4;function uM(t={}){let{cwd:e="."}=t,r,n=[],i=!1,o=new Map;try{let p=q(e);r=p.project.deliverable,n=p.project.smoke??[],i=p.features.some(m=>m.status==="done"),o=new Map(p.features.map(m=>[m.id,m.status]))}catch{return{stage:fi,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return HHe(e,n,{anyDone:i,featureStatus:o});if(!r)return{stage:fi,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:fi,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:fi,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let s=Sre(e,r.path);if(!zHe(s))return{stage:fi,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let a=r.timeout_ms??lM,c;try{c=Ke(s,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:a})}catch(p){c=p}let l=Nt(fi,r.path,c);if(l)return l;if(c.timedOut)return{stage:fi,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${a}ms (hung or too slow)`};let u=r.expect_exit??0,d=c.exitCode??1;if(d===u)return{stage:fi,pass:!0,exitCode:0,disposition:"liveness"};let f=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:fi,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${d}, expected ${u}${f?` \u2014 ${f.slice(0,200)}`:""}`}}var vre={fail:5,advisory:4,pending_env:4,liveness:3,pass:2,na:1,skip:0},qHe={pass:"\u2713",fail:"\u2717",liveness:"liveness",na:"na",pending_env:"pending_env",advisory:"advisory",skip:"skip"};function HHe(t,e,r){let n=Math.min(e.length*lM,UHe),i=Date.now(),o=[];for(let s of e){if(Date.now()-i>=n){o.push({argv:(s.run??[]).join(" ")||"(none)",kind:s.kind,disposition:"pending_env",detail:"stage time ceiling \u2014 not started",feature:s.feature,why:s.why});continue}o.push(BHe(t,s,r))}return GHe(o)}function BHe(t,e,r){let n=(e.run??[]).join(" ")||"(none)",i=e.why;if(e.kind==="none")return{argv:"(kind:none)",kind:"none",disposition:"na",detail:"nothing to run (library/static)",why:i};let o=e.feature;if(o!==void 0){let h=r.featureStatus.get(o);if(h!=="done"){let g=h===void 0?`bound feature ${o} not found in spec \u2014 not executed`:`bound feature ${o} is ${h}, not done \u2014 not executed`;return{argv:n,kind:"cli",disposition:"na",detail:g,feature:o,why:i}}}else if(!r.anyDone)return{argv:n,kind:"cli",disposition:"skip",detail:"no done feature yet \u2014 smoke probe skipped",why:i};let s=e.run??[];if(s.length===0)return{argv:"(none)",kind:"cli",disposition:"skip",detail:"cli smoke probe has no run argv \u2014 skipped",feature:o,why:i};let[a,...c]=s,l=a.startsWith(".")||a.startsWith("/")?Sre(t,a):a,u=lM,d;try{d=Ke(l,[...c],{cwd:t,reject:!1,timeout:u})}catch(h){d=h}if(Ba(d))return{argv:n,kind:"cli",disposition:"skip",detail:`'${a}' not installed`,feature:o,why:i};if(d.timedOut)return{argv:n,kind:"cli",disposition:"fail",detail:`timed out after ${u}ms`,feature:o,why:i};let f=e.expect?.exit??0,p=d.exitCode??1;if(p!==f){let h=String(d.stderr??"").trim()||String(d.stdout??"").trim();return{argv:n,kind:"cli",disposition:"fail",detail:`exited ${p}, expected ${f}${h?` \u2014 ${h.slice(0,200)}`:""}`,feature:o,why:i}}let m=e.expect?.token;return m?String(d.stdout??"").includes(m)?{argv:n,kind:"cli",disposition:"pass",detail:`ran clean (exit ${p}), stdout contains ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"fail",detail:`ran (exit ${p}) but stdout did not contain the AC token ${JSON.stringify(m)}`,feature:o,why:i}:{argv:n,kind:"cli",disposition:"liveness",detail:`ran clean (exit ${p}), no token declared \u2014 exit-only`,feature:o,why:i}}function GHe(t){let e="skip";for(let o of t)vre[o.disposition]>vre[e]&&(e=o.disposition);let r=t.map(o=>{let s=o.why?` \xB7 ${o.why}`:"";return`${qHe[o.disposition]} ${o.argv} \xB7 ${o.detail}${s}`}).join(` `),n=t.map((o,s)=>({id:`probe_${s+1}`,kind:o.kind,disposition:o.disposition==="skip"?"na":o.disposition,bindsFeature:o.feature,why:o.why,detail:o.detail}));if(e==="skip")return{stage:fi,pass:!1,exitCode:2,stderr:r,probes:n};let i=e==="fail"||e==="pending_env"||e==="advisory";return{stage:fi,pass:!i,exitCode:i?1:0,disposition:e,stderr:r,probes:n}}var ZHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wre.argv[1]}`;if(ZHe){let t=uM();console.log(JSON.stringify(t)),wre.exit(t.exitCode)}zr();Dn();Nn();import xre from"node:process";var o0="stage_3.1";function dM(t={}){let{cwd:e="."}=t,r=_t(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:o0,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Jl(e,o[o.length-1]))return{stage:o0,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=Ke(i,[...o],{cwd:e,reject:!1}),a=Nt(o0,i,s,o);return a||Xt(o0,s)}var VHe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${xre.argv[1]}`;if(VHe){let t=dM();console.log(JSON.stringify(t)),xre.exit(t.exitCode)}ZC();fM();pM();zr();r0();import{randomBytes as e6e}from"node:crypto";import{unlinkSync as t6e}from"node:fs";import{tmpdir as r6e}from"node:os";import{join as n6e}from"node:path";import hM from"node:process";sh();Nn();Ue();import{readFileSync as JHe}from"node:fs";import{resolve as Ere}from"node:path";function YHe(t){let e=t.trim();if(!e.startsWith("{"))return null;let r;try{r=JSON.parse(e)}catch{return null}let n=r.testResults;if(!Array.isArray(n))return null;let i=new Map;for(let o of n){if(typeof o.name!="string"||!o.name)continue;let s=Ere(o.name),a=i.get(s)??0;for(let c of o.assertionResults??[])c.status==="passed"&&(a+=1);i.set(s,a)}return i}function XHe(t){let e=t.indexOf("#");return(e===-1?t:t.slice(0,e)).trim()}function QHe(t,e,r){let n=[];for(let i of t.features??[]){if(i.status!=="done")continue;let o=[],s=new Set;for(let u of i.acceptance_criteria??[])for(let d of u.test_refs??[]){let f=XHe(d);f&&!s.has(f)&&(s.add(f),o.push(f))}if(o.length===0)continue;let a=!0,c=!1;for(let u of o){let d=e.get(Ere(r,u));if(d===void 0){a=!1;break}if(d>0){c=!0;break}}if(c||!a)continue;let l=i.title||i.id;n.push({detector:"VACUOUS_TESTS",severity:"warn",path:o[0],message:`Done feature "${l}" declares tests, but none of its test files executed a passing test (all skipped / todo / empty) \u2014 its behavioral proof never actually ran`})}return n}function mM(t,e){try{let r=YHe(JHe(t,"utf8"));return r?QHe(q(e),r,e):[]}catch{return[]}}var Zr="stage_2.1";function Are(t,e){return t==="vitest"||t.endsWith("/vitest")||e.includes("vitest")}function Ore(t,e){return[t,...e].some(r=>r==="pytest"||r.endsWith("/pytest"))}function Tre(t){let e=`${String(t.stdout??"")} -${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function i6e(t,e,r){let n,i;try{({cmd:n,args:i}=Xi("coverage",t))}catch{return null}if(!n||!i||!Are(n,i))return null;let o=n,s=i,a=nM(e,d=>Ke(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Zr,n,c,s))return null;let u=Xt(Zr,c);if(iM(u)==="fallback")return null;if(r){let d=mM(l,e);if(d.length>0)return{stage:Zr,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Zr,pass:!0,exitCode:0}}function o6e(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Xi("coverage",t))}catch{return null}if(!n||!i||!Ore(n,i))return null;let o=n,s=i,a=nM(e,()=>Ke(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Zr,o,a.proc,s))return null;let c=Xt(Zr,a.proc);if(iM(c)==="fallback")return null;if(r&&Tre(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Zr,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Zr,pass:!0,exitCode:0}}function gM(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Xi("test",t))}catch(d){return{stage:Zr,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Zr,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`};let s=Are(n,i),a=Ore(n,i),c=r&&s;if(rM()&&s){let d=i6e(t,e,c);if(d)return d}if(rM()&&a){let d=o6e(t,e);if(d)return d}let l,u=i;c&&(l=n6e(r6e(),`clad-vitest-${hM.pid}-${e6e(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=Ke(n,[...u],{cwd:e,reject:!1}),f=Nt(Zr,n,d,u);if(f)return f;let p=Lu("unit",Xt(Zr,d),d);if(r&&p.pass&&Tre(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Zr,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=mM(l,e);if(m.length>0)return{stage:Zr,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{t6e(l)}catch{}}}var s6e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hM.argv[1]}`;if(s6e){let t=gM();console.log(JSON.stringify(t)),hM.exit(t.exitCode)}zr();Dn();Nn();import Rre from"node:process";var c0="stage_3.3";function yM(t={}){let{cwd:e="."}=t,r=_t(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:c0,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Jl(e,o[o.length-1]))return{stage:c0,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=Ke(i,[...o],{cwd:e,reject:!1}),a=Nt(c0,i,s,o);return a||Xt(c0,s)}var a6e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Rre.argv[1]}`;if(a6e){let t=yM();console.log(JSON.stringify(t)),Rre.exit(t.exitCode)}WC();Zf();wa();bM();Up();_S();var Mre=wt(tr(),1);import{existsSync as vM,readFileSync as _6e,readdirSync as jre,statSync as b6e,writeFileSync as v6e}from"node:fs";import{basename as dh,join as fh,relative as Nre}from"node:path";var S6e=["self-dogfood:","fixture:","derived:"],Fre=/\.(test|spec)\.[jt]sx?$/;function Lre(t,e=t,r=[]){let n;try{n=jre(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=fh(e,i);try{b6e(o).isDirectory()?Lre(t,o,r):Fre.test(i)&&r.push(o)}catch{continue}}return r}function zre(t="."){let e=fh(t,"spec","features"),r=fh(t,"tests"),n=[],i=[];if(!vM(e)||!vM(r))return{repaired:n,suggested:i};let o=Lre(r),s=new Map;for(let a of o){let c=Nre(t,a).split("\\").join("/"),l=s.get(dh(a))??[];l.push(c),s.set(dh(a),l)}for(let a of jre(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=fh(e,a),l,u;try{l=_6e(c,"utf8"),u=(0,Mre.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(S6e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(vM(fh(t,b)))continue;let _=s.get(dh(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[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=>dh(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Nre(t,h).split("\\").join("/")).find(h=>{let g=dh(h).replace(Fre,"");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"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 +${String(t.stderr??"")}`,r=[],n=[/^\s*#\s*tests\s+(\d+)\s*$/gim,/^\s*ℹ\s+tests\s+(\d+)\s*$/gim,/^\s*Tests:\s+.*?\b(\d+)\s+total\b.*$/gim,/^\s*collected\s+(\d+)\s+items?\b.*$/gim];for(let i of n)for(let o of e.matchAll(i))r.push(Number(o[1]));return r.length>0&&r.every(i=>i===0)}function i6e(t,e,r){let n,i;try{({cmd:n,args:i}=Xi("coverage",t))}catch{return null}if(!n||!i||!Are(n,i))return null;let o=n,s=i,a=nM(e,d=>Ke(o,[...s,"--reporter=default","--reporter=json",`--outputFile=${d}`],{cwd:e,reject:!1}));if(!a)return null;let{proc:c,jsonFile:l}=a;if(Nt(Zr,n,c,s))return null;let u=Xt(Zr,c);if(iM(u)==="fallback")return null;if(r){let d=mM(l,e);if(d.length>0)return{stage:Zr,pass:!1,exitCode:1,findings:d,stderr:d[0].message}}return{stage:Zr,pass:!0,exitCode:0}}function o6e(t,e){let{strict:r=!1}=t,n,i;try{({cmd:n,args:i}=Xi("coverage",t))}catch{return null}if(!n||!i||!Ore(n,i))return null;let o=n,s=i,a=nM(e,()=>Ke(o,[...s],{cwd:e,reject:!1}));if(!a||Nt(Zr,o,a.proc,s))return null;let c=Xt(Zr,a.proc);if(iM(c)==="fallback")return null;if(r&&Tre(a.proc)){let l={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Zr,pass:!1,exitCode:1,findings:[l],stderr:l.message}}return{stage:Zr,pass:!0,exitCode:0}}function gM(t={}){let{cwd:e=".",strict:r=!1}=t,n,i,o;try{({cmd:n,args:i,language:o}=Xi("test",t))}catch(d){return{stage:Zr,pass:!1,exitCode:1,stderr:d.message}}if(!n||!i)return{stage:Zr,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${o}'`,skipReason:"no-runner"};let s=Are(n,i),a=Ore(n,i),c=r&&s;if(rM()&&s){let d=i6e(t,e,c);if(d)return d}if(rM()&&a){let d=o6e(t,e);if(d)return d}let l,u=i;c&&(l=n6e(r6e(),`clad-vitest-${hM.pid}-${e6e(6).toString("hex")}.json`),u=[...i,"--reporter=default","--reporter=json",`--outputFile=${l}`]);try{let d=Ke(n,[...u],{cwd:e,reject:!1}),f=Nt(Zr,n,d,u);if(f)return f;let p=Lu("unit",Xt(Zr,d),d);if(r&&p.pass&&Tre(d)){let m={detector:"VACUOUS_TESTS",severity:"error",message:"The unit test command exited successfully but reported zero executed tests."};return{stage:Zr,pass:!1,exitCode:1,findings:[m],stderr:m.message}}if(c&&p.pass&&l){let m=mM(l,e);if(m.length>0)return{stage:Zr,pass:!1,exitCode:1,findings:m,stderr:m[0].message}}return p}finally{if(l)try{t6e(l)}catch{}}}var s6e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${hM.argv[1]}`;if(s6e){let t=gM();console.log(JSON.stringify(t)),hM.exit(t.exitCode)}zr();Dn();Nn();import Rre from"node:process";var c0="stage_3.3";function yM(t={}){let{cwd:e="."}=t,r=_t(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:c0,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Jl(e,o[o.length-1]))return{stage:c0,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=Ke(i,[...o],{cwd:e,reject:!1}),a=Nt(c0,i,s,o);return a||Xt(c0,s)}var a6e=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${Rre.argv[1]}`;if(a6e){let t=yM();console.log(JSON.stringify(t)),Rre.exit(t.exitCode)}WC();Zf();wa();bM();Up();_S();var Mre=wt(tr(),1);import{existsSync as vM,readFileSync as _6e,readdirSync as jre,statSync as b6e,writeFileSync as v6e}from"node:fs";import{basename as dh,join as fh,relative as Nre}from"node:path";var S6e=["self-dogfood:","fixture:","derived:"],Fre=/\.(test|spec)\.[jt]sx?$/;function Lre(t,e=t,r=[]){let n;try{n=jre(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=fh(e,i);try{b6e(o).isDirectory()?Lre(t,o,r):Fre.test(i)&&r.push(o)}catch{continue}}return r}function zre(t="."){let e=fh(t,"spec","features"),r=fh(t,"tests"),n=[],i=[];if(!vM(e)||!vM(r))return{repaired:n,suggested:i};let o=Lre(r),s=new Map;for(let a of o){let c=Nre(t,a).split("\\").join("/"),l=s.get(dh(a))??[];l.push(c),s.set(dh(a),l)}for(let a of jre(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=fh(e,a),l,u;try{l=_6e(c,"utf8"),u=(0,Mre.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(S6e.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(vM(fh(t,b)))continue;let _=s.get(dh(b))??[];if(_.length!==1)continue;let S=g.replace(b,_[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=>dh(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>Nre(t,h).split("\\").join("/")).find(h=>{let g=dh(h).replace(Fre,"");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"),b=l.match(g);if(!b)continue;let _=b[2]+" ";l=l.replace(g,`$1 ${_}test_refs: ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&v6e(c,l,"utf8")}return{repaired:n,suggested:i}}El();import{existsSync as w6e,readFileSync as x6e}from"node:fs";import{join as $6e}from"node:path";function k6e(t,e){let r=$6e(t,e);if(!w6e(r))return[];let n=[];for(let i of x6e(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 Ure(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=>k6e(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 qre(t){let e=[];e.push(`# Impl-blind 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(` `)}SS();Ue();un();Pi();un();El();var SM=["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"],E6e=[...SM,"att"];function A6e(t,e,r){if(e.startsWith("stage_4")){let n=pr(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return Qx(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function O6e(t,e,r){let n=t.modules??[];return t.status!=="done"||n.length===0?"\xB7":e===null?"-":Q_(e,r,t).state==="fresh"?"\u2713":"!"}function f0(t,e="."){let r=ds(e),n=t.features.map(i=>({featureId:i.id,title:i.title||i.id,status:i.status,cells:[...SM.map(o=>A6e(i,o,e)),O6e(i,r,e)]}));return{columns:E6e,rows:n}}function Hre(t,e=".",r={}){let n=r.internal??!1,i=f0(t,e),o=[...SM.map(c=>n?c.replace("stage_",""):T6e(c)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,a=i.rows.map(c=>{let l=c.cells.join(" ");return n?`${c.featureId.padEnd(12)} ${l} ${c.title}`:`${c.title.padEnd(35).slice(0,35)} ${l}`});return[s,...a].join(` @@ -958,22 +958,24 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&v6e(c,l,"u `):H.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. `),H.exit(0)}async function fXe(t){let e=t.host?t.host==="all"?["claude","codex","gemini","antigravity","cursor"].slice():[t.host]:void 0,r=await RC({force:t.force,quiet:t.quiet,projectRoot:t.project,hosts:e});H.exit(r.errors.length>0?1:0)}async function pXe(){L("note","update","reconciling the current project after the engine upgrade");let t=await H7(".",{wireHosts:async()=>(await RC({quiet:!0,projectRoot:"."})).errors.length});if(!t.isProject){L("skip","update","no spec.yaml here \u2014 nothing re-wired. Run `clad update` inside a cladding project, or `clad init` to start one."),H.exit(t.code);return}L(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),t.inventoryDeferred?L("note","spec",`inventory + index writes deferred \u2014 git operation in progress; re-run \`clad update\` after it completes (${t.features} features seen).`):L("pass","spec",`inventory synced \xB7 ${t.features} features`),L(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),L(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)L("note","deprecated",r);H.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): -`),LA({tier:"pre-commit",strict:!0}).anyFailed?H.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"):L("pass","drift","clean against the stricter detectors"),H.exit(t.code)}var mXe={"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 LA(t){let e=t.tier??"all",r=t.silent===!0,n=mXe[e];if(!n)return t.json&&!r?H.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} -`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>lh(i)],["stage_1.2",()=>ch(i)],["stage_1.3",()=>ci({...i,strict:t.strict})],["stage_1.4",oM],["stage_1.5",ac],["stage_1.6",nm],["stage_2.1",()=>gM({...i,strict:t.strict})],["stage_2.2",()=>sM(i)],["stage_2.3",GC],["stage_2.4",uM],["stage_3.1",dM],["stage_3.2",cM],["stage_3.3",yM],["stage_4.1",eM],["stage_4.2",uh]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":mr(d)?"fail":"skip",u=[];eb("."),pre(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ra(d),h=SX(p);mr(h)&&(c=!0,a=Math.max(a,wX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings}),!t.json&&!r&&(L(l(h),m),mr(h)&&wXe(p))}}finally{rb(),hre()}if(t.strict)try{let d=q();for(let f of dre(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!mr(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>mr(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(Sa("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{aZ(".",q(),{cladding:fn()??"unknown",blocking:"strict",detectorsSha256:oZ(IS)})&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json&&!r?H.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} -`):c&&!r&&H.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n"),Jt(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c,blockers:PS(u),stopFingerprint:xX(u)}),{worst:a,anyFailed:c,stages:u}}function hXe(t){try{let e=q(),r=bl(e,t);H.stdout.write(`${JSON.stringify(r,null,2)} -`),H.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),H.exit(1)}}function gXe(t,e={}){try{let r=q(),n=e.depth!==void 0?Number(e.depth):void 0,i=xr(r,t,{depth:n});H.stdout.write(`${JSON.stringify(i,null,2)} -`),H.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),H.exit(1)}}function yXe(t={}){try{let e=q(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=RS(e,o=>{try{return Dfe(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});H.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} -`),H.exit(0)}catch(e){L("fail","infer-deps",e.message),H.exit(1)}}function _Xe(t={}){try{if(t.sessions){Yte(t);return}if(t.trend!==void 0&&t.trend!==!1){Xte(t);return}let e=q(),n=rG(e,o=>{try{return Dfe(o,"utf8")}catch{return null}},"."),i=iG(".",n);if(t.json)H.stdout.write(`${JSON.stringify(n,null,2)} +`),LA({tier:"pre-commit",strict:!0}).anyFailed?H.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"):L("pass","drift","clean against the stricter detectors"),H.exit(t.code)}var mXe={"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 hXe(t){return t.length===0?"":`${t.join(", ")} skipped \u2014 no runner is known for this project. Declare commands in .cladding/config.yaml (gate: \u2192 commands: \u2192 e.g. test: ["zig","test"]) to run them; the file is committable, so CI runs the same gate you do.`}function LA(t){let e=t.tier??"all",r=t.silent===!0,n=mXe[e];if(!n)return t.json&&!r?H.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} +`):r||L("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0,stages:[]};let i={focusModules:t.focusModules},s=[["stage_1.1",()=>lh(i)],["stage_1.2",()=>ch(i)],["stage_1.3",()=>ci({...i,strict:t.strict})],["stage_1.4",oM],["stage_1.5",ac],["stage_1.6",nm],["stage_2.1",()=>gM({...i,strict:t.strict})],["stage_2.2",()=>sM(i)],["stage_2.3",GC],["stage_2.4",uM],["stage_3.1",dM],["stage_3.2",cM],["stage_3.3",yM],["stage_4.1",eM],["stage_4.2",uh]].filter(([d])=>n.includes(d)),a=0,c=!1,l=d=>d==="pass"?"pass":d==="liveness"?"note":d==="na"?"skip":mr(d)?"fail":"skip",u=[];eb("."),pre(".");try{for(let[d,f]of s){let p=f({}),m=t.internal?d:Ra(d),h=SX(p);mr(h)&&(c=!0,a=Math.max(a,wX(p,h))),u.push({stage:d,label:m,status:h,exitCode:p.exitCode,stderr:p.stderr,findings:p.findings,skipReason:p.skipReason}),!t.json&&!r&&(L(l(h),m),mr(h)&&xXe(p))}}finally{rb(),hre()}if(t.strict)try{let d=q();for(let f of dre(d,u))a=Math.max(a,1),c=!0,u.push({stage:f.stage,label:f.label,status:"fail",exitCode:1,stderr:f.message}),!t.json&&!r&&L("fail",f.label,f.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let d=u.find(h=>h.stage==="stage_1.3"),f=(d?.findings??[]).filter(h=>h.severity==="error"||h.severity==="warn"),p=d?.status==="fail"&&f.length>0&&f.every(h=>h.detector==="STALE_ATTESTATION"),m=u.every(h=>h.stage==="stage_1.3"||!mr(h.status));if(p&&m&&d&&(d.status="pass",d.exitCode=0,d.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",c=u.some(h=>mr(h.status)),a=c?Math.max(1,a):0,!t.json&&!r&&L("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!c&&!r)if(Sa("."))t.json||L("note","attestation","deferred \u2014 git operation in progress; run the gate again after the merge/rebase completes.");else try{aZ(".",q(),{cladding:fn()??"unknown",blocking:"strict",detectorsSha256:oZ(IS)})&&(t.json||L("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}if(t.json&&!r?H.stdout.write(`${JSON.stringify({tier:e,worst:a,anyFailed:c,stages:u},null,2)} +`):c&&!r&&H.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n"),!t.json&&!r){let d=hXe(u.filter(f=>f.skipReason==="no-runner").map(f=>f.label));d&&H.stdout.write(` +\u2139 ${d} +`)}return Jt(".","gate_run",{tier:e,strict:t.strict===!0,worst:a,anyFailed:c,blockers:PS(u),stopFingerprint:xX(u)}),{worst:a,anyFailed:c,stages:u}}function gXe(t){try{let e=q(),r=bl(e,t);H.stdout.write(`${JSON.stringify(r,null,2)} +`),H.exit("not_found"in r?1:0)}catch(e){L("fail","context",e.message),H.exit(1)}}function yXe(t,e={}){try{let r=q(),n=e.depth!==void 0?Number(e.depth):void 0,i=xr(r,t,{depth:n});H.stdout.write(`${JSON.stringify(i,null,2)} +`),H.exit("not_found"in i?1:0)}catch(r){L("fail","impact",r.message),H.exit(1)}}function _Xe(t={}){try{let e=q(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=RS(e,o=>{try{return Dfe(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});H.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} +`),H.exit(0)}catch(e){L("fail","infer-deps",e.message),H.exit(1)}}function bXe(t={}){try{if(t.sessions){Yte(t);return}if(t.trend!==void 0&&t.trend!==!1){Xte(t);return}let e=q(),n=rG(e,o=>{try{return Dfe(o,"utf8")}catch{return null}},"."),i=iG(".",n);if(t.json)H.stdout.write(`${JSON.stringify(n,null,2)} `);else{let o=n.context,s=o.truncatedCount>0?`budget enforces ${o.medianShrinkTruncated}x on ${o.truncatedCount} capped feature(s) (cap-driven)`:"no feature hit the budget cap",a=o.fitsCount>0?`${o.medianShrinkFit}x on ${o.fitsCount} fitting`:"none fit untruncated",c=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${o.medianSliceTokens} tok vs naive ${o.medianNaiveTokens} tok \u2014 ${s}, ${a}`,` uncapped structural slice = ${o.medianStructuralRatio}x of naive \u2014 the value is the guaranteed budget + wired needs/breaks/verify, not raw shrink`,` 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)}`,` ${vl}`];H.stdout.write(`${c.join(` `)} -`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}H.exit(0)}catch(e){L("fail","measure",e.message),H.exit(1)}}function bXe(t){let e;if(t.feature)try{let i=(q().features??[]).find(o=>o.id===t.feature||o.slug===t.feature);i||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),H.exit(1)),e=i.modules}catch(n){L("fail","check",n.message),H.exit(1)}let r=LA({...t,focusModules:e});if(!t.json){let n=d7(".");n&&H.stdout.write(`\u2139 ${n} -`)}H.exitCode=r.worst}function vXe(t){let e;try{e={policy:q(".").project.independence_policy??"label",evidence:pr(".")}}catch{e=void 0}let r=n7(".",t,{checkStages:LA,onIndex:rc,gitOpInProgress:zT,independence:e});if(L(r.ok?"pass":"fail",`done \xB7 ${t}`,r.reason),r.independence){let n=r.independence==="independent"?"independence: independent \u2014 backed by human or independent review":"independence: self-certified \u2014 no independent or human review yet";L("note",`done \xB7 ${t}`,n)}H.exit(r.code)}function SXe(t,e={}){let r=e.cwd??".",n;try{n=q(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),H.exit(1);return}if(e.required){t&&H.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') +`),i.appended?L("note","measure","snapshot recorded to .cladding/measure.jsonl \u2014 see `clad measure --trend`"):i.reason==="deduped"?L("note","measure","commit+spec state unchanged since last snapshot \u2014 not recorded"):i.reason==="no_head"&&L("note","measure","no git HEAD \u2014 snapshot not recorded (commit first; a head-less line has no reproduce target)")}H.exit(0)}catch(e){L("fail","measure",e.message),H.exit(1)}}function vXe(t){let e;if(t.feature)try{let i=(q().features??[]).find(o=>o.id===t.feature||o.slug===t.feature);i||(L("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),H.exit(1)),e=i.modules}catch(n){L("fail","check",n.message),H.exit(1)}let r=LA({...t,focusModules:e});if(!t.json){let n=d7(".");n&&H.stdout.write(`\u2139 ${n} +`)}H.exitCode=r.worst}function SXe(t){let e;try{e={policy:q(".").project.independence_policy??"label",evidence:pr(".")}}catch{e=void 0}let r=n7(".",t,{checkStages:LA,onIndex:rc,gitOpInProgress:zT,independence:e});if(L(r.ok?"pass":"fail",`done \xB7 ${t}`,r.reason),r.independence){let n=r.independence==="independent"?"independence: independent \u2014 backed by human or independent review":"independence: self-certified \u2014 no independent or human review yet";L("note",`done \xB7 ${t}`,n)}H.exit(r.code)}function wXe(t,e={}){let r=e.cwd??".",n;try{n=q(r)}catch(o){L("fail","oracle",`spec not loaded: ${o.message}`),H.exit(1);return}if(e.required){t&&H.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') `);let o=jY(n);if(o.length===0){H.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. `),H.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";H.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} `)}H.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. `),H.exit(s.length>0?1:0);return}if(!t){L("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),H.exit(1);return}let i=Ure(n,t,e.ac,r);if(!i||i.acs.length===0){L("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),H.exit(1);return}H.stdout.write(`${qre(i)} -`),H.exit(0)}function wXe(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=P4(Ia(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";if(H.stdout.write(` ${o}${s} [${i.detector}] +`),H.exit(0)}function xXe(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=P4(Ia(i.detector,i.message),140),s=i.path?` \u2014 ${i.path}`:"";if(H.stdout.write(` ${o}${s} [${i.detector}] `),Ia(i.detector,i.message)!==i.message){let c=i.message.split(` `).map(l=>l.trim()).filter(l=>l.length>0);for(let l of c.slice(0,4))H.stdout.write(` ${P4(l,160)} `);c.length>4&&H.stdout.write(` \u2026 and ${c.length-4} more line(s) \u2014 see \`clad check --json\` @@ -982,6 +984,6 @@ ${o.length} AC(s) required, ${s.length} missing an oracle. `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` `).map(r=>r.trim()).filter(r=>r.length>0);for(let r of e.slice(0,5))H.stdout.write(` ${P4(r,160)} `);e.length>5&&H.stdout.write(` \u2026 and ${e.length-5} more line(s) \u2014 see \`clad check --json\` -`)}}function P4(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function xXe(t){let e=q();if(t.json){H.stdout.write(`${JSON.stringify(f0(e,"."),null,2)} +`)}}function P4(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function $Xe(t){let e=q();if(t.json){H.stdout.write(`${JSON.stringify(f0(e,"."),null,2)} `),H.exitCode=0;return}H.stdout.write(`${Hre(e,".",{internal:t.internal})} -`),H.exit(0)}function $Xe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function kXe(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),H.exit(1);return}let n;try{let i=q(e),o=f0(i,e),s={gitHead:xa(e),version:fn(),generatedAt:t.now??new Date().toISOString()},a=xl(i),c;try{let l=t.since??is(e),u=os(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:Sl(u),auditMarkdown:wl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=JG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),H.exit(1);return}try{oXe(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),H.exit(1);return}L("pass","bundle",`${r} \xB7 ${$Xe(Buffer.byteLength(n,"utf8"))}`),H.exit(0)}function EXe(t){let e=iO(t);L("note",`route \u2192 ${e}`,t),H.exit(e==="unknown"?1:0)}function AXe(){let t=new Z4;t.name("clad").description("Reference Ironclad CLI").version("0.9.4"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) 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.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(aXe),t.command("run [goal]").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(cXe),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(lXe),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(fXe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(pXe),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(bXe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(uXe),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(vXe),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)=>SXe(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(dXe),t.command("status").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").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action(xXe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(hXe),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)=>gXe(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>F7(r,{checkStages:LA})),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=>yXe(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 report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>_Xe(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=>cre(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>lre()),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=>{ure(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)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>jG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec entry movement (from the changelog), how each acceptance criterion moved, changed source files resolved to their owning features via the reverse index, the tests those features declare, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the six-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>vX(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>kXe(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(EXe),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(I7),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(sXe),t.command("doctor").description("Diagnose Claude Code hook liveness/version, lifecycle governance, and LLM dispatcher sentinel misses").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){QX({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}HX(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); 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(Gte),t}var OXe=!!globalThis.__CLADDING_BUNDLED,TXe=OXe||import.meta.url===`file://${H.argv[1]}`;TXe&&AXe().parse();export{mXe as TIER_STAGES,AXe as createProgram,kXe as runBundleCommand,bXe as runCheckCommand,LA as runCheckStages,uXe as runCheckpointCommand,hXe as runContextCommand,vXe as runDoneCommand,gXe as runImpactCommand,yXe as runInferDepsCommand,aXe as runInitCommand,_Xe as runMeasureCommand,SXe as runOracleCommand,dXe as runRollbackCommand,EXe as runRouteCommand,cXe as runRunCommand,sXe as runServeCommand,fXe as runSetupCommand,xXe as runStatusCommand,lXe as runSyncCommand,pXe as runUpdateCommand}; +`),H.exit(0)}function kXe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function EXe(t){let e=t.cwd??".",r=(t.out??"").trim();if(r.length===0){L("fail","bundle","missing --out \u2014 the bundle needs a destination path"),H.exit(1);return}let n;try{let i=q(e),o=f0(i,e),s={gitHead:xa(e),version:fn(),generatedAt:t.now??new Date().toISOString()},a=xl(i),c;try{let l=t.since??is(e),u=os(e,l);c={kind:"present",sinceRef:l,changelogMarkdown:Sl(u),auditMarkdown:wl(u,i,e)}}catch(l){c={kind:"omitted",reason:l.message}}n=JG({spec:i,panel:o,provenance:s,catalogMarkdown:a,changes:c})}catch(i){L("fail","bundle",i.message),H.exit(1);return}try{oXe(r,n,"utf8")}catch(i){L("fail","bundle",`could not write ${r}: ${i.message}`),H.exit(1);return}L("pass","bundle",`${r} \xB7 ${kXe(Buffer.byteLength(n,"utf8"))}`),H.exit(0)}function AXe(t){let e=iO(t);L("note",`route \u2192 ${e}`,t),H.exit(e==="unknown"?1:0)}function OXe(){let t=new Z4;t.name("clad").description("Reference Ironclad CLI").version("0.9.4"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init payment SaaS for B2B` \u2014 free text in any language) 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.").option("--json","emit the raw InitResult for tooling; default is the human-readable surface").action(aXe),t.command("run [goal]").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(cXe),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(lXe),t.command("setup").description("Activate Cladding only for the current project (Claude Code / Codex / Gemini / Antigravity / Cursor)").option("--project ","activate a project other than the current directory").option("--host ","activate detected hosts (default), all, or one of: claude, codex, gemini, antigravity, cursor").option("--force","replace an existing conflicting cladding-owned project entry").option("--quiet","suppress stdout output").action(fXe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: refresh project host wiring + sync inventory + refresh managed CLAUDE.md/AGENTS.md, then report stricter detector findings").action(pXe),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(vXe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(uXe),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(SXe),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)=>wXe(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(dXe),t.command("status").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").option("--json","emit the row model as JSON \u2014 the same feature \xD7 stage integrity matrix rendered to the terminal (columns + per-feature glyph cells), one SSoT for terminal, JSON, and the audit bundle").action($Xe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(gXe),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)=>yXe(r,n)),t.command("verdict").description("One-poll loop decision: DONE|ITERATE|ESCALATE|BLOCKED|BOOTSTRAP over the pre-push strict gate + feature statuses (F-2e28cc72). Single gate touch; DONE requires \u22651 non-liveness proof.").option("--json","emit the verdict object as JSON").option("--tier ","gate tier (default pre-push)").action(r=>F7(r,{checkStages:LA})),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=>_Xe(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 report as JSON").option("--sessions","summarize recorded value-delivery telemetry instead \u2014 impact-card fire rate over eligible edits, the per-reason skip histogram, and MCP read-serve counts. Measures DELIVERY (did the surfaces fire), NOT adoption (F-6ba22c5c).").option("--trend [n]","render the last N (default 5) recorded measure snapshots with signed deltas \u2014 spot efficiency drift over time from the deduped .cladding/measure.jsonl ledger (F-39609db4)").action(r=>bXe(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=>cre(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>lre()),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=>{ure(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)").option("--measure","embed the release's own re-derivable measurement \u2014 but ONLY a snapshot taken at the current HEAD; no match renders a not-measured notice, never an older snapshot (F-ede6fa75)").action(r=>jG(r)),t.command("report").description("Render one deterministic review packet for a git range (F-f6cc5e5a) \u2014 spec entry movement (from the changelog), how each acceptance criterion moved, changed source files resolved to their owning features via the reverse index, the tests those features declare, the deduped regression set, and gate + attestation state. For PR reviewers, team-leads, and auditors: it RENDERS, it gates nothing. Byte-identical across two runs on the same repository state.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--format ","md (default, the six-section markdown packet) | sarif (SARIF 2.1.0 \u2014 one result per error/warn drift finding, for code-scanning UIs) | json (the raw deterministic model)").action(r=>vX(r)),t.command("bundle").description("Write ONE self-contained HTML audit bundle (F-e940fffe) a non-coder can double-click \u2014 offline, zero network, no CDN, no scripts. Contains the project header + inventory, the feature \xD7 stage matrix, the capability catalog, shipped changes for the range, the audit table with resolved refs, and the attestation summary, under a provenance banner (git HEAD, date, version). Deterministic modulo the date stamp. If no anchor ref resolves, the changelog + audit sections show an omitted notice while the rest still renders.").requiredOption("--out ","destination path for the HTML bundle").option("--since ","git ref to diff shipped changes from (default: the latest tag via `git describe --tags --abbrev=0`)").action(r=>EXe(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(AXe),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(I7),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(sXe),t.command("doctor").description("Diagnose Claude Code hook liveness/version, lifecycle governance, and LLM dispatcher sentinel misses").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").option("--hosts","smoke-test host CLIs (Claude Code / Gemini / Antigravity / Codex / Cursor) and project wiring \u2192 dated artifact + docs/dogfood/matrix.md. Live LLM prompts run only with consent (CLAD_HOST_SMOKE=1 or --yes); otherwise not-run").option("--yes","grant live-run consent for --hosts (equivalent to CLAD_HOST_SMOKE=1)").option("--matrix-only","regenerate docs/dogfood/matrix.md from the newest host-smoke artifact without any probing").action(r=>{if(r.hosts||r.matrixOnly){QX({cwd:r.cwd,yes:r.yes,matrixOnly:r.matrixOnly});return}HX(r)}),t.command("clarify [answer...]").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, free text in any language, e.g. `clad clarify B2B only`); 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(Gte),t}var TXe=!!globalThis.__CLADDING_BUNDLED,RXe=TXe||import.meta.url===`file://${H.argv[1]}`;RXe&&OXe().parse();export{mXe as TIER_STAGES,OXe as createProgram,hXe as renderNoRunnerGuidance,EXe as runBundleCommand,vXe as runCheckCommand,LA as runCheckStages,uXe as runCheckpointCommand,gXe as runContextCommand,SXe as runDoneCommand,yXe as runImpactCommand,_Xe as runInferDepsCommand,aXe as runInitCommand,bXe as runMeasureCommand,wXe as runOracleCommand,dXe as runRollbackCommand,AXe as runRouteCommand,cXe as runRunCommand,sXe as runServeCommand,fXe as runSetupCommand,$Xe as runStatusCommand,lXe as runSyncCommand,pXe as runUpdateCommand}; diff --git a/spec.yaml b/spec.yaml index 7038149..efe3dfa 100644 --- a/spec.yaml +++ b/spec.yaml @@ -54,7 +54,7 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 280 + features: 281 scenarios: 2 capabilities: 6 - test_files: 257 + test_files: 259 diff --git a/spec/attestation.yaml b/spec/attestation.yaml index 38cd28e..9311ffe 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -26,12 +26,12 @@ attested_modules: CHANGELOG.md: b15c6185d8326b9b CLAUDE.md: 9f2fa4edd5c6df80 GOVERNANCE.md: 21cc28eaaf637a20 - README.html: 736f4c0126990f5b - README.ja.md: 82b53a627e2d1b1f - README.ko.html: efbfce7cab897fb6 - README.ko.md: 3f31659ae168dcb1 - README.md: 4b06c324d8168a7c - README.zh.md: c7ac2cfce5153064 + README.html: 238c9d2f0b277e22 + README.ja.md: 22f0dc832db0fa5e + README.ko.html: ee75bfe5b5a1bc76 + README.ko.md: 3ca7d8b31a5e3ce6 + README.md: 562ae2d94af38500 + README.zh.md: 695a60c73fd01383 SECURITY.md: df1d0c80304b2f28 bin/clad: 77b80666665dd1b0 conformance/fixtures.yaml: 5b461bb43a79a983 @@ -123,7 +123,7 @@ attested_modules: skills/serve/SKILL.md: f08bbdbbfeb05041 skills/status/SKILL.md: 09faadc50b3449da skills/sync/SKILL.md: 775c0f990a52a3d9 - spec.yaml: 92fb4b9e3ef75577 + spec.yaml: 9b979cd4e7d137d2 spec/README.md: 7c257426396d435c spec/architecture.yaml: f0888480405a13a8 spec/features/: a4d0f0eb87fed960 @@ -157,7 +157,7 @@ attested_modules: src/cli/benchmark.ts: 77f84d2a898d724f src/cli/changelog.ts: 2de1adb009b89ab4 src/cli/ci-version.ts: 9fce2c2d7415b4ca - src/cli/clad.ts: dc3a50b14786e23b + src/cli/clad.ts: 8705b384a37f38e1 src/cli/clarify.ts: f17177969d5b75ff src/cli/doctor-hosts.ts: 1f0c2cec5a310b81 src/cli/doctor.ts: 50d904fdbfe7e942 @@ -267,7 +267,7 @@ attested_modules: src/stages/arch.ts: 268422e53c6d20bb src/stages/audit.ts: 3ba117606f8a81a1 src/stages/commit.ts: f6b6836af0a4d96c - src/stages/cov.ts: 3dbe8381e374e8c0 + src/stages/cov.ts: 4529f5e80bda08fd src/stages/deliverable-smoke.ts: 9ecfd4210e6ec5c0 src/stages/detector-result-cache.ts: 93ea6af02ef361c5 src/stages/detectors/README.md: 3fe2c865aa2adcba @@ -320,7 +320,7 @@ attested_modules: src/stages/finding-parser.ts: d9cd56dbe3c3b9a7 src/stages/graph-health.ts: a294f06796b0e293 src/stages/junit-report.ts: f8466dc1e00140f1 - src/stages/lint.ts: e9c4505e587e6088 + src/stages/lint.ts: e2bd76900a583983 src/stages/perf.ts: 2b27c12427f65b2e src/stages/secret.ts: b90abc0e00c86219 src/stages/skip-policy.ts: 1a6412d708561cf0 @@ -334,11 +334,11 @@ attested_modules: src/stages/toolchain/module-scope.ts: 88358ec3b84eedd3 src/stages/toolchain/scoped-command.ts: f2dd6410c063279f src/stages/toolchain/types.ts: 05f018fb3dddc321 - src/stages/type.ts: 0ac37e45b407446d - src/stages/types.ts: 95e8c9e13187d85b + src/stages/type.ts: 56c43d7954c25db3 + src/stages/types.ts: ccc885299871e57f src/stages/uat.ts: 62ec3e37a124f8c5 - src/stages/unit.ts: b503350b0e5c7e5a - src/stages/util.ts: 7c49de3250816de8 + src/stages/unit.ts: 7471a2cca0c969d6 + src/stages/util.ts: c9e18d2c9cd90dba src/stages/vacuous-tests.ts: 8e71b81e151325af src/stages/visual.ts: 2b60dd991fa8124e src/ui: a4d0f0eb87fed960 @@ -676,6 +676,7 @@ attested_features: F-bdcd90: ok F-be5306eb: ok F-c037ae: ok + F-c17e1edc: ok F-c2c996: ok F-c3747d7d: ok F-c48eb2: ok diff --git a/spec/features/skip-exit-guidance-c17e1edc.yaml b/spec/features/skip-exit-guidance-c17e1edc.yaml new file mode 100644 index 0000000..d0360b7 --- /dev/null +++ b/spec/features/skip-exit-guidance-c17e1edc.yaml @@ -0,0 +1,63 @@ +id: F-c17e1edc +slug: skip-exit-guidance +title: "Runner-less skips name their exit: gate.commands guidance" +status: done +modules: + - src/stages/types.ts + - src/stages/type.ts + - src/stages/lint.ts + - src/stages/unit.ts + - src/stages/cov.ts + - src/stages/util.ts + - src/cli/clad.ts +acceptance_criteria: + - id: AC-4b7d20e5 + ears: ubiquitous + action: "tag every skip result with a structured reason — 'no-runner' when a command stage skips because no runner is registered for the project's language, 'tool-missing' when the resolved tool is absent or npx cannot fetch it — leaving by-design skips (missing oracles, no declared deliverable) untagged" + response: "the machine surface distinguishes 'cladding does not know how to run this' from 'this stage does not apply', without changing any existing stderr string, exit code, or skip semantics" + text: "The system shall carry a structured skipReason ('no-runner' | 'tool-missing') on command-stage skip results, tagged at the production sites, with by-design skips untagged and every existing skip message byte-identical." + notes: | + ## Why + Measured on a zig adopter: six of nine stages skip, and the six split into + two classes — four say "no registered for language" (curable by + declaring gate.commands) and two are by-design (oracle absence, no + deliverable) where that cure is a false prescription. Blanket guidance + would lie on two stages; a stderr regex would be a parser where a field + belongs. + test_refs: ["tests/cli/skip-exit-guidance.test.ts", "tests/cli/gate-golden-matrix.test.ts"] + - id: AC-90c3f1a8 + ears: event + condition: "when a check run finishes with at least one no-runner skip and text output is active" + action: "print exactly one trailing info line that lists the skipped stage labels and shows the concrete remedy inline — declaring commands under gate.commands in .cladding/config.yaml — noting the file is committable so CI runs the same gate" + response: "an adopter whose language cladding cannot drive sees, at the moment of the skip, the one declaration that turns those stages on — measured true end-to-end before this feature was designed: declaring gate.commands flips all four stages from skip to run through the shipped binary" + text: "When at least one stage skipped for lack of a runner, the system shall print one info line naming those stages and the gate.commands declaration inline, and shall print nothing when no such skip occurred." + notes: | + ## Why + The exit exists but is invisible: across every adopter-reachable surface + (gate output, READMEs, managed AGENTS.md, doctor, MCP tool descriptions) + gate.commands is mentioned once — a CHANGELOG line. The gate.language + external E2E proved this exact configuration fails: removing that one + line left a fully-capable AI unable to find the exit. The guidance is + inline (key path + example) because docs/ does not ship in the npm + package. The language name is not printed — it reads 'unknown' in the + motivating case. + test_refs: ["tests/cli/skip-exit-guidance.test.ts"] + - id: AC-2f6e88d0 + ears: unwanted + condition: "if every skip is by-design or tool-missing, or gate.commands is already declared, or all stages ran" + action: "print no guidance line" + response: "the by-design skips (spec-conformance oracles, deliverable smoke) never carry a false prescription, a tool-missing skip is not advised to declare commands it already has, and a fully-driven project sees nothing new — measured 4/0/0/0 across the four guard environments before implementation" + text: "If no stage skipped for lack of a runner, the system shall print no guidance." + test_refs: ["tests/cli/skip-exit-guidance.test.ts"] + - id: AC-b59a37c4 + ears: event + condition: "when check emits its JSON report" + action: "include the skipReason field on each skipped stage entry that carries one" + response: "MCP and CI consumers receive the same discrimination the terminal renders, additively — no existing JSON field changes" + text: "When emitting JSON, the system shall include skipReason on tagged stage entries and change no existing field." + test_refs: ["tests/cli/skip-exit-guidance.test.ts"] +design_impact: + classification: none + rationale: "Additive observability: a structured reason on an existing skip lane and one rendered line. No gate decision, severity, or stage semantics change; skips stay skips." + status: resolved + artifacts: [] diff --git a/spec/index.yaml b/spec/index.yaml index 4b12c5a..8936f07 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -234,6 +234,7 @@ features: F-bdcd90: {slug: oracle-policy-risk-weighted, status: done, modules: 8} F-be5306eb: {slug: cold-start-cycle-signal, status: done, modules: 3} F-c037ae: {slug: test-refs-repair, status: done, modules: 4} + F-c17e1edc: {slug: skip-exit-guidance, status: done, modules: 7} F-c2c996: {slug: checkpoint-events, status: done, modules: 3} F-c3747d7d: {slug: spec-first-window-complete, status: done, modules: 5} F-c48eb2: {slug: scan-source-roots, status: done, modules: 5} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index 02cf137..dc8e3ca 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -491,6 +491,13 @@ export interface StageOutcome { readonly stderr?: string; /** Structured drift findings (only the drift stage carries these). */ readonly findings?: readonly DriftFinding[]; + /** + * WHY a skipped stage skipped (F-c17e1edc), carried through from the stage + * result: `no-runner` = cladding knows no command for this project (curable + * by declaring `gate.commands`), `tool-missing` = the command is known but + * absent here. By-design skips (no oracle, no deliverable) carry nothing. + */ + readonly skipReason?: 'no-runner' | 'tool-missing'; } /** Outcome of running a tier's stages — exported so `clad done` can gate on @@ -508,6 +515,28 @@ export interface CheckOutcome { readonly stages?: readonly StageOutcome[]; } +/** + * Renders the one trailing line a runner-less project needs (F-c17e1edc). + * + * WHY: on a project whose language cladding cannot drive, the command stages + * skip silently and the exit is invisible — `gate.commands` appears nowhere an + * adopter reaches (gate output, doctor, READMEs), so a fully-capable agent + * still could not find it. The remedy is inline (key path + example) because + * `docs/` does not ship in the npm package. The language name is deliberately + * absent: it reads `'unknown'` in exactly the case this fires. + * + * @param labels - Labels of the stages that skipped for lack of a runner, in run order. + * @returns The guidance line, or `''` when nothing skipped that way (print nothing). + */ +export function renderNoRunnerGuidance(labels: readonly string[]): string { + if (labels.length === 0) return ''; + return ( + `${labels.join(', ')} skipped — no runner is known for this project. ` + + 'Declare commands in .cladding/config.yaml (gate: → commands: → e.g. test: ["zig","test"]) ' + + 'to run them; the file is committable, so CI runs the same gate you do.' + ); +} + /** * Runs a tier's Iron Law stages in-process and reports the worst exit code. * Shared by `clad check` (which wraps it with `process.exit`) and `clad done` @@ -562,7 +591,7 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier // Mutable during the run (the EXEMPT half below rewrites the drift row); the // element shape matches StageOutcome exactly, so `collected` returns cleanly // as `readonly StageOutcome[]`. - const collected: {stage: string; label: string; status: GateStatus; exitCode: number; stderr?: string; findings?: readonly DriftFinding[]}[] = []; + const collected: {stage: string; label: string; status: GateStatus; exitCode: number; stderr?: string; findings?: readonly DriftFinding[]; skipReason?: 'no-runner' | 'tool-missing'}[] = []; // F-e53596dd — prime the run-scoped detector cache so the drift stage's // ARCHITECTURE_VIOLATION + HARDCODED_SECRET runs are reused by stage_1.5/1.6 // instead of re-spawning madge + secretlint (~5s of duplicate work per run). @@ -582,6 +611,7 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier stderr?: string; findings?: readonly DriftFinding[]; disposition?: Disposition; + skipReason?: 'no-runner' | 'tool-missing'; }; const label = opts.internal ? name : gateLabel(name); // INVARIANT: exitCode 2 means "skipped" (cladding chose not to run — tool @@ -595,7 +625,9 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier anyFailed = true; worst = Math.max(worst, worstContribution(r, status)); } - collected.push({stage: name, label, status, exitCode: r.exitCode, stderr: r.stderr, findings: r.findings}); + // `skipReason` rides along additively (F-c17e1edc) — the --json writer + // serializes `collected` wholesale, so no field whitelist to update. + collected.push({stage: name, label, status, exitCode: r.exitCode, stderr: r.stderr, findings: r.findings, skipReason: r.skipReason}); if (!opts.json && !silent) { pulse(pulseKindOf(status), label); if (isBlocking(status)) printStageDetails(r); @@ -684,6 +716,16 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier } else if (anyFailed && !silent) { process.stdout.write('\nℹ Run `clad doctor` for the event log, or `clad sync` to check the spec. The findings above say what drifted and why.\n'); } + // F-c17e1edc — name the exit for the curable skips only. A no-runner skip is + // one declaration away from running; a tool-missing skip already HAS its + // command, and a by-design skip (no oracle / no deliverable) would be given a + // false prescription — so both stay out of the line, and out of its list. + if (!opts.json && !silent) { + const guidance = renderNoRunnerGuidance( + collected.filter((c) => c.skipReason === 'no-runner').map((c) => c.label), + ); + if (guidance) process.stdout.write(`\nℹ ${guidance}\n`); + } // F-b84c38 + F-1aab1bba — verification freshness and Stop follow-through // need one gate record. Compact blocker names explain rejected done attempts; // the Stop-compatible trio fingerprint lets read-time analysis determine diff --git a/src/stages/cov.ts b/src/stages/cov.ts index 7b7afff..0a41715 100644 --- a/src/stages/cov.ts +++ b/src/stages/cov.ts @@ -36,6 +36,8 @@ export function runCov(opts: CommandStageOptions = {}): StageResult { pass: false, exitCode: 2, stderr: `no coverage runner registered for language '${language}'`, + // F-c17e1edc — curable skip: declaring gate.commands.coverage turns this on. + skipReason: 'no-runner', }; } // F-49f6f2d2 (#215): on a primed vitest gate the unit stage (stage_2.1) already diff --git a/src/stages/lint.ts b/src/stages/lint.ts index 5fa08b8..8f5faee 100644 --- a/src/stages/lint.ts +++ b/src/stages/lint.ts @@ -60,6 +60,8 @@ export function runLint(opts: CommandStageOptions = {}): StageResult { pass: false, exitCode: 2, stderr: `no linter registered for language '${language}'`, + // F-c17e1edc — curable skip: declaring gate.commands.lint turns this on. + skipReason: 'no-runner', }; } const proc = execaSync(cmd, [...args], {cwd, reject: false}); diff --git a/src/stages/type.ts b/src/stages/type.ts index b8cf5f6..e4055d7 100644 --- a/src/stages/type.ts +++ b/src/stages/type.ts @@ -53,6 +53,8 @@ export function runType(opts: CommandStageOptions = {}): StageResult { pass: false, exitCode: 2, stderr: `no type checker registered for language '${language}'`, + // F-c17e1edc — curable skip: declaring gate.commands.type turns this on. + skipReason: 'no-runner', }; } const proc = execaSync(cmd, [...args], {cwd, reject: false}); diff --git a/src/stages/types.ts b/src/stages/types.ts index 2a6ad7d..835971b 100644 --- a/src/stages/types.ts +++ b/src/stages/types.ts @@ -61,6 +61,19 @@ export interface StageResult { * absent on green stages and on stages with no known fix command. */ readonly hint?: string; + /** + * NEW (F-c17e1edc) — WHY this skip (exitCode 2) happened, structured so the + * renderer and machine consumers stop parsing stderr prose: + * no-runner — cladding knows no command for this stage in this project + * (`no registered for language '…'`). Curable by ONE + * declaration: `gate.commands` in `.cladding/config.yaml`. + * tool-missing — the resolved tool is absent (ENOENT) or `npx` cannot fetch + * it offline. The command IS known; the environment lacks it. + * By-design skips stay UNTAGGED — a missing spec-conformance oracle or an + * undeclared deliverable is "this stage does not apply", and prescribing + * `gate.commands` there would be a false cure. Absent on pass/fail results. + */ + readonly skipReason?: 'no-runner' | 'tool-missing'; } /** Shared options for any stage that wraps an external command. */ diff --git a/src/stages/unit.ts b/src/stages/unit.ts index 192b188..f9d8024 100644 --- a/src/stages/unit.ts +++ b/src/stages/unit.ts @@ -200,6 +200,8 @@ export function runUnit(opts: UnitStageOptions = {}): StageResult { pass: false, exitCode: 2, stderr: `no unit test runner registered for language '${language}'`, + // F-c17e1edc — curable skip: declaring gate.commands.test turns this on. + skipReason: 'no-runner', }; } // Guard applies only under --strict on a vitest runner (the only path we can diff --git a/src/stages/util.ts b/src/stages/util.ts index 2a45968..3be6564 100644 --- a/src/stages/util.ts +++ b/src/stages/util.ts @@ -104,7 +104,9 @@ export function missingToolSkip( args: readonly string[] = [], ): StageResult | null { if (isMissingBinary(proc)) { - return {stage, pass: false, exitCode: 2, stderr: `'${cmd}' not installed`}; + // F-c17e1edc — the command IS known; the environment lacks it. Tagged + // `tool-missing` so the renderer never prescribes `gate.commands` here. + return {stage, pass: false, exitCode: 2, stderr: `'${cmd}' not installed`, skipReason: 'tool-missing'}; } const output = `${String(proc.stderr ?? '')}\n${String(proc.stdout ?? '')}`; const npxResolutionFailure = @@ -121,6 +123,9 @@ export function missingToolSkip( stderr: "setup gap: 'npx' could not resolve the configured tool without installing it; " + 'the inferred tool is not installed or unavailable offline', + // F-c17e1edc — same lane as ENOENT: a resolution/installation gap, not an + // absent runner declaration. + skipReason: 'tool-missing', }; } return null; diff --git a/tests/cli/skip-exit-guidance.test.ts b/tests/cli/skip-exit-guidance.test.ts new file mode 100644 index 0000000..15f4b94 --- /dev/null +++ b/tests/cli/skip-exit-guidance.test.ts @@ -0,0 +1,284 @@ +// Cladding · F-c17e1edc — runner-less skips name their exit. +// +// Two halves, tested apart: +// ① the TAG — a command stage that skips because cladding knows no runner for +// this project carries `skipReason: 'no-runner'`; an absent/unfetchable tool +// carries `'tool-missing'`; a by-design skip (no oracle, no deliverable) +// carries nothing. Driven against REAL stage runners on a temp fixture whose +// language cladding cannot drive (.zig), because the split this feature turns +// on is a property of the real toolchain resolver, not of a stub. +// ② the LINE — `runCheckStages` lists the tagged stages once, with the +// `gate.commands` remedy inline, and stays silent for every other skip +// class. Driven against stubbed stages so the matrix is exact and fast. +// +// The existing stderr strings are asserted byte-for-byte here: this feature is +// additive, so a reworded skip message is a regression, not a refactor. + +import {mkdirSync, mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest'; + +type StageResult = { + pass: boolean; + exitCode: number; + stderr?: string; + skipReason?: 'no-runner' | 'tool-missing'; +}; + +const PASS: StageResult = {pass: true, exitCode: 0}; +const noRunner = (stderr: string): StageResult => ({pass: false, exitCode: 2, stderr, skipReason: 'no-runner'}); +const TOOL_MISSING: StageResult = {pass: false, exitCode: 2, stderr: "'zig' not installed", skipReason: 'tool-missing'}; +const BY_DESIGN: StageResult = {pass: false, exitCode: 2, stderr: 'no project.deliverable declared — skipped'}; + +// One swappable vi.fn per stage (same shape as the gate golden matrix) so each +// case re-targets outcomes without re-mocking modules. +const stubs = { + 'stage_1.1': vi.fn((): StageResult => PASS), + 'stage_1.2': vi.fn((): StageResult => PASS), + 'stage_1.3': vi.fn((): StageResult => PASS), + 'stage_1.4': vi.fn((): StageResult => PASS), + 'stage_1.5': vi.fn((): StageResult => PASS), + 'stage_1.6': vi.fn((): StageResult => PASS), + 'stage_2.1': vi.fn((): StageResult => PASS), + 'stage_2.2': vi.fn((): StageResult => PASS), + 'stage_2.3': vi.fn((): StageResult => PASS), + 'stage_2.4': vi.fn((): StageResult => PASS), +} as const; + +vi.mock('../../src/stages/type.js', () => ({runType: () => stubs['stage_1.1']()})); +vi.mock('../../src/stages/lint.js', () => ({runLint: () => stubs['stage_1.2']()})); +vi.mock('../../src/stages/drift.js', () => ({runDrift: () => stubs['stage_1.3']()})); +vi.mock('../../src/stages/commit.js', () => ({runCommit: () => stubs['stage_1.4']()})); +vi.mock('../../src/stages/arch.js', () => ({runArch: () => stubs['stage_1.5']()})); +vi.mock('../../src/stages/secret.js', () => ({runSecret: () => stubs['stage_1.6']()})); +vi.mock('../../src/stages/unit.js', () => ({runUnit: () => stubs['stage_2.1']()})); +vi.mock('../../src/stages/cov.js', () => ({runCov: () => stubs['stage_2.2']()})); +vi.mock('../../src/stages/spec-conformance.js', () => ({runSpecConformance: () => stubs['stage_2.3']()})); +vi.mock('../../src/stages/deliverable-smoke.js', () => ({runDeliverableSmoke: () => stubs['stage_2.4']()})); + +// The gate ledger is the real repo's; a unit test must never append to it. +const recordEventMock = vi.fn(); +vi.mock('../../src/events/log.js', () => ({recordEvent: (...a: unknown[]) => recordEventMock(...(a as []))})); + +const clad = await import('../../src/cli/clad.js'); + +// The REAL runners, reached past the stubs above — half ① drives these. +const {runType} = await vi.importActual('../../src/stages/type.js'); +const {runLint} = await vi.importActual('../../src/stages/lint.js'); +const {runUnit} = await vi.importActual('../../src/stages/unit.js'); +const {runCov} = await vi.importActual('../../src/stages/cov.js'); +const {runSpecConformance} = + await vi.importActual('../../src/stages/spec-conformance.js'); +const {runDeliverableSmoke} = + await vi.importActual('../../src/stages/deliverable-smoke.js'); +const {missingToolSkip} = await vi.importActual('../../src/stages/util.js'); + +const SPEC = `schema: "0.1" +project: + name: zigdemo + language: zig +features: + - id: F-a1b2c3d4 + title: "Add two numbers" + status: planned + modules: ["src/main.zig"] + acceptance_criteria: + - id: AC-11112222 + text: "The system shall add two numbers." +`; + +/** A project whose language cladding has no registered runner for. */ +function makeRunnerlessProject(): string { + const dir = mkdtempSync(join(tmpdir(), 'clad-skipexit-')); + mkdirSync(join(dir, 'src'), {recursive: true}); + writeFileSync(join(dir, 'spec.yaml'), SPEC); + writeFileSync(join(dir, 'src', 'main.zig'), 'pub fn add(a: i32, b: i32) i32 {\n return a + b;\n}\n'); + writeFileSync(join(dir, 'src', 'util.zig'), 'pub fn double(a: i32) i32 {\n return a * 2;\n}\n'); + return dir; +} + +/** The same project after the one declaration that turns the four stages on. */ +function declareGateCommands(dir: string): void { + mkdirSync(join(dir, '.cladding'), {recursive: true}); + writeFileSync( + join(dir, '.cladding', 'config.yaml'), + `gate: + commands: + type: ["node", "--version"] + lint: ["node", "--version"] + test: ["node", "--version"] + coverage: ["node", "--version"] +`, + ); +} + +let dir: string; +beforeEach(() => { + dir = makeRunnerlessProject(); + for (const fn of Object.values(stubs)) fn.mockImplementation(() => PASS); +}); +afterEach(() => { + rmSync(dir, {recursive: true, force: true}); + vi.clearAllMocks(); + vi.restoreAllMocks(); +}); + +describe('AC-4b7d20e5 — every skip carries a structured reason, or none by design', () => { + test('the four command stages of a runner-less project tag no-runner, message byte-identical', () => { + const results = [ + {r: runType({cwd: dir}), stderr: "no type checker registered for language 'unknown'"}, + {r: runLint({cwd: dir}), stderr: "no linter registered for language 'unknown'"}, + {r: runUnit({cwd: dir}), stderr: "no unit test runner registered for language 'unknown'"}, + {r: runCov({cwd: dir}), stderr: "no coverage runner registered for language 'unknown'"}, + ]; + for (const {r, stderr} of results) { + expect(r.exitCode, r.stage).toBe(2); + expect(r.pass, r.stage).toBe(false); + expect(r.stderr, r.stage).toBe(stderr); + expect(r.skipReason, r.stage).toBe('no-runner'); + } + }); + + test('by-design skips stay untagged — the gate.commands cure would be a false prescription', () => { + const conformance = runSpecConformance({cwd: dir}); + const smoke = runDeliverableSmoke({cwd: dir}); + expect(conformance.exitCode).toBe(2); + expect(conformance.stderr).toBe('no spec-conformance oracles under tests/oracle/ — skipped'); + expect(conformance.skipReason).toBeUndefined(); + expect(smoke.exitCode).toBe(2); + expect(smoke.stderr).toBe('no project.deliverable declared — skipped'); + expect(smoke.skipReason).toBeUndefined(); + }); + + test('an absent binary is tool-missing, never no-runner — the command IS known here', () => { + const enoent = missingToolSkip('stage_1.1', 'zig', {code: 'ENOENT'}); + expect(enoent).toEqual({stage: 'stage_1.1', pass: false, exitCode: 2, stderr: "'zig' not installed", skipReason: 'tool-missing'}); + + const npxUnresolvable = missingToolSkip( + 'stage_2.1', + 'npx', + {exitCode: 1, stderr: 'npm error canceled due to missing packages'}, + ['vitest', 'run'], + ); + expect(npxUnresolvable?.exitCode).toBe(2); + expect(npxUnresolvable?.skipReason).toBe('tool-missing'); + expect(npxUnresolvable?.stderr).toBe( + "setup gap: 'npx' could not resolve the configured tool without installing it; " + + 'the inferred tool is not installed or unavailable offline', + ); + + // …and through a real stage whose resolved command does not exist. + const staged = runType({cwd: dir, cmd: 'clad-no-such-binary-xyz', args: []}); + expect(staged.exitCode).toBe(2); + expect(staged.skipReason).toBe('tool-missing'); + expect(staged.skipReason).not.toBe('no-runner'); + }); + + test('a tool that RAN is not tagged at all — skipReason lives only on the skip lane', () => { + declareGateCommands(dir); + for (const r of [runType({cwd: dir}), runLint({cwd: dir}), runUnit({cwd: dir}), runCov({cwd: dir})]) { + expect(r.pass, r.stage).toBe(true); + expect(r.exitCode, r.stage).toBe(0); + expect(r.skipReason, r.stage).toBeUndefined(); + } + }); +}); + +describe('AC-90c3f1a8 / AC-2f6e88d0 — the guidance text', () => { + test('names every skipped stage and carries the remedy inline, on one line', () => { + const line = clad.renderNoRunnerGuidance(['Type', 'Lint', 'Unit tests', 'Coverage']); + for (const label of ['Type', 'Lint', 'Unit tests', 'Coverage']) expect(line).toContain(label); + expect(line).toContain('.cladding/config.yaml'); + expect(line).toContain('gate:'); + expect(line).toContain('commands:'); + expect(line).toContain('committable'); + expect(line).not.toContain('\n'); + // The language name is deliberately absent — it reads 'unknown' exactly when + // this fires, which names nothing an adopter can act on. + expect(line).not.toContain('unknown'); + }); + + test('nothing to say when nothing skipped for lack of a runner', () => { + expect(clad.renderNoRunnerGuidance([])).toBe(''); + }); +}); + +describe('AC-90c3f1a8 / AC-2f6e88d0 / AC-b59a37c4 — what a check run renders and reports', () => { + let stdout: string; + beforeEach(() => { + stdout = ''; + vi.spyOn(process.stdout, 'write').mockImplementation(((s: unknown) => { + stdout += String(s); + return true; + }) as never); + }); + + const runnerlessGate = (): void => { + stubs['stage_1.1'].mockImplementation(() => noRunner("no type checker registered for language 'unknown'")); + stubs['stage_1.2'].mockImplementation(() => noRunner("no linter registered for language 'unknown'")); + stubs['stage_2.1'].mockImplementation(() => noRunner("no unit test runner registered for language 'unknown'")); + stubs['stage_2.2'].mockImplementation(() => noRunner("no coverage runner registered for language 'unknown'")); + stubs['stage_2.3'].mockImplementation(() => BY_DESIGN); + stubs['stage_2.4'].mockImplementation(() => BY_DESIGN); + }; + + test('one line, listing the four stages in run order, and the skips stay non-blocking', () => { + runnerlessGate(); + const out = clad.runCheckStages({tier: 'pre-push'}); + const hits = stdout.split('no runner is known for this project').length - 1; + expect(hits).toBe(1); + expect(stdout).toContain('Type, Lint, Unit tests, Coverage skipped — no runner is known for this project.'); + expect(stdout).toContain('.cladding/config.yaml'); + expect(out.worst).toBe(0); + expect(out.anyFailed).toBe(false); + }); + + test('an all-green run says nothing new', () => { + const out = clad.runCheckStages({tier: 'pre-push'}); + expect(stdout).not.toContain('no runner is known'); + expect(out.worst).toBe(0); + }); + + test('by-design and tool-missing skips alone print nothing', () => { + stubs['stage_1.1'].mockImplementation(() => TOOL_MISSING); + stubs['stage_2.3'].mockImplementation(() => BY_DESIGN); + stubs['stage_2.4'].mockImplementation(() => BY_DESIGN); + clad.runCheckStages({tier: 'pre-push'}); + expect(stdout).not.toContain('no runner is known'); + }); + + test('a tool-missing stage is not listed even when the line does fire', () => { + runnerlessGate(); + stubs['stage_1.2'].mockImplementation(() => TOOL_MISSING); // Lint has its command; it is just absent + clad.runCheckStages({tier: 'pre-push'}); + expect(stdout).toContain('Type, Unit tests, Coverage skipped — no runner is known for this project.'); + expect(stdout).not.toContain('Lint,'); + }); + + test('JSON carries the same discrimination and no prose', () => { + runnerlessGate(); + clad.runCheckStages({tier: 'pre-push', json: true}); + const doc = JSON.parse(stdout) as {stages: {stage: string; status: string; exitCode: number; skipReason?: string}[]}; + const bs = new Map(doc.stages.map((s) => [s.stage, s])); + for (const id of ['stage_1.1', 'stage_1.2', 'stage_2.1', 'stage_2.2']) { + expect(bs.get(id)?.skipReason, id).toBe('no-runner'); + expect(bs.get(id)?.status, id).toBe('skip'); + expect(bs.get(id)?.exitCode, id).toBe(2); + } + for (const id of ['stage_2.3', 'stage_2.4']) { + expect(bs.get(id), id).toBeDefined(); + expect(bs.get(id)).not.toHaveProperty('skipReason'); + } + expect(bs.get('stage_1.3')).not.toHaveProperty('skipReason'); + expect(stdout).not.toContain('no runner is known'); + }); + + test('the verdict poll observes without speaking', () => { + runnerlessGate(); + const out = clad.runCheckStages({tier: 'pre-push', silent: true}); + expect(stdout).toBe(''); + expect(out.stages?.find((s) => s.stage === 'stage_1.1')?.skipReason).toBe('no-runner'); + }); +}); diff --git a/tests/cli/skip-guidance-evidence.test.ts b/tests/cli/skip-guidance-evidence.test.ts new file mode 100644 index 0000000..5cfa9f6 --- /dev/null +++ b/tests/cli/skip-guidance-evidence.test.ts @@ -0,0 +1,173 @@ +// Cladding · impl-blind oracle for F-c17e1edc — authored from the spec contract only. +// +// AC under test: runner-less skips name their exit. +// 1. No registered runner for the project language -> the four command stages +// ('Type', 'Lint', 'Unit tests', 'Coverage') end status 'skip' AND carry +// skipReason: 'no-runner'. +// 2. By-design skips ('Spec conformance', 'Deliverable smoke') stay skip/na and +// carry NO skipReason. +// 3. With gate.commands declared in .cladding/config.yaml those four stages no +// longer skip and carry no skipReason. +// 4. skipReason is only ever 'no-runner' | 'tool-missing' | absent — on any stage. +// 5. The runner-less stderr message is unchanged: /no .* registered for language/. +// +// Written without reading src/cli/clad.ts — behaviour is asserted against the +// declared public surface `runCheckStages({tier, silent}) -> {stages: [...]}` only. + +import {afterAll, beforeAll, describe, expect, it} from 'vitest'; +import {mkdirSync, mkdtempSync, rmSync, writeFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import {join} from 'node:path'; + +import {runCheckStages} from '../../src/cli/clad.js'; + +type StageRow = { + stage?: unknown; + label?: string; + status?: string; + exitCode?: number; + stderr?: string; + skipReason?: string; +}; +type CheckResult = {stages: StageRow[]}; + +const COMMAND_LABELS = ['Type', 'Lint', 'Unit tests', 'Coverage'] as const; +const BY_DESIGN_SKIP_LABELS = ['Spec conformance', 'Deliverable smoke'] as const; +const ALLOWED_SKIP_REASONS = ['no-runner', 'tool-missing']; +const RUNNERLESS_STDERR = /no .* registered for language/; + +const GATE_COMMANDS_YAML = [ + 'gate:', + ' commands:', + ' type: ["node", "--version"]', + ' lint: ["node", "--version"]', + ' test: ["node", "--version"]', + ' coverage: ["node", "--version"]', + '', +].join('\n'); + +/** A project in a language with no registered runner: a tree of .zig files. */ +function makeFixture(withGateCommands: boolean): string { + const dir = mkdtempSync(join(tmpdir(), 'clad-oracle-c17e1edc-')); + writeFileSync( + join(dir, 'spec.yaml'), + 'schema: "0.1"\nproject: {name: x, language: zig}\nfeatures: []\n', + 'utf8', + ); + mkdirSync(join(dir, 'spec', 'features'), {recursive: true}); + mkdirSync(join(dir, 'src', 'core'), {recursive: true}); + for (let i = 0; i < 6; i++) { + writeFileSync(join(dir, 'src', 'core', `f${i}.zig`), '// x\n', 'utf8'); + } + if (withGateCommands) { + mkdirSync(join(dir, '.cladding'), {recursive: true}); + writeFileSync(join(dir, '.cladding', 'config.yaml'), GATE_COMMANDS_YAML, 'utf8'); + } + return dir; +} + +/** runCheckStages has no cwd parameter — stages run in '.', so chdir around it. */ +function runInDir(dir: string): CheckResult { + if (typeof process.chdir !== 'function') { + throw new Error( + 'process.chdir is unavailable in this vitest pool; this oracle needs a pool where cwd can be changed (forks)', + ); + } + const origin = process.cwd(); + process.chdir(dir); + try { + return runCheckStages({tier: 'pre-push', silent: true} as never) as unknown as CheckResult; + } finally { + process.chdir(origin); + } +} + +function stageByLabel(result: CheckResult, label: string): StageRow { + const row = result.stages.find(s => s.label === label); + expect(row, `expected a stage labelled '${label}' in: ${labelsOf(result).join(', ')}`).toBeDefined(); + return row as StageRow; +} + +function labelsOf(result: CheckResult): string[] { + return result.stages.map(s => String(s.label)); +} + +let dirNoRunner = ''; +let dirConfigured = ''; +let noRunner: CheckResult; +let configured: CheckResult; + +beforeAll(() => { + dirNoRunner = makeFixture(false); + dirConfigured = makeFixture(true); + // One real gate run per fixture; every assertion below reuses these two results. + noRunner = runInDir(dirNoRunner); + configured = runInDir(dirConfigured); +}, 300_000); + +afterAll(() => { + for (const dir of [dirNoRunner, dirConfigured]) { + if (dir) rmSync(dir, {recursive: true, force: true}); + } +}); + +describe('F-c17e1edc — runner-less skips name their exit', () => { + it('produces a stage list for both fixtures', () => { + expect(Array.isArray(noRunner?.stages)).toBe(true); + expect(noRunner.stages.length).toBeGreaterThan(0); + expect(Array.isArray(configured?.stages)).toBe(true); + expect(configured.stages.length).toBeGreaterThan(0); + }); + + it.each(COMMAND_LABELS)( + "with no registered runner, the '%s' stage skips with skipReason 'no-runner'", + label => { + const row = stageByLabel(noRunner, label); + expect(row.status, `status of '${label}'`).toBe('skip'); + expect(row.skipReason, `skipReason of '${label}'`).toBe('no-runner'); + }, + ); + + it.each(BY_DESIGN_SKIP_LABELS)( + "the by-design skip '%s' carries no skipReason", + label => { + const row = stageByLabel(noRunner, label); + expect(['skip', 'na'], `status of '${label}'`).toContain(String(row.status)); + expect(row.skipReason, `skipReason of '${label}'`).toBeUndefined(); + }, + ); + + it.each(COMMAND_LABELS)( + "with gate.commands declared, the '%s' stage no longer skips and names no exit", + label => { + const row = stageByLabel(configured, label); + expect(row.status, `status of '${label}' with gate.commands`).not.toBe('skip'); + expect(row.skipReason, `skipReason of '${label}' with gate.commands`).toBeUndefined(); + }, + ); + + it('never emits a skipReason outside the declared vocabulary, in either fixture', () => { + const offenders: string[] = []; + for (const [fixture, result] of [ + ['no-runner fixture', noRunner], + ['gate.commands fixture', configured], + ] as const) { + for (const row of result.stages) { + if (row.skipReason === undefined) continue; + if (!ALLOWED_SKIP_REASONS.includes(row.skipReason)) { + offenders.push(`${fixture}: '${row.label}' -> ${JSON.stringify(row.skipReason)}`); + } + } + } + expect(offenders, `skipReason must be one of ${ALLOWED_SKIP_REASONS.join(' | ')} or absent`).toEqual([]); + }); + + it.each(COMMAND_LABELS)( + "the '%s' runner-less skip still explains itself in stderr", + label => { + const row = stageByLabel(noRunner, label); + expect(row.status).toBe('skip'); + expect(String(row.stderr ?? ''), `stderr of '${label}'`).toMatch(RUNNERLESS_STDERR); + }, + ); +});