From 5c521a5889de65b259400c9869479b6677c65835 Mon Sep 17 00:00:00 2001 From: sungju Yun Date: Mon, 29 Jun 2026 20:53:35 +0900 Subject: [PATCH] perf(gate): spawn secretlint/madge once per gate via a gate-scoped scanner memo (F-5a49899e) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HARDCODED_SECRET (secretlint, ~4.4s) and ARCHITECTURE_VIOLATION (madge, ~1.4s) shell out to an external tool — together ~97% of the drift stage. They ran TWICE per gate: once inside the Drift stage (stage_1.3 sweeps every detector) and again as their dedicated Secret (stage_1.6) / Arch (stage_1.5) stage. secret.ts even documented that the layering "avoids spawning the scanner twice" — but nothing enforced it, so a full gate paid ~5.8s of duplicate subprocess time. - src/stages/scanner-cache.ts (new) — gate-scoped memo (mirrors the run-scoped spec cache F-cd0415): primeScannerCache(on) + memoizeScan(key, compute). - hardcoded-secret.ts / architecture-violation.ts — route execaSync through memoizeScan keyed by (cwd, cmd, args). Pass-through when no cache is primed → standalone/MCP behavior byte-for-byte unchanged. - clad check primes the memo around the stage loop, clears in finally (the long-lived MCP server must not carry a scan across runs). - secret.ts comment updated: the dedup it promised is now actually enforced. Measured (isolated worktree A/B, cladding's own repo): clad check --tier=pre-commit ~11.9s → ~6.3s (-47%), IDENTICAL findings. Blind-authored tests (tests/stages/scanner-cache.test.ts, 6). scanner-cache.ts lives in src/stages/ (NOT detectors/) so the 38-detector count is unchanged. Co-Authored-By: Claude Opus 4.8 --- CHANGELOG.md | 16 + plugins/claude-code/dist/clad.js | 542 +++++++++--------- spec.yaml | 6 +- spec/attestation.yaml | 89 +-- spec/features/gate-scanner-memo-5a49899e.yaml | 38 ++ spec/index.yaml | 1 + src/cli/clad.ts | 11 + .../detectors/architecture-violation.ts | 47 +- src/stages/detectors/hardcoded-secret.ts | 49 +- src/stages/scanner-cache.ts | 46 ++ src/stages/secret.ts | 5 +- tests/stages/scanner-cache.test.ts | 70 +++ 12 files changed, 556 insertions(+), 364 deletions(-) create mode 100644 spec/features/gate-scanner-memo-5a49899e.yaml create mode 100644 src/stages/scanner-cache.ts create mode 100644 tests/stages/scanner-cache.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index b9bad350..80a5dc76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ Versioning: [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- **Gate ~47% faster — secretlint/madge now spawn once per gate, not twice** (`F-5a49899e`) + — `HARDCODED_SECRET` (secretlint, ~4.4s) and `ARCHITECTURE_VIOLATION` (madge, ~1.4s) + shell out to an external tool and together are ~97% of the drift stage. They ran + **twice** per gate: once inside the Drift stage (which sweeps every detector) and + again as their dedicated Secret/Arch stage. `secret.ts` even documented that the + layering "avoids spawning the scanner twice" — but nothing enforced it. A new + gate-scoped memo (`src/stages/scanner-cache.ts`, mirroring the run-scoped spec cache + F-cd0415) makes the second invocation a cache hit, so each tool spawns once. Measured + on cladding's own repo (isolated worktree A/B): `clad check --tier=pre-commit` + **~11.9s → ~6.3s (−47%)**, with **identical findings** (a pass-through when no gate + cache is primed, so standalone/MCP behavior is unchanged; cleared in a `finally` so + the long-lived MCP server never serves a stale scan). + + ## [0.7.1] — 2026-07-02 — Honest Graph Repairs found by a deep multi-agent review of the 0.7.0 graph capability. diff --git a/plugins/claude-code/dist/clad.js b/plugins/claude-code/dist/clad.js index 2ca9cdf2..3222940c 100755 --- a/plugins/claude-code/dist/clad.js +++ b/plugins/claude-code/dist/clad.js @@ -4,66 +4,66 @@ const require = __claddingCreateRequire(import.meta.url); // Marker for stages/*.ts: when true, the per-stage CLI-entry guard // short-circuits so the bundle doesn't fire every stage at startup. globalThis.__CLADDING_BUNDLED = true; -var Cae=Object.create;var Uk=Object.defineProperty;var Dae=Object.getOwnPropertyDescriptor;var Nae=Object.getOwnPropertyNames;var jae=Object.getPrototypeOf,Mae=Object.prototype.hasOwnProperty;var Be=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Er=(t,e)=>{for(var r in e)Uk(t,r,{get:e[r],enumerable:!0})},Fae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nae(e))!Mae.call(t,i)&&i!==r&&Uk(t,i,{get:()=>e[i],enumerable:!(n=Dae(e,i))||n.enumerable});return t};var kt=(t,e,r)=>(r=t!=null?Cae(jae(t)):{},Fae(e||!t||!t.__esModule?Uk(r,"default",{value:t,enumerable:!0}):r,t));var nd=v(Bk=>{var Xh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},qk=class extends Xh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Bk.CommanderError=Xh;Bk.InvalidArgumentError=qk});var Qh=v(Zk=>{var{InvalidArgumentError:zae}=nd(),Hk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new zae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Lae(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Zk.Argument=Hk;Zk.humanReadableArgName=Lae});var Wk=v(Vk=>{var{humanReadableArgName:Uae}=Qh(),Gk=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Uae(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` -`)}displayWidth(e){return F2(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return utypeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>(t&&(e=t(t=0)),e);var v=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Er=(t,e)=>{for(var r in e)Hk(t,r,{get:e[r],enumerable:!0})},qae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zae(e))!Uae.call(t,i)&&i!==r&&Hk(t,i,{get:()=>e[i],enumerable:!(n=Fae(e,i))||n.enumerable});return t};var kt=(t,e,r)=>(r=t!=null?Mae(Lae(t)):{},qae(e||!t||!t.__esModule?Hk(r,"default",{value:t,enumerable:!0}):r,t));var nd=v(Gk=>{var Xh=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},Zk=class extends Xh{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Gk.CommanderError=Xh;Gk.InvalidArgumentError=Zk});var Qh=v(Wk=>{var{InvalidArgumentError:Bae}=nd(),Vk=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Bae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Hae(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Wk.Argument=Vk;Wk.humanReadableArgName=Hae});var Yk=v(Jk=>{var{humanReadableArgName:Zae}=Qh(),Kk=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Zae(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,r,n){return r.length===0?[]:[n.styleTitle(e),...r,""]}groupItems(e,r,n){let i=new Map;return e.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let p=d.map(m=>o(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let p=d.map(m=>o(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(f,p,r))}),s.join(` +`)}displayWidth(e){return q2(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,i){let s=" ".repeat(2);if(!n)return s+e;let a=e.padEnd(r+e.length-i.displayWidth(e)),c=2,u=(this.helpWidth??80)-r-c-2,d;return u{let a=s.match(i);if(a===null){o.push("");return}let c=[a.shift()],l=this.displayWidth(c[0]);a.forEach(u=>{let d=this.displayWidth(u);if(l+d<=r){c.push(u),l+=d;return}o.push(c.join(""));let f=u.trimStart();c=[f],l=this.displayWidth(f)}),o.push(c.join(""))}),o.join(` -`)}};function F2(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Vk.Help=Gk;Vk.stripColor=F2});var Xk=v(Yk=>{var{InvalidArgumentError:qae}=nd(),Kk=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Bae(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new qae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?z2(this.name().replace(/^no-/,"")):z2(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Jk=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function z2(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Bae(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} +`)}};function q2(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}Jk.Help=Kk;Jk.stripColor=q2});var tE=v(eE=>{var{InvalidArgumentError:Gae}=nd(),Xk=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=Vae(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Gae(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?B2(this.name().replace(/^no-/,"")):B2(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Qk=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function B2(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function Vae(t){let e,r,n=/^-[^-]$/,i=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(e=o.shift()),i.test(o[0])&&(r=o.shift()),!e&&n.test(o[0])&&(e=o.shift()),!e&&i.test(o[0])&&(e=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a} - too many short flags`):i.test(s)?new Error(`${a} - too many long flags`):new Error(`${a} -- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}Yk.Option=Kk;Yk.DualOptions=Jk});var U2=v(L2=>{function Hae(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Zae(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Hae(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` +- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}eE.Option=Xk;eE.DualOptions=Qk});var Z2=v(H2=>{function Wae(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function Kae(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=Wae(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(as.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` -(Did you mean ${n[0]}?)`:""}L2.suggestSimilar=Zae});var Z2=v(nE=>{var Gae=Be("node:events").EventEmitter,Qk=Be("node:child_process"),Hi=Be("node:path"),eg=Be("node:fs"),Ue=Be("node:process"),{Argument:Vae,humanReadableArgName:Wae}=Qh(),{CommanderError:eE}=nd(),{Help:Kae,stripColor:Jae}=Wk(),{Option:q2,DualOptions:Yae}=Xk(),{suggestSimilar:B2}=U2(),tE=class t extends Gae{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Ue.stdout.write(r),writeErr:r=>Ue.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Ue.stdout.isTTY?Ue.stdout.columns:void 0,getErrHelpWidth:()=>Ue.stderr.isTTY?Ue.stderr.columns:void 0,getOutHasColors:()=>rE()??(Ue.stdout.isTTY&&Ue.stdout.hasColors?.()),getErrHasColors:()=>rE()??(Ue.stderr.isTTY&&Ue.stderr.hasColors?.()),stripColor:r=>Jae(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Kae,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Vae(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. -Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new eE(e,r,n)),Ue.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new q2(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' -- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof q2)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ue.versions?.electron&&(r.from="electron");let i=Ue.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ue.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ue.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. +(Did you mean ${n[0]}?)`:""}H2.suggestSimilar=Kae});var K2=v(sE=>{var Jae=Be("node:events").EventEmitter,rE=Be("node:child_process"),Hi=Be("node:path"),eg=Be("node:fs"),Ue=Be("node:process"),{Argument:Yae,humanReadableArgName:Xae}=Qh(),{CommanderError:nE}=nd(),{Help:Qae,stripColor:ece}=Yk(),{Option:G2,DualOptions:tce}=tE(),{suggestSimilar:V2}=Z2(),iE=class t extends Jae{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>Ue.stdout.write(r),writeErr:r=>Ue.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>Ue.stdout.isTTY?Ue.stdout.columns:void 0,getErrHelpWidth:()=>Ue.stderr.isTTY?Ue.stderr.columns:void 0,getOutHasColors:()=>oE()??(Ue.stdout.isTTY&&Ue.stdout.hasColors?.()),getErrHasColors:()=>oE()??(Ue.stderr.isTTY&&Ue.stderr.hasColors?.()),stripColor:r=>ece(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return i&&(c.description(i),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),i?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qae,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new Yae(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=e??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'. +Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new nE(e,r,n)),Ue.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new G2(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}' +- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof G2)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(c,l)=>{let u=a.exec(c);return u?u[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){Ue.versions?.electron&&(r.from="electron");let i=Ue.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=Ue.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":Ue.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,r,n){if(eg.existsSync(e))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=Hi.resolve(u,d);if(eg.existsSync(f))return f;if(i.includes(Hi.extname(d)))return;let p=i.find(m=>eg.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=eg.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=Hi.resolve(Hi.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=Hi.basename(this._scriptPath,Hi.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(Hi.extname(s));let c;Ue.platform!=="win32"?n?(r.unshift(s),r=H2(Ue.execArgv).concat(r),c=Qk.spawn(Ue.argv[0],r,{stdio:"inherit"})):c=Qk.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=H2(Ue.execArgv).concat(r),c=Qk.spawn(Ue.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Ue.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new eE(u,"commander.executeSubCommandAsync","(close)")):Ue.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)Ue.exit(1);else{let d=new eE(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} + - ${i}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(u,d){let f=Hi.resolve(u,d);if(eg.existsSync(f))return f;if(i.includes(Hi.extname(d)))return;let p=i.find(m=>eg.existsSync(`${f}${m}`));if(p)return`${f}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let u;try{u=eg.realpathSync(this._scriptPath)}catch{u=this._scriptPath}a=Hi.resolve(Hi.dirname(u),a)}if(a){let u=o(a,s);if(!u&&!e._executableFile&&this._scriptPath){let d=Hi.basename(this._scriptPath,Hi.extname(this._scriptPath));d!==this._name&&(u=o(a,`${d}-${e._name}`))}s=u||s}n=i.includes(Hi.extname(s));let c;Ue.platform!=="win32"?n?(r.unshift(s),r=W2(Ue.execArgv).concat(r),c=rE.spawn(Ue.argv[0],r,{stdio:"inherit"})):c=rE.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,e._name),r.unshift(s),r=W2(Ue.execArgv).concat(r),c=rE.spawn(Ue.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{Ue.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let l=this._exitCallback;c.on("close",u=>{u=u??1,l?l(new nE(u,"commander.executeSubCommandAsync","(close)")):Ue.exit(u)}),c.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(s,a,e._name);else if(u.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)Ue.exit(1);else{let d=new nE(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?ie(n,a,s),n.defaultValue))):o===void 0&&(o=[]):ir()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r;function o(u){return u.length>1&&u[0]==="-"}let s=u=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,c=null,l=0;for(;l2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),c=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),f=this._findOption(u.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,u.slice(d+1));continue}}if(i===r&&o(u)&&!(this.commands.length===0&&s(u))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),n.push(...e.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u,...e.slice(l));break}else if(this._defaultCommandName){n.push(u,...e.slice(l));break}}if(this._passThroughOptions){i.push(u,...e.slice(l));break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;nObject.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ue.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ue.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Yae(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=B2(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=B2(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} -`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Wae(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Hi.basename(e,Hi.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Ue.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Ue.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Ue.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new tce(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),l=this.options.find(d=>d.negate&&a===d.attributeName()),u=this.options.find(d=>!d.negate&&a===d.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||s},i=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=V2(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=V2(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e} +`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Xae(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Hi.basename(e,Hi.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let r=!!e.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(Ue.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} -`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function H2(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function rE(){if(Ue.env.NO_COLOR||Ue.env.FORCE_COLOR==="0"||Ue.env.FORCE_COLOR==="false")return!1;if(Ue.env.FORCE_COLOR||Ue.env.CLICOLOR_FORCE!==void 0)return!0}nE.Command=tE;nE.useColor=rE});var K2=v(pn=>{var{Argument:G2}=Qh(),{Command:iE}=Z2(),{CommanderError:Xae,InvalidArgumentError:V2}=nd(),{Help:Qae}=Wk(),{Option:W2}=Xk();pn.program=new iE;pn.createCommand=t=>new iE(t);pn.createOption=(t,e)=>new W2(t,e);pn.createArgument=(t,e)=>new G2(t,e);pn.Command=iE;pn.Option=W2;pn.Argument=G2;pn.Help=Qae;pn.CommanderError=Xae;pn.InvalidArgumentError=V2;pn.InvalidOptionArgumentError=V2});var Pe=v(Jt=>{"use strict";var sE=Symbol.for("yaml.alias"),Q2=Symbol.for("yaml.document"),tg=Symbol.for("yaml.map"),eU=Symbol.for("yaml.pair"),aE=Symbol.for("yaml.scalar"),rg=Symbol.for("yaml.seq"),Zi=Symbol.for("yaml.node.type"),oce=t=>!!t&&typeof t=="object"&&t[Zi]===sE,sce=t=>!!t&&typeof t=="object"&&t[Zi]===Q2,ace=t=>!!t&&typeof t=="object"&&t[Zi]===tg,cce=t=>!!t&&typeof t=="object"&&t[Zi]===eU,tU=t=>!!t&&typeof t=="object"&&t[Zi]===aE,lce=t=>!!t&&typeof t=="object"&&t[Zi]===rg;function rU(t){if(t&&typeof t=="object")switch(t[Zi]){case tg:case rg:return!0}return!1}function uce(t){if(t&&typeof t=="object")switch(t[Zi]){case sE:case tg:case aE:case rg:return!0}return!1}var dce=t=>(tU(t)||rU(t))&&!!t.anchor;Jt.ALIAS=sE;Jt.DOC=Q2;Jt.MAP=tg;Jt.NODE_TYPE=Zi;Jt.PAIR=eU;Jt.SCALAR=aE;Jt.SEQ=rg;Jt.hasAnchor=dce;Jt.isAlias=oce;Jt.isCollection=rU;Jt.isDocument=sce;Jt.isMap=ace;Jt.isNode=uce;Jt.isPair=cce;Jt.isScalar=tU;Jt.isSeq=lce});var id=v(cE=>{"use strict";var Mt=Pe(),Ar=Symbol("break visit"),nU=Symbol("skip children"),li=Symbol("remove node");function ng(t,e){let r=iU(e);Mt.isDocument(t)?cc(null,t.contents,r,Object.freeze([t]))===li&&(t.contents=null):cc(null,t,r,Object.freeze([]))}ng.BREAK=Ar;ng.SKIP=nU;ng.REMOVE=li;function cc(t,e,r,n){let i=oU(t,e,r,n);if(Mt.isNode(i)||Mt.isPair(i))return sU(t,n,i),cc(t,i,r,n);if(typeof i!="symbol"){if(Mt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var aU=Pe(),fce=id(),pce={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},mce=t=>t.replace(/[!,[\]{}]/g,e=>pce[e]),od=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+mce(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&aU.isNode(e.contents)){let o={};fce.visit(e.contents,(s,a)=>{aU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` -`)}};od.defaultYaml={explicit:!1,version:"1.2"};od.defaultTags={"!!":"tag:yaml.org,2002:"};cU.Directives=od});var og=v(sd=>{"use strict";var lU=Pe(),hce=id();function gce(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function uU(t){let e=new Set;return hce.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function dU(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function yce(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=uU(t));let s=dU(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(lU.isScalar(s.node)||lU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}sd.anchorIsValid=gce;sd.anchorNames=uU;sd.createNodeAnchors=yce;sd.findNewAnchor=dU});var uE=v(fU=>{"use strict";function ad(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var _ce=Pe();function pU(t,e,r){if(Array.isArray(t))return t.map((n,i)=>pU(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!_ce.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}mU.toJS=pU});var sg=v(gU=>{"use strict";var bce=uE(),hU=Pe(),vce=Eo(),dE=class{constructor(e){Object.defineProperty(this,hU.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!hU.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=vce.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?bce.applyReviver(o,{"":a},"",a):a}};gU.NodeBase=dE});var cd=v(yU=>{"use strict";var Sce=og(),wce=id(),uc=Pe(),xce=sg(),$ce=Eo(),fE=class extends xce.NodeBase{constructor(e){super(uc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],wce.visit(e,{Node:(o,s)=>{(uc.isAlias(s)||uc.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||($ce.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ag(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(Sce.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function ag(t,e,r){if(uc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(uc.isCollection(e)){let n=0;for(let i of e.items){let o=ag(t,i,r);o>n&&(n=o)}return n}else if(uc.isPair(e)){let n=ag(t,e.key,r),i=ag(t,e.value,r);return Math.max(n,i)}return 1}yU.Alias=fE});var Pt=v(pE=>{"use strict";var kce=Pe(),Ece=sg(),Ace=Eo(),Tce=t=>!t||typeof t!="function"&&typeof t!="object",Ao=class extends Ece.NodeBase{constructor(e){super(kce.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ace.toJS(this.value,e,r)}toString(){return String(this.value)}};Ao.BLOCK_FOLDED="BLOCK_FOLDED";Ao.BLOCK_LITERAL="BLOCK_LITERAL";Ao.PLAIN="PLAIN";Ao.QUOTE_DOUBLE="QUOTE_DOUBLE";Ao.QUOTE_SINGLE="QUOTE_SINGLE";pE.Scalar=Ao;pE.isScalarValue=Tce});var ld=v(bU=>{"use strict";var Oce=cd(),Us=Pe(),_U=Pt(),Ice="tag:yaml.org,2002:";function Pce(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function Rce(t,e,r){if(Us.isDocument(t)&&(t=t.contents),Us.isNode(t))return t;if(Us.isPair(t)){let d=r.schema[Us.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Oce.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Ice+e.slice(2));let l=Pce(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new _U.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Us.MAP]:Symbol.iterator in Object(t)?s[Us.SEQ]:s[Us.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new _U.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}bU.createNode=Rce});var lg=v(cg=>{"use strict";var Cce=ld(),ui=Pe(),Dce=sg();function mE(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Cce.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var vU=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,hE=class extends Dce.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>ui.isNode(n)||ui.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(vU(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(ui.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,mE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ui.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&ui.isScalar(o)?o.value:o:ui.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ui.isPair(r))return!1;let n=r.value;return n==null||e&&ui.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ui.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(ui.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,mE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};cg.Collection=hE;cg.collectionFromPath=mE;cg.isEmptyPath=vU});var ud=v(ug=>{"use strict";var Nce=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function gE(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var jce=(t,e,r)=>t.endsWith(` -`)?gE(r,e):r.includes(` +`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function W2(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}function oE(){if(Ue.env.NO_COLOR||Ue.env.FORCE_COLOR==="0"||Ue.env.FORCE_COLOR==="false")return!1;if(Ue.env.FORCE_COLOR||Ue.env.CLICOLOR_FORCE!==void 0)return!0}sE.Command=iE;sE.useColor=oE});var Q2=v(pn=>{var{Argument:J2}=Qh(),{Command:aE}=K2(),{CommanderError:rce,InvalidArgumentError:Y2}=nd(),{Help:nce}=Yk(),{Option:X2}=tE();pn.program=new aE;pn.createCommand=t=>new aE(t);pn.createOption=(t,e)=>new X2(t,e);pn.createArgument=(t,e)=>new J2(t,e);pn.Command=aE;pn.Option=X2;pn.Argument=J2;pn.Help=nce;pn.CommanderError=rce;pn.InvalidArgumentError=Y2;pn.InvalidOptionArgumentError=Y2});var Pe=v(Jt=>{"use strict";var lE=Symbol.for("yaml.alias"),nU=Symbol.for("yaml.document"),tg=Symbol.for("yaml.map"),iU=Symbol.for("yaml.pair"),uE=Symbol.for("yaml.scalar"),rg=Symbol.for("yaml.seq"),Zi=Symbol.for("yaml.node.type"),lce=t=>!!t&&typeof t=="object"&&t[Zi]===lE,uce=t=>!!t&&typeof t=="object"&&t[Zi]===nU,dce=t=>!!t&&typeof t=="object"&&t[Zi]===tg,fce=t=>!!t&&typeof t=="object"&&t[Zi]===iU,oU=t=>!!t&&typeof t=="object"&&t[Zi]===uE,pce=t=>!!t&&typeof t=="object"&&t[Zi]===rg;function sU(t){if(t&&typeof t=="object")switch(t[Zi]){case tg:case rg:return!0}return!1}function mce(t){if(t&&typeof t=="object")switch(t[Zi]){case lE:case tg:case uE:case rg:return!0}return!1}var hce=t=>(oU(t)||sU(t))&&!!t.anchor;Jt.ALIAS=lE;Jt.DOC=nU;Jt.MAP=tg;Jt.NODE_TYPE=Zi;Jt.PAIR=iU;Jt.SCALAR=uE;Jt.SEQ=rg;Jt.hasAnchor=hce;Jt.isAlias=lce;Jt.isCollection=sU;Jt.isDocument=uce;Jt.isMap=dce;Jt.isNode=mce;Jt.isPair=fce;Jt.isScalar=oU;Jt.isSeq=pce});var id=v(dE=>{"use strict";var Mt=Pe(),Ar=Symbol("break visit"),aU=Symbol("skip children"),li=Symbol("remove node");function ng(t,e){let r=cU(e);Mt.isDocument(t)?cc(null,t.contents,r,Object.freeze([t]))===li&&(t.contents=null):cc(null,t,r,Object.freeze([]))}ng.BREAK=Ar;ng.SKIP=aU;ng.REMOVE=li;function cc(t,e,r,n){let i=lU(t,e,r,n);if(Mt.isNode(i)||Mt.isPair(i))return uU(t,n,i),cc(t,i,r,n);if(typeof i!="symbol"){if(Mt.isCollection(e)){n=Object.freeze(n.concat(e));for(let o=0;o{"use strict";var dU=Pe(),gce=id(),yce={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_ce=t=>t.replace(/[!,[\]{}]/g,e=>yce[e]),od=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[o,s]=n;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[o]=n;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let o=this.tags[n];if(o)try{return o+decodeURIComponent(i)}catch(s){return r(String(s)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+_ce(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&dU.isNode(e.contents)){let o={};gce.visit(e.contents,(s,a)=>{dU.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of n)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(` +`)}};od.defaultYaml={explicit:!1,version:"1.2"};od.defaultTags={"!!":"tag:yaml.org,2002:"};fU.Directives=od});var og=v(sd=>{"use strict";var pU=Pe(),bce=id();function vce(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function mU(t){let e=new Set;return bce.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function hU(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Sce(t,e){let r=[],n=new Map,i=null;return{onAnchor:o=>{r.push(o),i??(i=mU(t));let s=hU(e,i);return i.add(s),s},setAnchors:()=>{for(let o of r){let s=n.get(o);if(typeof s=="object"&&s.anchor&&(pU.isScalar(s.node)||pU.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:n}}sd.anchorIsValid=vce;sd.anchorNames=mU;sd.createNodeAnchors=Sce;sd.findNewAnchor=hU});var pE=v(gU=>{"use strict";function ad(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,o=n.length;i{"use strict";var wce=Pe();function yU(t,e,r){if(Array.isArray(t))return t.map((n,i)=>yU(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!wce.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=o=>{n.res=o,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}_U.toJS=yU});var sg=v(vU=>{"use strict";var xce=pE(),bU=Pe(),$ce=Eo(),mE=class{constructor(e){Object.defineProperty(this,bU.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:o}={}){if(!bU.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=$ce.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?xce.applyReviver(o,{"":a},"",a):a}};vU.NodeBase=mE});var cd=v(SU=>{"use strict";var kce=og(),Ece=id(),uc=Pe(),Ace=sg(),Tce=Eo(),hE=class extends Ace.NodeBase{constructor(e){super(uc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Ece.visit(e,{Node:(o,s)=>{(uc.isAlias(s)||uc.hasAnchor(s))&&n.push(s)}}),r&&(r.aliasResolveCache=n));let i;for(let o of n){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:o}=r,s=this.resolve(i,r);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(s);if(a||(Tce.toJS(s,null,r),a=n.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ag(i,s,n)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(kce.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function ag(t,e,r){if(uc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(uc.isCollection(e)){let n=0;for(let i of e.items){let o=ag(t,i,r);o>n&&(n=o)}return n}else if(uc.isPair(e)){let n=ag(t,e.key,r),i=ag(t,e.value,r);return Math.max(n,i)}return 1}SU.Alias=hE});var Pt=v(gE=>{"use strict";var Oce=Pe(),Ice=sg(),Pce=Eo(),Rce=t=>!t||typeof t!="function"&&typeof t!="object",Ao=class extends Ice.NodeBase{constructor(e){super(Oce.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Pce.toJS(this.value,e,r)}toString(){return String(this.value)}};Ao.BLOCK_FOLDED="BLOCK_FOLDED";Ao.BLOCK_LITERAL="BLOCK_LITERAL";Ao.PLAIN="PLAIN";Ao.QUOTE_DOUBLE="QUOTE_DOUBLE";Ao.QUOTE_SINGLE="QUOTE_SINGLE";gE.Scalar=Ao;gE.isScalarValue=Rce});var ld=v(xU=>{"use strict";var Cce=cd(),Us=Pe(),wU=Pt(),Dce="tag:yaml.org,2002:";function Nce(t,e,r){if(e){let n=r.filter(o=>o.tag===e),i=n.find(o=>!o.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function jce(t,e,r){if(Us.isDocument(t)&&(t=t.contents),Us.isNode(t))return t;if(Us.isPair(t)){let d=r.schema[Us.MAP].createNode?.(r.schema,null,r);return d.items.push(t),d}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=r,c;if(n&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Cce.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Dce+e.slice(2));let l=Nce(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let d=new wU.Scalar(t);return c&&(c.node=d),d}l=t instanceof Map?s[Us.MAP]:Symbol.iterator in Object(t)?s[Us.SEQ]:s[Us.MAP]}o&&(o(l),delete r.onTagObj);let u=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new wU.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}xU.createNode=jce});var lg=v(cg=>{"use strict";var Mce=ld(),ui=Pe(),Fce=sg();function yE(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=n,n=s}else n=new Map([[o,n]])}return Mce.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var $U=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,_E=class extends Fce.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>ui.isNode(n)||ui.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if($U(e))this.add(r);else{let[n,...i]=e,o=this.get(n,!0);if(ui.isCollection(o))o.addIn(i,r);else if(o===void 0&&this.schema)this.set(n,yE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(ui.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,o=this.get(n,!0);return i.length===0?!r&&ui.isScalar(o)?o.value:o:ui.isCollection(o)?o.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!ui.isPair(r))return!1;let n=r.value;return n==null||e&&ui.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return ui.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let o=this.get(n,!0);if(ui.isCollection(o))o.setIn(i,r);else if(o===void 0&&this.schema)this.set(n,yE(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};cg.Collection=_E;cg.collectionFromPath=yE;cg.isEmptyPath=$U});var ud=v(ug=>{"use strict";var zce=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function bE(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Lce=(t,e,r)=>t.endsWith(` +`)?bE(r,e):r.includes(` `)?` -`+gE(r,e):(t.endsWith(" ")?"":" ")+r;ug.indentComment=gE;ug.lineComment=jce;ug.stringifyComment=Nce});var wU=v(dd=>{"use strict";var Mce="flow",yE="block",dg="quoted";function Fce(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===yE&&(h=SU(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===dg&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` -`)r===yE&&(h=SU(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` +`+bE(r,e):(t.endsWith(" ")?"":" ")+r;ug.indentComment=bE;ug.lineComment=Lce;ug.stringifyComment=zce});var EU=v(dd=>{"use strict";var Uce="flow",vE="block",dg="quoted";function qce(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;ii-Math.max(2,o)?l.push(0):d=i-n);let f,p,m=!1,h=-1,g=-1,b=-1;r===vE&&(h=kU(t,h,e.length),h!==-1&&(d=h+c));for(let S;S=t[h+=1];){if(r===dg&&S==="\\"){switch(g=h,t[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}b=h}if(S===` +`)r===vE&&(h=kU(t,h,e.length)),d=h+e.length+c,f=void 0;else{if(S===" "&&p&&p!==" "&&p!==` `&&p!==" "){let x=t[h+1];x&&x!==" "&&x!==` `&&x!==" "&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(r===dg){for(;p===" "||p===" ";)p=S,S=t[h+=1],m=!0;let x=h>b+1?h-2:g-1;if(u[x])return t;l.push(x),u[x]=!0,d=x+c,f=void 0}else m=!0}p=S}if(m&&a&&a(),l.length===0)return t;s&&s();let _=t.slice(0,l[0]);for(let S=0;S{"use strict";var Mn=Pt(),To=wU(),pg=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),mg=t=>/^(%|---|\.\.\.)/m.test(t);function zce(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;o{"use strict";var Mn=Pt(),To=EU(),pg=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),mg=t=>/^(%|---|\.\.\.)/m.test(t);function Bce(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let o=0,s=0;on)return!0;if(s=o+1,i-s<=n)return!1}return!0}function fd(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(mg(t)?" ":""),s="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(s+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let u=r.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length `;let d,f;for(f=r.length;f>0;--f){let w=r[f-1];if(w!==` `&&w!==" "&&w!==" ")break}let p=r.substring(f),m=p.indexOf(` `);m===-1?d="-":r===p||m!==p.length-1?(d="+",o&&o()):d="",p&&(r=r.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(bE,`$&${l}`));let h=!1,g,b=-1;for(g=0;g{R=!0});let E=To.foldFlowLines(`${_}${w}${p}`,l,To.FOLD_BLOCK,A);if(!R)return`>${x} ${l}${E}`}return r=r.replace(/\n+/g,`$&${l}`),`|${x} -${l}${_}${r}${p}`}function Lce(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` +${l}${_}${r}${p}`}function Hce(t,e,r,n){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(` `)||u&&/[[\]{},]/.test(o))return dc(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(` `)?dc(o,e):fg(t,e,r,n);if(!a&&!u&&i!==Mn.Scalar.PLAIN&&o.includes(` `))return fg(t,e,r,n);if(mg(o)){if(c==="")return e.forceBlockIndent=!0,fg(t,e,r,n);if(a&&c===l)return dc(o,e)}let d=o.replace(/\n+/g,`$& -${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return dc(o,e)}return a?d:To.foldFlowLines(d,c,To.FOLD_FLOW,pg(e,!1))}function Uce(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Mn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mn.Scalar.BLOCK_FOLDED:case Mn.Scalar.BLOCK_LITERAL:return i||o?dc(s.value,e):fg(s,e,r,n);case Mn.Scalar.QUOTE_DOUBLE:return fd(s.value,e);case Mn.Scalar.QUOTE_SINGLE:return _E(s.value,e);case Mn.Scalar.PLAIN:return Lce(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}xU.stringifyString=Uce});var md=v(vE=>{"use strict";var qce=og(),Oo=Pe(),Bce=ud(),Hce=pd();function Zce(t,e){let r=Object.assign({blockQuote:!0,commentString:Bce.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Gce(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Oo.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Vce(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Oo.isScalar(t)||Oo.isCollection(t))&&t.anchor;o&&qce.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Wce(t,e,r,n){if(Oo.isPair(t))return t.toString(e,r,n);if(Oo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Oo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Gce(e.doc.schema.tags,o));let s=Vce(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Oo.isScalar(o)?Hce.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Oo.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} -${e.indent}${a}`:a}vE.createStringifyContext=Zce;vE.stringify=Wce});var AU=v(EU=>{"use strict";var Gi=Pe(),$U=Pt(),kU=md(),hd=ud();function Kce({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Gi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Gi.isCollection(t)||!Gi.isNode(t)&&typeof t=="object"){let A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Gi.isCollection(t)||(Gi.isScalar(t)?t.type===$U.Scalar.BLOCK_FOLDED||t.type===$U.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=kU.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=hd.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hd.lineComment(g,r.indent,l(f))),g=`? ${g} -${a}:`):(g=`${g}:`,f&&(g+=hd.lineComment(g,r.indent,l(f))));let b,_,S;Gi.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&Gi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Gi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=kU.stringify(e,r,()=>x=!0,()=>h=!0),R=" ";if(f||b||_){if(R=b?` +${c}`);if(s){let f=h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(d),{compat:p,tags:m}=e.doc.schema;if(m.some(f)||p?.some(f))return dc(o,e)}return a?d:To.foldFlowLines(d,c,To.FOLD_FLOW,pg(e,!1))}function Zce(t,e,r,n){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Mn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Mn.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Mn.Scalar.BLOCK_FOLDED:case Mn.Scalar.BLOCK_LITERAL:return i||o?dc(s.value,e):fg(s,e,r,n);case Mn.Scalar.QUOTE_DOUBLE:return fd(s.value,e);case Mn.Scalar.QUOTE_SINGLE:return SE(s.value,e);case Mn.Scalar.PLAIN:return Hce(s,e,r,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:d}=e.options,f=i&&u||d;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}AU.stringifyString=Zce});var md=v(xE=>{"use strict";var Gce=og(),Oo=Pe(),Vce=ud(),Wce=pd();function Kce(t,e){let r=Object.assign({blockQuote:!0,commentString:Vce.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function Jce(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let r,n;if(Oo.isScalar(e)){n=e.value;let i=t.filter(o=>o.identify?.(n));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}r=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function Yce(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],o=(Oo.isScalar(t)||Oo.isCollection(t))&&t.anchor;o&&Gce.anchorIsValid(o)&&(r.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(n.directives.tagString(s)),i.join(" ")}function Xce(t,e,r,n){if(Oo.isPair(t))return t.toString(e,r,n);if(Oo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,o=Oo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jce(e.doc.schema.tags,o));let s=Yce(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,r,n):Oo.isScalar(o)?Wce.stringifyString(o,e,r,n):o.toString(e,r,n);return s?Oo.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s} +${e.indent}${a}`:a}xE.createStringifyContext=Kce;xE.stringify=Xce});var PU=v(IU=>{"use strict";var Gi=Pe(),TU=Pt(),OU=md(),hd=ud();function Qce({key:t,value:e},r,n,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=r,f=Gi.isNode(t)&&t.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Gi.isCollection(t)||!Gi.isNode(t)&&typeof t=="object"){let A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!d&&(!t||f&&e==null&&!r.inFlow||Gi.isCollection(t)||(Gi.isScalar(t)?t.type===TU.Scalar.BLOCK_FOLDED||t.type===TU.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!p&&(d||!o),indent:a+c});let m=!1,h=!1,g=OU.stringify(t,r,()=>m=!0,()=>h=!0);if(!p&&!r.inFlow&&g.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(r.inFlow){if(o||e==null)return m&&n&&n(),g===""?"?":p?`? ${g}`:g}else if(o&&!d||e==null&&p)return g=`? ${g}`,f&&!m?g+=hd.lineComment(g,r.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=hd.lineComment(g,r.indent,l(f))),g=`? ${g} +${a}:`):(g=`${g}:`,f&&(g+=hd.lineComment(g,r.indent,l(f))));let b,_,S;Gi.isNode(e)?(b=!!e.spaceBefore,_=e.commentBefore,S=e.comment):(b=!1,_=null,S=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=!1,!p&&!f&&Gi.isScalar(e)&&(r.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!r.inFlow&&!p&&Gi.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,w=OU.stringify(e,r,()=>x=!0,()=>h=!0),R=" ";if(f||b||_){if(R=b?` `:"",_){let A=l(_);R+=` ${hd.indentComment(A,r.indent)}`}w===""&&!r.inFlow?R===` `&&S&&(R=` @@ -72,34 +72,34 @@ ${hd.indentComment(A,r.indent)}`}w===""&&!r.inFlow?R===` ${r.indent}`}else if(!p&&Gi.isCollection(e)){let A=w[0],E=w.indexOf(` `),C=E!==-1,k=r.inFlow??e.flow??e.items.length===0;if(C||!k){let L=!1;if(C&&(A==="&"||A==="!")){let te=w.indexOf(" ");A==="&"&&te!==-1&&te{"use strict";var TU=Be("process");function Jce(t,...e){t==="debug"&&console.log(...e)}function Yce(t,e){(t==="debug"||t==="warn")&&(typeof TU.emitWarning=="function"?TU.emitWarning(e):console.warn(e))}SE.debug=Jce;SE.warn=Yce});var bg=v(_g=>{"use strict";var yg=Pe(),OU=Pt(),hg="<<",gg={identify:t=>t===hg||typeof t=="symbol"&&t.description===hg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new OU.Scalar(Symbol(hg)),{addToJSMap:IU}),stringify:()=>hg},Xce=(t,e)=>(gg.identify(e)||yg.isScalar(e)&&(!e.type||e.type===OU.Scalar.PLAIN)&&gg.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===gg.tag&&r.default);function IU(t,e,r){let n=PU(t,r);if(yg.isSeq(n))for(let i of n.items)xE(t,e,i);else if(Array.isArray(n))for(let i of n)xE(t,e,i);else xE(t,e,n)}function xE(t,e,r){let n=PU(t,r);if(!yg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function PU(t,e){return t&&yg.isAlias(e)?e.resolve(t.doc,t):e}_g.addMergeToJSMap=IU;_g.isMergeKey=Xce;_g.merge=gg});var kE=v(DU=>{"use strict";var Qce=wE(),RU=bg(),ele=md(),CU=Pe(),$E=Eo();function tle(t,e,{key:r,value:n}){if(CU.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(RU.isMergeKey(t,r))RU.addMergeToJSMap(t,e,n);else{let i=$E.toJS(r,"",t);if(e instanceof Map)e.set(i,$E.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=rle(r,i,t),s=$E.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function rle(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(CU.isNode(t)&&r?.doc){let n=ele.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Qce.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}DU.addPairToJSMap=tle});var Io=v(EE=>{"use strict";var NU=ld(),nle=AU(),ile=kE(),vg=Pe();function ole(t,e,r){let n=NU.createNode(t,void 0,r),i=NU.createNode(e,void 0,r);return new Sg(n,i)}var Sg=class t{constructor(e,r=null){Object.defineProperty(this,vg.NODE_TYPE,{value:vg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return vg.isNode(r)&&(r=r.clone(e)),vg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return ile.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?nle.stringifyPair(this,e,r,n):JSON.stringify(this)}};EE.Pair=Sg;EE.createPair=ole});var AE=v(MU=>{"use strict";var qs=Pe(),jU=md(),wg=ud();function sle(t,e,r){return(e.inFlow??t.flow?cle:ale)(t,e,r)}function ale({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=wg.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;m{"use strict";var RU=Be("process");function ele(t,...e){t==="debug"&&console.log(...e)}function tle(t,e){(t==="debug"||t==="warn")&&(typeof RU.emitWarning=="function"?RU.emitWarning(e):console.warn(e))}$E.debug=ele;$E.warn=tle});var bg=v(_g=>{"use strict";var yg=Pe(),CU=Pt(),hg="<<",gg={identify:t=>t===hg||typeof t=="symbol"&&t.description===hg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new CU.Scalar(Symbol(hg)),{addToJSMap:DU}),stringify:()=>hg},rle=(t,e)=>(gg.identify(e)||yg.isScalar(e)&&(!e.type||e.type===CU.Scalar.PLAIN)&&gg.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===gg.tag&&r.default);function DU(t,e,r){let n=NU(t,r);if(yg.isSeq(n))for(let i of n.items)EE(t,e,i);else if(Array.isArray(n))for(let i of n)EE(t,e,i);else EE(t,e,n)}function EE(t,e,r){let n=NU(t,r);if(!yg.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function NU(t,e){return t&&yg.isAlias(e)?e.resolve(t.doc,t):e}_g.addMergeToJSMap=DU;_g.isMergeKey=rle;_g.merge=gg});var TE=v(FU=>{"use strict";var nle=kE(),jU=bg(),ile=md(),MU=Pe(),AE=Eo();function ole(t,e,{key:r,value:n}){if(MU.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(jU.isMergeKey(t,r))jU.addMergeToJSMap(t,e,n);else{let i=AE.toJS(r,"",t);if(e instanceof Map)e.set(i,AE.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let o=sle(r,i,t),s=AE.toJS(n,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function sle(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(MU.isNode(t)&&r?.doc){let n=ile.createStringifyContext(r.doc,{});n.anchors=new Set;for(let o of r.anchors.keys())n.anchors.add(o.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),nle.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}FU.addPairToJSMap=ole});var Io=v(OE=>{"use strict";var zU=ld(),ale=PU(),cle=TE(),vg=Pe();function lle(t,e,r){let n=zU.createNode(t,void 0,r),i=zU.createNode(e,void 0,r);return new Sg(n,i)}var Sg=class t{constructor(e,r=null){Object.defineProperty(this,vg.NODE_TYPE,{value:vg.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return vg.isNode(r)&&(r=r.clone(e)),vg.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return cle.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?ale.stringifyPair(this,e,r,n):JSON.stringify(this)}};OE.Pair=Sg;OE.createPair=lle});var IE=v(UU=>{"use strict";var qs=Pe(),LU=md(),wg=ud();function ule(t,e,r){return(e.inFlow??t.flow?fle:dle)(t,e,r)}function dle({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:o,type:null}),d=!1,f=[];for(let m=0;mg=null,()=>d=!0);g&&(b+=wg.lineComment(b,o,l(g))),d&&g&&(d=!1),f.push(n+b)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let m=1;mg=null);l||(l=d.length>u||b.includes(` +`+wg.indentComment(l(t),c),a&&a()):d&&s&&s(),p}function fle({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;n+=o;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let m=0;mg=null);l||(l=d.length>u||b.includes(` `)),m0&&(l||(l=d.reduce((_,S)=>_+S.length+2,2)+(b.length+2)>e.options.lineWidth)),l&&(b+=",")),g&&(b+=wg.lineComment(b,n,a(g))),d.push(b),u=d.length}let{start:f,end:p}=r;if(d.length===0)return f+p;if(!l){let m=d.reduce((h,g)=>h+g.length+2,2);l=e.options.lineWidth>0&&m>e.options.lineWidth}if(l){let m=f;for(let h of d)m+=h?` ${o}${i}${h}`:` `;return`${m} -${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function xg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=wg.indentComment(e(n),t);r.push(o.trimStart())}}MU.stringifyCollection=sle});var Ro=v(OE=>{"use strict";var lle=AE(),ule=kE(),dle=lg(),Po=Pe(),$g=Io(),fle=Pt();function gd(t,e){let r=Po.isScalar(e)?e.value:e;for(let n of t)if(Po.isPair(n)&&(n.key===e||n.key===r||Po.isScalar(n.key)&&n.key.value===r))return n}var TE=class extends dle.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Po.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push($g.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Po.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new $g.Pair(e,e?.value):n=new $g.Pair(e.key,e.value);let i=gd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Po.isScalar(i.value)&&fle.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gd(this.items,e)?.value;return(!r&&Po.isScalar(i)?i.value:i)??void 0}has(e){return!!gd(this.items,e)}set(e,r){this.add(new $g.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)ule.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Po.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),lle.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};OE.YAMLMap=TE;OE.findPair=gd});var fc=v(zU=>{"use strict";var ple=Pe(),FU=Ro(),mle={collection:"map",default:!0,nodeClass:FU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ple.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>FU.YAMLMap.from(t,e,r)};zU.map=mle});var Co=v(LU=>{"use strict";var hle=ld(),gle=AE(),yle=lg(),Eg=Pe(),_le=Pt(),ble=Eo(),IE=class extends yle.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Eg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=kg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=kg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Eg.isScalar(i)?i.value:i}has(e){let r=kg(e);return typeof r=="number"&&r=0?e:null}LU.YAMLSeq=IE});var pc=v(qU=>{"use strict";var vle=Pe(),UU=Co(),Sle={collection:"seq",default:!0,nodeClass:UU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return vle.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>UU.YAMLSeq.from(t,e,r)};qU.seq=Sle});var yd=v(BU=>{"use strict";var wle=pd(),xle={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),wle.stringifyString(t,e,r,n)}};BU.string=xle});var Ag=v(GU=>{"use strict";var HU=Pt(),ZU={identify:t=>t==null,createNode:()=>new HU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new HU.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ZU.test.test(t)?t:e.options.nullStr};GU.nullTag=ZU});var PE=v(WU=>{"use strict";var $le=Pt(),VU={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new $le.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&VU.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};WU.boolTag=VU});var mc=v(KU=>{"use strict";function kle({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}KU.stringifyNumber=kle});var CE=v(Tg=>{"use strict";var Ele=Pt(),RE=mc(),Ale={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:RE.stringifyNumber},Tle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():RE.stringifyNumber(t)}},Ole={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Ele.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:RE.stringifyNumber};Tg.float=Ole;Tg.floatExp=Tle;Tg.floatNaN=Ale});var NE=v(Ig=>{"use strict";var JU=mc(),Og=t=>typeof t=="bigint"||Number.isInteger(t),DE=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function YU(t,e,r){let{value:n}=t;return Og(n)&&n>=0?r+n.toString(e):JU.stringifyNumber(t)}var Ile={identify:t=>Og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>DE(t,2,8,r),stringify:t=>YU(t,8,"0o")},Ple={identify:Og,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>DE(t,0,10,r),stringify:JU.stringifyNumber},Rle={identify:t=>Og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>DE(t,2,16,r),stringify:t=>YU(t,16,"0x")};Ig.int=Ple;Ig.intHex=Rle;Ig.intOct=Ile});var QU=v(XU=>{"use strict";var Cle=fc(),Dle=Ag(),Nle=pc(),jle=yd(),Mle=PE(),jE=CE(),ME=NE(),Fle=[Cle.map,Nle.seq,jle.string,Dle.nullTag,Mle.boolTag,ME.intOct,ME.int,ME.intHex,jE.floatNaN,jE.floatExp,jE.float];XU.schema=Fle});var rq=v(tq=>{"use strict";var zle=Pt(),Lle=fc(),Ule=pc();function eq(t){return typeof t=="bigint"||Number.isInteger(t)}var Pg=({value:t})=>JSON.stringify(t),qle=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Pg},{identify:t=>t==null,createNode:()=>new zle.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Pg},{identify:eq,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>eq(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Pg}],Ble={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Hle=[Lle.map,Ule.seq].concat(qle,Ble);tq.schema=Hle});var zE=v(nq=>{"use strict";var _d=Be("buffer"),FE=Pt(),Zle=pd(),Gle={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _d.Buffer=="function")return _d.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Rg=Pe(),LE=Io(),Vle=Pt(),Wle=Co();function iq(t,e){if(Rg.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new LE.Pair(new Vle.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} +${i}${p}`}else return`${f}${s}${d.join(" ")}${s}${p}`}function xg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let o=wg.indentComment(e(n),t);r.push(o.trimStart())}}UU.stringifyCollection=ule});var Ro=v(RE=>{"use strict";var ple=IE(),mle=TE(),hle=lg(),Po=Pe(),$g=Io(),gle=Pt();function gd(t,e){let r=Po.isScalar(e)?e.value:e;for(let n of t)if(Po.isPair(n)&&(n.key===e||n.key===r||Po.isScalar(n.key)&&n.key.value===r))return n}var PE=class extends hle.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Po.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:o}=n,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(r,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push($g.createPair(c,l,n))};if(r instanceof Map)for(let[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))a(c,r[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let n;Po.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new $g.Pair(e,e?.value):n=new $g.Pair(e.key,e.value);let i=gd(this.items,n.key),o=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Po.isScalar(i.value)&&gle.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(o){let s=this.items.findIndex(a=>o(n,a)<0);s===-1?this.items.push(n):this.items.splice(s,0,n)}else this.items.push(n)}delete(e){let r=gd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=gd(this.items,e)?.value;return(!r&&Po.isScalar(i)?i.value:i)??void 0}has(e){return!!gd(this.items,e)}set(e,r){this.add(new $g.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let o of this.items)mle.addPairToJSMap(r,i,o);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Po.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ple.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};RE.YAMLMap=PE;RE.findPair=gd});var fc=v(BU=>{"use strict";var yle=Pe(),qU=Ro(),_le={collection:"map",default:!0,nodeClass:qU.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return yle.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>qU.YAMLMap.from(t,e,r)};BU.map=_le});var Co=v(HU=>{"use strict";var ble=ld(),vle=IE(),Sle=lg(),Eg=Pe(),wle=Pt(),xle=Eo(),CE=class extends Sle.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Eg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=kg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=kg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Eg.isScalar(i)?i.value:i}has(e){let r=kg(e);return typeof r=="number"&&r=0?e:null}HU.YAMLSeq=CE});var pc=v(GU=>{"use strict";var $le=Pe(),ZU=Co(),kle={collection:"seq",default:!0,nodeClass:ZU.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return $le.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>ZU.YAMLSeq.from(t,e,r)};GU.seq=kle});var yd=v(VU=>{"use strict";var Ele=pd(),Ale={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),Ele.stringifyString(t,e,r,n)}};VU.string=Ale});var Ag=v(JU=>{"use strict";var WU=Pt(),KU={identify:t=>t==null,createNode:()=>new WU.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new WU.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&KU.test.test(t)?t:e.options.nullStr};JU.nullTag=KU});var DE=v(XU=>{"use strict";var Tle=Pt(),YU={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Tle.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&YU.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};XU.boolTag=YU});var mc=v(QU=>{"use strict";function Ole({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}QU.stringifyNumber=Ole});var jE=v(Tg=>{"use strict";var Ile=Pt(),NE=mc(),Ple={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:NE.stringifyNumber},Rle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():NE.stringifyNumber(t)}},Cle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Ile.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:NE.stringifyNumber};Tg.float=Cle;Tg.floatExp=Rle;Tg.floatNaN=Ple});var FE=v(Ig=>{"use strict";var eq=mc(),Og=t=>typeof t=="bigint"||Number.isInteger(t),ME=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function tq(t,e,r){let{value:n}=t;return Og(n)&&n>=0?r+n.toString(e):eq.stringifyNumber(t)}var Dle={identify:t=>Og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>ME(t,2,8,r),stringify:t=>tq(t,8,"0o")},Nle={identify:Og,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>ME(t,0,10,r),stringify:eq.stringifyNumber},jle={identify:t=>Og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>ME(t,2,16,r),stringify:t=>tq(t,16,"0x")};Ig.int=Nle;Ig.intHex=jle;Ig.intOct=Dle});var nq=v(rq=>{"use strict";var Mle=fc(),Fle=Ag(),zle=pc(),Lle=yd(),Ule=DE(),zE=jE(),LE=FE(),qle=[Mle.map,zle.seq,Lle.string,Fle.nullTag,Ule.boolTag,LE.intOct,LE.int,LE.intHex,zE.floatNaN,zE.floatExp,zE.float];rq.schema=qle});var sq=v(oq=>{"use strict";var Ble=Pt(),Hle=fc(),Zle=pc();function iq(t){return typeof t=="bigint"||Number.isInteger(t)}var Pg=({value:t})=>JSON.stringify(t),Gle=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Pg},{identify:t=>t==null,createNode:()=>new Ble.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Pg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Pg},{identify:iq,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>iq(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Pg}],Vle={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Wle=[Hle.map,Zle.seq].concat(Gle,Vle);oq.schema=Wle});var qE=v(aq=>{"use strict";var _d=Be("buffer"),UE=Pt(),Kle=pd(),Jle={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof _d.Buffer=="function")return _d.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i{"use strict";var Rg=Pe(),BE=Io(),Yle=Pt(),Xle=Co();function cq(t,e){if(Rg.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new BE.Pair(new Yle.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore} ${i.key.commentBefore}`:n.commentBefore),n.comment){let o=i.value??i.key;o.comment=o.comment?`${n.comment} -${o.comment}`:n.comment}n=i}t.items[r]=Rg.isPair(n)?n:new LE.Pair(n)}}else e("Expected a sequence for this tag");return t}function oq(t,e,r){let{replacer:n}=r,i=new Wle.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(LE.createPair(a,c,r))}return i}var Kle={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:iq,createNode:oq};Cg.createPairs=oq;Cg.pairs=Kle;Cg.resolvePairs=iq});var BE=v(qE=>{"use strict";var sq=Pe(),UE=Eo(),bd=Ro(),Jle=Co(),aq=Dg(),Bs=class t extends Jle.YAMLSeq{constructor(){super(),this.add=bd.YAMLMap.prototype.add.bind(this),this.delete=bd.YAMLMap.prototype.delete.bind(this),this.get=bd.YAMLMap.prototype.get.bind(this),this.has=bd.YAMLMap.prototype.has.bind(this),this.set=bd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(sq.isPair(i)?(o=UE.toJS(i.key,"",r),s=UE.toJS(i.value,o,r)):o=UE.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=aq.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Bs.tag="tag:yaml.org,2002:omap";var Yle={collection:"seq",identify:t=>t instanceof Map,nodeClass:Bs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=aq.resolvePairs(t,e),n=[];for(let{key:i}of r.items)sq.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Bs,r)},createNode:(t,e,r)=>Bs.from(t,e,r)};qE.YAMLOMap=Bs;qE.omap=Yle});var fq=v(HE=>{"use strict";var cq=Pt();function lq({value:t,source:e},r){return e&&(t?uq:dq).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var uq={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new cq.Scalar(!0),stringify:lq},dq={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new cq.Scalar(!1),stringify:lq};HE.falseTag=dq;HE.trueTag=uq});var pq=v(Ng=>{"use strict";var Xle=Pt(),ZE=mc(),Qle={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ZE.stringifyNumber},eue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ZE.stringifyNumber(t)}},tue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Xle.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:ZE.stringifyNumber};Ng.float=tue;Ng.floatExp=eue;Ng.floatNaN=Qle});var hq=v(Sd=>{"use strict";var mq=mc(),vd=t=>typeof t=="bigint"||Number.isInteger(t);function jg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function GE(t,e,r){let{value:n}=t;if(vd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return mq.stringifyNumber(t)}var rue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>jg(t,2,2,r),stringify:t=>GE(t,2,"0b")},nue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>jg(t,1,8,r),stringify:t=>GE(t,8,"0")},iue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>jg(t,0,10,r),stringify:mq.stringifyNumber},oue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>jg(t,2,16,r),stringify:t=>GE(t,16,"0x")};Sd.int=iue;Sd.intBin=rue;Sd.intHex=oue;Sd.intOct=nue});var WE=v(VE=>{"use strict";var zg=Pe(),Mg=Io(),Fg=Ro(),Hs=class t extends Fg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;zg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Mg.Pair(e.key,null):r=new Mg.Pair(e,null),Fg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Fg.findPair(this.items,e);return!r&&zg.isPair(n)?zg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Fg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Mg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Mg.createPair(s,null,n));return o}};Hs.tag="tag:yaml.org,2002:set";var sue={collection:"map",identify:t=>t instanceof Set,nodeClass:Hs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Hs.from(t,e,r),resolve(t,e){if(zg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Hs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};VE.YAMLSet=Hs;VE.set=sue});var JE=v(Lg=>{"use strict";var aue=mc();function KE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function gq(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return aue.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var cue={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>KE(t,r),stringify:gq},lue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>KE(t,!1),stringify:gq},yq={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(yq.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=KE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Lg.floatTime=lue;Lg.intTime=cue;Lg.timestamp=yq});var vq=v(bq=>{"use strict";var uue=fc(),due=Ag(),fue=pc(),pue=yd(),mue=zE(),_q=fq(),YE=pq(),Ug=hq(),hue=bg(),gue=BE(),yue=Dg(),_ue=WE(),XE=JE(),bue=[uue.map,fue.seq,pue.string,due.nullTag,_q.trueTag,_q.falseTag,Ug.intBin,Ug.intOct,Ug.int,Ug.intHex,YE.floatNaN,YE.floatExp,YE.float,mue.binary,hue.merge,gue.omap,yue.pairs,_ue.set,XE.intTime,XE.floatTime,XE.timestamp];bq.schema=bue});var Iq=v(tA=>{"use strict";var $q=fc(),vue=Ag(),kq=pc(),Sue=yd(),wue=PE(),QE=CE(),eA=NE(),xue=QU(),$ue=rq(),Eq=zE(),wd=bg(),Aq=BE(),Tq=Dg(),Sq=vq(),Oq=WE(),qg=JE(),wq=new Map([["core",xue.schema],["failsafe",[$q.map,kq.seq,Sue.string]],["json",$ue.schema],["yaml11",Sq.schema],["yaml-1.1",Sq.schema]]),xq={binary:Eq.binary,bool:wue.boolTag,float:QE.float,floatExp:QE.floatExp,floatNaN:QE.floatNaN,floatTime:qg.floatTime,int:eA.int,intHex:eA.intHex,intOct:eA.intOct,intTime:qg.intTime,map:$q.map,merge:wd.merge,null:vue.nullTag,omap:Aq.omap,pairs:Tq.pairs,seq:kq.seq,set:Oq.set,timestamp:qg.timestamp},kue={"tag:yaml.org,2002:binary":Eq.binary,"tag:yaml.org,2002:merge":wd.merge,"tag:yaml.org,2002:omap":Aq.omap,"tag:yaml.org,2002:pairs":Tq.pairs,"tag:yaml.org,2002:set":Oq.set,"tag:yaml.org,2002:timestamp":qg.timestamp};function Eue(t,e,r){let n=wq.get(e);if(n&&!t)return r&&!n.includes(wd.merge)?n.concat(wd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(wq.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wd.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?xq[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(xq).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}tA.coreKnownTags=kue;tA.getTags=Eue});var iA=v(Pq=>{"use strict";var rA=Pe(),Aue=fc(),Tue=pc(),Oue=yd(),Bg=Iq(),Iue=(t,e)=>t.keye.key?1:0,nA=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Bg.getTags(e,"compat"):e?Bg.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Bg.coreKnownTags:{},this.tags=Bg.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,rA.MAP,{value:Aue.map}),Object.defineProperty(this,rA.SCALAR,{value:Oue.string}),Object.defineProperty(this,rA.SEQ,{value:Tue.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Iue:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Pq.Schema=nA});var Cq=v(Rq=>{"use strict";var Pue=Pe(),oA=md(),xd=ud();function Rue(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=oA.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(xd.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Pue.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(xd.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=oA.stringify(t.contents,i,()=>a=null,c);a&&(l+=xd.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(oA.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` +${o.comment}`:n.comment}n=i}t.items[r]=Rg.isPair(n)?n:new BE.Pair(n)}}else e("Expected a sequence for this tag");return t}function lq(t,e,r){let{replacer:n}=r,i=new Xle.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof n=="function"&&(s=n.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(BE.createPair(a,c,r))}return i}var Qle={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cq,createNode:lq};Cg.createPairs=lq;Cg.pairs=Qle;Cg.resolvePairs=cq});var GE=v(ZE=>{"use strict";var uq=Pe(),HE=Eo(),bd=Ro(),eue=Co(),dq=Dg(),Bs=class t extends eue.YAMLSeq{constructor(){super(),this.add=bd.YAMLMap.prototype.add.bind(this),this.delete=bd.YAMLMap.prototype.delete.bind(this),this.get=bd.YAMLMap.prototype.get.bind(this),this.has=bd.YAMLMap.prototype.has.bind(this),this.set=bd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let o,s;if(uq.isPair(i)?(o=HE.toJS(i.key,"",r),s=HE.toJS(i.value,o,r)):o=HE.toJS(i,"",r),n.has(o))throw new Error("Ordered maps must not include duplicate keys");n.set(o,s)}return n}static from(e,r,n){let i=dq.createPairs(e,r,n),o=new this;return o.items=i.items,o}};Bs.tag="tag:yaml.org,2002:omap";var tue={collection:"seq",identify:t=>t instanceof Map,nodeClass:Bs,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=dq.resolvePairs(t,e),n=[];for(let{key:i}of r.items)uq.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Bs,r)},createNode:(t,e,r)=>Bs.from(t,e,r)};ZE.YAMLOMap=Bs;ZE.omap=tue});var gq=v(VE=>{"use strict";var fq=Pt();function pq({value:t,source:e},r){return e&&(t?mq:hq).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var mq={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new fq.Scalar(!0),stringify:pq},hq={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new fq.Scalar(!1),stringify:pq};VE.falseTag=hq;VE.trueTag=mq});var yq=v(Ng=>{"use strict";var rue=Pt(),WE=mc(),nue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:WE.stringifyNumber},iue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():WE.stringifyNumber(t)}},oue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new rue.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:WE.stringifyNumber};Ng.float=oue;Ng.floatExp=iue;Ng.floatNaN=nue});var bq=v(Sd=>{"use strict";var _q=mc(),vd=t=>typeof t=="bigint"||Number.isInteger(t);function jg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return i==="-"?-1*o:o}function KE(t,e,r){let{value:n}=t;if(vd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return _q.stringifyNumber(t)}var sue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>jg(t,2,2,r),stringify:t=>KE(t,2,"0b")},aue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>jg(t,1,8,r),stringify:t=>KE(t,8,"0")},cue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>jg(t,0,10,r),stringify:_q.stringifyNumber},lue={identify:vd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>jg(t,2,16,r),stringify:t=>KE(t,16,"0x")};Sd.int=cue;Sd.intBin=sue;Sd.intHex=lue;Sd.intOct=aue});var YE=v(JE=>{"use strict";var zg=Pe(),Mg=Io(),Fg=Ro(),Hs=class t extends Fg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;zg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Mg.Pair(e.key,null):r=new Mg.Pair(e,null),Fg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Fg.findPair(this.items,e);return!r&&zg.isPair(n)?zg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Fg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Mg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof i=="function"&&(s=i.call(r,s,s)),o.items.push(Mg.createPair(s,null,n));return o}};Hs.tag="tag:yaml.org,2002:set";var uue={collection:"map",identify:t=>t instanceof Set,nodeClass:Hs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Hs.from(t,e,r),resolve(t,e){if(zg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Hs,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};JE.YAMLSet=Hs;JE.set=uue});var QE=v(Lg=>{"use strict";var due=mc();function XE(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=n.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return r==="-"?i(-1)*o:o}function vq(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return due.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),n+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var fue={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>XE(t,r),stringify:vq},pue={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>XE(t,!1),stringify:vq},Sq={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Sq.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,n-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let d=XE(u,!1);Math.abs(d)<30&&(d*=60),l-=6e4*d}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Lg.floatTime=pue;Lg.intTime=fue;Lg.timestamp=Sq});var $q=v(xq=>{"use strict";var mue=fc(),hue=Ag(),gue=pc(),yue=yd(),_ue=qE(),wq=gq(),eA=yq(),Ug=bq(),bue=bg(),vue=GE(),Sue=Dg(),wue=YE(),tA=QE(),xue=[mue.map,gue.seq,yue.string,hue.nullTag,wq.trueTag,wq.falseTag,Ug.intBin,Ug.intOct,Ug.int,Ug.intHex,eA.floatNaN,eA.floatExp,eA.float,_ue.binary,bue.merge,vue.omap,Sue.pairs,wue.set,tA.intTime,tA.floatTime,tA.timestamp];xq.schema=xue});var Dq=v(iA=>{"use strict";var Tq=fc(),$ue=Ag(),Oq=pc(),kue=yd(),Eue=DE(),rA=jE(),nA=FE(),Aue=nq(),Tue=sq(),Iq=qE(),wd=bg(),Pq=GE(),Rq=Dg(),kq=$q(),Cq=YE(),qg=QE(),Eq=new Map([["core",Aue.schema],["failsafe",[Tq.map,Oq.seq,kue.string]],["json",Tue.schema],["yaml11",kq.schema],["yaml-1.1",kq.schema]]),Aq={binary:Iq.binary,bool:Eue.boolTag,float:rA.float,floatExp:rA.floatExp,floatNaN:rA.floatNaN,floatTime:qg.floatTime,int:nA.int,intHex:nA.intHex,intOct:nA.intOct,intTime:qg.intTime,map:Tq.map,merge:wd.merge,null:$ue.nullTag,omap:Pq.omap,pairs:Rq.pairs,seq:Oq.seq,set:Cq.set,timestamp:qg.timestamp},Oue={"tag:yaml.org,2002:binary":Iq.binary,"tag:yaml.org,2002:merge":wd.merge,"tag:yaml.org,2002:omap":Pq.omap,"tag:yaml.org,2002:pairs":Rq.pairs,"tag:yaml.org,2002:set":Cq.set,"tag:yaml.org,2002:timestamp":qg.timestamp};function Iue(t,e,r){let n=Eq.get(e);if(n&&!t)return r&&!n.includes(wd.merge)?n.concat(wd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(Eq.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(wd.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?Aq[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Aq).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}iA.coreKnownTags=Oue;iA.getTags=Iue});var aA=v(Nq=>{"use strict";var oA=Pe(),Pue=fc(),Rue=pc(),Cue=yd(),Bg=Dq(),Due=(t,e)=>t.keye.key?1:0,sA=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Bg.getTags(e,"compat"):e?Bg.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Bg.coreKnownTags:{},this.tags=Bg.getTags(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,oA.MAP,{value:Pue.map}),Object.defineProperty(this,oA.SCALAR,{value:Cue.string}),Object.defineProperty(this,oA.SEQ,{value:Rue.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Due:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Nq.Schema=sA});var Mq=v(jq=>{"use strict";var Nue=Pe(),cA=md(),xd=ud();function jue(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=cA.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=o(t.commentBefore);r.unshift(xd.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Nue.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);r.push(xd.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=cA.stringify(t.contents,i,()=>a=null,c);a&&(l+=xd.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(cA.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(` `)?(r.push("..."),r.push(xd.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(xd.indentComment(o(c),"")))}return r.join(` `)+` -`}Rq.stringifyDocument=Rue});var $d=v(Dq=>{"use strict";var Cue=cd(),hc=lg(),mn=Pe(),Due=Io(),Nue=Eo(),jue=iA(),Mue=Cq(),sA=og(),Fue=uE(),zue=ld(),aA=lE(),cA=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mn.NODE_TYPE,{value:mn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new aA.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[mn.NODE_TYPE]:{value:mn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=mn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){gc(this.contents)&&this.contents.add(e)}addIn(e,r){gc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=sA.anchorNames(this);e.anchor=!r||n.has(r)?sA.findNewAnchor(r||"a",n):r}return new Cue.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=sA.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=zue.createNode(e,u,m);return a&&mn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Due.Pair(i,o)}delete(e){return gc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):gc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return mn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return hc.isEmptyPath(e)?!r&&mn.isScalar(this.contents)?this.contents.value:this.contents:mn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return mn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return hc.isEmptyPath(e)?this.contents!==void 0:mn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=hc.collectionFromPath(this.schema,[e],r):gc(this.contents)&&this.contents.set(e,r)}setIn(e,r){hc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=hc.collectionFromPath(this.schema,Array.from(e),r):gc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new aA.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new aA.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new jue.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Nue.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Fue.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Mue.stringifyDocument(this,e)}};function gc(t){if(mn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Dq.Document=cA});var Ad=v(Ed=>{"use strict";var kd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},lA=class extends kd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},uA=class extends kd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Lue=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 +`}jq.stringifyDocument=jue});var $d=v(Fq=>{"use strict";var Mue=cd(),hc=lg(),mn=Pe(),Fue=Io(),zue=Eo(),Lue=aA(),Uue=Mq(),lA=og(),que=pE(),Bue=ld(),uA=fE(),dA=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mn.NODE_TYPE,{value:mn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=o;let{version:s}=o;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new uA.Directives({version:s}),this.setSchema(s,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[mn.NODE_TYPE]:{value:mn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=mn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){gc(this.contents)&&this.contents.add(e)}addIn(e,r){gc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=lA.anchorNames(this);e.anchor=!r||n.has(r)?lA.findNewAnchor(r||"a",n):r}return new Mue.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let g=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,b=r.filter(g).map(String);b.length>0&&(r=r.concat(b)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:d,setAnchors:f,sourceObjects:p}=lA.createNodeAnchors(this,s||"a"),m={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},h=Bue.createNode(e,u,m);return a&&mn.isCollection(h)&&(h.flow=!0),f(),h}createPair(e,r,n={}){let i=this.createNode(e,null,n),o=this.createNode(r,null,n);return new Fue.Pair(i,o)}delete(e){return gc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):gc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return mn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return hc.isEmptyPath(e)?!r&&mn.isScalar(this.contents)?this.contents.value:this.contents:mn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return mn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return hc.isEmptyPath(e)?this.contents!==void 0:mn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=hc.collectionFromPath(this.schema,[e],r):gc(this.contents)&&this.contents.set(e,r)}setIn(e,r){hc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=hc.collectionFromPath(this.schema,Array.from(e),r):gc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new uA.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new uA.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Lue.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=zue.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?que.applyReviver(s,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Uue.stringifyDocument(this,e)}};function gc(t){if(mn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Fq.Document=dA});var Ad=v(Ed=>{"use strict";var kd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},fA=class extends kd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},pA=class extends kd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},Hue=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026 `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];c?.line===n&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);r.message+=`: ${s} ${l} -`}};Ed.YAMLError=kd;Ed.YAMLParseError=lA;Ed.YAMLWarning=uA;Ed.prettifyError=Lue});var Td=v(Nq=>{"use strict";function Uue(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let E of t)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),E.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&E.source.includes(" ")&&(h=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=E.source.substring(1)||" ";d?d+=f+C:d=C,f="",l=!1;break}case"newline":l?d?d+=E.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=E.source,l=!0,p=!0,(g||b)&&(_=E),u=!0;break;case"anchor":g&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=E,w??(w=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,w??(w=E.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),x&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e??"collection"}`),x=E,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let R=t[t.length-1],A=R?R.offset+R.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:A,start:w??A}}Nq.resolveProps=Uue});var Hg=v(jq=>{"use strict";function dA(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(dA(e.key)||dA(e.value))return!0}return!1;default:return!0}}jq.containsNewline=dA});var fA=v(Mq=>{"use strict";var que=Hg();function Bue(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&que.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Mq.flowIndentCheck=Bue});var pA=v(zq=>{"use strict";var Fq=Pe();function Hue(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||Fq.isScalar(o)&&Fq.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}zq.mapIncludes=Hue});var Zq=v(Hq=>{"use strict";var Lq=Io(),Zue=Ro(),Uq=Td(),Gue=Hg(),qq=fA(),Vue=pA(),Bq="All mapping items must start at the same column";function Wue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Zue.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=Uq.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Bq)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` -`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Gue.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Bq);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&qq.flowIndentCheck(n.indent,f,i),r.atKey=!1,Vue.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=Uq.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Kue=Co(),Jue=Td(),Yue=fA();function Xue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kue.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=Jue.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&Yue.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Gq.resolveBlockSeq=Xue});var yc=v(Wq=>{"use strict";function Que(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Wq.resolveEnd=Que});var Xq=v(Yq=>{"use strict";var ede=Pe(),tde=Io(),Kq=Ro(),rde=Co(),nde=yc(),Jq=Td(),ide=Hg(),ode=pA(),mA="Block collections are not allowed within flow collections",hA=t=>t&&(t.type==="block-map"||t.type==="block-seq");function sde({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Kq.YAMLMap:rde.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=nde.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` -`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}Yq.resolveFlowCollection=sde});var e4=v(Qq=>{"use strict";var ade=Pe(),cde=Pt(),lde=Ro(),ude=Co(),dde=Zq(),fde=Vq(),pde=Xq();function gA(t,e,r,n,i,o){let s=r.type==="block-map"?dde.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?fde.resolveBlockSeq(t,e,r,n,o):pde.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function mde(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),gA(t,e,r,i,s)}let l=gA(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=ade.isNode(u)?u:new cde.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}Qq.composeCollection=mde});var _A=v(t4=>{"use strict";var yA=Pt();function hde(t,e,r){let n=e.offset,i=gde(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?yA.Scalar.BLOCK_FOLDED:yA.Scalar.BLOCK_LITERAL,s=e.source?yde(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` +`}};Ed.YAMLError=kd;Ed.YAMLParseError=fA;Ed.YAMLWarning=pA;Ed.prettifyError=Hue});var Td=v(zq=>{"use strict";function Zue(t,{flow:e,indicator:r,next:n,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,d="",f="",p=!1,m=!1,h=null,g=null,b=null,_=null,S=null,x=null,w=null;for(let E of t)switch(m&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&o(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),h&&(l&&E.type!=="comment"&&E.type!=="newline"&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),E.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&E.source.includes(" ")&&(h=E),u=!0;break;case"comment":{u||o(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=E.source.substring(1)||" ";d?d+=f+C:d=C,f="",l=!1;break}case"newline":l?d?d+=E.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=E.source,l=!0,p=!0,(g||b)&&(_=E),u=!0;break;case"anchor":g&&o(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&o(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=E,w??(w=E.offset),l=!1,u=!1,m=!0;break;case"tag":{b&&o(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,w??(w=E.offset),l=!1,u=!1,m=!0;break}case r:(g||b)&&o(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),x&&o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e??"collection"}`),x=E,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(e){S&&o(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),S=E,l=!1,u=!1;break}default:o(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),l=!1,u=!1}let R=t[t.length-1],A=R?R.offset+R.source.length:i;return m&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&o(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(l&&h.indent<=s||n?.type==="block-map"||n?.type==="block-seq")&&o(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:x,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:b,newlineAfterProp:_,end:A,start:w??A}}zq.resolveProps=Zue});var Hg=v(Lq=>{"use strict";function mA(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(mA(e.key)||mA(e.value))return!0}return!1;default:return!0}}Lq.containsNewline=mA});var hA=v(Uq=>{"use strict";var Gue=Hg();function Vue(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Gue.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Uq.flowIndentCheck=Vue});var gA=v(Bq=>{"use strict";var qq=Pe();function Wue(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(o,s)=>o===s||qq.isScalar(o)&&qq.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,r))}Bq.mapIncludes=Wue});var Kq=v(Wq=>{"use strict";var Hq=Io(),Kue=Ro(),Zq=Td(),Jue=Hg(),Gq=hA(),Yue=gA(),Vq="All mapping items must start at the same column";function Xue({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Kue.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(let u of n.items){let{start:d,key:f,sep:p,value:m}=u,h=Zq.resolveProps(d,{indicator:"explicit-key-ind",next:f??p?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),g=!h.found;if(g){if(f&&(f.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&i(c,"BAD_INDENT",Vq)),!h.anchor&&!h.tag&&!p){l=h.end,h.comment&&(a.comment?a.comment+=` +`+h.comment:a.comment=h.comment);continue}(h.newlineAfterProp||Jue.containsNewline(f))&&i(f??d[d.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Vq);r.atKey=!0;let b=h.end,_=f?t(r,f,h,i):e(r,b,d,null,h,i);r.schema.compat&&Gq.flowIndentCheck(n.indent,f,i),r.atKey=!1,Yue.mapIncludes(r,a.items,_)&&i(b,"DUPLICATE_KEY","Map keys must be unique");let S=Zq.resolveProps(p??[],{indicator:"map-value-ind",next:m,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=S.end,S.found){g&&(m?.type==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&h.start{"use strict";var Que=Co(),ede=Td(),tde=hA();function rde({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=o?.nodeClass??Que.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(let{start:u,value:d}of n.items){let f=ede.resolveProps(u,{indicator:"seq-item-ind",next:d,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)d?.type==="block-seq"?i(f.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}let p=d?t(r,d,f,i):e(r,f.end,u,null,f,i);r.schema.compat&&tde.flowIndentCheck(n.indent,d,i),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}Jq.resolveBlockSeq=rde});var yc=v(Xq=>{"use strict";function nde(t,e,r,n){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{r&&!o&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Xq.resolveEnd=nde});var r4=v(t4=>{"use strict";var ide=Pe(),ode=Io(),Qq=Ro(),sde=Co(),ade=yc(),e4=Td(),cde=Hg(),lde=gA(),yA="Block collections are not allowed within flow collections",_A=t=>t&&(t.type==="block-map"||t.type==="block-seq");function ude({composeNode:t,composeEmptyNode:e},r,n,i,o){let s=n.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Qq.YAMLMap:sde.YAMLSeq),l=new c(r.schema);l.flow=!0;let u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let d=n.offset+n.start.source.length;for(let g=0;g0){let g=ade.resolveEnd(m,h,r.options.strict,i);g.comment&&(l.comment?l.comment+=` +`+g.comment:l.comment=g.comment),l.range=[n.offset,h,g.offset]}else l.range=[n.offset,h,h];return l}t4.resolveFlowCollection=ude});var i4=v(n4=>{"use strict";var dde=Pe(),fde=Pt(),pde=Ro(),mde=Co(),hde=Kq(),gde=Yq(),yde=r4();function bA(t,e,r,n,i,o){let s=r.type==="block-map"?hde.resolveBlockMap(t,e,r,n,o):r.type==="block-seq"?gde.resolveBlockSeq(t,e,r,n,o):yde.resolveFlowCollection(t,e,r,n,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function _de(t,e,r,n,i){let o=n.tag,s=o?e.directives.tagName(o.source,f=>i(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=n,m=f&&o?f.offset>o.offset?f:o:f??o;m&&(!p||p.offsetf.tag===s&&f.collection===a);if(!c){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?i(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),bA(t,e,r,i,s)}let l=bA(t,e,r,i,s,c),u=c.resolve?.(l,f=>i(o,"TAG_RESOLVE_FAILED",f),e.options)??l,d=dde.isNode(u)?u:new fde.Scalar(u);return d.range=l.range,d.tag=s,c?.format&&(d.format=c.format),d}n4.composeCollection=_de});var SA=v(o4=>{"use strict";var vA=Pt();function bde(t,e,r){let n=e.offset,i=vde(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let o=i.mode===">"?vA.Scalar.BLOCK_FOLDED:vA.Scalar.BLOCK_LITERAL,s=e.source?Sde(e.source):[],a=s.length;for(let h=s.length-1;h>=0;--h){let g=s[h][1];if(g===""||g==="\r")a=h;else break}if(a===0){let h=i.chomp==="+"&&s.length>0?` `.repeat(Math.max(1,s.length-1)):"",g=n+i.length;return e.source&&(g+=e.source.length),{value:h,type:o,comment:i.comment,range:[n,g,g]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let h=0;hc&&(c=g.length);else{g.length=a;--h)s[h][0].length>c&&(a=h+1);let d="",f="",p=!1;for(let h=0;hc||b[0]===" "?(f===" "?f=` `:!p&&f===` `&&(f=` @@ -112,46 +112,46 @@ ${l} `+s[h][0].slice(c);d[d.length-1]!==` `&&(d+=` `);break;default:d+=` -`}let m=n+i.length+e.source.length;return{value:d,type:o,comment:i.comment,range:[n,m,m]}}function gde({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let f=1;f{"use strict";var bA=Pt(),_de=yc();function bde(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=bA.Scalar.PLAIN,c=vde(o,l);break;case"single-quoted-scalar":a=bA.Scalar.QUOTE_SINGLE,c=Sde(o,l);break;case"double-quoted-scalar":a=bA.Scalar.QUOTE_DOUBLE,c=wde(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=_de.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function vde(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),r4(t)}function Sde(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),r4(t.slice(1,-1)).replace(/''/g,"'")}function r4(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";var wA=Pt(),wde=yc();function xde(t,e,r){let{offset:n,type:i,source:o,end:s}=t,a,c,l=(f,p,m)=>r(n+f,p,m);switch(i){case"scalar":a=wA.Scalar.PLAIN,c=$de(o,l);break;case"single-quoted-scalar":a=wA.Scalar.QUOTE_SINGLE,c=kde(o,l);break;case"double-quoted-scalar":a=wA.Scalar.QUOTE_DOUBLE,c=Ede(o,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+o.length,n+o.length]}}let u=n+o.length,d=wde.resolveEnd(s,u,e,r);return{value:c,type:a,comment:d.comment,range:[n,u,d.offset]}}function $de(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),s4(t)}function kde(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),s4(t.slice(1,-1)).replace(/''/g,"'")}function s4(t){let e,r;try{e=new RegExp(`(.*?)(?o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function xde(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>o?t.slice(o,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function Ade(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var $de={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function kde(t,e,r,n){let i=t.substr(e,r),s=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}n4.resolveFlowScalar=bde});var s4=v(o4=>{"use strict";var Zs=Pe(),i4=Pt(),Ede=_A(),Ade=vA();function Tde(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Ede.resolveBlockScalar(t,e,n):Ade.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Zs.SCALAR]:c?l=Ode(t.schema,i,c,r,n):e.type==="scalar"?l=Ide(t,i,e,n):l=t.schema[Zs.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Zs.isScalar(d)?d:new i4.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new i4.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Ode(t,e,r,n,i){if(r==="!")return t[Zs.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Zs.SCALAR])}function Ide({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Zs.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Zs.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}o4.composeScalar=Tde});var c4=v(a4=>{"use strict";function Pde(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}a4.emptyScalarPosition=Pde});var d4=v(wA=>{"use strict";var Rde=cd(),Cde=Pe(),Dde=e4(),l4=s4(),Nde=yc(),jde=c4(),Mde={composeNode:u4,composeEmptyNode:SA};function u4(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=Fde(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=l4.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Dde.composeCollection(Mde,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=SA(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Cde.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function SA(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:jde.emptyScalarPosition(e,r,n),indent:-1,source:""},d=l4.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function Fde({options:t},{offset:e,source:r,end:n},i){let o=new Rde.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=Nde.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}wA.composeEmptyNode=SA;wA.composeNode=u4});var m4=v(p4=>{"use strict";var zde=$d(),f4=d4(),Lde=yc(),Ude=Td();function qde(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new zde.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ude.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?f4.composeNode(l,i,u,s):f4.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Lde.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}p4.composeDoc=qde});var $A=v(y4=>{"use strict";var Bde=Be("process"),Hde=lE(),Zde=$d(),Od=Ad(),h4=Pe(),Gde=m4(),Vde=yc();function Id(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function g4(t){let e="",r=!1,n=!1;for(let i=0;i{"use strict";var Zs=Pe(),c4=Pt(),Ide=SA(),Pde=xA();function Rde(t,e,r,n){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Ide.resolveBlockScalar(t,e,n):Pde.resolveFlowScalar(e,t.options.strict,n),c=r?t.directives.tagName(r.source,d=>n(r,"TAG_RESOLVE_FAILED",d)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Zs.SCALAR]:c?l=Cde(t.schema,i,c,r,n):e.type==="scalar"?l=Dde(t,i,e,n):l=t.schema[Zs.SCALAR];let u;try{let d=l.resolve(i,f=>n(r??e,"TAG_RESOLVE_FAILED",f),t.options);u=Zs.isScalar(d)?d:new c4.Scalar(d)}catch(d){let f=d instanceof Error?d.message:String(d);n(r??e,"TAG_RESOLVE_FAILED",f),u=new c4.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Cde(t,e,r,n,i){if(r==="!")return t[Zs.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Zs.SCALAR])}function Dde({atKey:t,directives:e,schema:r},n,i,o){let s=r.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(n))||r[Zs.SCALAR];if(r.compat){let a=r.compat.find(c=>c.default&&c.test?.test(n))??r[Zs.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}l4.composeScalar=Rde});var f4=v(d4=>{"use strict";function Nde(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}d4.emptyScalarPosition=Nde});var h4=v(kA=>{"use strict";var jde=cd(),Mde=Pe(),Fde=i4(),p4=u4(),zde=yc(),Lde=f4(),Ude={composeNode:m4,composeEmptyNode:$A};function m4(t,e,r,n){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=r,l,u=!0;switch(e.type){case"alias":l=qde(t,e,n),(a||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=p4.composeScalar(t,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Fde.composeCollection(Ude,t,e,r,n),a&&(l.anchor=a.source.substring(1))}catch(d){let f=d instanceof Error?d.message:String(d);n(e,"RESOURCE_EXHAUSTION",f)}break;default:{let d=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",d),u=!1}}return l??(l=$A(t,e.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Mde.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function $A(t,e,r,n,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:Lde.emptyScalarPosition(e,r,n),indent:-1,source:""},d=p4.composeScalar(t,u,a,l);return s&&(d.anchor=s.source.substring(1),d.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(d.spaceBefore=!0),o&&(d.comment=o,d.range[2]=c),d}function qde({options:t},{offset:e,source:r,end:n},i){let o=new jde.Alias(r.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+r.length,a=zde.resolveEnd(n,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}kA.composeEmptyNode=$A;kA.composeNode=m4});var _4=v(y4=>{"use strict";var Bde=$d(),g4=h4(),Hde=yc(),Zde=Td();function Gde(t,e,{offset:r,start:n,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Bde.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Zde.resolveProps(n,{indicator:"doc-start",next:i??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?g4.composeNode(l,i,u,s):g4.composeEmptyNode(l,u.end,n,null,u,s);let d=c.contents.range[2],f=Hde.resolveEnd(o,d,!1,s);return f.comment&&(c.comment=f.comment),c.range=[r,d,f.offset],c}y4.composeDoc=Gde});var AA=v(S4=>{"use strict";var Vde=Be("process"),Wde=fE(),Kde=$d(),Od=Ad(),b4=Pe(),Jde=_4(),Yde=yc();function Id(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function v4(t){let e="",r=!1,n=!1;for(let i=0;i{let s=Id(r);o?this.warnings.push(new Od.YAMLWarning(s,n,i)):this.errors.push(new Od.YAMLParseError(s,n,i))},this.directives=new Hde.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=g4(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(h4.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];h4.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} +`)+(o.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var EA=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,o)=>{let s=Id(r);o?this.warnings.push(new Od.YAMLWarning(s,n,i)):this.errors.push(new Od.YAMLParseError(s,n,i))},this.directives=new Wde.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=v4(this.prelude);if(n){let o=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(i||e.directives.docStart||!o)e.commentBefore=n;else if(b4.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];b4.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${n} ${a}`:n}else{let s=o.commentBefore;o.commentBefore=s?`${n} -${s}`:n}}if(r){for(let o=0;o{let o=Id(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Gde.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Vde.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Zde.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};y4.Composer=xA});var v4=v(Zg=>{"use strict";var Wde=_A(),Kde=vA(),Jde=Ad(),_4=pd();function Yde(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new Jde.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Kde.resolveFlowScalar(t,e,n);case"block-scalar":return Wde.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function Xde(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=_4.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` +${s}`:n}}if(r){for(let o=0;o{let o=Id(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=Jde.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=Yde.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Od.YAMLParseError(Id(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new Kde.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};S4.Composer=EA});var $4=v(Zg=>{"use strict";var Xde=SA(),Qde=xA(),efe=Ad(),w4=pd();function tfe(t,e=!0,r){if(t){let n=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(a,o,s);else throw new efe.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Qde.resolveFlowScalar(t,e,n);case"block-scalar":return Xde.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function rfe(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=w4.stringifyString({type:s,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(a[0]){case"|":case">":{let l=a.indexOf(` `),u=a.substring(0,l),d=a.substring(l+1)+` -`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return b4(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function Qde(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=_4.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":efe(t,c);break;case'"':kA(t,c,"double-quoted-scalar");break;case"'":kA(t,c,"single-quoted-scalar");break;default:kA(t,c,"scalar")}}function efe(t,e){let r=e.indexOf(` +`,f=[{type:"block-scalar-header",offset:o,indent:n,source:u}];return x4(f,c)||f.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:o,indent:n,props:f,source:d}}case'"':return{type:"double-quoted-scalar",offset:o,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:n,source:a,end:c};default:return{type:"scalar",offset:o,indent:n,source:a,end:c}}}function nfe(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=r,a="indent"in t?t.indent:null;if(n&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=w4.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ife(t,c);break;case'"':TA(t,c,"double-quoted-scalar");break;case"'":TA(t,c,"single-quoted-scalar");break;default:TA(t,c,"scalar")}}function ife(t,e){let r=e.indexOf(` `),n=e.substring(0,r),i=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];b4(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` -`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function b4(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function kA(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Zg.createScalarToken=Xde;Zg.resolveAsScalar=Yde;Zg.setScalarValue=Qde});var w4=v(S4=>{"use strict";var tfe=t=>"type"in t?Vg(t):Gg(t);function Vg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Vg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Gg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Gg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Gg(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Gg({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Vg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Vg(n)),i}S4.stringify=tfe});var E4=v(k4=>{"use strict";var EA=Symbol("break visit"),rfe=Symbol("skip children"),x4=Symbol("remove item");function Gs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),$4(Object.freeze([]),t,e)}Gs.BREAK=EA;Gs.SKIP=rfe;Gs.REMOVE=x4;Gs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Gs.parentCollection=(t,e)=>{let r=Gs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function $4(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var AA=v4(),nfe=w4(),ife=E4(),TA="\uFEFF",OA="",IA="",PA="",ofe=t=>!!t&&"items"in t,sfe=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function afe(t){switch(t){case TA:return"";case OA:return"";case IA:return"";case PA:return"";default:return JSON.stringify(t)}}function cfe(t){switch(t){case TA:return"byte-order-mark";case OA:return"doc-mode";case IA:return"flow-error-end";case PA:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=n,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:n}];x4(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:` +`});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function x4(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function TA(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of n)o.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Zg.createScalarToken=rfe;Zg.resolveAsScalar=tfe;Zg.setScalarValue=nfe});var E4=v(k4=>{"use strict";var ofe=t=>"type"in t?Vg(t):Gg(t);function Vg(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Vg(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Gg(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Gg(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Gg(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Gg({start:t,key:e,sep:r,value:n}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Vg(e)),r)for(let o of r)i+=o.source;return n&&(i+=Vg(n)),i}k4.stringify=ofe});var I4=v(O4=>{"use strict";var OA=Symbol("break visit"),sfe=Symbol("skip children"),A4=Symbol("remove item");function Gs(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),T4(Object.freeze([]),t,e)}Gs.BREAK=OA;Gs.SKIP=sfe;Gs.REMOVE=A4;Gs.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let o=r?.[n];if(o&&"items"in o)r=o.items[i];else return}return r};Gs.parentCollection=(t,e)=>{let r=Gs.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function T4(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s{"use strict";var IA=$4(),afe=E4(),cfe=I4(),PA="\uFEFF",RA="",CA="",DA="",lfe=t=>!!t&&"items"in t,ufe=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function dfe(t){switch(t){case PA:return"";case RA:return"";case CA:return"";case DA:return"";default:return JSON.stringify(t)}}function ffe(t){switch(t){case PA:return"byte-order-mark";case RA:return"doc-mode";case CA:return"flow-error-end";case DA:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Tr.createScalarToken=AA.createScalarToken;Tr.resolveAsScalar=AA.resolveAsScalar;Tr.setScalarValue=AA.setScalarValue;Tr.stringify=nfe.stringify;Tr.visit=ife.visit;Tr.BOM=TA;Tr.DOCUMENT=OA;Tr.FLOW_END=IA;Tr.SCALAR=PA;Tr.isCollection=ofe;Tr.isScalar=sfe;Tr.prettyToken=afe;Tr.tokenType=cfe});var DA=v(T4=>{"use strict";var Pd=Wg();function Fn(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}var A4=new Set("0123456789ABCDEFabcdef"),lfe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kg=new Set(",[]{}"),ufe=new Set(` ,[]{} -\r `),RA=t=>!t||ufe.has(t),CA=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Tr.createScalarToken=IA.createScalarToken;Tr.resolveAsScalar=IA.resolveAsScalar;Tr.setScalarValue=IA.setScalarValue;Tr.stringify=afe.stringify;Tr.visit=cfe.visit;Tr.BOM=PA;Tr.DOCUMENT=RA;Tr.FLOW_END=CA;Tr.SCALAR=DA;Tr.isCollection=lfe;Tr.isScalar=ufe;Tr.prettyToken=dfe;Tr.tokenType=ffe});var MA=v(R4=>{"use strict";var Pd=Wg();function Fn(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}var P4=new Set("0123456789ABCDEFabcdef"),pfe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kg=new Set(",[]{}"),mfe=new Set(` ,[]{} +\r `),NA=t=>!t||mfe.has(t),jA=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===` `||!i&&!this.atEnd)return e+n+1}return r===` `||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Fn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!Fn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Fn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(RA),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&nthis.indentValue&&!Fn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Fn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(NA),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Fn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let o=this.pos;n=this.buffer[o];++o)switch(n){case" ":r+=1;break;case` `:e=o,r=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===` @@ -161,28 +161,28 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus `&&o>=this.pos&&o+1+r>a)e=o;else break}while(!0);return yield Pd.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let o=this.buffer[n+1];if(Fn(o)||e&&Kg.has(o))break;r=n}else if(Fn(i)){let o=this.buffer[n+1];if(i==="\r"&&(o===` `?(n+=1,i=` `,o=this.buffer[n+1]):r=n),o==="#"||e&&Kg.has(o))break;if(i===` -`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Kg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Pd.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(RA),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Fn(n)||r&&Kg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Fn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(lfe.has(r))r=this.buffer[++e];else if(r==="%"&&A4.has(this.buffer[e+1])&&A4.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`){let s=this.continueScalar(n+1);if(s===-1)break;n=Math.max(n,s-2)}}else{if(e&&Kg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Pd.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(NA),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Fn(n)||r&&Kg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Fn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(pfe.has(r))r=this.buffer[++e];else if(r==="%"&&P4.has(this.buffer[e+1])&&P4.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};T4.Lexer=CA});var jA=v(O4=>{"use strict";var NA=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var dfe=Be("process"),I4=Wg(),ffe=DA();function Do(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Yg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&R4(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&P4(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};R4.Lexer=jA});var zA=v(C4=>{"use strict";var FA=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[o]{"use strict";var hfe=Be("process"),D4=Wg(),gfe=MA();function Do(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Yg(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&j4(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&N4(i.start)===-1&&(r.indent===0||i.start.every(o=>o.type!=="comment"||o.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Do(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(C4(r.key)&&!Do(r.sep,"newline")){let s=_c(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(Do(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=_c(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Do(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Do(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Yg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Do(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Jg(n),o=_c(i);R4(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Yg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&r.sep&&!r.value){let s=[];for(let a=0;ae.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=r.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Do(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(M4(r.key)&&!Do(r.sep,"newline")){let s=_c(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(Do(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let s=_c(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Do(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Do(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Yg(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Do(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Jg(n),o=_c(i);j4(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Jg(e),n=_c(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Jg(e),n=_c(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};D4.Parser=MA});var z4=v(Cd=>{"use strict";var N4=$A(),pfe=$d(),Rd=Ad(),mfe=wE(),hfe=Pe(),gfe=jA(),j4=FA();function M4(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new gfe.LineCounter||null,prettyErrors:e}}function yfe(t,e={}){let{lineCounter:r,prettyErrors:n}=M4(e),i=new j4.Parser(r?.addNewLine),o=new N4.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Rd.prettifyError(t,r)),a.warnings.forEach(Rd.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function F4(t,e={}){let{lineCounter:r,prettyErrors:n}=M4(e),i=new j4.Parser(r?.addNewLine),o=new N4.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Rd.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Rd.prettifyError(t,r)),s.warnings.forEach(Rd.prettifyError(t,r))),s}function _fe(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=F4(t,r);if(!i)return null;if(i.warnings.forEach(o=>mfe.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function bfe(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return hfe.isDocument(t)&&!n?t.toString(r):new pfe.Document(t,n,r).toString(r)}Cd.parse=_fe;Cd.parseAllDocuments=yfe;Cd.parseDocument=F4;Cd.stringify=bfe});var or=v(He=>{"use strict";var vfe=$A(),Sfe=$d(),wfe=iA(),zA=Ad(),xfe=cd(),No=Pe(),$fe=Io(),kfe=Pt(),Efe=Ro(),Afe=Co(),Tfe=Wg(),Ofe=DA(),Ife=jA(),Pfe=FA(),Xg=z4(),L4=id();He.Composer=vfe.Composer;He.Document=Sfe.Document;He.Schema=wfe.Schema;He.YAMLError=zA.YAMLError;He.YAMLParseError=zA.YAMLParseError;He.YAMLWarning=zA.YAMLWarning;He.Alias=xfe.Alias;He.isAlias=No.isAlias;He.isCollection=No.isCollection;He.isDocument=No.isDocument;He.isMap=No.isMap;He.isNode=No.isNode;He.isPair=No.isPair;He.isScalar=No.isScalar;He.isSeq=No.isSeq;He.Pair=$fe.Pair;He.Scalar=kfe.Scalar;He.YAMLMap=Efe.YAMLMap;He.YAMLSeq=Afe.YAMLSeq;He.CST=Tfe;He.Lexer=Ofe.Lexer;He.LineCounter=Ife.LineCounter;He.Parser=Pfe.Parser;He.parse=Xg.parse;He.parseAllDocuments=Xg.parseAllDocuments;He.parseDocument=Xg.parseDocument;He.stringify=Xg.stringify;He.visit=L4.visit;He.visitAsync=L4.visitAsync});import{execFileSync as Rfe}from"node:child_process";import{existsSync as Cfe,readFileSync as Dfe}from"node:fs";import{join as B4}from"node:path";function vc(t,e){return Rfe("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function ry(t){try{let e=vc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ny(t,e){Nfe(t,e);let r=vc(t,["rev-parse","HEAD"]).trim(),n=jfe(t,e);return{groups:Mfe(t,n),head:r,inventory:{after:q4(ey(t,"spec.yaml")),before:q4(LA(t,e,"spec.yaml"))},since:e,unsharded_commits:Ufe(t,e)}}function UA(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function Nfe(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{vc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function jfe(t,e){let r=vc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!U4(c)&&!U4(a)))if(s.startsWith("A")){let l=Qg(ey(t,c));if(!l)continue;l.status==="done"?n.push(bc(l,"added-as-done")):l.status==="archived"&&n.push(bc(l,"archived"))}else if(s.startsWith("D")){let l=Qg(LA(t,e,a));l&&n.push(bc(l,"archived"))}else{let l=Qg(ey(t,c));if(!l)continue;let d=Qg(LA(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(bc(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(bc(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(bc(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function U4(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function bc(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>UA(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function Qg(t){if(t===null)return null;let e;try{e=(0,ty.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function ey(t,e){let r=B4(t,e);if(!Cfe(r))return null;try{return Dfe(r,"utf8")}catch{return null}}function LA(t,e,r){try{return vc(t,["show",`${e}:${r}`])}catch{return null}}function Mfe(t,e){let r=Ffe(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function Ffe(t){let e=ey(t,B4("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,ty.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function q4(t){let e={};if(t!==null)try{let n=(0,ty.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Ufe(t,e){let r=vc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` -`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);zfe.test(a)&&(Lfe.test(a)||n.push({hash:s,subject:a}))}return n}var ty,zfe,Lfe,iy=y(()=>{"use strict";ty=kt(or(),1);zfe=/^(feat|fix)(\([^)]*\))?!?:/,Lfe=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as qfe}from"node:fs";import{join as Bfe}from"node:path";function oy(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Hfe[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` -`)}function sy(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"} | ${Gfe(l,r)} |`)}return n.join(` -`)}function Gfe(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 Zfe)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${qfe(Bfe(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function ay(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),H4(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)H4(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` -`)}function H4(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=UA(r);n&&t.push(`- ${n}`)}t.push("")}var Hfe,Zfe,qA=y(()=>{"use strict";iy();Hfe={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Zfe=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Vfe}from"node:fs";function di(t="./spec.yaml"){let e=Vfe(t,"utf8");return(0,Z4.parse)(e)}var Z4,cy=y(()=>{"use strict";Z4=kt(or(),1)});var jo=v((Or,GA)=>{"use strict";var BA=Or.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+V4(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()};BA.prototype.toString=function(){return this.property+" "+this.message};var ly=Or.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};ly.prototype.addError=function(e){var r;if(typeof e=="string")r=new BA(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 BA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Vs(this);if(this.throwError)throw r;return r};ly.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Wfe(t,e){return e+": "+t.toString()+` -`}ly.prototype.toString=function(e){return this.errors.map(Wfe).join("")};Object.defineProperty(ly.prototype,"valid",{get:function(){return!this.errors.length}});GA.exports.ValidatorResultError=Vs;function Vs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Vs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Vs.prototype=new Error;Vs.prototype.constructor=Vs;Vs.prototype.name="Validation Error";var G4=Or.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};G4.prototype=Object.create(Error.prototype,{constructor:{value:G4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var HA=Or.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+V4(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};HA.prototype.resolve=function(e){return W4(this.base,e)};HA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=W4(this.base,i||"");var s=new HA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var zn=Or.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]+$/};zn.regexp=zn.regex;zn.pattern=zn.regex;zn.ipv4=zn["ip-address"];Or.isFormat=function(e,r,n){if(typeof e=="string"&&zn[r]!==void 0){if(zn[r]instanceof RegExp)return zn[r].test(e);if(typeof zn[r]=="function")return zn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var V4=Or.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Or.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 Kfe(t,e,r,n){typeof r=="object"?e[n]=ZA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function Jfe(t,e,r){e[r]=t[r]}function Yfe(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=ZA(t[n],e[n]):r[n]=e[n]}function ZA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Kfe.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(Jfe.bind(null,t,n)),Object.keys(e).forEach(Yfe.bind(null,t,e,n))),n}GA.exports.deepMerge=ZA;Or.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 Xfe(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Or.encodePath=function(e){return e.map(Xfe).join("")};Or.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};Or.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var W4=Or.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 X4=v((cVe,Y4)=>{"use strict";var Hr=jo(),Fe=Hr.ValidatorResult,Mo=Hr.SchemaError,VA={};VA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=VA.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Fe(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 WA(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 Fe(e,r,n,i),s=new Fe(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Mo("anyOf must be an array");if(!r.anyOf.some(WA.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 Mo("allOf must be an array");var o=new Fe(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 Mo("oneOf must be an array");var o=new Fe(e,r,n,i),s=new Fe(e,r,n,i),a=r.oneOf.filter(WA.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(!Hr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=WA.call(this,e,n,i,null,r.if),s=new Fe(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!Hr.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(!Hr.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 KA(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 Fe(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!Hr.isSchema(s))throw new Mo('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(KA(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 Fe(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 Mo('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=KA(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 K4(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 Fe(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 Mo('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&&K4.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 Fe(e,r,n,i);for(var s in e)K4.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 Fe(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 Fe(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 Fe(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(!Hr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 Qfe(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var JA=jo();YA.exports.SchemaScanResult=Q4;function Q4(t,e){this.id=t,this.ref=e}YA.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=JA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=JA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!JA.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 e6=X4(),Fo=jo(),t6=uy().scan,r6=Fo.ValidatorResult,epe=Fo.ValidatorResultError,Dd=Fo.SchemaError,n6=Fo.SchemaContext,tpe="/",Vt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(fi),this.attributes=Object.create(e6.validators)};Vt.prototype.customFormats={};Vt.prototype.schemas=null;Vt.prototype.types=null;Vt.prototype.attributes=null;Vt.prototype.unresolvedRefs=null;Vt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=t6(r||tpe,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]};Vt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=Fo.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Dd("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Vt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Dd('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 fi=Vt.prototype.types={};fi.string=function(e){return typeof e=="string"};fi.number=function(e){return typeof e=="number"&&isFinite(e)};fi.integer=function(e){return typeof e=="number"&&e%1===0};fi.boolean=function(e){return typeof e=="boolean"};fi.array=function(e){return Array.isArray(e)};fi.null=function(e){return e===null};fi.date=function(e){return e instanceof Date};fi.any=function(e){return!0};fi.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};o6.exports=Vt});var a6=v((dVe,Vi)=>{"use strict";var rpe=Vi.exports.Validator=s6();Vi.exports.ValidatorResult=jo().ValidatorResult;Vi.exports.ValidatorResultError=jo().ValidatorResultError;Vi.exports.ValidationError=jo().ValidationError;Vi.exports.SchemaError=jo().SchemaError;Vi.exports.SchemaScanResult=uy().SchemaScanResult;Vi.exports.scan=uy().scan;Vi.exports.validate=function(t,e,r){var n=new rpe;return n.validate(t,e,r)}});import{readFileSync as npe}from"node:fs";import{dirname as ipe,join as ope}from"node:path";import{fileURLToPath as spe}from"node:url";function dpe(t){let e=upe.validate(t,lpe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function l6(t){let e=dpe(t);if(!e.valid)throw new Error(`spec.yaml invalid: +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Jg(e),n=_c(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Jg(e),n=_c(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};F4.Parser=LA});var B4=v(Cd=>{"use strict";var z4=AA(),yfe=$d(),Rd=Ad(),_fe=kE(),bfe=Pe(),vfe=zA(),L4=UA();function U4(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vfe.LineCounter||null,prettyErrors:e}}function Sfe(t,e={}){let{lineCounter:r,prettyErrors:n}=U4(e),i=new L4.Parser(r?.addNewLine),o=new z4.Composer(e),s=Array.from(o.compose(i.parse(t)));if(n&&r)for(let a of s)a.errors.forEach(Rd.prettifyError(t,r)),a.warnings.forEach(Rd.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function q4(t,e={}){let{lineCounter:r,prettyErrors:n}=U4(e),i=new L4.Parser(r?.addNewLine),o=new z4.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Rd.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(s.errors.forEach(Rd.prettifyError(t,r)),s.warnings.forEach(Rd.prettifyError(t,r))),s}function wfe(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=q4(t,r);if(!i)return null;if(i.warnings.forEach(o=>_fe.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function xfe(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return bfe.isDocument(t)&&!n?t.toString(r):new yfe.Document(t,n,r).toString(r)}Cd.parse=wfe;Cd.parseAllDocuments=Sfe;Cd.parseDocument=q4;Cd.stringify=xfe});var or=v(He=>{"use strict";var $fe=AA(),kfe=$d(),Efe=aA(),qA=Ad(),Afe=cd(),No=Pe(),Tfe=Io(),Ofe=Pt(),Ife=Ro(),Pfe=Co(),Rfe=Wg(),Cfe=MA(),Dfe=zA(),Nfe=UA(),Xg=B4(),H4=id();He.Composer=$fe.Composer;He.Document=kfe.Document;He.Schema=Efe.Schema;He.YAMLError=qA.YAMLError;He.YAMLParseError=qA.YAMLParseError;He.YAMLWarning=qA.YAMLWarning;He.Alias=Afe.Alias;He.isAlias=No.isAlias;He.isCollection=No.isCollection;He.isDocument=No.isDocument;He.isMap=No.isMap;He.isNode=No.isNode;He.isPair=No.isPair;He.isScalar=No.isScalar;He.isSeq=No.isSeq;He.Pair=Tfe.Pair;He.Scalar=Ofe.Scalar;He.YAMLMap=Ife.YAMLMap;He.YAMLSeq=Pfe.YAMLSeq;He.CST=Rfe;He.Lexer=Cfe.Lexer;He.LineCounter=Dfe.LineCounter;He.Parser=Nfe.Parser;He.parse=Xg.parse;He.parseAllDocuments=Xg.parseAllDocuments;He.parseDocument=Xg.parseDocument;He.stringify=Xg.stringify;He.visit=H4.visit;He.visitAsync=H4.visitAsync});import{execFileSync as jfe}from"node:child_process";import{existsSync as Mfe,readFileSync as Ffe}from"node:fs";import{join as V4}from"node:path";function vc(t,e){return jfe("git",[...e],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}function ry(t){try{let e=vc(t,["describe","--tags","--abbrev=0"]).trim();if(e.length>0)return e}catch{}throw new Error("changelog: no git tag found to anchor the default range \u2014 pass --since explicitly (e.g. clad changelog --since v1.0.0)")}function ny(t,e){zfe(t,e);let r=vc(t,["rev-parse","HEAD"]).trim(),n=Lfe(t,e);return{groups:Ufe(t,n),head:r,inventory:{after:G4(ey(t,"spec.yaml")),before:G4(BA(t,e,"spec.yaml"))},since:e,unsharded_commits:Zfe(t,e)}}function HA(t){if(t.text&&t.text.trim().length>0)return t.text.trim();let e=t.action?.trim();if(!e)return null;let r=t.condition?.trim(),n=t.response?.trim(),i=r?`${r.charAt(0).toUpperCase()}${r.slice(1)}, the system shall ${e}`:`The system shall ${e}`;return n?`${i} \u2014 ${n}.`:`${i}.`}function zfe(t,e){let r=(e??"").trim();if(r.length===0)throw new Error("changelog: empty since ref \u2014 pass --since ");try{vc(t,["rev-parse","--verify","--quiet",`${r}^{commit}`])}catch{throw new Error(`changelog: '${r}' does not resolve to a commit in this repository \u2014 pass --since that exists. An unknown ref is an error, never a silently empty changelog.`)}}function Lfe(t,e){let r=vc(t,["diff","--name-status",`${e}..HEAD`,"--","spec/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.split(" "),s=o[0]??"",a=o[1]??"",c=o.length>2?o[2]:a;if(!(!Z4(c)&&!Z4(a)))if(s.startsWith("A")){let l=Qg(ey(t,c));if(!l)continue;l.status==="done"?n.push(bc(l,"added-as-done")):l.status==="archived"&&n.push(bc(l,"archived"))}else if(s.startsWith("D")){let l=Qg(BA(t,e,a));l&&n.push(bc(l,"archived"))}else{let l=Qg(ey(t,c));if(!l)continue;let d=Qg(BA(t,e,a))?.status;l.status==="done"&&d!=="done"?n.push(bc(l,"flipped-to-done")):l.status==="done"&&d==="done"?n.push(bc(l,"modified-while-done")):l.status==="archived"&&d!=="archived"&&n.push(bc(l,"archived"))}}return n.sort((i,o)=>i.id.localeCompare(o.id)),n}function Z4(t){return t.startsWith("spec/features/")&&(t.endsWith(".yaml")||t.endsWith(".yml"))}function bc(t,e){return{acceptance:(t.acceptance_criteria??[]).map(n=>HA(n)).filter(n=>n!==null),change:e,id:t.id,...t.slug?{slug:t.slug}:{},title:t.title}}function Qg(t){if(t===null)return null;let e;try{e=(0,ty.parse)(t)}catch{return null}let r=e;return!r||typeof r.id!="string"||typeof r.status!="string"?null:{id:r.id,slug:typeof r.slug=="string"?r.slug:void 0,title:typeof r.title=="string"?r.title:r.id,status:r.status,acceptance_criteria:r.acceptance_criteria}}function ey(t,e){let r=V4(t,e);if(!Mfe(r))return null;try{return Ffe(r,"utf8")}catch{return null}}function BA(t,e,r){try{return vc(t,["show",`${e}:${r}`])}catch{return null}}function Ufe(t,e){let r=qfe(t).filter(s=>typeof s.id=="string"&&s.id.length>0).sort((s,a)=>s.id.localeCompare(a.id)),n=[],i=new Set;for(let s of r){let a=new Set(s.features??[]),c=e.filter(l=>a.has(l.id)&&!i.has(l.id));if(c.length!==0){for(let l of c)i.add(l.id);n.push({capability:s.id,features:c,title:s.title??s.id})}}let o=e.filter(s=>!i.has(s.id));return o.length>0&&n.push({capability:"uncategorized",features:o,title:"Uncategorized"}),n}function qfe(t){let e=ey(t,V4("spec","capabilities.yaml"));if(e===null)return[];try{let r=(0,ty.parse)(e);return Array.isArray(r?.capabilities)?r.capabilities:[]}catch{return[]}}function G4(t){let e={};if(t!==null)try{let n=(0,ty.parse)(t);n&&typeof n.inventory=="object"&&n.inventory!==null&&(e=n.inventory)}catch{}let r=n=>typeof e[n]=="number"?e[n]:0;return{capabilities:r("capabilities"),features:r("features"),scenarios:r("scenarios"),test_files:r("test_files")}}function Zfe(t,e){let r=vc(t,["log",`${e}..HEAD`,"--format=%h%x09%s","--","src/"]),n=[];for(let i of r.split(` +`)){if(i.trim().length===0)continue;let o=i.indexOf(" ");if(o<0)continue;let s=i.slice(0,o),a=i.slice(o+1);Bfe.test(a)&&(Hfe.test(a)||n.push({hash:s,subject:a}))}return n}var ty,Bfe,Hfe,iy=y(()=>{"use strict";ty=kt(or(),1);Bfe=/^(feat|fix)(\([^)]*\))?!?:/,Hfe=/\bF-(\d{3,}|[a-f0-9]{6,})\b/});import{existsSync as Gfe}from"node:fs";import{join as Vfe}from"node:path";function oy(t){if(t.groups.reduce((i,o)=>i+o.features.length,0)===0&&t.unsharded_commits.length===0)return`no shipped changes since ${t.since}`;let r=[`# Changes since ${t.since}`,""];for(let i of t.groups){r.push(`## ${i.title}`,"");for(let o of i.features){r.push(`- **${o.title}** (${Wfe[o.change]})`);for(let s of o.acceptance)r.push(` - ${s}`)}r.push("")}if(t.unsharded_commits.length>0){r.push("## Other changes (not yet spec-tracked)","");for(let i of t.unsharded_commits)r.push(`- ${i.subject}`);r.push("")}let n=t.inventory;for((n.before.features!==n.after.features||n.before.scenarios!==n.after.scenarios)&&r.push(`_Spec inventory: ${n.before.features} \u2192 ${n.after.features} features, ${n.before.scenarios} \u2192 ${n.after.scenarios} scenarios._`,"");r[r.length-1]==="";)r.pop();return r.join(` +`)}function sy(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"} | ${Jfe(l,r)} |`)}return n.join(` +`)}function Jfe(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 Kfe)if(n.startsWith(o))return`${n} (${s})`;let i=n.split("#",1)[0]??n;return`${Gfe(Vfe(e,i))?"\u2713":"\u2717"} ${n}`}).join("
")}function ay(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),W4(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)W4(e,s)}for(;e[e.length-1]==="";)e.pop();return e.join(` +`)}function W4(t,e){t.push(`### ${e.title}`,"");for(let r of e.acceptance_criteria??[]){let n=HA(r);n&&t.push(`- ${n}`)}t.push("")}var Wfe,Kfe,ZA=y(()=>{"use strict";iy();Wfe={"added-as-done":"new","flipped-to-done":"completed","modified-while-done":"updated",archived:"retired"};Kfe=[["derived:","machine-suggested \u2014 not author-confirmed"],["self-dogfood:","verified by cladding running on itself"],["fixture:","conformance fixture"],["script:","npm script"]]});import{readFileSync as Yfe}from"node:fs";function di(t="./spec.yaml"){let e=Yfe(t,"utf8");return(0,K4.parse)(e)}var K4,cy=y(()=>{"use strict";K4=kt(or(),1)});var jo=v((Or,KA)=>{"use strict";var GA=Or.ValidationError=function(e,r,n,i,o,s){if(Array.isArray(i)?(this.path=i,this.property=i.reduce(function(c,l){return c+Y4(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()};GA.prototype.toString=function(){return this.property+" "+this.message};var ly=Or.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};ly.prototype.addError=function(e){var r;if(typeof e=="string")r=new GA(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 GA(e.message,this.instance,this.schema,this.path,e.name,e.argument)}if(this.errors.push(r),this.throwFirst)throw new Vs(this);if(this.throwError)throw r;return r};ly.prototype.importErrors=function(e){typeof e=="string"||e&&e.validatorType?this.addError(e):e&&e.errors&&(this.errors=this.errors.concat(e.errors))};function Xfe(t,e){return e+": "+t.toString()+` +`}ly.prototype.toString=function(e){return this.errors.map(Xfe).join("")};Object.defineProperty(ly.prototype,"valid",{get:function(){return!this.errors.length}});KA.exports.ValidatorResultError=Vs;function Vs(t){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Vs),this.instance=t.instance,this.schema=t.schema,this.options=t.options,this.errors=t.errors}Vs.prototype=new Error;Vs.prototype.constructor=Vs;Vs.prototype.name="Validation Error";var J4=Or.SchemaError=function t(e,r){this.message=e,this.schema=r,Error.call(this,e),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)};J4.prototype=Object.create(Error.prototype,{constructor:{value:J4,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var VA=Or.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+Y4(a)},"instance")):this.propertyPath=n,this.base=i,this.schemas=o};VA.prototype.resolve=function(e){return X4(this.base,e)};VA.prototype.makeChild=function(e,r){var n=r===void 0?this.path:this.path.concat([r]),i=e.$id||e.id;let o=X4(this.base,i||"");var s=new VA(e,this.options,n,o,Object.create(this.schemas));return i&&!s.schemas[o]&&(s.schemas[o]=e),s};var zn=Or.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]+$/};zn.regexp=zn.regex;zn.pattern=zn.regex;zn.ipv4=zn["ip-address"];Or.isFormat=function(e,r,n){if(typeof e=="string"&&zn[r]!==void 0){if(zn[r]instanceof RegExp)return zn[r].test(e);if(typeof zn[r]=="function")return zn[r](e)}else if(n&&n.customFormats&&typeof n.customFormats[r]=="function")return n.customFormats[r](e);return!0};var Y4=Or.makeSuffix=function(e){return e=e.toString(),!e.match(/[.\s\[\]]/)&&!e.match(/^[\d]/)?"."+e:e.match(/^\d+$/)?"["+e+"]":"["+JSON.stringify(e)+"]"};Or.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 Qfe(t,e,r,n){typeof r=="object"?e[n]=WA(t[n],r):t.indexOf(r)===-1&&e.push(r)}function epe(t,e,r){e[r]=t[r]}function tpe(t,e,r,n){typeof e[n]!="object"||!e[n]?r[n]=e[n]:t[n]?r[n]=WA(t[n],e[n]):r[n]=e[n]}function WA(t,e){var r=Array.isArray(e),n=r&&[]||{};return r?(t=t||[],n=n.concat(t),e.forEach(Qfe.bind(null,t,n))):(t&&typeof t=="object"&&Object.keys(t).forEach(epe.bind(null,t,n)),Object.keys(e).forEach(tpe.bind(null,t,e,n))),n}KA.exports.deepMerge=WA;Or.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 rpe(t){return"/"+encodeURIComponent(t).replace(/~/g,"%7E")}Or.encodePath=function(e){return e.map(rpe).join("")};Or.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};Or.isSchema=function(e){return typeof e=="object"&&e||typeof e=="boolean"};var X4=Or.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 r6=v((mVe,t6)=>{"use strict";var Hr=jo(),Fe=Hr.ValidatorResult,Mo=Hr.SchemaError,JA={};JA.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var ze=JA.validators={};ze.type=function(e,r,n,i){if(e===void 0)return null;var o=new Fe(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 YA(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 Fe(e,r,n,i),s=new Fe(e,r,n,i);if(!Array.isArray(r.anyOf))throw new Mo("anyOf must be an array");if(!r.anyOf.some(YA.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 Mo("allOf must be an array");var o=new Fe(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 Mo("oneOf must be an array");var o=new Fe(e,r,n,i),s=new Fe(e,r,n,i),a=r.oneOf.filter(YA.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(!Hr.isSchema(r.if))throw new Error('Expected "if" keyword to be a schema');var o=YA.call(this,e,n,i,null,r.if),s=new Fe(e,r,n,i),a;if(o){if(r.then===void 0)return;if(!Hr.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(!Hr.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 XA(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 Fe(e,r,n,i),s=r.propertyNames!==void 0?r.propertyNames:{};if(!Hr.isSchema(s))throw new Mo('Expected "propertyNames" to be a schema (object or boolean)');for(var a in e)if(XA(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 Fe(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 Mo('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(e,a,c,n,i);var l=XA(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 Q4(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 Fe(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 Mo('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&&Q4.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 Fe(e,r,n,i);for(var s in e)Q4.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 Fe(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 Fe(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 Fe(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(!Hr.isSchema(r.contains))throw new Error('Expected "contains" keyword to be a schema');var s=new Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 Fe(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 npe(t,e,r){var n,i=r.length;for(n=e+1,i;n{"use strict";var QA=jo();eT.exports.SchemaScanResult=n6;function n6(t,e){this.id=t,this.ref=e}eT.exports.scan=function(e,r){function n(c,l){if(!l||typeof l!="object")return;if(l.$ref){let p=QA.resolveUrl(c,l.$ref);a[p]=a[p]?a[p]+1:0;return}var u=l.$id||l.id;let d=QA.resolveUrl(c,u);var f=u?d:c;if(f){if(f.indexOf("#")<0&&(f+="#"),s[f]){if(!QA.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 i6=r6(),Fo=jo(),o6=uy().scan,s6=Fo.ValidatorResult,ipe=Fo.ValidatorResultError,Dd=Fo.SchemaError,a6=Fo.SchemaContext,ope="/",Vt=function t(){this.customFormats=Object.create(t.prototype.customFormats),this.schemas={},this.unresolvedRefs=[],this.types=Object.create(fi),this.attributes=Object.create(i6.validators)};Vt.prototype.customFormats={};Vt.prototype.schemas=null;Vt.prototype.types=null;Vt.prototype.attributes=null;Vt.prototype.unresolvedRefs=null;Vt.prototype.addSchema=function(e,r){var n=this;if(!e)return null;var i=o6(r||ope,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]};Vt.prototype.addSubSchemaArray=function(e,r){if(Array.isArray(r))for(var n=0;n",e);var a=Fo.objectGetPath(n.schemas[s],o.substr(1));if(a===void 0)throw new Dd("no such schema "+o+" located in <"+s+">",e);return{subschema:a,switchSchema:r}};Vt.prototype.testType=function(e,r,n,i,o){if(o!==void 0){if(o===null)throw new Dd('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 fi=Vt.prototype.types={};fi.string=function(e){return typeof e=="string"};fi.number=function(e){return typeof e=="number"&&isFinite(e)};fi.integer=function(e){return typeof e=="number"&&e%1===0};fi.boolean=function(e){return typeof e=="boolean"};fi.array=function(e){return Array.isArray(e)};fi.null=function(e){return e===null};fi.date=function(e){return e instanceof Date};fi.any=function(e){return!0};fi.object=function(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof Date)};l6.exports=Vt});var d6=v((yVe,Vi)=>{"use strict";var spe=Vi.exports.Validator=u6();Vi.exports.ValidatorResult=jo().ValidatorResult;Vi.exports.ValidatorResultError=jo().ValidatorResultError;Vi.exports.ValidationError=jo().ValidationError;Vi.exports.SchemaError=jo().SchemaError;Vi.exports.SchemaScanResult=uy().SchemaScanResult;Vi.exports.scan=uy().scan;Vi.exports.validate=function(t,e,r){var n=new spe;return n.validate(t,e,r)}});import{readFileSync as ape}from"node:fs";import{dirname as cpe,join as lpe}from"node:path";import{fileURLToPath as upe}from"node:url";function hpe(t){let e=mpe.validate(t,ppe);return e.valid?{valid:!0,errors:[]}:{valid:!1,errors:e.errors.map(n=>`${n.property}: ${n.message}`)}}function p6(t){let e=hpe(t);if(!e.valid)throw new Error(`spec.yaml invalid: ${e.errors.join(` - `)}`)}var c6,ape,cpe,lpe,upe,u6=y(()=>{"use strict";c6=kt(a6(),1),ape=ipe(spe(import.meta.url)),cpe=ope(ape,"schema.json"),lpe=JSON.parse(npe(cpe,"utf8")),upe=new c6.Validator});import{existsSync as XA,readdirSync as fpe}from"node:fs";import{dirname as ppe,join as Ws,resolve as f6}from"node:path";function d6(t){return XA(t)?fpe(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>di(Ws(t,r))):[]}function Ks(t,e){dy=e?{cwd:f6(t),spec:e}:null}function Y(t=".",e="spec.yaml"){return dy&&e==="spec.yaml"&&f6(t)===dy.cwd?dy.spec:mpe(t,e)}function mpe(t,e){let r=Ws(t,e),n=di(r),i=Ws(t,ppe(e),"spec");if(!n.features||n.features.length===0){let o=d6(Ws(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=d6(Ws(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Ws(i,"architecture.yaml");XA(o)&&(n.architecture=di(o))}if(!n.capabilities||n.capabilities.length===0){let o=Ws(i,"capabilities.yaml");if(XA(o)){let s=di(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return l6(n),n}var dy,at=y(()=>{"use strict";cy();u6();dy=null});import Sc from"node:process";function tT(){return!!Sc.stdout.isTTY}function B(t,e,r=""){let n=p6[t],i=r?` ${r}`:"";tT()?Sc.stdout.write(`${QA[t]}${n}${eT} ${e}${i} + `)}`)}var f6,dpe,fpe,ppe,mpe,m6=y(()=>{"use strict";f6=kt(d6(),1),dpe=cpe(upe(import.meta.url)),fpe=lpe(dpe,"schema.json"),ppe=JSON.parse(ape(fpe,"utf8")),mpe=new f6.Validator});import{existsSync as tT,readdirSync as gpe}from"node:fs";import{dirname as ype,join as Ws,resolve as g6}from"node:path";function h6(t){return tT(t)?gpe(t).filter(r=>r.endsWith(".yaml")||r.endsWith(".yml")).map(r=>di(Ws(t,r))):[]}function Ks(t,e){dy=e?{cwd:g6(t),spec:e}:null}function Y(t=".",e="spec.yaml"){return dy&&e==="spec.yaml"&&g6(t)===dy.cwd?dy.spec:_pe(t,e)}function _pe(t,e){let r=Ws(t,e),n=di(r),i=Ws(t,ype(e),"spec");if(!n.features||n.features.length===0){let o=h6(Ws(i,"features"));o.length>0&&(n.features=o)}if(!n.scenarios||n.scenarios.length===0){let o=h6(Ws(i,"scenarios"));o.length>0&&(n.scenarios=o)}if(!n.architecture){let o=Ws(i,"architecture.yaml");tT(o)&&(n.architecture=di(o))}if(!n.capabilities||n.capabilities.length===0){let o=Ws(i,"capabilities.yaml");if(tT(o)){let s=di(o);s&&Array.isArray(s.capabilities)&&(n.capabilities=s.capabilities)}}return p6(n),n}var dy,at=y(()=>{"use strict";cy();m6();dy=null});import Sc from"node:process";function iT(){return!!Sc.stdout.isTTY}function B(t,e,r=""){let n=y6[t],i=r?` ${r}`:"";iT()?Sc.stdout.write(`${rT[t]}${n}${nT} ${e}${i} `):Sc.stdout.write(`${n} ${e}${i} -`)}function Nd(t,e,r=""){if(!tT())return;let n=r?` ${r}`:"";Sc.stdout.write(`${m6}${QA.start}\xB7${eT} ${t} \xB7 ${e}${n}`)}function Js(t,e,r=""){let n=p6[t],i=r?` ${r}`:"";tT()?Sc.stdout.write(`${m6}${QA[t]}${n}${eT} ${e}${i} +`)}function Nd(t,e,r=""){if(!iT())return;let n=r?` ${r}`:"";Sc.stdout.write(`${_6}${rT.start}\xB7${nT} ${t} \xB7 ${e}${n}`)}function Js(t,e,r=""){let n=y6[t],i=r?` ${r}`:"";iT()?Sc.stdout.write(`${_6}${rT[t]}${n}${nT} ${e}${i} `):Sc.stdout.write(`${n} ${e}${i} -`)}var p6,QA,eT,m6,zo=y(()=>{"use strict";p6={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},QA={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},eT="\x1B[0m",m6="\r\x1B[K"});import{execFileSync as g6}from"node:child_process";import{appendFileSync as hpe,existsSync as rT,mkdirSync as gpe,readFileSync as ype,renameSync as _pe,statSync as bpe}from"node:fs";import{userInfo as vpe}from"node:os";import{dirname as Spe,join as y6}from"node:path";function _6(t){return y6(t,wpe,xpe)}function Zr(t,e){let r=_6(t),n=Spe(r);rT(n)||gpe(n,{recursive:!0});try{rT(r)&&bpe(r).size>kpe&&_pe(r,y6(n,$pe))}catch{}hpe(r,`${JSON.stringify(e)} -`,"utf8")}function jd(t){let e=_6(t);if(!rT(e))return[];let r=ype(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function Gr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function Epe(t){let e;try{e=g6("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=vpe().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function Ape(t){try{return g6("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function nT(t,e){try{let r=jd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function Ki(t,e,r){try{let n=Ape(t),i=Epe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=nT(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Zr(t,Gr(e,o))}catch{}}var wpe,xpe,$pe,kpe,pi=y(()=>{"use strict";wpe=".cladding",xpe="events.log.jsonl",$pe="events.log.1.jsonl",kpe=5*1024*1024});import{createHash as Tpe}from"node:crypto";import{existsSync as Ope,readFileSync as b6,writeFileSync as Ipe}from"node:fs";import{join as iT}from"node:path";function Md(t,e){let r=Tpe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(b6(iT(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function wc(t){let e=iT(t,...v6);if(!Ope(e))return null;let r=new Map;try{for(let n of b6(e,"utf8").split(` -`)){let i=n.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);i&&r.set(i[1],i[2])}}catch{return null}return r}function S6(t,e){let r=(e.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return!1;let i=`# Cladding \xB7 Tier C \u2014 verification attestation (GREEN strict pre-push gate). Do not edit by hand. +`)}var y6,rT,nT,_6,zo=y(()=>{"use strict";y6={start:"\xB7",pass:"\u2713",fail:"\u2717",skip:"\xB7",note:"\u2139"},rT={start:"\x1B[90m",pass:"\x1B[32m",fail:"\x1B[31m",skip:"\x1B[90m",note:"\x1B[36m"},nT="\x1B[0m",_6="\r\x1B[K"});import{execFileSync as v6}from"node:child_process";import{appendFileSync as bpe,existsSync as oT,mkdirSync as vpe,readFileSync as Spe,renameSync as wpe,statSync as xpe}from"node:fs";import{userInfo as $pe}from"node:os";import{dirname as kpe,join as S6}from"node:path";function w6(t){return S6(t,Epe,Ape)}function Zr(t,e){let r=w6(t),n=kpe(r);oT(n)||vpe(n,{recursive:!0});try{oT(r)&&xpe(r).size>Ope&&wpe(r,S6(n,Tpe))}catch{}bpe(r,`${JSON.stringify(e)} +`,"utf8")}function jd(t){let e=w6(t);if(!oT(e))return[];let r=Spe(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}function Gr(t,e){return{id:`ev-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,timestamp:new Date().toISOString(),type:t,payload:e}}function Ipe(t){let e;try{e=v6("git",["config","user.name"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||void 0}catch{}if(!e)try{e=$pe().username}catch{e=void 0}return{author:"human",name:e,timestamp:new Date().toISOString()}}function Ppe(t){try{return v6("git",["rev-parse","HEAD"],{cwd:t,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return}}function sT(t,e){try{let r=jd(t);for(let n=r.length-1;n>=0;n--)if(r[n].type===e)return r[n]}catch{}return null}function Ki(t,e,r){try{let n=Ppe(t),i=Ipe(t),o={...r,head:n,identity:i};if(e==="gate_run"){let s=sT(t,"gate_run");if(s&&s.payload.head===n&&s.payload.tier===r.tier&&s.payload.strict===r.strict&&s.payload.worst===r.worst)return}Zr(t,Gr(e,o))}catch{}}var Epe,Ape,Tpe,Ope,pi=y(()=>{"use strict";Epe=".cladding",Ape="events.log.jsonl",Tpe="events.log.1.jsonl",Ope=5*1024*1024});import{createHash as Rpe}from"node:crypto";import{existsSync as Cpe,readFileSync as x6,writeFileSync as Dpe}from"node:fs";import{join as aT}from"node:path";function Md(t,e){let r=Rpe("sha256");for(let n of[...e].sort()){r.update(n),r.update("\0");try{r.update(x6(aT(t,n)))}catch{r.update("")}r.update("\0")}return r.digest("hex").slice(0,16)}function wc(t){let e=aT(t,...$6);if(!Cpe(e))return null;let r=new Map;try{for(let n of x6(e,"utf8").split(` +`)){let i=n.match(/^ {2}(F-[\w-]+): ([0-9a-f]{16})$/);i&&r.set(i[1],i[2])}}catch{return null}return r}function k6(t,e){let r=(e.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return!1;let i=`# Cladding \xB7 Tier C \u2014 verification attestation (GREEN strict pre-push gate). Do not edit by hand. # One line per done feature: sha256 tree-hash of its modules at the last # attested verification. STALE_ATTESTATION compares; \`clad check # --tier=pre-push --strict\` GREEN refreshes. Content-anchored: survives @@ -190,53 +190,53 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus attested: `+r.map(o=>` ${o.id}: ${Md(t,o.modules??[])}`).sort().join(` `)+` -`;return Ipe(iT(t,...v6),i,"utf8"),!0}var v6,Fd=y(()=>{"use strict";v6=["spec","attestation.yaml"]});function Et(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Ji=y(()=>{});import{fileURLToPath as Lpe}from"node:url";var xc,Upe,aT,cT,$c=y(()=>{xc=(t,e)=>{let r=cT(Upe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Upe=t=>aT(t)?t.toString():t,aT=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,cT=t=>t instanceof URL?Lpe(t):t});var py,lT=y(()=>{Ji();$c();py=(t,e=[],r={})=>{let n=xc(t,"First argument"),[i,o]=Et(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Et(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as qpe}from"node:string_decoder";var T6,O6,Ft,Yi,Bpe,I6,Hpe,my,P6,Zpe,zd,Gpe,uT,Vpe,Vr=y(()=>{({toString:T6}=Object.prototype),O6=t=>T6.call(t)==="[object ArrayBuffer]",Ft=t=>T6.call(t)==="[object Uint8Array]",Yi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Bpe=new TextEncoder,I6=t=>Bpe.encode(t),Hpe=new TextDecoder,my=t=>Hpe.decode(t),P6=(t,e)=>Zpe(t,e).join(""),Zpe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new qpe(e),n=t.map(o=>typeof o=="string"?I6(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},zd=t=>t.length===1&&Ft(t[0])?t[0]:uT(Gpe(t)),Gpe=t=>t.map(e=>typeof e=="string"?I6(e):e),uT=t=>{let e=new Uint8Array(Vpe(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Vpe=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Wpe}from"node:child_process";var N6,j6,Kpe,Jpe,R6,Ype,C6,D6,Xpe,M6=y(()=>{Ji();Vr();N6=t=>Array.isArray(t)&&Array.isArray(t.raw),j6=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Kpe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Kpe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=Jpe(i,t.raw[n]),c=C6(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>D6(d)):[D6(l)];return C6(c,u,a)},Jpe=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=R6.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],D6=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Et(t)&&("stdout"in t||"isMaxBuffer"in t))return Xpe(t);throw t instanceof Wpe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Xpe=({stdout:t})=>{if(typeof t=="string")return t;if(Ft(t))return my(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import dT from"node:process";var Ln,hy,hn,gy,Xi=y(()=>{Ln=t=>hy.includes(t),hy=[dT.stdin,dT.stdout,dT.stderr],hn=["stdin","stdout","stderr"],gy=t=>hn[t]??`stdio[${t}]`});import{debuglog as Qpe}from"node:util";var z6,fT,eme,tme,rme,nme,F6,ime,pT,ome,sme,ame,cme,mT,Qi,eo=y(()=>{Ji();Xi();z6=t=>{let e={...t};for(let r of mT)e[r]=fT(t,r);return e},fT=(t,e)=>{let r=Array.from({length:eme(t)+1}),n=tme(t[e],r,e);return sme(n,e)},eme=({stdio:t})=>Array.isArray(t)?Math.max(t.length,hn.length):hn.length,tme=(t,e,r)=>Et(t)?rme(t,e,r):e.fill(t),rme=(t,e,r)=>{for(let n of Object.keys(t).sort(nme))for(let i of ime(n,r,e))e[i]=t[n];return e},nme=(t,e)=>F6(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,ime=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=pT(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. +`;return Dpe(aT(t,...$6),i,"utf8"),!0}var $6,Fd=y(()=>{"use strict";$6=["spec","attestation.yaml"]});function Et(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var Ji=y(()=>{});import{fileURLToPath as Hpe}from"node:url";var xc,Zpe,uT,dT,$c=y(()=>{xc=(t,e)=>{let r=dT(Zpe(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},Zpe=t=>uT(t)?t.toString():t,uT=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,dT=t=>t instanceof URL?Hpe(t):t});var py,fT=y(()=>{Ji();$c();py=(t,e=[],r={})=>{let n=xc(t,"First argument"),[i,o]=Et(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let s=i.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!Et(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,s,o]}});import{StringDecoder as Gpe}from"node:string_decoder";var R6,C6,Ft,Yi,Vpe,D6,Wpe,my,N6,Kpe,zd,Jpe,pT,Ype,Vr=y(()=>{({toString:R6}=Object.prototype),C6=t=>R6.call(t)==="[object ArrayBuffer]",Ft=t=>R6.call(t)==="[object Uint8Array]",Yi=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Vpe=new TextEncoder,D6=t=>Vpe.encode(t),Wpe=new TextDecoder,my=t=>Wpe.decode(t),N6=(t,e)=>Kpe(t,e).join(""),Kpe=(t,e)=>{if(e==="utf8"&&t.every(o=>typeof o=="string"))return t;let r=new Gpe(e),n=t.map(o=>typeof o=="string"?D6(o):o).map(o=>r.write(o)),i=r.end();return i===""?n:[...n,i]},zd=t=>t.length===1&&Ft(t[0])?t[0]:pT(Jpe(t)),Jpe=t=>t.map(e=>typeof e=="string"?D6(e):e),pT=t=>{let e=new Uint8Array(Ype(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},Ype=t=>{let e=0;for(let r of t)e+=r.length;return e}});import{ChildProcess as Xpe}from"node:child_process";var z6,L6,Qpe,eme,j6,tme,M6,F6,rme,U6=y(()=>{Ji();Vr();z6=t=>Array.isArray(t)&&Array.isArray(t.raw),L6=(t,e)=>{let r=[];for(let[o,s]of t.entries())r=Qpe({templates:t,expressions:e,tokens:r,index:o,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},Qpe=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:a}=eme(i,t.raw[n]),c=M6(r,o,s);if(n===e.length)return c;let l=e[n],u=Array.isArray(l)?l.map(d=>F6(d)):[F6(l)];return M6(c,u,a)},eme=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=j6.has(e[0]);for(let s=0,a=0;sr||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],F6=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(Et(t)&&("stdout"in t||"isMaxBuffer"in t))return rme(t);throw t instanceof Xpe||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},rme=({stdout:t})=>{if(typeof t=="string")return t;if(Ft(t))return my(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)}});import mT from"node:process";var Ln,hy,hn,gy,Xi=y(()=>{Ln=t=>hy.includes(t),hy=[mT.stdin,mT.stdout,mT.stderr],hn=["stdin","stdout","stderr"],gy=t=>hn[t]??`stdio[${t}]`});import{debuglog as nme}from"node:util";var B6,hT,ime,ome,sme,ame,q6,cme,gT,lme,ume,dme,fme,yT,Qi,eo=y(()=>{Ji();Xi();B6=t=>{let e={...t};for(let r of yT)e[r]=hT(t,r);return e},hT=(t,e)=>{let r=Array.from({length:ime(t)+1}),n=ome(t[e],r,e);return ume(n,e)},ime=({stdio:t})=>Array.isArray(t)?Math.max(t.length,hn.length):hn.length,ome=(t,e,r)=>Et(t)?sme(t,e,r):e.fill(t),sme=(t,e,r)=>{for(let n of Object.keys(t).sort(ame))for(let i of cme(n,r,e))e[i]=t[n];return e},ame=(t,e)=>q6(t)t==="stdout"||t==="stderr"?0:t==="all"?2:1,cme=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=gT(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid. It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},pT=t=>{if(t==="all")return t;if(hn.includes(t))return hn.indexOf(t);let e=ome.exec(t);if(e!==null)return Number(e[1])},ome=/^fd(\d+)$/,sme=(t,e)=>t.map(r=>r===void 0?cme[e]:r),ame=Qpe("execa").enabled?"full":"none",cme={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:ame,stripFinalNewline:!0},mT=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Qi=(t,e)=>e==="ipc"?t.at(-1):t[e]});var kc,Ec,L6,hT,lme,yy,_y,Lo=y(()=>{eo();kc=({verbose:t},e)=>hT(t,e)!=="none",Ec=({verbose:t},e)=>!["none","short"].includes(hT(t,e)),L6=({verbose:t},e)=>{let r=hT(t,e);return yy(r)?r:void 0},hT=(t,e)=>e===void 0?lme(t):Qi(t,e),lme=t=>t.find(e=>yy(e))??_y.findLast(e=>t.includes(e)),yy=t=>typeof t=="function",_y=["none","short","full"]});import{platform as ume}from"node:process";import{stripVTControlCharacters as dme}from"node:util";var U6,Ld,q6,fme,pme,mme,hme,gme,yme,_me,by=y(()=>{U6=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>yme(q6(o))).join(" ");return{command:n,escapedCommand:i}},Ld=t=>dme(t).split(` -`).map(e=>q6(e)).join(` -`),q6=t=>t.replaceAll(mme,e=>fme(e)),fme=t=>{let e=hme[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=gme?`\\u${n.padStart(4,"0")}`:`\\U${n}`},pme=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},mme=pme(),hme={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},gme=65535,yme=t=>_me.test(t)?t:ume==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,_me=/^[\w./-]+$/});import B6 from"node:process";function gT(){let{env:t}=B6,{TERM:e,TERM_PROGRAM:r}=t;return B6.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 H6=y(()=>{});var Z6,G6,bme,vme,Sme,wme,xme,vy,$We,V6=y(()=>{H6();Z6={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"},G6={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"},bme={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"},vme={...Z6,...G6},Sme={...Z6,...bme},wme=gT(),xme=wme?vme:Sme,vy=xme,$We=Object.entries(G6)});import $me from"node:tty";var kme,ge,AWe,W6,TWe,OWe,IWe,PWe,RWe,CWe,DWe,NWe,jWe,MWe,FWe,zWe,LWe,UWe,qWe,Sy,BWe,HWe,ZWe,GWe,VWe,WWe,KWe,JWe,YWe,K6,XWe,J6,QWe,eKe,tKe,rKe,nKe,iKe,oKe,sKe,aKe,cKe,lKe,yT=y(()=>{kme=$me?.WriteStream?.prototype?.hasColors?.()??!1,ge=(t,e)=>{if(!kme)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}},AWe=ge(0,0),W6=ge(1,22),TWe=ge(2,22),OWe=ge(3,23),IWe=ge(4,24),PWe=ge(53,55),RWe=ge(7,27),CWe=ge(8,28),DWe=ge(9,29),NWe=ge(30,39),jWe=ge(31,39),MWe=ge(32,39),FWe=ge(33,39),zWe=ge(34,39),LWe=ge(35,39),UWe=ge(36,39),qWe=ge(37,39),Sy=ge(90,39),BWe=ge(40,49),HWe=ge(41,49),ZWe=ge(42,49),GWe=ge(43,49),VWe=ge(44,49),WWe=ge(45,49),KWe=ge(46,49),JWe=ge(47,49),YWe=ge(100,49),K6=ge(91,39),XWe=ge(92,39),J6=ge(93,39),QWe=ge(94,39),eKe=ge(95,39),tKe=ge(96,39),rKe=ge(97,39),nKe=ge(101,49),iKe=ge(102,49),oKe=ge(103,49),sKe=ge(104,49),aKe=ge(105,49),cKe=ge(106,49),lKe=ge(107,49)});var Y6=y(()=>{yT();yT()});var eB,Ame,wy,X6,Tme,Q6,Ome,tB=y(()=>{V6();Y6();eB=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Ame(r),c=Tme[t]({failed:o,reject:s,piped:n}),l=Ome[t]({reject:s});return`${Sy(`[${a}]`)} ${Sy(`[${i}]`)} ${l(c)} ${l(e)}`},Ame=t=>`${wy(t.getHours(),2)}:${wy(t.getMinutes(),2)}:${wy(t.getSeconds(),2)}.${wy(t.getMilliseconds(),3)}`,wy=(t,e)=>String(t).padStart(e,"0"),X6=({failed:t,reject:e})=>t?e?vy.cross:vy.warning:vy.tick,Tme={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:X6,duration:X6},Q6=t=>t,Ome={command:()=>W6,output:()=>Q6,ipc:()=>Q6,error:({reject:t})=>t?K6:J6,duration:()=>Sy}});var rB,Ime,Pme,nB=y(()=>{Lo();rB=(t,e,r)=>{let n=L6(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Ime(i,o,n)).filter(i=>i!==void 0).map(i=>Pme(i)).join("")},Ime=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Pme=t=>t.endsWith(` +Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},gT=t=>{if(t==="all")return t;if(hn.includes(t))return hn.indexOf(t);let e=lme.exec(t);if(e!==null)return Number(e[1])},lme=/^fd(\d+)$/,ume=(t,e)=>t.map(r=>r===void 0?fme[e]:r),dme=nme("execa").enabled?"full":"none",fme={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:dme,stripFinalNewline:!0},yT=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Qi=(t,e)=>e==="ipc"?t.at(-1):t[e]});var kc,Ec,H6,_T,pme,yy,_y,Lo=y(()=>{eo();kc=({verbose:t},e)=>_T(t,e)!=="none",Ec=({verbose:t},e)=>!["none","short"].includes(_T(t,e)),H6=({verbose:t},e)=>{let r=_T(t,e);return yy(r)?r:void 0},_T=(t,e)=>e===void 0?pme(t):Qi(t,e),pme=t=>t.find(e=>yy(e))??_y.findLast(e=>t.includes(e)),yy=t=>typeof t=="function",_y=["none","short","full"]});import{platform as mme}from"node:process";import{stripVTControlCharacters as hme}from"node:util";var Z6,Ld,G6,gme,yme,_me,bme,vme,Sme,wme,by=y(()=>{Z6=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(o=>Sme(G6(o))).join(" ");return{command:n,escapedCommand:i}},Ld=t=>hme(t).split(` +`).map(e=>G6(e)).join(` +`),G6=t=>t.replaceAll(_me,e=>gme(e)),gme=t=>{let e=bme[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=vme?`\\u${n.padStart(4,"0")}`:`\\U${n}`},yme=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},_me=yme(),bme={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},vme=65535,Sme=t=>wme.test(t)?t:mme==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,wme=/^[\w./-]+$/});import V6 from"node:process";function bT(){let{env:t}=V6,{TERM:e,TERM_PROGRAM:r}=t;return V6.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 W6=y(()=>{});var K6,J6,xme,$me,kme,Eme,Ame,vy,IWe,Y6=y(()=>{W6();K6={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"},J6={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"},xme={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"},$me={...K6,...J6},kme={...K6,...xme},Eme=bT(),Ame=Eme?$me:kme,vy=Ame,IWe=Object.entries(J6)});import Tme from"node:tty";var Ome,ge,CWe,X6,DWe,NWe,jWe,MWe,FWe,zWe,LWe,UWe,qWe,BWe,HWe,ZWe,GWe,VWe,WWe,Sy,KWe,JWe,YWe,XWe,QWe,eKe,tKe,rKe,nKe,Q6,iKe,eB,oKe,sKe,aKe,cKe,lKe,uKe,dKe,fKe,pKe,mKe,hKe,vT=y(()=>{Ome=Tme?.WriteStream?.prototype?.hasColors?.()??!1,ge=(t,e)=>{if(!Ome)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}},CWe=ge(0,0),X6=ge(1,22),DWe=ge(2,22),NWe=ge(3,23),jWe=ge(4,24),MWe=ge(53,55),FWe=ge(7,27),zWe=ge(8,28),LWe=ge(9,29),UWe=ge(30,39),qWe=ge(31,39),BWe=ge(32,39),HWe=ge(33,39),ZWe=ge(34,39),GWe=ge(35,39),VWe=ge(36,39),WWe=ge(37,39),Sy=ge(90,39),KWe=ge(40,49),JWe=ge(41,49),YWe=ge(42,49),XWe=ge(43,49),QWe=ge(44,49),eKe=ge(45,49),tKe=ge(46,49),rKe=ge(47,49),nKe=ge(100,49),Q6=ge(91,39),iKe=ge(92,39),eB=ge(93,39),oKe=ge(94,39),sKe=ge(95,39),aKe=ge(96,39),cKe=ge(97,39),lKe=ge(101,49),uKe=ge(102,49),dKe=ge(103,49),fKe=ge(104,49),pKe=ge(105,49),mKe=ge(106,49),hKe=ge(107,49)});var tB=y(()=>{vT();vT()});var iB,Pme,wy,rB,Rme,nB,Cme,oB=y(()=>{Y6();tB();iB=({type:t,message:e,timestamp:r,piped:n,commandId:i,result:{failed:o=!1}={},options:{reject:s=!0}})=>{let a=Pme(r),c=Rme[t]({failed:o,reject:s,piped:n}),l=Cme[t]({reject:s});return`${Sy(`[${a}]`)} ${Sy(`[${i}]`)} ${l(c)} ${l(e)}`},Pme=t=>`${wy(t.getHours(),2)}:${wy(t.getMinutes(),2)}:${wy(t.getSeconds(),2)}.${wy(t.getMilliseconds(),3)}`,wy=(t,e)=>String(t).padStart(e,"0"),rB=({failed:t,reject:e})=>t?e?vy.cross:vy.warning:vy.tick,Rme={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:rB,duration:rB},nB=t=>t,Cme={command:()=>X6,output:()=>nB,ipc:()=>nB,error:({reject:t})=>t?Q6:eB,duration:()=>Sy}});var sB,Dme,Nme,aB=y(()=>{Lo();sB=(t,e,r)=>{let n=H6(e,r);return t.map(({verboseLine:i,verboseObject:o})=>Dme(i,o,n)).filter(i=>i!==void 0).map(i=>Nme(i)).join("")},Dme=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},Nme=t=>t.endsWith(` `)?t:`${t} -`});import{inspect as Rme}from"node:util";var mi,Cme,Dme,Nme,xy,jme,Ac=y(()=>{by();tB();nB();mi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Cme({type:t,result:i,verboseInfo:n}),s=Dme(e,o),a=rB(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Cme=({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}),Dme=(t,e)=>t.split(` -`).map(r=>Nme({...e,message:r})),Nme=t=>({verboseLine:eB(t),verboseObject:t}),xy=t=>{let e=typeof t=="string"?t:Rme(t);return Ld(e).replaceAll(" "," ".repeat(jme))},jme=2});var iB,oB=y(()=>{Lo();Ac();iB=(t,e)=>{kc(e)&&mi({type:"command",verboseMessage:t,verboseInfo:e})}});var sB,Mme,Fme,zme,aB=y(()=>{Lo();sB=(t,e,r)=>{zme(t);let n=Mme(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Mme=t=>kc({verbose:t})?Fme++:void 0,Fme=0n,zme=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(!_y.includes(e)&&!yy(e)){let r=_y.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as cB}from"node:process";var $y,_T,ky=y(()=>{$y=()=>cB.bigint(),_T=t=>Number(cB.bigint()-t)/1e6});var Ey,bT=y(()=>{oB();aB();ky();by();eo();Ey=(t,e,r)=>{let n=$y(),{command:i,escapedCommand:o}=U6(t,e),s=fT(r,"verbose"),a=sB(s,o,{...r});return iB(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var pB=v((NKe,fB)=>{fB.exports=dB;dB.sync=Ume;var lB=Be("fs");function Lme(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{yB.exports=hB;hB.sync=qme;var mB=Be("fs");function hB(t,e,r){mB.stat(t,function(n,i){r(n,n?!1:gB(i,e))})}function qme(t,e){return gB(mB.statSync(t),e)}function gB(t,e){return t.isFile()&&Bme(t,e)}function Bme(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 vB=v((FKe,bB)=>{var MKe=Be("fs"),Ay;process.platform==="win32"||global.TESTING_WINDOWS?Ay=pB():Ay=_B();bB.exports=vT;vT.sync=Hme;function vT(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){vT(t,e||{},function(o,s){o?i(o):n(s)})})}Ay(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Hme(t,e){try{return Ay.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var AB=v((zKe,EB)=>{var Tc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",SB=Be("path"),Zme=Tc?";":":",wB=vB(),xB=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),$B=(t,e)=>{let r=e.colon||Zme,n=t.match(/\//)||Tc&&t.match(/\\/)?[""]:[...Tc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Tc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Tc?i.split(r):[""];return Tc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},kB=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=$B(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(xB(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=SB.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];wB(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)},Gme=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=$B(t,e),o=[];for(let s=0;s{"use strict";var TB=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ST.exports=TB;ST.exports.default=TB});var CB=v((UKe,RB)=>{"use strict";var IB=Be("path"),Vme=AB(),Wme=OB();function PB(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=Vme.sync(t.command,{path:r[Wme({env:r})],pathExt:e?IB.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=IB.resolve(i?t.options.cwd:"",s)),s}function Kme(t){return PB(t)||PB(t,!0)}RB.exports=Kme});var DB=v((qKe,xT)=>{"use strict";var wT=/([()\][%!^"`<>&|;, *?])/g;function Jme(t){return t=t.replace(wT,"^$1"),t}function Yme(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(wT,"^$1"),e&&(t=t.replace(wT,"^$1")),t}xT.exports.command=Jme;xT.exports.argument=Yme});var jB=v((BKe,NB)=>{"use strict";NB.exports=/^#!(.*)/});var FB=v((HKe,MB)=>{"use strict";var Xme=jB();MB.exports=(t="")=>{let e=t.match(Xme);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var LB=v((ZKe,zB)=>{"use strict";var $T=Be("fs"),Qme=FB();function ehe(t){let r=Buffer.alloc(150),n;try{n=$T.openSync(t,"r"),$T.readSync(n,r,0,150,0),$T.closeSync(n)}catch{}return Qme(r.toString())}zB.exports=ehe});var HB=v((GKe,BB)=>{"use strict";var the=Be("path"),UB=CB(),qB=DB(),rhe=LB(),nhe=process.platform==="win32",ihe=/\.(?:com|exe)$/i,ohe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function she(t){t.file=UB(t);let e=t.file&&rhe(t.file);return e?(t.args.unshift(t.file),t.command=e,UB(t)):t.file}function ahe(t){if(!nhe)return t;let e=she(t),r=!ihe.test(e);if(t.options.forceShell||r){let n=ohe.test(e);t.command=the.normalize(t.command),t.command=qB.command(t.command),t.args=t.args.map(o=>qB.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 che(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:ahe(n)}BB.exports=che});var VB=v((VKe,GB)=>{"use strict";var kT=process.platform==="win32";function ET(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 lhe(t,e){if(!kT)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=ZB(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function ZB(t,e){return kT&&t===1&&!e.file?ET(e.original,"spawn"):null}function uhe(t,e){return kT&&t===1&&!e.file?ET(e.original,"spawnSync"):null}GB.exports={hookChildProcess:lhe,verifyENOENT:ZB,verifyENOENTSync:uhe,notFoundError:ET}});var JB=v((WKe,Oc)=>{"use strict";var WB=Be("child_process"),AT=HB(),TT=VB();function KB(t,e,r){let n=AT(t,e,r),i=WB.spawn(n.command,n.args,n.options);return TT.hookChildProcess(i,n),i}function dhe(t,e,r){let n=AT(t,e,r),i=WB.spawnSync(n.command,n.args,n.options);return i.error=i.error||TT.verifyENOENTSync(i.status,n),i}Oc.exports=KB;Oc.exports.spawn=KB;Oc.exports.sync=dhe;Oc.exports._parse=AT;Oc.exports._enoent=TT});function Ty(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 YB=y(()=>{});var XB=y(()=>{});import{promisify as fhe}from"node:util";import{execFile as phe,execFileSync as QKe}from"node:child_process";import QB from"node:path";import{fileURLToPath as mhe}from"node:url";function Oy(t){return t instanceof URL?mhe(t):t}function eH(t){return{*[Symbol.iterator](){let e=QB.resolve(Oy(t)),r;for(;r!==e;)yield e,r=e,e=QB.resolve(e,"..")}}}var r3e,n3e,tH=y(()=>{XB();r3e=fhe(phe);n3e=10*1024*1024});import Iy from"node:process";import Ys from"node:path";var hhe,ghe,yhe,rH,nH=y(()=>{YB();tH();hhe=({cwd:t=Iy.cwd(),path:e=Iy.env[Ty()],preferLocal:r=!0,execPath:n=Iy.execPath,addExecPath:i=!0}={})=>{let o=Ys.resolve(Oy(t)),s=[],a=e.split(Ys.delimiter);return r&&ghe(s,a,o),i&&yhe(s,a,n,o),e===""||e===Ys.delimiter?`${s.join(Ys.delimiter)}${e}`:[...s,e].join(Ys.delimiter)},ghe=(t,e,r)=>{for(let n of eH(r)){let i=Ys.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},yhe=(t,e,r,n)=>{let i=Ys.resolve(n,Oy(r),"..");e.includes(i)||t.push(i)},rH=({env:t=Iy.env,...e}={})=>{t={...t};let r=Ty({env:t});return e.path=t[r],t[r]=hhe(e),t}});var iH,Un,oH,sH,aH,Py,Ud,qd,Xs=y(()=>{iH=(t,e,r)=>{let n=r?qd:Ud,i=t instanceof Un?{}:{cause:t};return new n(e,i)},Un=class extends Error{},oH=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,aH,{value:!0,writable:!1,enumerable:!1,configurable:!1})},sH=t=>Py(t)&&aH in t,aH=Symbol("isExecaError"),Py=t=>Object.prototype.toString.call(t)==="[object Error]",Ud=class extends Error{};oH(Ud,Ud.name);qd=class extends Error{};oH(qd,qd.name)});var cH,_he,lH,uH,dH=y(()=>{cH=()=>{let t=uH-lH+1;return Array.from({length:t},_he)},_he=(t,e)=>({name:`SIGRT${e+1}`,number:lH+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),lH=34,uH=64});var fH,pH=y(()=>{fH=[{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 bhe}from"node:os";var OT,vhe,mH=y(()=>{pH();dH();OT=()=>{let t=cH();return[...fH,...t].map(vhe)},vhe=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=bhe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as She}from"node:os";var whe,xhe,hH,$he,khe,Ehe,v3e,gH=y(()=>{mH();whe=()=>{let t=OT();return Object.fromEntries(t.map(xhe))},xhe=({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}],hH=whe(),$he=()=>{let t=OT(),e=65,r=Array.from({length:e},(n,i)=>khe(i,t));return Object.assign({},...r)},khe=(t,e)=>{let r=Ehe(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}}},Ehe=(t,e)=>{let r=e.find(({name:n})=>She.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},v3e=$he()});import{constants as Bd}from"node:os";var _H,bH,vH,Ahe,The,yH,Ohe,IT,Ihe,Phe,Ry,Hd=y(()=>{gH();_H=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return vH(t,e)},bH=t=>t===0?t:vH(t,"`subprocess.kill()`'s argument"),vH=(t,e)=>{if(Number.isInteger(t))return Ahe(t,e);if(typeof t=="string")return Ohe(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. -${IT()}`)},Ahe=(t,e)=>{if(yH.has(t))return yH.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. -${IT()}`)},The=()=>new Map(Object.entries(Bd.signals).reverse().map(([t,e])=>[e,t])),yH=The(),Ohe=(t,e)=>{if(t in Bd.signals)return t;throw t.toUpperCase()in Bd.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. -${IT()}`)},IT=()=>`Available signal names: ${Ihe()}. -Available signal numbers: ${Phe()}.`,Ihe=()=>Object.keys(Bd.signals).sort().map(t=>`'${t}'`).join(", "),Phe=()=>[...new Set(Object.values(Bd.signals).sort((t,e)=>t-e))].join(", "),Ry=t=>hH[t].description});import{setTimeout as Rhe}from"node:timers/promises";var SH,Che,wH,Dhe,Nhe,jhe,PT,Cy=y(()=>{Xs();Hd();SH=t=>{if(t===!1)return t;if(t===!0)return Che;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Che=1e3*5,wH=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Dhe(s,a,r);Nhe(l,n);let u=t(c);return jhe({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Dhe=(t,e,r)=>{let[n=r,i]=Py(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!Py(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:bH(n),error:i}},Nhe=(t,e)=>{t!==void 0&&e.reject(t)},jhe=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&PT({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},PT=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await Rhe(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Mhe}from"node:events";var Dy,RT=y(()=>{Dy=async(t,e)=>{t.aborted||await Mhe(t,"abort",{signal:e})}});var xH,$H,Fhe,CT=y(()=>{RT();xH=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},$H=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[Fhe(t,e,n,i)],Fhe=async(t,e,r,{signal:n})=>{throw await Dy(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Ic,zhe,DT,kH,EH,Ny,AH,TH,OH,IH,PH,RH,Lhe,Uhe,qhe,qn,Bhe,Uo,Pc,Rc=y(()=>{Ic=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{zhe(t,e,r),DT(t,e,n)},zhe=(t,e,r)=>{if(!r)throw new Error(`${qn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},DT=(t,e,r)=>{if(!r)throw new Error(`${qn(t,e)} cannot be used: the ${Uo(e)} has already exited or disconnected.`)},kH=t=>{throw new Error(`${qn("getOneMessage",t)} could not complete: the ${Uo(t)} exited or disconnected.`)},EH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} is sending a message too, instead of listening to incoming messages. +`});import{inspect as jme}from"node:util";var mi,Mme,Fme,zme,xy,Lme,Ac=y(()=>{by();oB();aB();mi=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:i})=>{let o=Mme({type:t,result:i,verboseInfo:n}),s=Fme(e,o),a=sB(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Mme=({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}),Fme=(t,e)=>t.split(` +`).map(r=>zme({...e,message:r})),zme=t=>({verboseLine:iB(t),verboseObject:t}),xy=t=>{let e=typeof t=="string"?t:jme(t);return Ld(e).replaceAll(" "," ".repeat(Lme))},Lme=2});var cB,lB=y(()=>{Lo();Ac();cB=(t,e)=>{kc(e)&&mi({type:"command",verboseMessage:t,verboseInfo:e})}});var uB,Ume,qme,Bme,dB=y(()=>{Lo();uB=(t,e,r)=>{Bme(t);let n=Ume(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},Ume=t=>kc({verbose:t})?qme++:void 0,qme=0n,Bme=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(!_y.includes(e)&&!yy(e)){let r=_y.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}}});import{hrtime as fB}from"node:process";var $y,ST,ky=y(()=>{$y=()=>fB.bigint(),ST=t=>Number(fB.bigint()-t)/1e6});var Ey,wT=y(()=>{lB();dB();ky();by();eo();Ey=(t,e,r)=>{let n=$y(),{command:i,escapedCommand:o}=Z6(t,e),s=hT(r,"verbose"),a=uB(s,o,{...r});return cB(o,a),{command:i,escapedCommand:o,startTime:n,verboseInfo:a}}});var yB=v((UKe,gB)=>{gB.exports=hB;hB.sync=Zme;var pB=Be("fs");function Hme(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{SB.exports=bB;bB.sync=Gme;var _B=Be("fs");function bB(t,e,r){_B.stat(t,function(n,i){r(n,n?!1:vB(i,e))})}function Gme(t,e){return vB(_B.statSync(t),e)}function vB(t,e){return t.isFile()&&Vme(t,e)}function Vme(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 $B=v((HKe,xB)=>{var BKe=Be("fs"),Ay;process.platform==="win32"||global.TESTING_WINDOWS?Ay=yB():Ay=wB();xB.exports=xT;xT.sync=Wme;function xT(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){xT(t,e||{},function(o,s){o?i(o):n(s)})})}Ay(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function Wme(t,e){try{return Ay.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var PB=v((ZKe,IB)=>{var Tc=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",kB=Be("path"),Kme=Tc?";":":",EB=$B(),AB=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),TB=(t,e)=>{let r=e.colon||Kme,n=t.match(/\//)||Tc&&t.match(/\\/)?[""]:[...Tc?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=Tc?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Tc?i.split(r):[""];return Tc&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},OB=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=TB(t,e),s=[],a=l=>new Promise((u,d)=>{if(l===n.length)return e.all&&s.length?u(s):d(AB(t));let f=n[l],p=/^".*"$/.test(f)?f.slice(1,-1):f,m=kB.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];EB(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)},Jme=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=TB(t,e),o=[];for(let s=0;s{"use strict";var RB=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};$T.exports=RB;$T.exports.default=RB});var MB=v((VKe,jB)=>{"use strict";var DB=Be("path"),Yme=PB(),Xme=CB();function NB(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=Yme.sync(t.command,{path:r[Xme({env:r})],pathExt:e?DB.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=DB.resolve(i?t.options.cwd:"",s)),s}function Qme(t){return NB(t)||NB(t,!0)}jB.exports=Qme});var FB=v((WKe,ET)=>{"use strict";var kT=/([()\][%!^"`<>&|;, *?])/g;function ehe(t){return t=t.replace(kT,"^$1"),t}function the(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(kT,"^$1"),e&&(t=t.replace(kT,"^$1")),t}ET.exports.command=ehe;ET.exports.argument=the});var LB=v((KKe,zB)=>{"use strict";zB.exports=/^#!(.*)/});var qB=v((JKe,UB)=>{"use strict";var rhe=LB();UB.exports=(t="")=>{let e=t.match(rhe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var HB=v((YKe,BB)=>{"use strict";var AT=Be("fs"),nhe=qB();function ihe(t){let r=Buffer.alloc(150),n;try{n=AT.openSync(t,"r"),AT.readSync(n,r,0,150,0),AT.closeSync(n)}catch{}return nhe(r.toString())}BB.exports=ihe});var WB=v((XKe,VB)=>{"use strict";var ohe=Be("path"),ZB=MB(),GB=FB(),she=HB(),ahe=process.platform==="win32",che=/\.(?:com|exe)$/i,lhe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function uhe(t){t.file=ZB(t);let e=t.file&&she(t.file);return e?(t.args.unshift(t.file),t.command=e,ZB(t)):t.file}function dhe(t){if(!ahe)return t;let e=uhe(t),r=!che.test(e);if(t.options.forceShell||r){let n=lhe.test(e);t.command=ohe.normalize(t.command),t.command=GB.command(t.command),t.args=t.args.map(o=>GB.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 fhe(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:dhe(n)}VB.exports=fhe});var YB=v((QKe,JB)=>{"use strict";var TT=process.platform==="win32";function OT(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 phe(t,e){if(!TT)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=KB(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function KB(t,e){return TT&&t===1&&!e.file?OT(e.original,"spawn"):null}function mhe(t,e){return TT&&t===1&&!e.file?OT(e.original,"spawnSync"):null}JB.exports={hookChildProcess:phe,verifyENOENT:KB,verifyENOENTSync:mhe,notFoundError:OT}});var eH=v((e3e,Oc)=>{"use strict";var XB=Be("child_process"),IT=WB(),PT=YB();function QB(t,e,r){let n=IT(t,e,r),i=XB.spawn(n.command,n.args,n.options);return PT.hookChildProcess(i,n),i}function hhe(t,e,r){let n=IT(t,e,r),i=XB.spawnSync(n.command,n.args,n.options);return i.error=i.error||PT.verifyENOENTSync(i.status,n),i}Oc.exports=QB;Oc.exports.spawn=QB;Oc.exports.sync=hhe;Oc.exports._parse=IT;Oc.exports._enoent=PT});function Ty(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 tH=y(()=>{});var rH=y(()=>{});import{promisify as ghe}from"node:util";import{execFile as yhe,execFileSync as o3e}from"node:child_process";import nH from"node:path";import{fileURLToPath as _he}from"node:url";function Oy(t){return t instanceof URL?_he(t):t}function iH(t){return{*[Symbol.iterator](){let e=nH.resolve(Oy(t)),r;for(;r!==e;)yield e,r=e,e=nH.resolve(e,"..")}}}var c3e,l3e,oH=y(()=>{rH();c3e=ghe(yhe);l3e=10*1024*1024});import Iy from"node:process";import Ys from"node:path";var bhe,vhe,She,sH,aH=y(()=>{tH();oH();bhe=({cwd:t=Iy.cwd(),path:e=Iy.env[Ty()],preferLocal:r=!0,execPath:n=Iy.execPath,addExecPath:i=!0}={})=>{let o=Ys.resolve(Oy(t)),s=[],a=e.split(Ys.delimiter);return r&&vhe(s,a,o),i&&She(s,a,n,o),e===""||e===Ys.delimiter?`${s.join(Ys.delimiter)}${e}`:[...s,e].join(Ys.delimiter)},vhe=(t,e,r)=>{for(let n of iH(r)){let i=Ys.join(n,"node_modules/.bin");e.includes(i)||t.push(i)}},She=(t,e,r,n)=>{let i=Ys.resolve(n,Oy(r),"..");e.includes(i)||t.push(i)},sH=({env:t=Iy.env,...e}={})=>{t={...t};let r=Ty({env:t});return e.path=t[r],t[r]=bhe(e),t}});var cH,Un,lH,uH,dH,Py,Ud,qd,Xs=y(()=>{cH=(t,e,r)=>{let n=r?qd:Ud,i=t instanceof Un?{}:{cause:t};return new n(e,i)},Un=class extends Error{},lH=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,dH,{value:!0,writable:!1,enumerable:!1,configurable:!1})},uH=t=>Py(t)&&dH in t,dH=Symbol("isExecaError"),Py=t=>Object.prototype.toString.call(t)==="[object Error]",Ud=class extends Error{};lH(Ud,Ud.name);qd=class extends Error{};lH(qd,qd.name)});var fH,whe,pH,mH,hH=y(()=>{fH=()=>{let t=mH-pH+1;return Array.from({length:t},whe)},whe=(t,e)=>({name:`SIGRT${e+1}`,number:pH+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),pH=34,mH=64});var gH,yH=y(()=>{gH=[{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 xhe}from"node:os";var RT,$he,_H=y(()=>{yH();hH();RT=()=>{let t=fH();return[...gH,...t].map($he)},$he=({name:t,number:e,description:r,action:n,forced:i=!1,standard:o})=>{let{signals:{[t]:s}}=xhe,a=s!==void 0;return{name:t,number:a?s:e,description:r,supported:a,action:n,forced:i,standard:o}}});import{constants as khe}from"node:os";var Ehe,Ahe,bH,The,Ohe,Ihe,E3e,vH=y(()=>{_H();Ehe=()=>{let t=RT();return Object.fromEntries(t.map(Ahe))},Ahe=({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}],bH=Ehe(),The=()=>{let t=RT(),e=65,r=Array.from({length:e},(n,i)=>Ohe(i,t));return Object.assign({},...r)},Ohe=(t,e)=>{let r=Ihe(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}}},Ihe=(t,e)=>{let r=e.find(({name:n})=>khe.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},E3e=The()});import{constants as Bd}from"node:os";var wH,xH,$H,Phe,Rhe,SH,Che,CT,Dhe,Nhe,Ry,Hd=y(()=>{vH();wH=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return $H(t,e)},xH=t=>t===0?t:$H(t,"`subprocess.kill()`'s argument"),$H=(t,e)=>{if(Number.isInteger(t))return Phe(t,e);if(typeof t=="string")return Che(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer. +${CT()}`)},Phe=(t,e)=>{if(SH.has(t))return SH.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist. +${CT()}`)},Rhe=()=>new Map(Object.entries(Bd.signals).reverse().map(([t,e])=>[e,t])),SH=Rhe(),Che=(t,e)=>{if(t in Bd.signals)return t;throw t.toUpperCase()in Bd.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist. +${CT()}`)},CT=()=>`Available signal names: ${Dhe()}. +Available signal numbers: ${Nhe()}.`,Dhe=()=>Object.keys(Bd.signals).sort().map(t=>`'${t}'`).join(", "),Nhe=()=>[...new Set(Object.values(Bd.signals).sort((t,e)=>t-e))].join(", "),Ry=t=>bH[t].description});import{setTimeout as jhe}from"node:timers/promises";var kH,Mhe,EH,Fhe,zhe,Lhe,DT,Cy=y(()=>{Xs();Hd();kH=t=>{if(t===!1)return t;if(t===!0)return Mhe;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},Mhe=1e3*5,EH=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:i,controller:o},s,a)=>{let{signal:c,error:l}=Fhe(s,a,r);zhe(l,n);let u=t(c);return Lhe({kill:t,signal:c,forceKillAfterDelay:e,killSignal:r,killResult:u,context:i,controller:o}),u},Fhe=(t,e,r)=>{let[n=r,i]=Py(t)?[void 0,t]:[t,e];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(i!==void 0&&!Py(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:xH(n),error:i}},zhe=(t,e)=>{t!==void 0&&e.reject(t)},Lhe=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:i,context:o,controller:s})=>{e===n&&i&&DT({kill:t,forceKillAfterDelay:r,context:o,controllerSignal:s.signal})},DT=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await jhe(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}}});import{once as Uhe}from"node:events";var Dy,NT=y(()=>{Dy=async(t,e)=>{t.aborted||await Uhe(t,"abort",{signal:e})}});var AH,TH,qhe,jT=y(()=>{NT();AH=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},TH=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:i})=>e===void 0||r?[]:[qhe(t,e,n,i)],qhe=async(t,e,r,{signal:n})=>{throw await Dy(e,n),r.terminationReason??="cancel",t.kill(),e.reason}});var Ic,Bhe,MT,OH,IH,Ny,PH,RH,CH,DH,NH,jH,Hhe,Zhe,Ghe,qn,Vhe,Uo,Pc,Rc=y(()=>{Ic=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{Bhe(t,e,r),MT(t,e,n)},Bhe=(t,e,r)=>{if(!r)throw new Error(`${qn(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},MT=(t,e,r)=>{if(!r)throw new Error(`${qn(t,e)} cannot be used: the ${Uo(e)} has already exited or disconnected.`)},OH=t=>{throw new Error(`${qn("getOneMessage",t)} could not complete: the ${Uo(t)} exited or disconnected.`)},IH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} is sending a message too, instead of listening to incoming messages. This can be fixed by both sending a message and listening to incoming messages at the same time: const [receivedMessage] = await Promise.all([ ${qn("getOneMessage",t)}, ${qn("sendMessage",t,"message, {strict: true}")}, -]);`)},Ny=(t,e)=>new Error(`${qn("sendMessage",e)} failed when sending an acknowledgment response to the ${Uo(e)}.`,{cause:t}),AH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} is not listening to incoming messages.`)},TH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} exited without listening to incoming messages.`)},OH=()=>new Error(`\`cancelSignal\` aborted: the ${Uo(!0)} disconnected.`),IH=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},PH=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${qn(e,r)} cannot be used: the ${Uo(r)} is disconnecting.`,{cause:t})},RH=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Lhe(t))throw new Error(`${qn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Lhe=({code:t,message:e})=>Uhe.has(t)||qhe.some(r=>e.includes(r)),Uhe=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),qhe=["could not be cloned","circular structure","call stack size exceeded"],qn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Bhe(e)}${t}(${r})`,Bhe=t=>t?"":"subprocess.",Uo=t=>t?"parent process":"subprocess",Pc=t=>{t.connected&&t.disconnect()}});var hi,Cc=y(()=>{hi=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var My,Dc,gi,CH,Hhe,Zhe,DH,Ghe,NH,Zd,jy,qo=y(()=>{eo();My=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=gi.get(t),o=CH(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(DH(o,e,n,!0));return s},Dc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=gi.get(t),o=CH(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(DH(o,e,n,!1));return s},gi=new WeakMap,CH=(t,e,r)=>{let n=Hhe(e,r);return Zhe(n,e,r,t),n},Hhe=(t,e)=>{let r=pT(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Zd(e)}" must not be "${t}". +]);`)},Ny=(t,e)=>new Error(`${qn("sendMessage",e)} failed when sending an acknowledgment response to the ${Uo(e)}.`,{cause:t}),PH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} is not listening to incoming messages.`)},RH=t=>{throw new Error(`${qn("sendMessage",t)} failed: the ${Uo(t)} exited without listening to incoming messages.`)},CH=()=>new Error(`\`cancelSignal\` aborted: the ${Uo(!0)} disconnected.`),DH=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},NH=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${qn(e,r)} cannot be used: the ${Uo(r)} is disconnecting.`,{cause:t})},jH=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(Hhe(t))throw new Error(`${qn(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},Hhe=({code:t,message:e})=>Zhe.has(t)||Ghe.some(r=>e.includes(r)),Zhe=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Ghe=["could not be cloned","circular structure","call stack size exceeded"],qn=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Vhe(e)}${t}(${r})`,Vhe=t=>t?"":"subprocess.",Uo=t=>t?"parent process":"subprocess",Pc=t=>{t.connected&&t.disconnect()}});var hi,Cc=y(()=>{hi=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)}});var My,Dc,gi,MH,Whe,Khe,FH,Jhe,zH,Zd,jy,qo=y(()=>{eo();My=(t,e="stdin")=>{let{options:n,fileDescriptors:i}=gi.get(t),o=MH(i,e,!0),s=t.stdio[o];if(s===null)throw new TypeError(FH(o,e,n,!0));return s},Dc=(t,e="stdout")=>{let{options:n,fileDescriptors:i}=gi.get(t),o=MH(i,e,!1),s=o==="all"?t.all:t.stdio[o];if(s==null)throw new TypeError(FH(o,e,n,!1));return s},gi=new WeakMap,MH=(t,e,r)=>{let n=Whe(e,r);return Khe(n,e,r,t),n},Whe=(t,e)=>{let r=gT(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Zd(e)}" must not be "${t}". It must be ${n} or "fd3", "fd4" (and so on). -It is optional and defaults to "${i}".`)},Zhe=(t,e,r,n)=>{let i=n[NH(t)];if(i===void 0)throw new TypeError(`"${Zd(r)}" must not be ${e}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Zd(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Zd(r)}" must not be ${e}. It must be a writable stream, not readable.`)},DH=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Ghe(t,r);return`The "${i}: ${jy(o)}" option is incompatible with using "${Zd(n)}: ${jy(e)}". -Please set this option with "pipe" instead.`},Ghe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=NH(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},NH=t=>t==="all"?1:t,Zd=t=>t?"to":"from",jy=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Vhe}from"node:events";var Qs,Fy=y(()=>{Qs=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Vhe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var zy,NT,Ly,jT,jH,MH,Gd=y(()=>{zy=(t,e)=>{e&&NT(t)},NT=t=>{t.refCounted()},Ly=(t,e)=>{e&&jT(t)},jT=t=>{t.unrefCounted()},jH=(t,e)=>{e&&(jT(t),jT(t))},MH=(t,e)=>{e&&(NT(t),NT(t))}});import{once as Whe}from"node:events";import{scheduler as Khe}from"node:timers/promises";var FH,zH,Uy,LH=y(()=>{By();Gd();qy();Hy();FH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(qH(i)||HH(i))return;Uy.has(t)||Uy.set(t,[]);let o=Uy.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await BH(t,n,i),await Khe.yield();let s=await UH({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},zH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{MT();let o=Uy.get(t);for(;o?.length>0;)await Whe(n,"message:done");t.removeListener("message",i),MH(e,r),n.connected=!1,n.emit("disconnect")},Uy=new WeakMap});import{EventEmitter as Jhe}from"node:events";var Bo,Zy,Yhe,Gy,Vd=y(()=>{LH();Gd();Bo=(t,e,r)=>{if(Zy.has(t))return Zy.get(t);let n=new Jhe;return n.connected=!0,Zy.set(t,n),Yhe({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Zy=new WeakMap,Yhe=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=FH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",zH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),jH(r,n)},Gy=t=>{let e=Zy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as Xhe}from"node:events";var ZH,Qhe,GH,UH,qH,VH,Vy,ege,Wy,WH,qy=y(()=>{Cc();Fy();Yy();Rc();Vd();By();ZH=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=Bo(t,e,r),s=Ky(t,o);return{id:Qhe++,type:Wy,message:n,hasListeners:s}},Qhe=0n,GH=(t,e)=>{if(!(e?.type!==Wy||e.hasListeners))for(let{id:r}of t)r!==void 0&&Vy[r].resolve({isDeadlock:!0,hasListeners:!1})},UH=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Wy||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:WH,message:Ky(e,i)};try{await Jy({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},qH=t=>{if(t?.type!==WH)return!1;let{id:e,message:r}=t;return Vy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},VH=async(t,e,r)=>{if(t?.type!==Wy)return;let n=hi();Vy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,ege(e,r,i)]);o&&EH(r),s||AH(r)}finally{i.abort(),delete Vy[t.id]}},Vy={},ege=async(t,e,{signal:r})=>{Qs(t,1,r),await Xhe(t,"disconnect",{signal:r}),TH(e)},Wy="execa:ipc:request",WH="execa:ipc:response"});var KH,JH,BH,Wd,Ky,tge,By=y(()=>{Cc();eo();qo();qy();KH=(t,e,r)=>{Wd.has(t)||Wd.set(t,new Set);let n=Wd.get(t),i=hi(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},JH=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},BH=async(t,e,r)=>{for(;!Ky(t,e)&&Wd.get(t)?.size>0;){let n=[...Wd.get(t)];GH(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Wd=new WeakMap,Ky=(t,e)=>e.listenerCount("message")>tge(t),tge=t=>gi.has(t)&&!Qi(gi.get(t).options.buffer,"ipc")?1:0});import{promisify as rge}from"node:util";var Jy,nge,zT,ige,FT,Yy=y(()=>{Rc();By();qy();Jy=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Ic({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),nge({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},nge=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=ZH({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=KH(t,s,o);try{await zT({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Pc(t),c}finally{JH(a)}},zT=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=ige(t);try{await Promise.all([VH(n,t,r),o(n)])}catch(s){throw PH({error:s,methodName:e,isSubprocess:r}),RH({error:s,methodName:e,isSubprocess:r,message:i}),s}},ige=t=>{if(FT.has(t))return FT.get(t);let e=rge(t.send.bind(t));return FT.set(t,e),e},FT=new WeakMap});import{scheduler as oge}from"node:timers/promises";var XH,QH,sge,YH,HH,eZ,MT,LT,Hy=y(()=>{Yy();Vd();Rc();XH=(t,e)=>{let r="cancelSignal";return DT(r,!1,t.connected),zT({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:eZ,message:e},message:e})},QH=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await sge({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),LT.signal),sge=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!YH){if(YH=!0,!n){IH();return}if(e===null){MT();return}Bo(t,e,r),await oge.yield()}},YH=!1,HH=t=>t?.type!==eZ?!1:(LT.abort(t.message),!0),eZ="execa:ipc:cancel",MT=()=>{LT.abort(OH())},LT=new AbortController});var tZ,rZ,age,cge,UT=y(()=>{RT();Hy();Cy();tZ=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},rZ=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[age({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],age=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await Dy(e,i);let o=cge(e);throw await XH(t,o),PT({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},cge=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as lge}from"node:timers/promises";var nZ,iZ,uge,qT=y(()=>{Xs();nZ=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},iZ=(t,e,r,n)=>e===0||e===void 0?[]:[uge(t,e,r,n)],uge=async(t,e,r,{signal:n})=>{throw await lge(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Un}});import{execPath as dge,execArgv as fge}from"node:process";import oZ from"node:path";var sZ,aZ,BT=y(()=>{$c();sZ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},aZ=(t,e,{node:r=!1,nodePath:n=dge,nodeOptions:i=fge.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=xc(n,'The "nodePath" option'),l=oZ.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(oZ.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as pge}from"node:v8";var cZ,mge,hge,gge,lZ,HT=y(()=>{cZ=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");gge[r](t)}},mge=t=>{try{pge(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},hge=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},gge={advanced:mge,json:hge},lZ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var dZ,yge,Wr,ZT,_ge,uZ,Xy,ea=y(()=>{dZ=({encoding:t})=>{if(ZT.has(t))return;let e=_ge(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Xy(t)}\`. -Please rename it to ${Xy(e)}.`);let r=[...ZT].map(n=>Xy(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Xy(t)}\`. -Please rename it to one of: ${r}.`)},yge=new Set(["utf8","utf16le"]),Wr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),ZT=new Set([...yge,...Wr]),_ge=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in uZ)return uZ[e];if(ZT.has(e))return e},uZ={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Xy=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as bge}from"node:fs";import vge from"node:path";import Sge from"node:process";var fZ,pZ,mZ,GT=y(()=>{$c();fZ=(t=pZ())=>{let e=xc(t,'The "cwd" option');return vge.resolve(e)},pZ=()=>{try{return Sge.cwd()}catch(t){throw t.message=`The current directory does not exist. -${t.message}`,t}},mZ=(t,e)=>{if(e===pZ())return t;let r;try{r=bge(e)}catch(n){return`The "cwd" option is invalid: ${e}. +It is optional and defaults to "${i}".`)},Khe=(t,e,r,n)=>{let i=n[zH(t)];if(i===void 0)throw new TypeError(`"${Zd(r)}" must not be ${e}. That file descriptor does not exist. +Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!r)throw new TypeError(`"${Zd(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&r)throw new TypeError(`"${Zd(r)}" must not be ${e}. It must be a writable stream, not readable.`)},FH=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:o}=Jhe(t,r);return`The "${i}: ${jy(o)}" option is incompatible with using "${Zd(n)}: ${jy(e)}". +Please set this option with "pipe" instead.`},Jhe=(t,{stdin:e,stdout:r,stderr:n,stdio:i})=>{let o=zH(t);return o===0&&e!==void 0?{optionName:"stdin",optionValue:e}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:i[o]}},zH=t=>t==="all"?1:t,Zd=t=>t?"to":"from",jy=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream"});import{addAbortListener as Yhe}from"node:events";var Qs,Fy=y(()=>{Qs=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),Yhe(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))}});var zy,FT,Ly,zT,LH,UH,Gd=y(()=>{zy=(t,e)=>{e&&FT(t)},FT=t=>{t.refCounted()},Ly=(t,e)=>{e&&zT(t)},zT=t=>{t.unrefCounted()},LH=(t,e)=>{e&&(zT(t),zT(t))},UH=(t,e)=>{e&&(FT(t),FT(t))}});import{once as Xhe}from"node:events";import{scheduler as Qhe}from"node:timers/promises";var qH,BH,Uy,HH=y(()=>{By();Gd();qy();Hy();qH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},i)=>{if(GH(i)||WH(i))return;Uy.has(t)||Uy.set(t,[]);let o=Uy.get(t);if(o.push(i),!(o.length>1))for(;o.length>0;){await VH(t,n,i),await Qhe.yield();let s=await ZH({wrappedMessage:o[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",s),n.emit("message:done")}},BH=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:i})=>{LT();let o=Uy.get(t);for(;o?.length>0;)await Xhe(n,"message:done");t.removeListener("message",i),UH(e,r),n.connected=!1,n.emit("disconnect")},Uy=new WeakMap});import{EventEmitter as ege}from"node:events";var Bo,Zy,tge,Gy,Vd=y(()=>{HH();Gd();Bo=(t,e,r)=>{if(Zy.has(t))return Zy.get(t);let n=new ege;return n.connected=!0,Zy.set(t,n),tge({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Zy=new WeakMap,tge=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let i=qH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",i),e.once("disconnect",BH.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:i})),LH(r,n)},Gy=t=>{let e=Zy.get(t);return e===void 0?t.channel!==null:e.connected}});import{once as rge}from"node:events";var KH,nge,JH,ZH,GH,YH,Vy,ige,Wy,XH,qy=y(()=>{Cc();Fy();Yy();Rc();Vd();By();KH=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:i})=>{if(!i)return n;let o=Bo(t,e,r),s=Ky(t,o);return{id:nge++,type:Wy,message:n,hasListeners:s}},nge=0n,JH=(t,e)=>{if(!(e?.type!==Wy||e.hasListeners))for(let{id:r}of t)r!==void 0&&Vy[r].resolve({isDeadlock:!0,hasListeners:!1})},ZH=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:i})=>{if(t?.type!==Wy||!e.connected)return t;let{id:o,message:s}=t,a={id:o,type:XH,message:Ky(e,i)};try{await Jy({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return s},GH=t=>{if(t?.type!==XH)return!1;let{id:e,message:r}=t;return Vy[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},YH=async(t,e,r)=>{if(t?.type!==Wy)return;let n=hi();Vy[t.id]=n;let i=new AbortController;try{let{isDeadlock:o,hasListeners:s}=await Promise.race([n,ige(e,r,i)]);o&&IH(r),s||PH(r)}finally{i.abort(),delete Vy[t.id]}},Vy={},ige=async(t,e,{signal:r})=>{Qs(t,1,r),await rge(t,"disconnect",{signal:r}),RH(e)},Wy="execa:ipc:request",XH="execa:ipc:response"});var QH,eZ,VH,Wd,Ky,oge,By=y(()=>{Cc();eo();qo();qy();QH=(t,e,r)=>{Wd.has(t)||Wd.set(t,new Set);let n=Wd.get(t),i=hi(),o=r?e.id:void 0,s={onMessageSent:i,id:o};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},eZ=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},VH=async(t,e,r)=>{for(;!Ky(t,e)&&Wd.get(t)?.size>0;){let n=[...Wd.get(t)];JH(n,r),await Promise.all(n.map(({onMessageSent:i})=>i))}},Wd=new WeakMap,Ky=(t,e)=>e.listenerCount("message")>oge(t),oge=t=>gi.has(t)&&!Qi(gi.get(t).options.buffer,"ipc")?1:0});import{promisify as sge}from"node:util";var Jy,age,qT,cge,UT,Yy=y(()=>{Rc();By();qy();Jy=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},i,{strict:o=!1}={})=>{let s="sendMessage";return Ic({methodName:s,isSubprocess:r,ipc:n,isConnected:t.connected}),age({anyProcess:t,channel:e,methodName:s,isSubprocess:r,message:i,strict:o})},age=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:i,strict:o})=>{let s=KH({anyProcess:t,channel:e,isSubprocess:n,message:i,strict:o}),a=QH(t,s,o);try{await qT({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:s,message:i})}catch(c){throw Pc(t),c}finally{eZ(a)}},qT=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:i})=>{let o=cge(t);try{await Promise.all([YH(n,t,r),o(n)])}catch(s){throw NH({error:s,methodName:e,isSubprocess:r}),jH({error:s,methodName:e,isSubprocess:r,message:i}),s}},cge=t=>{if(UT.has(t))return UT.get(t);let e=sge(t.send.bind(t));return UT.set(t,e),e},UT=new WeakMap});import{scheduler as lge}from"node:timers/promises";var rZ,nZ,uge,tZ,WH,iZ,LT,BT,Hy=y(()=>{Yy();Vd();Rc();rZ=(t,e)=>{let r="cancelSignal";return MT(r,!1,t.connected),qT({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:iZ,message:e},message:e})},nZ=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await uge({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),BT.signal),uge=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!tZ){if(tZ=!0,!n){DH();return}if(e===null){LT();return}Bo(t,e,r),await lge.yield()}},tZ=!1,WH=t=>t?.type!==iZ?!1:(BT.abort(t.message),!0),iZ="execa:ipc:cancel",LT=()=>{BT.abort(CH())},BT=new AbortController});var oZ,sZ,dge,fge,HT=y(()=>{NT();Hy();Cy();oZ=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},sZ=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:i,controller:o})=>r?[dge({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:i,controller:o})]:[],dge=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:i}})=>{await Dy(e,i);let o=fge(e);throw await rZ(t,o),DT({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:i}),n.terminationReason??="gracefulCancel",e.reason},fge=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e}});import{setTimeout as pge}from"node:timers/promises";var aZ,cZ,mge,ZT=y(()=>{Xs();aZ=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},cZ=(t,e,r,n)=>e===0||e===void 0?[]:[mge(t,e,r,n)],mge=async(t,e,r,{signal:n})=>{throw await pge(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new Un}});import{execPath as hge,execArgv as gge}from"node:process";import lZ from"node:path";var uZ,dZ,GT=y(()=>{$c();uZ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},dZ=(t,e,{node:r=!1,nodePath:n=hge,nodeOptions:i=gge.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=xc(n,'The "nodePath" option'),l=lZ.resolve(o,c),u={...a,nodePath:l,node:r,cwd:o};if(!r)return[t,e,u];if(lZ.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[l,[...i,t,...e],{ipc:!0,...u,shell:!1}]}});import{serialize as yge}from"node:v8";var fZ,_ge,bge,vge,pZ,VT=y(()=>{fZ=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");vge[r](t)}},_ge=t=>{try{yge(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},bge=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},vge={advanced:_ge,json:bge},pZ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)}});var hZ,Sge,Wr,WT,wge,mZ,Xy,ea=y(()=>{hZ=({encoding:t})=>{if(WT.has(t))return;let e=wge(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Xy(t)}\`. +Please rename it to ${Xy(e)}.`);let r=[...WT].map(n=>Xy(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Xy(t)}\`. +Please rename it to one of: ${r}.`)},Sge=new Set(["utf8","utf16le"]),Wr=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),WT=new Set([...Sge,...Wr]),wge=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in mZ)return mZ[e];if(WT.has(e))return e},mZ={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Xy=t=>typeof t=="string"?`"${t}"`:String(t)});import{statSync as xge}from"node:fs";import $ge from"node:path";import kge from"node:process";var gZ,yZ,_Z,KT=y(()=>{$c();gZ=(t=yZ())=>{let e=xc(t,'The "cwd" option');return $ge.resolve(e)},yZ=()=>{try{return kge.cwd()}catch(t){throw t.message=`The current directory does not exist. +${t.message}`,t}},_Z=(t,e)=>{if(e===yZ())return t;let r;try{r=xge(e)}catch(n){return`The "cwd" option is invalid: ${e}. ${n.message} ${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}. -${t}`}});import wge from"node:path";import hZ from"node:process";var gZ,Qy,xge,$ge,VT=y(()=>{gZ=kt(JB(),1);nH();Cy();Hd();CT();UT();qT();BT();HT();ea();GT();$c();eo();Qy=(t,e,r)=>{r.cwd=fZ(r.cwd);let[n,i,o]=aZ(t,e,r),{command:s,args:a,options:c}=gZ.default._parse(n,i,o),l=z6(c),u=xge(l);return nZ(u),dZ(u),cZ(u),xH(u),tZ(u),u.shell=cT(u.shell),u.env=$ge(u),u.killSignal=_H(u.killSignal),u.forceKillAfterDelay=SH(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!Wr.has(u.encoding)&&u.buffer[f]),hZ.platform==="win32"&&wge.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},xge=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),$ge=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...hZ.env,...t}:t;return r||n?rH({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var e_,WT=y(()=>{e_=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Nc(t){if(typeof t=="string")return kge(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Ege(t)}var kge,Ege,yZ,Age,_Z,Tge,KT=y(()=>{kge=t=>t.at(-1)===yZ?t.slice(0,t.at(-2)===_Z?-2:-1):t,Ege=t=>t.at(-1)===Age?t.subarray(0,t.at(-2)===Tge?-2:-1):t,yZ=` -`,Age=yZ.codePointAt(0),_Z="\r",Tge=_Z.codePointAt(0)});function Bn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function JT(t,{checkOpen:e=!0}={}){return Bn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function ta(t,{checkOpen:e=!0}={}){return Bn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function YT(t,e){return JT(t,e)&&ta(t,e)}var ra=y(()=>{});function bZ(){return this[QT].next()}function vZ(t){return this[QT].return(t)}function eO({preventCancel:t=!1}={}){let e=this.getReader(),r=new XT(e,t),n=Object.create(Ige);return n[QT]=r,n}var Oge,XT,QT,Ige,SZ=y(()=>{Oge=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),XT=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},QT=Symbol();Object.defineProperty(bZ,"name",{value:"next"});Object.defineProperty(vZ,"name",{value:"return"});Ige=Object.create(Oge,{next:{enumerable:!0,configurable:!0,writable:!0,value:bZ},return:{enumerable:!0,configurable:!0,writable:!0,value:vZ}})});var wZ=y(()=>{});var xZ=y(()=>{SZ();wZ()});var $Z,Pge,Rge,Cge,Kd,tO=y(()=>{ra();xZ();$Z=t=>{if(ta(t,{checkOpen:!1})&&Kd.on!==void 0)return Rge(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Pge.call(t)==="[object ReadableStream]")return eO.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Pge}=Object.prototype,Rge=async function*(t){let e=new AbortController,r={};Cge(t,e,r);try{for await(let[n]of Kd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},Cge=async(t,e,r)=>{try{await Kd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Kd={}});var jc,Dge,AZ,kZ,Nge,EZ,yi,Jd=y(()=>{tO();jc=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=$Z(t),u=e();u.length=0;try{for await(let d of l){let f=Nge(d),p=r[f](d,u);AZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return Dge({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},Dge=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&AZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},AZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){kZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&kZ(c,e,i,o),new yi},kZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},Nge=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=EZ.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&EZ.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:EZ}=Object.prototype,yi=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var to,Yd,t_,r_,n_,i_=y(()=>{to=t=>t,Yd=()=>{},t_=({contents:t})=>t,r_=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},n_=t=>t.length});async function o_(t,e){return jc(t,zge,e)}var jge,Mge,Fge,zge,TZ=y(()=>{Jd();i_();jge=()=>({contents:[]}),Mge=()=>1,Fge=(t,{contents:e})=>(e.push(t),e),zge={init:jge,convertChunk:{string:to,buffer:to,arrayBuffer:to,dataView:to,typedArray:to,others:to},getSize:Mge,truncateChunk:Yd,addChunk:Fge,getFinalChunk:Yd,finalize:t_}});async function s_(t,e){return jc(t,Wge,e)}var Lge,Uge,qge,OZ,IZ,Bge,Hge,Zge,Gge,RZ,PZ,Vge,CZ,Wge,DZ=y(()=>{Jd();i_();Lge=()=>({contents:new ArrayBuffer(0)}),Uge=t=>qge.encode(t),qge=new TextEncoder,OZ=t=>new Uint8Array(t),IZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Bge=(t,e)=>t.slice(0,e),Hge=(t,{contents:e,length:r},n)=>{let i=CZ()?Gge(e,n):Zge(e,n);return new Uint8Array(i).set(t,r),i},Zge=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(RZ(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Gge=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:RZ(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},RZ=t=>PZ**Math.ceil(Math.log(t)/Math.log(PZ)),PZ=2,Vge=({contents:t,length:e})=>CZ()?t:t.slice(0,e),CZ=()=>"resize"in ArrayBuffer.prototype,Wge={init:Lge,convertChunk:{string:Uge,buffer:OZ,arrayBuffer:OZ,dataView:IZ,typedArray:IZ,others:r_},getSize:n_,truncateChunk:Bge,addChunk:Hge,getFinalChunk:Yd,finalize:Vge}});async function c_(t,e){return jc(t,Qge,e)}var Kge,a_,Jge,Yge,Xge,Qge,NZ=y(()=>{Jd();i_();Kge=()=>({contents:"",textDecoder:new TextDecoder}),a_=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Jge=(t,{contents:e})=>e+t,Yge=(t,e)=>t.slice(0,e),Xge=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Qge={init:Kge,convertChunk:{string:to,buffer:a_,arrayBuffer:a_,dataView:a_,typedArray:a_,others:r_},getSize:n_,truncateChunk:Yge,addChunk:Jge,getFinalChunk:Xge,finalize:t_}});var jZ=y(()=>{TZ();DZ();NZ();Jd()});import{on as eye}from"node:events";import{finished as tye}from"node:stream/promises";var l_=y(()=>{tO();jZ();Object.assign(Kd,{on:eye,finished:tye})});var MZ,rye,FZ,zZ,nye,LZ,UZ,u_,na=y(()=>{l_();Xi();eo();MZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof yi))throw t;if(o==="all")return t;let s=rye(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},rye=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",FZ=(t,e,r)=>{if(e.length!==r)return;let n=new yi;throw n.maxBufferInfo={fdNumber:"ipc"},n},zZ=(t,e)=>{let{streamName:r,threshold:n,unit:i}=nye(t,e);return`Command's ${r} was larger than ${n} ${i}`},nye=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Qi(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:gy(r),threshold:i,unit:n}},LZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>u_(r)),UZ=(t,e,r)=>{if(!e)return t;let n=u_(r);return t.length>n?t.slice(0,n):t},u_=([,t])=>t});import{inspect as iye}from"node:util";var BZ,oye,sye,aye,cye,lye,qZ,HZ=y(()=>{KT();Vr();GT();by();na();Hd();Xs();BZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=oye({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=aye(n,b),w=x===void 0?"":` -${x}`,R=`${S}: ${a}${w}`,A=e===void 0?[t[2],t[1]]:[e],E=[R,...A,...t.slice(3),r.map(C=>cye(C)).join(` -`)].map(C=>Ld(Nc(lye(C)))).filter(Boolean).join(` - -`);return{originalMessage:x,shortMessage:R,message:E}},oye=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=sye(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${zZ(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${Ry(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},sye=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",aye=(t,e)=>{if(t instanceof Un)return;let r=sH(t)?t.originalMessage:String(t?.message??t),n=Ld(mZ(r,e));return n===""?void 0:n},cye=t=>typeof t=="string"?t:iye(t),lye=t=>Array.isArray(t)?t.map(e=>Nc(qZ(e))).filter(Boolean).join(` -`):qZ(t),qZ=t=>typeof t=="string"?t:Ft(t)?my(t):""});var d_,Mc,Xd,uye,ZZ,dye,Qd=y(()=>{Hd();ky();Xs();HZ();d_=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>ZZ({command:t,escapedCommand:e,cwd:o,durationMs:_T(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Mc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Xd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Xd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:R,signalDescription:A}=dye(l,u),{originalMessage:E,shortMessage:C,message:k}=BZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:R,signalDescription:A,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),L=iH(t,k,x);return Object.assign(L,uye({error:L,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:R,signalDescription:A,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:E,shortMessage:C})),L},uye=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>ZZ({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:_T(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),ZZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),dye=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:Ry(e);return{exitCode:r,signal:n,signalDescription:i}}});function fye(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(GZ(t*1e3)%1e3),nanoseconds:Math.trunc(GZ(t*1e6)%1e3)}}function pye(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function rO(t){switch(typeof t){case"number":{if(Number.isFinite(t))return fye(t);break}case"bigint":return pye(t)}throw new TypeError("Expected a finite number or bigint")}var GZ,VZ=y(()=>{GZ=t=>Number.isFinite(t)?t:0});function nO(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+gye);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&mye(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+hye(d,u):f;i.push(p)}},a=rO(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%yye):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var mye,hye,gye,yye,WZ=y(()=>{VZ();mye=t=>t===0||t===0n,hye=(t,e)=>e===1||e===1n?t:`${t}s`,gye=1e-7,yye=24n*60n*60n*1000n});var KZ,JZ=y(()=>{Ac();KZ=(t,e)=>{t.failed&&mi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var YZ,_ye,XZ=y(()=>{WZ();Lo();Ac();JZ();YZ=(t,e)=>{kc(e)&&(KZ(t,e),_ye(t,e))},_ye=(t,e)=>{let r=`(done in ${nO(t.durationMs)})`;mi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Fc,f_=y(()=>{XZ();Fc=(t,e,{reject:r})=>{if(YZ(t,e),t.failed&&r)throw t;return t}});var tG,bye,vye,rG,nG,QZ,Sye,iO,eG,ia,iG,wye,p_,oG,xye,$ye,oO,sG,kye,aG,m_,Eye,sO,Aye,Tye,cG,gn,h_,aO,lG,uG,Ho,hr=y(()=>{ra();Ji();Vr();tG=(t,e)=>ia(t)?"asyncGenerator":iG(t)?"generator":p_(t)?"fileUrl":xye(t)?"filePath":Eye(t)?"webStream":Bn(t,{checkOpen:!1})?"native":Ft(t)?"uint8Array":Aye(t)?"asyncIterable":Tye(t)?"iterable":sO(t)?rG({transform:t},e):wye(t)?bye(t,e):"native",bye=(t,e)=>YT(t.transform,{checkOpen:!1})?vye(t,e):sO(t.transform)?rG(t,e):Sye(t,e),vye=(t,e)=>(nG(t,e,"Duplex stream"),"duplex"),rG=(t,e)=>(nG(t,e,"web TransformStream"),"webTransform"),nG=({final:t,binary:e,objectMode:r},n,i)=>{QZ(t,`${n}.final`,i),QZ(e,`${n}.binary`,i),iO(r,`${n}.objectMode`)},QZ=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},Sye=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!eG(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(YT(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(sO(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!eG(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return iO(r,`${i}.binary`),iO(n,`${i}.objectMode`),ia(t)||ia(e)?"asyncGenerator":"generator"},iO=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},eG=t=>ia(t)||iG(t),ia=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",iG=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",wye=t=>Et(t)&&(t.transform!==void 0||t.final!==void 0),p_=t=>Object.prototype.toString.call(t)==="[object URL]",oG=t=>p_(t)&&t.protocol!=="file:",xye=t=>Et(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>$ye.has(e))&&oO(t.file),$ye=new Set(["file","append"]),oO=t=>typeof t=="string",sG=(t,e)=>t==="native"&&typeof e=="string"&&!kye.has(e),kye=new Set(["ipc","ignore","inherit","overlapped","pipe"]),aG=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",m_=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Eye=t=>aG(t)||m_(t),sO=t=>aG(t?.readable)&&m_(t?.writable),Aye=t=>cG(t)&&typeof t[Symbol.asyncIterator]=="function",Tye=t=>cG(t)&&typeof t[Symbol.iterator]=="function",cG=t=>typeof t=="object"&&t!==null,gn=new Set(["generator","asyncGenerator","duplex","webTransform"]),h_=new Set(["fileUrl","filePath","fileNumber"]),aO=new Set(["fileUrl","filePath"]),lG=new Set([...aO,"webStream","nodeStream"]),uG=new Set(["webTransform","duplex"]),Ho={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var cO,Oye,Iye,dG,lO=y(()=>{hr();cO=(t,e,r,n)=>n==="output"?Oye(t,e,r):Iye(t,e,r),Oye=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Iye=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},dG=(t,e)=>{let r=t.findLast(({type:n})=>gn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var fG,Pye,Rye,Cye,Dye,Nye,jye,pG=y(()=>{Ji();ea();hr();lO();fG=(t,e,r,n)=>[...t.filter(({type:i})=>!gn.has(i)),...Pye(t,e,r,n)],Pye=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>gn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=Rye({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return jye(o,r)},Rye=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Cye({stdioItem:t,optionName:i}):e==="webTransform"?Dye({stdioItem:t,index:r,newTransforms:n,direction:o}):Nye({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Cye=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Dye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Et(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=cO(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},Nye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Et(e)?e:{transform:e},d=c||Wr.has(o),{writableObjectMode:f,readableObjectMode:p}=cO(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},jye=(t,e)=>e==="input"?t.reverse():t});import uO from"node:process";var mG,Mye,Fye,zc,dO,hG,zye,Lye,gG=y(()=>{ra();hr();mG=(t,e,r)=>{let n=t.map(i=>Mye(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Lye},Mye=({type:t,value:e},r)=>Fye[r]??hG[t](e),Fye=["input","output","output"],zc=()=>{},dO=()=>"input",hG={generator:zc,asyncGenerator:zc,fileUrl:zc,filePath:zc,iterable:dO,asyncIterable:dO,uint8Array:dO,webStream:t=>m_(t)?"output":"input",nodeStream(t){return ta(t,{checkOpen:!1})?JT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:zc,duplex:zc,native(t){let e=zye(t);if(e!==void 0)return e;if(Bn(t,{checkOpen:!1}))return hG.nodeStream(t)}},zye=t=>{if([0,uO.stdin].includes(t))return"input";if([1,2,uO.stdout,uO.stderr].includes(t))return"output"},Lye="output"});var yG,_G=y(()=>{yG=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var bG,Uye,qye,vG,Bye,Hye,SG=y(()=>{Xi();_G();Lo();bG=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Uye(t,n).map((a,c)=>vG(a,c));return o?Bye(s,r,i):yG(s,e)},Uye=(t,e)=>{if(t===void 0)return hn.map(n=>e[n]);if(qye(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${hn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,hn.length);return Array.from({length:r},(n,i)=>t[i])},qye=t=>hn.some(e=>t[e]!==void 0),vG=(t,e)=>Array.isArray(t)?t.map(r=>vG(r,e)):t??(e>=hn.length?"ignore":"pipe"),Bye=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Ec(r,i)&&Hye(n)?"ignore":n),Hye=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Zye}from"node:fs";import Gye from"node:tty";var xG,Vye,Wye,Kye,Jye,wG,$G=y(()=>{ra();Xi();Vr();qo();xG=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Vye({stdioItem:t,fdNumber:n,direction:i}):Jye({stdioItem:t,fdNumber:n}),Vye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Wye({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(Bn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Wye=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Kye(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Gye.isatty(i))throw new TypeError(`The \`${e}: ${jy(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Yi(Zye(i)),optionName:e}}},Kye=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=hy.indexOf(t);if(r!==-1)return r},Jye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:wG(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:wG(e,e,r),optionName:r}:Bn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,wG=(t,e,r)=>{let n=hy[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var kG,Yye,Xye,Qye,e_e,EG=y(()=>{ra();Vr();hr();kG=({input:t,inputFile:e},r)=>r===0?[...Yye(t),...Qye(e)]:[],Yye=t=>t===void 0?[]:[{type:Xye(t),value:t,optionName:"input"}],Xye=t=>{if(ta(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ft(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Qye=t=>t===void 0?[]:[{...e_e(t),optionName:"inputFile"}],e_e=t=>{if(p_(t))return{type:"fileUrl",value:t};if(oO(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var AG,TG,t_e,r_e,OG,n_e,i_e,IG,PG=y(()=>{hr();AG=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),TG=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=t_e(i,t);if(s.length!==0){if(o){r_e({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(lG.has(t))return OG({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});uG.has(t)&&i_e({otherStdioItems:s,type:t,value:e,optionName:r})}},t_e=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),r_e=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{aO.has(e)&&OG({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},OG=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>n_e(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return IG(s,n,e),i==="output"?o[0].stream:void 0},n_e=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,i_e=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);IG(i,n,e)},IG=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Ho[r]} that is the same.`)}});var g_,o_e,s_e,a_e,c_e,l_e,u_e,d_e,f_e,p_e,m_e,h_e,fO,g_e,y_=y(()=>{Xi();pG();lO();hr();gG();SG();$G();EG();PG();g_=(t,e,r,n)=>{let o=bG(e,r,n).map((a,c)=>o_e({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=p_e({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>g_e(a)),s},o_e=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=gy(e),{stdioItems:o,isStdioArray:s}=s_e({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=mG(o,e,i),c=o.map(d=>xG({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=fG(c,i,a,r),u=dG(l,a);return f_e(l,u),{direction:a,objectMode:u,stdioItems:l}},s_e=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>a_e(c,n)),...kG(r,e)],s=AG(o),a=s.length>1;return c_e(s,a,n),u_e(s),{stdioItems:s,isStdioArray:a}},a_e=(t,e)=>({type:tG(t,e),value:t,optionName:e}),c_e=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(l_e.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},l_e=new Set(["ignore","ipc"]),u_e=t=>{for(let e of t)d_e(e)},d_e=({type:t,value:e,optionName:r})=>{if(oG(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(sG(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},f_e=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>h_.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},p_e=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(m_e({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw fO(i),o}},m_e=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>h_e({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},h_e=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=TG({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},fO=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Ln(r)&&r.destroy()},g_e=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as RG}from"node:fs";var DG,_i,y_e,NG,CG,__e,jG=y(()=>{Vr();y_();hr();DG=(t,e)=>g_(__e,t,e,!0),_i=({type:t,optionName:e})=>{NG(e,Ho[t])},y_e=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&NG(t,`"${e}"`),{}),NG=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},CG={generator(){},asyncGenerator:_i,webStream:_i,nodeStream:_i,webTransform:_i,duplex:_i,asyncIterable:_i,native:y_e},__e={input:{...CG,fileUrl:({value:t})=>({contents:[Yi(RG(t))]}),filePath:({value:{file:t}})=>({contents:[Yi(RG(t))]}),fileNumber:_i,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...CG,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:_i,string:_i,uint8Array:_i}}});var ro,pO,ef=y(()=>{KT();ro=(t,{stripFinalNewline:e},r)=>pO(e,r)&&t!==void 0&&!Array.isArray(t)?Nc(t):t,pO=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var __,hO,MG,FG,b_e,v_e,S_e,zG,w_e,mO,x_e,$_e,k_e,b_=y(()=>{__=(t,e,r,n)=>t||r?void 0:FG(e,n),hO=(t,e,r)=>r?t.flatMap(n=>MG(n,e)):MG(t,e),MG=(t,e)=>{let{transform:r,final:n}=FG(e,{});return[...r(t),...n()]},FG=(t,e)=>(e.previousChunks="",{transform:b_e.bind(void 0,e,t),final:S_e.bind(void 0,e)}),b_e=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=mO(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=mO(n,r.slice(i+1))),t.previousChunks=n},v_e=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),S_e=function*({previousChunks:t}){t.length>0&&(yield t)},zG=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:w_e.bind(void 0,n)},w_e=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?x_e:k_e;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},mO=(t,e)=>`${t}${e}`,x_e={windowsNewline:`\r +${t}`}});import Ege from"node:path";import bZ from"node:process";var vZ,Qy,Age,Tge,JT=y(()=>{vZ=kt(eH(),1);aH();Cy();Hd();jT();HT();ZT();GT();VT();ea();KT();$c();eo();Qy=(t,e,r)=>{r.cwd=gZ(r.cwd);let[n,i,o]=dZ(t,e,r),{command:s,args:a,options:c}=vZ.default._parse(n,i,o),l=B6(c),u=Age(l);return aZ(u),hZ(u),fZ(u),AH(u),oZ(u),u.shell=dT(u.shell),u.env=Tge(u),u.killSignal=wH(u.killSignal),u.forceKillAfterDelay=kH(u.forceKillAfterDelay),u.lines=u.lines.map((d,f)=>d&&!Wr.has(u.encoding)&&u.buffer[f]),bZ.platform==="win32"&&Ege.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:u}},Age=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:i="utf8",reject:o=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:l="SIGTERM",forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...h})=>({...h,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:i,reject:o,cleanup:s,all:a,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Tge=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:i,nodePath:o})=>{let s=e?{...bZ.env,...t}:t;return r||n?sH({env:s,cwd:i,execPath:o,preferLocal:r,addExecPath:n}):s}});var e_,YT=y(()=>{e_=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r]});function Nc(t){if(typeof t=="string")return Oge(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Ige(t)}var Oge,Ige,SZ,Pge,wZ,Rge,XT=y(()=>{Oge=t=>t.at(-1)===SZ?t.slice(0,t.at(-2)===wZ?-2:-1):t,Ige=t=>t.at(-1)===Pge?t.subarray(0,t.at(-2)===Rge?-2:-1):t,SZ=` +`,Pge=SZ.codePointAt(0),wZ="\r",Rge=wZ.codePointAt(0)});function Bn(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function QT(t,{checkOpen:e=!0}={}){return Bn(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function ta(t,{checkOpen:e=!0}={}){return Bn(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function eO(t,e){return QT(t,e)&&ta(t,e)}var ra=y(()=>{});function xZ(){return this[rO].next()}function $Z(t){return this[rO].return(t)}function nO({preventCancel:t=!1}={}){let e=this.getReader(),r=new tO(e,t),n=Object.create(Dge);return n[rO]=r,n}var Cge,tO,rO,Dge,kZ=y(()=>{Cge=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),tO=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#o();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#i(e);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#i(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},rO=Symbol();Object.defineProperty(xZ,"name",{value:"next"});Object.defineProperty($Z,"name",{value:"return"});Dge=Object.create(Cge,{next:{enumerable:!0,configurable:!0,writable:!0,value:xZ},return:{enumerable:!0,configurable:!0,writable:!0,value:$Z}})});var EZ=y(()=>{});var AZ=y(()=>{kZ();EZ()});var TZ,Nge,jge,Mge,Kd,iO=y(()=>{ra();AZ();TZ=t=>{if(ta(t,{checkOpen:!1})&&Kd.on!==void 0)return jge(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Nge.call(t)==="[object ReadableStream]")return nO.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Nge}=Object.prototype,jge=async function*(t){let e=new AbortController,r={};Mge(t,e,r);try{for await(let[n]of Kd.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},Mge=async(t,e,r)=>{try{await Kd.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},Kd={}});var jc,Fge,PZ,OZ,zge,IZ,yi,Jd=y(()=>{iO();jc=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let l=TZ(t),u=e();u.length=0;try{for await(let d of l){let f=zge(d),p=r[f](d,u);PZ({convertedChunk:p,state:u,getSize:n,truncateChunk:i,addChunk:o,maxBuffer:c})}return Fge({state:u,convertChunk:r,getSize:n,truncateChunk:i,addChunk:o,getFinalChunk:s,maxBuffer:c}),a(u)}catch(d){let f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(u),f}},Fge=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:i,maxBuffer:o})=>{let s=i(t);s!==void 0&&PZ({convertedChunk:s,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:o})},PZ=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:i,maxBuffer:o})=>{let s=r(t),a=e.length+s;if(a<=o){OZ(t,e,i,a);return}let c=n(t,o-e.length);throw c!==void 0&&OZ(c,e,i,o),new yi},OZ=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},zge=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=IZ.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&IZ.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:IZ}=Object.prototype,yi=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var to,Yd,t_,r_,n_,i_=y(()=>{to=t=>t,Yd=()=>{},t_=({contents:t})=>t,r_=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},n_=t=>t.length});async function o_(t,e){return jc(t,Bge,e)}var Lge,Uge,qge,Bge,RZ=y(()=>{Jd();i_();Lge=()=>({contents:[]}),Uge=()=>1,qge=(t,{contents:e})=>(e.push(t),e),Bge={init:Lge,convertChunk:{string:to,buffer:to,arrayBuffer:to,dataView:to,typedArray:to,others:to},getSize:Uge,truncateChunk:Yd,addChunk:qge,getFinalChunk:Yd,finalize:t_}});async function s_(t,e){return jc(t,Xge,e)}var Hge,Zge,Gge,CZ,DZ,Vge,Wge,Kge,Jge,jZ,NZ,Yge,MZ,Xge,FZ=y(()=>{Jd();i_();Hge=()=>({contents:new ArrayBuffer(0)}),Zge=t=>Gge.encode(t),Gge=new TextEncoder,CZ=t=>new Uint8Array(t),DZ=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Vge=(t,e)=>t.slice(0,e),Wge=(t,{contents:e,length:r},n)=>{let i=MZ()?Jge(e,n):Kge(e,n);return new Uint8Array(i).set(t,r),i},Kge=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(jZ(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Jge=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:jZ(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},jZ=t=>NZ**Math.ceil(Math.log(t)/Math.log(NZ)),NZ=2,Yge=({contents:t,length:e})=>MZ()?t:t.slice(0,e),MZ=()=>"resize"in ArrayBuffer.prototype,Xge={init:Hge,convertChunk:{string:Zge,buffer:CZ,arrayBuffer:CZ,dataView:DZ,typedArray:DZ,others:r_},getSize:n_,truncateChunk:Vge,addChunk:Wge,getFinalChunk:Yd,finalize:Yge}});async function c_(t,e){return jc(t,nye,e)}var Qge,a_,eye,tye,rye,nye,zZ=y(()=>{Jd();i_();Qge=()=>({contents:"",textDecoder:new TextDecoder}),a_=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),eye=(t,{contents:e})=>e+t,tye=(t,e)=>t.slice(0,e),rye=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},nye={init:Qge,convertChunk:{string:to,buffer:a_,arrayBuffer:a_,dataView:a_,typedArray:a_,others:r_},getSize:n_,truncateChunk:tye,addChunk:eye,getFinalChunk:rye,finalize:t_}});var LZ=y(()=>{RZ();FZ();zZ();Jd()});import{on as iye}from"node:events";import{finished as oye}from"node:stream/promises";var l_=y(()=>{iO();LZ();Object.assign(Kd,{on:iye,finished:oye})});var UZ,sye,qZ,BZ,aye,HZ,ZZ,u_,na=y(()=>{l_();Xi();eo();UZ=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:i,fdNumber:o})=>{if(!(t instanceof yi))throw t;if(o==="all")return t;let s=sye(r,n,i);throw t.maxBufferInfo={fdNumber:o,unit:s},e.destroy(),t},sye=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",qZ=(t,e,r)=>{if(e.length!==r)return;let n=new yi;throw n.maxBufferInfo={fdNumber:"ipc"},n},BZ=(t,e)=>{let{streamName:r,threshold:n,unit:i}=aye(t,e);return`Command's ${r} was larger than ${n} ${i}`},aye=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let i=Qi(e,r);return r==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:gy(r),threshold:i,unit:n}},HZ=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>u_(r)),ZZ=(t,e,r)=>{if(!e)return t;let n=u_(r);return t.length>n?t.slice(0,n):t},u_=([,t])=>t});import{inspect as cye}from"node:util";var VZ,lye,uye,dye,fye,pye,GZ,WZ=y(()=>{XT();Vr();KT();by();na();Hd();Xs();VZ=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:i,signalDescription:o,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:b})=>{let _=n?.code,S=lye({originalError:n,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:_,signal:i,signalDescription:o,exitCode:s,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),x=dye(n,b),w=x===void 0?"":` +${x}`,R=`${S}: ${a}${w}`,A=e===void 0?[t[2],t[1]]:[e],E=[R,...A,...t.slice(3),r.map(C=>fye(C)).join(` +`)].map(C=>Ld(Nc(pye(C)))).filter(Boolean).join(` + +`);return{originalMessage:x,shortMessage:R,message:E}},lye=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:o,signal:s,signalDescription:a,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=uye(d,f);return e?`Command timed out after ${r} milliseconds${m}`:u?s===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:l?`Command was canceled${m}`:n?`${BZ(t,i)}${m}`:o!==void 0?`Command failed with ${o}${m}`:d?`Command was killed with ${p} (${Ry(p)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},uye=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",dye=(t,e)=>{if(t instanceof Un)return;let r=uH(t)?t.originalMessage:String(t?.message??t),n=Ld(_Z(r,e));return n===""?void 0:n},fye=t=>typeof t=="string"?t:cye(t),pye=t=>Array.isArray(t)?t.map(e=>Nc(GZ(e))).filter(Boolean).join(` +`):GZ(t),GZ=t=>typeof t=="string"?t:Ft(t)?my(t):""});var d_,Mc,Xd,mye,KZ,hye,Qd=y(()=>{Hd();ky();Xs();WZ();d_=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:o},startTime:s})=>KZ({command:t,escapedCommand:e,cwd:o,durationMs:ST(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),Mc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:s})=>Xd({error:t,command:e,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:s}),Xd=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:b,cwd:_,maxBuffer:S},isSync:x})=>{let{exitCode:w,signal:R,signalDescription:A}=hye(l,u),{originalMessage:E,shortMessage:C,message:k}=VZ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:R,signalDescription:A,exitCode:w,escapedCommand:r,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:b,maxBuffer:S,timeout:h,cwd:_}),L=cH(t,k,x);return Object.assign(L,mye({error:L,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:w,signal:R,signalDescription:A,stdio:d,all:f,ipcOutput:p,cwd:_,originalMessage:E,shortMessage:C})),L},mye=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:b})=>KZ({shortMessage:b,originalMessage:g,command:e,escapedCommand:r,cwd:h,durationMs:ST(n),failed:!0,timedOut:i,isCanceled:o,isGracefullyCanceled:s,isTerminated:u!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),KZ=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),hye=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:Ry(e);return{exitCode:r,signal:n,signalDescription:i}}});function gye(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(JZ(t*1e3)%1e3),nanoseconds:Math.trunc(JZ(t*1e6)%1e3)}}function yye(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function oO(t){switch(typeof t){case"number":{if(Number.isFinite(t))return gye(t);break}case"bigint":return yye(t)}throw new TypeError("Expected a finite number or bigint")}var JZ,YZ=y(()=>{JZ=t=>Number.isFinite(t)?t:0});function sO(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(u,d)=>{let f=Math.floor(u*10**d+vye);return(Math.round(f)/10**d).toFixed(d)},s=(u,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&_ye(u)&&!(e.colonNotation&&f==="m"))){if(p??=String(u),e.colonNotation){let m=p.includes(".")?p.split(".")[0].length:p.length,h=i.length>0?2:1;p="0".repeat(Math.max(0,h-m))+p}else p+=e.verbose?" "+bye(d,u):f;i.push(p)}},a=oO(t),c=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let u=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(s(u,"second","s"),e.formatSubMilliseconds)s(d,"millisecond","ms"),s(f,"microsecond","\xB5s"),s(p,"nanosecond","ns");else{let m=d+f/1e3+p/1e6,h=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let u=(r?Number(t%Sye):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=o(u,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");s(Number.parseFloat(p),"second","s",p)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}var _ye,bye,vye,Sye,XZ=y(()=>{YZ();_ye=t=>t===0||t===0n,bye=(t,e)=>e===1||e===1n?t:`${t}s`,vye=1e-7,Sye=24n*60n*60n*1000n});var QZ,eG=y(()=>{Ac();QZ=(t,e)=>{t.failed&&mi({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})}});var tG,wye,rG=y(()=>{XZ();Lo();Ac();eG();tG=(t,e)=>{kc(e)&&(QZ(t,e),wye(t,e))},wye=(t,e)=>{let r=`(done in ${sO(t.durationMs)})`;mi({type:"duration",verboseMessage:r,verboseInfo:e,result:t})}});var Fc,f_=y(()=>{rG();Fc=(t,e,{reject:r})=>{if(tG(t,e),t.failed&&r)throw t;return t}});var oG,xye,$ye,sG,aG,nG,kye,aO,iG,ia,cG,Eye,p_,lG,Aye,Tye,cO,uG,Oye,dG,m_,Iye,lO,Pye,Rye,fG,gn,h_,uO,pG,mG,Ho,hr=y(()=>{ra();Ji();Vr();oG=(t,e)=>ia(t)?"asyncGenerator":cG(t)?"generator":p_(t)?"fileUrl":Aye(t)?"filePath":Iye(t)?"webStream":Bn(t,{checkOpen:!1})?"native":Ft(t)?"uint8Array":Pye(t)?"asyncIterable":Rye(t)?"iterable":lO(t)?sG({transform:t},e):Eye(t)?xye(t,e):"native",xye=(t,e)=>eO(t.transform,{checkOpen:!1})?$ye(t,e):lO(t.transform)?sG(t,e):kye(t,e),$ye=(t,e)=>(aG(t,e,"Duplex stream"),"duplex"),sG=(t,e)=>(aG(t,e,"web TransformStream"),"webTransform"),aG=({final:t,binary:e,objectMode:r},n,i)=>{nG(t,`${n}.final`,i),nG(e,`${n}.binary`,i),aO(r,`${n}.objectMode`)},nG=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},kye=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!iG(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(eO(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(lO(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!iG(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return aO(r,`${i}.binary`),aO(n,`${i}.objectMode`),ia(t)||ia(e)?"asyncGenerator":"generator"},aO=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},iG=t=>ia(t)||cG(t),ia=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",cG=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Eye=t=>Et(t)&&(t.transform!==void 0||t.final!==void 0),p_=t=>Object.prototype.toString.call(t)==="[object URL]",lG=t=>p_(t)&&t.protocol!=="file:",Aye=t=>Et(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>Tye.has(e))&&cO(t.file),Tye=new Set(["file","append"]),cO=t=>typeof t=="string",uG=(t,e)=>t==="native"&&typeof e=="string"&&!Oye.has(e),Oye=new Set(["ipc","ignore","inherit","overlapped","pipe"]),dG=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",m_=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Iye=t=>dG(t)||m_(t),lO=t=>dG(t?.readable)&&m_(t?.writable),Pye=t=>fG(t)&&typeof t[Symbol.asyncIterator]=="function",Rye=t=>fG(t)&&typeof t[Symbol.iterator]=="function",fG=t=>typeof t=="object"&&t!==null,gn=new Set(["generator","asyncGenerator","duplex","webTransform"]),h_=new Set(["fileUrl","filePath","fileNumber"]),uO=new Set(["fileUrl","filePath"]),pG=new Set([...uO,"webStream","nodeStream"]),mG=new Set(["webTransform","duplex"]),Ho={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"}});var dO,Cye,Dye,hG,fO=y(()=>{hr();dO=(t,e,r,n)=>n==="output"?Cye(t,e,r):Dye(t,e,r),Cye=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},Dye=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},hG=(t,e)=>{let r=t.findLast(({type:n})=>gn.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode}});var gG,Nye,jye,Mye,Fye,zye,Lye,yG=y(()=>{Ji();ea();hr();fO();gG=(t,e,r,n)=>[...t.filter(({type:i})=>!gn.has(i)),...Nye(t,e,r,n)],Nye=(t,e,r,{encoding:n})=>{let i=t.filter(({type:s})=>gn.has(s)),o=Array.from({length:i.length});for(let[s,a]of Object.entries(i))o[s]=jye({stdioItem:a,index:Number(s),newTransforms:o,optionName:e,direction:r,encoding:n});return Lye(o,r)},jye=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:o,encoding:s})=>e==="duplex"?Mye({stdioItem:t,optionName:i}):e==="webTransform"?Fye({stdioItem:t,index:r,newTransforms:n,direction:o}):zye({stdioItem:t,index:r,newTransforms:n,direction:o,encoding:s}),Mye=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:o})=>{if(i&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},Fye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:o,objectMode:s}=Et(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=dO(s,r,n,i);return{...t,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},zye=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:o})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=Et(e)?e:{transform:e},d=c||Wr.has(o),{writableObjectMode:f,readableObjectMode:p}=dO(u,r,n,i);return{...t,value:{transform:s,final:a,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},Lye=(t,e)=>e==="input"?t.reverse():t});import pO from"node:process";var _G,Uye,qye,zc,mO,bG,Bye,Hye,vG=y(()=>{ra();hr();_G=(t,e,r)=>{let n=t.map(i=>Uye(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Hye},Uye=({type:t,value:e},r)=>qye[r]??bG[t](e),qye=["input","output","output"],zc=()=>{},mO=()=>"input",bG={generator:zc,asyncGenerator:zc,fileUrl:zc,filePath:zc,iterable:mO,asyncIterable:mO,uint8Array:mO,webStream:t=>m_(t)?"output":"input",nodeStream(t){return ta(t,{checkOpen:!1})?QT(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:zc,duplex:zc,native(t){let e=Bye(t);if(e!==void 0)return e;if(Bn(t,{checkOpen:!1}))return bG.nodeStream(t)}},Bye=t=>{if([0,pO.stdin].includes(t))return"input";if([1,2,pO.stdout,pO.stderr].includes(t))return"output"},Hye="output"});var SG,wG=y(()=>{SG=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t});var xG,Zye,Gye,$G,Vye,Wye,kG=y(()=>{Xi();wG();Lo();xG=({stdio:t,ipc:e,buffer:r,...n},i,o)=>{let s=Zye(t,n).map((a,c)=>$G(a,c));return o?Vye(s,r,i):SG(s,e)},Zye=(t,e)=>{if(t===void 0)return hn.map(n=>e[n]);if(Gye(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${hn.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,hn.length);return Array.from({length:r},(n,i)=>t[i])},Gye=t=>hn.some(e=>t[e]!==void 0),$G=(t,e)=>Array.isArray(t)?t.map(r=>$G(r,e)):t??(e>=hn.length?"ignore":"pipe"),Vye=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Ec(r,i)&&Wye(n)?"ignore":n),Wye=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe")});import{readFileSync as Kye}from"node:fs";import Jye from"node:tty";var AG,Yye,Xye,Qye,e_e,EG,TG=y(()=>{ra();Xi();Vr();qo();AG=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:o})=>!r||e!=="native"?t:o?Yye({stdioItem:t,fdNumber:n,direction:i}):e_e({stdioItem:t,fdNumber:n}),Yye=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let o=Xye({value:e,optionName:r,fdNumber:n,direction:i});if(o!==void 0)return o;if(Bn(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Xye=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=Qye(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(Jye.isatty(i))throw new TypeError(`The \`${e}: ${jy(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Yi(Kye(i)),optionName:e}}},Qye=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=hy.indexOf(t);if(r!==-1)return r},e_e=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:EG(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:EG(e,e,r),optionName:r}:Bn(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,EG=(t,e,r)=>{let n=hy[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n}});var OG,t_e,r_e,n_e,i_e,IG=y(()=>{ra();Vr();hr();OG=({input:t,inputFile:e},r)=>r===0?[...t_e(t),...n_e(e)]:[],t_e=t=>t===void 0?[]:[{type:r_e(t),value:t,optionName:"input"}],r_e=t=>{if(ta(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Ft(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},n_e=t=>t===void 0?[]:[{...i_e(t),optionName:"inputFile"}],i_e=t=>{if(p_(t))return{type:"fileUrl",value:t};if(cO(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")}});var PG,RG,o_e,s_e,CG,a_e,c_e,DG,NG=y(()=>{hr();PG=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),RG=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:o})=>{let s=o_e(i,t);if(s.length!==0){if(o){s_e({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});return}if(pG.has(t))return CG({otherStdioItems:s,type:t,value:e,optionName:r,direction:n});mG.has(t)&&c_e({otherStdioItems:s,type:t,value:e,optionName:r})}},o_e=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),s_e=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{uO.has(e)&&CG({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},CG=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let o=t.filter(a=>a_e(a,r));if(o.length===0)return;let s=o.find(a=>a.direction!==i);return DG(s,n,e),i==="output"?o[0].stream:void 0},a_e=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,c_e=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:o}})=>o===r.transform);DG(i,n,e)},DG=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Ho[r]} that is the same.`)}});var g_,l_e,u_e,d_e,f_e,p_e,m_e,h_e,g_e,y_e,__e,b_e,hO,v_e,y_=y(()=>{Xi();yG();fO();hr();vG();kG();TG();IG();NG();g_=(t,e,r,n)=>{let o=xG(e,r,n).map((a,c)=>l_e({stdioOption:a,fdNumber:c,options:e,isSync:n})),s=y_e({initialFileDescriptors:o,addProperties:t,options:e,isSync:n});return e.stdio=s.map(({stdioItems:a})=>v_e(a)),s},l_e=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=gy(e),{stdioItems:o,isStdioArray:s}=u_e({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=_G(o,e,i),c=o.map(d=>AG({stdioItem:d,isStdioArray:s,fdNumber:e,direction:a,isSync:n})),l=gG(c,i,a,r),u=hG(l,a);return g_e(l,u),{direction:a,objectMode:u,stdioItems:l}},u_e=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let o=[...(Array.isArray(t)?t:[t]).map(c=>d_e(c,n)),...OG(r,e)],s=PG(o),a=s.length>1;return f_e(s,a,n),m_e(s),{stdioItems:s,isStdioArray:a}},d_e=(t,e)=>({type:oG(t,e),value:t,optionName:e}),f_e=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(p_e.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},p_e=new Set(["ignore","ipc"]),m_e=t=>{for(let e of t)h_e(e)},h_e=({type:t,value:e,optionName:r})=>{if(lG(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme. +For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(uG(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},g_e=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>h_.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},y_e=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let o of t)i.push(__e({fileDescriptor:o,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(o){throw hO(i),o}},__e=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:o,isSync:s})=>{let a=r.map(c=>b_e({stdioItem:c,addProperties:i,direction:t,options:o,fileDescriptors:n,isSync:s}));return{direction:t,objectMode:e,stdioItems:a}},b_e=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:o})=>{let s=RG({stdioItem:t,direction:r,fileDescriptors:i,isSync:o});return s!==void 0?{...t,stream:s}:{...t,...e[r][t.type](t,n)}},hO=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Ln(r)&&r.destroy()},v_e=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"}});import{readFileSync as jG}from"node:fs";var FG,_i,S_e,zG,MG,w_e,LG=y(()=>{Vr();y_();hr();FG=(t,e)=>g_(w_e,t,e,!0),_i=({type:t,optionName:e})=>{zG(e,Ho[t])},S_e=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&zG(t,`"${e}"`),{}),zG=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},MG={generator(){},asyncGenerator:_i,webStream:_i,nodeStream:_i,webTransform:_i,duplex:_i,asyncIterable:_i,native:S_e},w_e={input:{...MG,fileUrl:({value:t})=>({contents:[Yi(jG(t))]}),filePath:({value:{file:t}})=>({contents:[Yi(jG(t))]}),fileNumber:_i,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...MG,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:_i,string:_i,uint8Array:_i}}});var ro,gO,ef=y(()=>{XT();ro=(t,{stripFinalNewline:e},r)=>gO(e,r)&&t!==void 0&&!Array.isArray(t)?Nc(t):t,gO=(t,e)=>e==="all"?t[1]||t[2]:t[e]});var __,_O,UG,qG,x_e,$_e,k_e,BG,E_e,yO,A_e,T_e,O_e,b_=y(()=>{__=(t,e,r,n)=>t||r?void 0:qG(e,n),_O=(t,e,r)=>r?t.flatMap(n=>UG(n,e)):UG(t,e),UG=(t,e)=>{let{transform:r,final:n}=qG(e,{});return[...r(t),...n()]},qG=(t,e)=>(e.previousChunks="",{transform:x_e.bind(void 0,e,t),final:k_e.bind(void 0,e)}),x_e=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let o=0;o0&&(a=yO(n,a),n=""),yield a,i=o}i!==r.length-1&&(n=yO(n,r.slice(i+1))),t.previousChunks=n},$_e=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),k_e=function*({previousChunks:t}){t.length>0&&(yield t)},BG=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:E_e.bind(void 0,n)},E_e=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:o}=typeof e=="string"?A_e:O_e;if(e.at(-1)===i){yield e;return}yield o(e,t?n:r)},yO=(t,e)=>`${t}${e}`,A_e={windowsNewline:`\r `,unixNewline:` `,LF:` -`,concatBytes:mO},$_e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},k_e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:$_e}});import{Buffer as E_e}from"node:buffer";var LG,A_e,UG,T_e,O_e,qG,BG=y(()=>{Vr();LG=(t,e)=>t?void 0:A_e.bind(void 0,e),A_e=function*(t,e){if(typeof e!="string"&&!Ft(e)&&!E_e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},UG=(t,e)=>t?T_e.bind(void 0,e):O_e.bind(void 0,e),T_e=function*(t,e){qG(t,e),yield e},O_e=function*(t,e){if(qG(t,e),typeof e!="string"&&!Ft(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},qG=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`. +`,concatBytes:yO},T_e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},O_e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:T_e}});import{Buffer as I_e}from"node:buffer";var HG,P_e,ZG,R_e,C_e,GG,VG=y(()=>{Vr();HG=(t,e)=>t?void 0:P_e.bind(void 0,e),P_e=function*(t,e){if(typeof e!="string"&&!Ft(e)&&!I_e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},ZG=(t,e)=>t?R_e.bind(void 0,e):C_e.bind(void 0,e),R_e=function*(t,e){GG(t,e),yield e},C_e=function*(t,e){if(GG(t,e),typeof e!="string"&&!Ft(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},GG=(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 I_e}from"node:buffer";import{StringDecoder as P_e}from"node:string_decoder";var v_,R_e,C_e,D_e,gO=y(()=>{Vr();v_=(t,e,r)=>{if(r)return;if(t)return{transform:R_e.bind(void 0,new TextEncoder)};let n=new P_e(e);return{transform:C_e.bind(void 0,n),final:D_e.bind(void 0,n)}},R_e=function*(t,e){I_e.isBuffer(e)?yield Yi(e):typeof e=="string"?yield t.encode(e):yield e},C_e=function*(t,e){yield Ft(e)?t.write(e):e},D_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as HG}from"node:util";var yO,S_,ZG,N_e,GG,j_e,VG=y(()=>{yO=HG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),S_=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=j_e}=e[r];for await(let i of n(t))yield*S_(i,e,r+1)},ZG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*N_e(r,Number(e),t)},N_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*S_(n,r,e+1)},GG=HG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),j_e=function*(t){yield t}});var _O,WG,oa,tf,M_e,F_e,bO=y(()=>{_O=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},WG=(t,e)=>[...e.flatMap(r=>[...oa(r,t,0)]),...tf(t)],oa=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=F_e}=e[r];for(let i of n(t))yield*oa(i,e,r+1)},tf=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*M_e(r,Number(e),t)},M_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*oa(n,r,e+1)},F_e=function*(t){yield t}});import{Transform as z_e,getDefaultHighWaterMark as KG}from"node:stream";var vO,w_,JG,x_=y(()=>{hr();b_();BG();gO();VG();bO();vO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=JG(t,s,o),l=ia(e),u=ia(r),d=l?yO.bind(void 0,S_,a):_O.bind(void 0,oa),f=l||u?yO.bind(void 0,ZG,a):_O.bind(void 0,tf),p=l||u?GG.bind(void 0,a):void 0;return{stream:new z_e({writableObjectMode:n,writableHighWaterMark:KG(n),readableObjectMode:i,readableHighWaterMark:KG(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},w_=(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=JG(s,r,a);t=WG(c,t)}return t},JG=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:LG(n,a)},v_(r,s,n),__(r,o,n,c),{transform:t,final:e},{transform:UG(i,a)},zG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var YG,L_e,U_e,q_e,B_e,XG=y(()=>{x_();Vr();hr();YG=(t,e)=>{for(let r of L_e(t))U_e(t,r,e)},L_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),U_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 ${Ho[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>q_e(a,n));r.input=zd(s)},q_e=(t,e)=>{let r=w_(t,e,"utf8",!0);return B_e(r),zd(r)},B_e=t=>{let e=t.find(r=>typeof r!="string"&&!Ft(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 $_,H_e,Z_e,QG,e9,G_e,t9,SO=y(()=>{ea();hr();Ac();Lo();$_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ec(r,n)&&!Wr.has(e)&&H_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&Z_e.has(o))||t.every(({type:i})=>gn.has(i))),H_e=t=>t===1||t===2,Z_e=new Set(["pipe","overlapped"]),QG=async(t,e,r,n)=>{for await(let i of t)G_e(e)||t9(i,r,n)},e9=(t,e,r)=>{for(let n of t)t9(n,e,r)},G_e=t=>t._readableState.pipes.length>0,t9=(t,e,r)=>{let n=xy(t);mi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as V_e,appendFileSync as W_e}from"node:fs";var r9,K_e,J_e,Y_e,X_e,Q_e,n9=y(()=>{SO();x_();b_();Vr();hr();na();r9=({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)=>K_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},K_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=UZ(t,o,d),p=Yi(f),{stdioItems:m,objectMode:h}=e[r],g=J_e([p],m,c,n),{serializedResult:b,finalResult:_=b}=Y_e({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});X_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&&Q_e(b,m,i),S}catch(x){return n.error=x,S}},J_e=(t,e,r,n)=>{try{return w_(t,e,r,!1)}catch(i){return n.error=i,t}},Y_e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:zd(t)};let s=P6(t,r);return n[o]?{serializedResult:s,finalResult:hO(s,!i[o],e)}:{serializedResult:s}},X_e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!$_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=hO(t,!1,s);try{e9(a,e,n)}catch(c){r.error??=c}},Q_e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>h_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?W_e(n,t):(r.add(o),V_e(n,t))}}});var i9,o9=y(()=>{Vr();ef();i9=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ro(e,r,"all")]:Array.isArray(e)?[ro(t,r,"all"),...e]:Ft(t)&&Ft(e)?uT([t,e]):`${t}${e}`}});import{once as wO}from"node:events";var s9,ebe,a9,c9,tbe,xO,$O=y(()=>{Xs();s9=async(t,e)=>{let[r,n]=await ebe(t);return e.isForcefullyTerminated??=!1,[r,n]},ebe=async t=>{let[e,r]=await Promise.allSettled([wO(t,"spawn"),wO(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?a9(t):r.value},a9=async t=>{try{return await wO(t,"exit")}catch{return a9(t)}},c9=async t=>{let[e,r]=await t;if(!tbe(e,r)&&xO(e,r))throw new Un;return[e,r]},tbe=(t,e)=>t===void 0&&e===void 0,xO=(t,e)=>t!==0||e!==null});var l9,rbe,u9=y(()=>{Xs();na();$O();l9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=rbe(t,e,r),s=o?.code==="ETIMEDOUT",a=LZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},rbe=(t,e,r)=>t!==void 0?t:xO(e,r)?new Un:void 0});import{spawnSync as nbe}from"node:child_process";var d9,ibe,obe,sbe,k_,abe,cbe,lbe,ube,f9=y(()=>{bT();VT();WT();Qd();f_();jG();ef();XG();n9();na();o9();u9();d9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=ibe(t,e,r),d=abe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Fc(d,c,l)},ibe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=Ey(t,e,r),a=obe(r),{file:c,commandArguments:l,options:u}=Qy(t,e,a);sbe(u);let d=DG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},obe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,sbe=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&k_("ipcInput"),t&&k_("ipc: true"),r&&k_("detached: true"),n&&k_("cancelSignal")},k_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},abe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=cbe({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}=l9(c,r),{output:m,error:h=l}=r9({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>ro(_,r,S)),b=ro(i9(m,r),r,"all");return ube({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},cbe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{YG(o,r);let a=lbe(r);return nbe(...e_(t,e,a))}catch(a){return Mc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},lbe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:u_(e)}),ube=({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?d_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Xd({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 kO,on as dbe}from"node:events";var p9,fbe,pbe,mbe,hbe,m9=y(()=>{Rc();Vd();Gd();p9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ic({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Gy(t)}),fbe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),fbe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{zy(e,i);let o=Bo(t,e,r),s=new AbortController;try{return await Promise.race([pbe(o,n,s),mbe(o,r,s),hbe(o,r,s)])}catch(a){throw Pc(t),a}finally{s.abort(),Ly(e,i)}},pbe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await kO(t,"message",{signal:r});return n}for await(let[n]of dbe(t,"message",{signal:r}))if(e(n))return n},mbe=async(t,e,{signal:r})=>{await kO(t,"disconnect",{signal:r}),kH(e)},hbe=async(t,e,{signal:r})=>{let[n]=await kO(t,"strict:error",{signal:r});throw Ny(n,e)}});import{once as g9,on as gbe}from"node:events";var y9,EO,ybe,_be,bbe,h9,AO=y(()=>{Rc();Vd();Gd();y9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>EO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),EO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ic({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Gy(t)}),zy(e,o);let s=Bo(t,e,r),a=new AbortController,c={};return ybe(t,s,a),_be({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),bbe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},ybe=async(t,e,r)=>{try{await g9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},_be=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await g9(t,"strict:error",{signal:r.signal});n.error=Ny(i,e),r.abort()}catch{}},bbe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of gbe(r,"message",{signal:o.signal}))h9(s),yield c}catch{h9(s)}finally{o.abort(),Ly(e,a),n||Pc(t),i&&await t}},h9=({error:t})=>{if(t)throw t}});import _9 from"node:process";var b9,v9,S9,TO=y(()=>{Yy();m9();AO();Hy();b9=(t,{ipc:e})=>{Object.assign(t,S9(t,!1,e))},v9=()=>{let t=_9,e=!0,r=_9.channel!==void 0;return{...S9(t,e,r),getCancelSignal:QH.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},S9=(t,e,r)=>({sendMessage:Jy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:p9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:y9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as vbe}from"node:child_process";import{PassThrough as Sbe,Readable as wbe,Writable as xbe,Duplex as $be}from"node:stream";var w9,kbe,rf,Ebe,Abe,Tbe,Obe,x9=y(()=>{y_();Qd();f_();w9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{fO(n);let a=new vbe;kbe(a,n),Object.assign(a,{readable:Ebe,writable:Abe,duplex:Tbe});let c=Mc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Obe(c,s,i);return{subprocess:a,promise:l}},kbe=(t,e)=>{let r=rf(),n=rf(),i=rf(),o=Array.from({length:e.length-3},rf),s=rf(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},rf=()=>{let t=new Sbe;return t.end(),t},Ebe=()=>new wbe({read(){}}),Abe=()=>new xbe({write(){}}),Tbe=()=>new $be({read(){},write(){}}),Obe=async(t,e,r)=>Fc(t,e,r)});import{createReadStream as $9,createWriteStream as k9}from"node:fs";import{Buffer as Ibe}from"node:buffer";import{Readable as nf,Writable as Pbe,Duplex as Rbe}from"node:stream";var A9,of,E9,Cbe,T9=y(()=>{x_();y_();hr();A9=(t,e)=>g_(Cbe,t,e,!1),of=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ho[t]}.`)},E9={fileNumber:of,generator:vO,asyncGenerator:vO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:Rbe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Cbe={input:{...E9,fileUrl:({value:t})=>({stream:$9(t)}),filePath:({value:{file:t}})=>({stream:$9(t)}),webStream:({value:t})=>({stream:nf.fromWeb(t)}),iterable:({value:t})=>({stream:nf.from(t)}),asyncIterable:({value:t})=>({stream:nf.from(t)}),string:({value:t})=>({stream:nf.from(t)}),uint8Array:({value:t})=>({stream:nf.from(Ibe.from(t))})},output:{...E9,fileUrl:({value:t})=>({stream:k9(t)}),filePath:({value:{file:t,append:e}})=>({stream:k9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Pbe.fromWeb(t)}),iterable:of,asyncIterable:of,string:of,uint8Array:of}}});import{on as Dbe,once as O9}from"node:events";import{PassThrough as Nbe,getDefaultHighWaterMark as jbe}from"node:stream";import{finished as R9}from"node:stream/promises";function sa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)IO(i);let e=t.some(({readableObjectMode:i})=>i),r=Mbe(t,e),n=new OO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Mbe,OO,Fbe,zbe,Lbe,IO,Ube,qbe,Bbe,Hbe,Zbe,C9,D9,PO,N9,Gbe,E_,I9,P9,A_=y(()=>{Mbe=(t,e)=>{if(t.length===0)return jbe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},OO=class extends Nbe{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(IO(e),this.#t.has(e))return;this.#t.add(e),this.#n??=Fbe(this,this.#t,this.#o);let r=Ube({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(IO(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)}},Fbe=async(t,e,r)=>{E_(t,I9);let n=new AbortController;try{await Promise.race([zbe(t,n),Lbe(t,e,r,n)])}finally{n.abort(),E_(t,-I9)}},zbe=async(t,{signal:e})=>{try{await R9(t,{signal:e,cleanup:!0})}catch(r){throw C9(t,r),r}},Lbe=async(t,e,r,{signal:n})=>{for await(let[i]of Dbe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},IO=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Ube=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{E_(t,P9);let a=new AbortController;try{await Promise.race([qbe(o,e,a),Bbe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),Hbe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),E_(t,-P9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?PO(t):Zbe(t))},qbe=async(t,e,{signal:r})=>{try{await t,r.aborted||PO(e)}catch(n){r.aborted||C9(e,n)}},Bbe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await R9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;D9(s)?i.add(e):N9(t,s)}},Hbe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await O9(t,i,{signal:o}),!t.readable)return O9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},Zbe=t=>{t.writable&&t.end()},C9=(t,e)=>{D9(e)?PO(t):N9(t,e)},D9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",PO=t=>{(t.readable||t.writable)&&t.destroy()},N9=(t,e)=>{t.destroyed||(t.once("error",Gbe),t.destroy(e))},Gbe=()=>{},E_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I9=2,P9=1});import{finished as j9}from"node:stream/promises";var Lc,Vbe,RO,Wbe,CO,T_=y(()=>{Xi();Lc=(t,e)=>{t.pipe(e),Vbe(t,e),Wbe(t,e)},Vbe=async(t,e)=>{if(!(Ln(t)||Ln(e))){try{await j9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}RO(e)}},RO=t=>{t.writable&&t.end()},Wbe=async(t,e)=>{if(!(Ln(t)||Ln(e))){try{await j9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}CO(t)}},CO=t=>{t.readable&&t.destroy()}});var M9,Kbe,Jbe,Ybe,Xbe,Qbe,F9=y(()=>{A_();Xi();Fy();hr();T_();M9=(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})=>gn.has(c)))Kbe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!gn.has(c)))Ybe({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]:sa(o);Lc(s,i)}},Kbe=(t,e,r,n)=>{r==="output"?Lc(t.stdio[n],e):Lc(e,t.stdio[n]);let i=Jbe[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},Jbe=["stdin","stdout","stderr"],Ybe=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;Xbe(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},Xbe=(t,{signal:e})=>{Ln(t)&&Qs(t,Qbe,e)},Qbe=2});var aa,z9=y(()=>{aa=[];aa.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&aa.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&aa.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var O_,DO,NO,eve,jO,I_,tve,MO,FO,zO,L9,n7e,i7e,U9=y(()=>{z9();O_=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",DO=Symbol.for("signal-exit emitter"),NO=globalThis,eve=Object.defineProperty.bind(Object),jO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(NO[DO])return NO[DO];eve(NO,DO,{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}},I_=class{},tve=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),MO=class extends I_{onExit(){return()=>{}}load(){}unload(){}},FO=class extends I_{#t=zO.platform==="win32"?"SIGINT":"SIGHUP";#r=new jO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of aa)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(!O_(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 aa)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,aa.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 O_(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"&&O_(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)}},zO=globalThis.process,{onExit:L9,load:n7e,unload:i7e}=tve(O_(zO)?new FO(zO):new MO)});import{addAbortListener as rve}from"node:events";var q9,B9=y(()=>{U9();q9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=L9(()=>{t.kill()});rve(n,()=>{i()})}});var Z9,nve,ive,H9,ove,G9=y(()=>{lT();ky();qo();$c();Z9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=$y(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=nve(r,n,i),{sourceStream:d,sourceError:f}=ove(t,l),{options:p,fileDescriptors:m}=gi.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},nve=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=ive(t,e,...r),a=My(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},ive=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(H9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||aT(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]=py(r,...n);return{destination:e(H9)(i,o,s),pipeOptions:s}}if(gi.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}`)},H9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),ove=(t,e)=>{try{return{sourceStream:Dc(t,e)}}catch(r){return{sourceError:r}}}});var W9,sve,LO,V9,UO=y(()=>{Qd();T_();W9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=sve({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw LO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},sve=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return CO(t),n;if(e!==void 0)return RO(r),e},LO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Mc({error:t,command:V9,escapedCommand:V9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),V9="source.pipe(destination)"});var K9,J9=y(()=>{K9=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 ave}from"node:stream/promises";var Y9,cve,lve,uve,P_,dve,fve,X9=y(()=>{A_();Fy();T_();Y9=(t,e,r)=>{let n=P_.has(e)?lve(t,e):cve(t,e);return Qs(t,dve,r.signal),Qs(e,fve,r.signal),uve(e),n},cve=(t,e)=>{let r=sa([t]);return Lc(r,e),P_.set(e,r),r},lve=(t,e)=>{let r=P_.get(e);return r.add(t),r},uve=async t=>{try{await ave(t,{cleanup:!0,readable:!1,writable:!0})}catch{}P_.delete(t)},P_=new WeakMap,dve=2,fve=1});import{aborted as pve}from"node:util";var Q9,mve,eV=y(()=>{UO();Q9=(t,e)=>t===void 0?[]:[mve(t,e)],mve=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await pve(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw LO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var R_,hve,gve,tV=y(()=>{Ji();G9();UO();J9();X9();eV();R_=(t,...e)=>{if(Et(e[0]))return R_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Z9(t,...e),i=hve({...n,destination:r});return i.pipe=R_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},hve=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=gve(t,i);W9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=Y9(e,o,d);return await Promise.race([K9(u),...Q9(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},gve=(t,e)=>Promise.allSettled([t,e])});import{on as yve}from"node:events";import{getDefaultHighWaterMark as _ve}from"node:stream";var C_,bve,qO,vve,nV,BO,rV,Sve,wve,D_=y(()=>{gO();b_();bO();C_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return bve(e,s),nV({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},bve=async(t,e)=>{try{await t}catch{}finally{e.abort()}},qO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;vve(e,s,t);let a=t.readableObjectMode&&!o;return nV({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},vve=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},nV=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=yve(t,"data",{signal:e.signal,highWaterMark:rV,highWatermark:rV});return Sve({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},BO=_ve(!0),rV=BO,Sve=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=wve({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*oa(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*tf(a)}},wve=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[v_(t,r,!e),__(t,i,!n,{})].filter(Boolean)});import{setImmediate as xve}from"node:timers/promises";var iV,$ve,kve,Eve,HO,oV,ZO=y(()=>{l_();Vr();SO();D_();na();ef();iV=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=$ve({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([kve(t),d]);return}let f=pO(c,r),p=qO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([Eve({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},$ve=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!$_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=qO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await QG(a,t,r,o)},kve=async t=>{await xve(),t.readableFlowing===null&&t.resume()},Eve=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await o_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await s_(r,{maxBuffer:o})):await c_(r,{maxBuffer:o})}catch(a){return oV(MZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},HO=async t=>{try{return await t}catch(e){return oV(e)}},oV=({bufferedData:t})=>O6(t)?new Uint8Array(t):t});import{finished as Ave}from"node:stream/promises";var sf,Tve,Ove,Ive,Pve,Rve,GO,N_,sV,j_=y(()=>{sf=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Tve(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],Ave(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Pve(a,e,r,n)}finally{s.abort()}},Tve=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Ove(t,r,n),n},Ove=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{Ive(e,r),n.call(t,...i)}},Ive=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Pve=(t,e,r,n)=>{if(!Rve(t,e,r,n))throw t},Rve=(t,e,r,n=!0)=>r.propagating?sV(t)||N_(t):(r.propagating=!0,GO(r,e)===n?sV(t):N_(t)),GO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",N_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",sV=t=>t?.code==="EPIPE"});var aV,VO,WO=y(()=>{ZO();j_();aV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>VO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),VO=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=sf(t,e,l);if(GO(l,e)){await u;return}let[d]=await Promise.all([iV({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 cV,lV,Cve,Dve,KO=y(()=>{A_();WO();cV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?sa([t,e].filter(Boolean)):void 0,lV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>VO({...Cve(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Dve(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Cve=({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}},Dve=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var uV,dV,fV=y(()=>{Ac();Lo();uV=t=>Ec(t,"ipc"),dV=(t,e)=>{let r=xy(t);mi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var pV,mV,hV=y(()=>{na();fV();eo();AO();pV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=uV(o),a=Qi(e,"ipc"),c=Qi(r,"ipc");for await(let l of EO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(FZ(t,i,c),i.push(l)),s&&dV(l,o);return i},mV=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as Nve}from"node:events";var gV,jve,Mve,Fve,yV=y(()=>{ra();qT();CT();UT();Xi();hr();ZO();hV();HT();KO();WO();$O();j_();gV=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 _=s9(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=aV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=lV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),R=[],A=pV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),E=jve(h,t,S),C=Mve(m,S);try{return await Promise.race([Promise.all([{},c9(_),Promise.all(x),w,A,lZ(t,d),...E,...C]),g,Fve(t,b),...iZ(t,o,f,b),...$H({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...rZ({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(k){return f.terminationReason??="other",Promise.all([{error:k},_,Promise.all(x.map(L=>HO(L))),HO(w),mV(A,R),Promise.allSettled(E),Promise.allSettled(C)])}},jve=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:sf(n,i,r)),Mve=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Bn(o,{checkOpen:!1})&&!Ln(o)).map(({type:i,value:o,stream:s=o})=>sf(s,n,e,{isSameDirection:gn.has(i),stopOnExit:i==="native"}))),Fve=async(t,{signal:e})=>{let[r]=await Nve(t,"error",{signal:e});throw r}});var _V,af,Uc,M_=y(()=>{Cc();_V=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),af=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=hi();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Uc=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 bV}from"node:stream/promises";var JO,vV,YO,XO,F_,z_,QO=y(()=>{j_();JO=async t=>{if(t!==void 0)try{await YO(t)}catch{}},vV=async t=>{if(t!==void 0)try{await XO(t)}catch{}},YO=async t=>{await bV(t,{cleanup:!0,readable:!1,writable:!0})},XO=async t=>{await bV(t,{cleanup:!0,readable:!0,writable:!1})},F_=async(t,e)=>{if(await t,e)throw e},z_=(t,e,r)=>{r&&!N_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as zve}from"node:stream";import{callbackify as Lve}from"node:util";var SV,eI,tI,rI,Uve,nI,iI,wV,oI=y(()=>{ea();qo();D_();Cc();M_();QO();SV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Wr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=eI(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=tI(a,s),{read:f,onStdoutDataDone:p}=rI({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new zve({read:f,destroy:Lve(iI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return nI({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},eI=(t,e,r)=>{let n=Dc(t,e),i=af(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},tI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:BO},rI=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=hi(),s=C_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Uve(this,s,o)},onStdoutDataDone:o}},Uve=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},nI=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await XO(t),await n,await JO(i),await e,r.readable&&r.push(null)}catch(o){await JO(i),wV(r,o)}},iI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Uc(r,e)&&(wV(t,n),await F_(e,n))},wV=(t,e)=>{z_(t,t.readable,e)}});import{Writable as qve}from"node:stream";import{callbackify as xV}from"node:util";var $V,sI,aI,Bve,Hve,cI,lI,kV,uI=y(()=>{qo();M_();QO();$V=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=sI(t,r,e),s=new qve({...aI(n,t,i),destroy:xV(lI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return cI(n,s),s},sI=(t,e,r)=>{let n=My(t,e),i=af(r,n,"writableFinal"),o=af(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},aI=(t,e,r)=>({write:Bve.bind(void 0,t),final:xV(Hve.bind(void 0,t,e,r))}),Bve=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Hve=async(t,e,r)=>{await Uc(r,e)&&(t.writable&&t.end(),await e)},cI=async(t,e,r)=>{try{await YO(t),e.writable&&e.end()}catch(n){await vV(r),kV(e,n)}},lI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Uc(r,e),await Uc(n,e)&&(kV(t,i),await F_(e,i))},kV=(t,e)=>{z_(t,t.writable,e)}});import{Duplex as Zve}from"node:stream";import{callbackify as Gve}from"node:util";var EV,Vve,AV=y(()=>{ea();oI();uI();EV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Wr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=eI(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=sI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=tI(c,a),{read:g,onStdoutDataDone:b}=rI({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Zve({read:g,...aI(u,t,d),destroy:Gve(Vve.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 nI({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),cI(u,_,c),_},Vve=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([iI({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),lI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var dI,Wve,TV=y(()=>{ea();qo();D_();dI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Wr.has(e),s=Dc(t,r),a=C_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Wve(a,s,t)},Wve=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var OV,IV=y(()=>{M_();oI();uI();AV();TV();OV=(t,{encoding:e})=>{let r=_V();t.readable=SV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=$V.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=EV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=dI.bind(void 0,t,e),t[Symbol.asyncIterator]=dI.bind(void 0,t,e,{})}});var PV,Kve,Jve,RV=y(()=>{PV=(t,e)=>{for(let[r,n]of Jve){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Kve=(async()=>{})().constructor.prototype,Jve=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Kve,t)])});import{setMaxListeners as Yve}from"node:events";import{spawn as Xve}from"node:child_process";var CV,Qve,eSe,tSe,rSe,nSe,DV=y(()=>{l_();bT();VT();qo();WT();TO();Qd();f_();x9();T9();ef();F9();Cy();B9();tV();KO();yV();IV();Cc();RV();CV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=Qve(t,e,r),{subprocess:f,promise:p}=tSe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=R_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),PV(f,p),gi.set(f,{options:u,fileDescriptors:d}),f},Qve=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=Ey(t,e,r),{file:a,commandArguments:c,options:l}=Qy(t,e,r),u=eSe(l),d=A9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},eSe=({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}},tSe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=Xve(...e_(t,e,r))}catch(m){return w9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;Yve(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];M9(c,a,l),q9(c,r,l);let d={},f=hi();c.kill=wH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=cV(c,r),OV(c,r),b9(c,r);let p=rSe({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}},rSe=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 gV({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)=>ro(x,e,w)),_=ro(h,e,"all"),S=nSe({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Fc(S,n,e)},nSe=({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?Xd({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 yi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):d_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var L_,iSe,oSe,NV=y(()=>{Ji();eo();L_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,iSe(n,t[n],i)]));return{...t,...r}},iSe=(t,e,r)=>oSe.has(t)&&Et(e)&&Et(r)?{...e,...r}:r,oSe=new Set(["env",...mT])});var Zo,sSe,aSe,jV=y(()=>{Ji();lT();M6();f9();DV();NV();Zo=(t,e,r,n)=>{let i=(s,a,c)=>Zo(s,a,r,c),o=(...s)=>sSe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},sSe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Et(o))return i(t,L_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=aSe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?d9(a,c,l):CV(a,c,l,i)},aSe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=N6(e)?j6(e,r):[e,...r],[s,a,c]=py(...o),l=L_(L_(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 MV,FV,zV,cSe,lSe,LV=y(()=>{MV=({file:t,commandArguments:e})=>zV(t,e),FV=({file:t,commandArguments:e})=>({...zV(t,e),isSync:!0}),zV=(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]=cSe(t);return{file:r,commandArguments:n}},cSe=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(lSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},lSe=/ +/g});var UV,qV,uSe,BV,dSe,HV,ZV=y(()=>{UV=(t,e,r)=>{t.sync=e(uSe,r),t.s=t.sync},qV=({options:t})=>BV(t),uSe=({options:t})=>({...BV(t),isSync:!0}),BV=t=>({options:{...dSe(t),...t}}),dSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},HV={preferLocal:!0}});var Ket,et,Jet,Yet,Xet,Qet,ett,ttt,rtt,ntt,Ir=y(()=>{jV();LV();BT();ZV();TO();Ket=Zo(()=>({})),et=Zo(()=>({isSync:!0})),Jet=Zo(MV),Yet=Zo(FV),Xet=Zo(sZ),Qet=Zo(qV,{},HV,UV),{sendMessage:ett,getOneMessage:ttt,getEachMessage:rtt,getCancelSignal:ntt}=v9()});import{existsSync as U_,statSync as fSe}from"node:fs";import{dirname as fI,extname as pSe,isAbsolute as GV,join as pI,relative as mI,resolve as q_,sep as mSe}from"node:path";function B_(t){return t==="./gradlew"||t==="gradle"}function hSe(t){return(U_(pI(t,"build.gradle.kts"))||U_(pI(t,"build.gradle")))&&U_(pI(t,"gradle.properties"))}function gSe(t,e){let n=mI(t,e).split(mSe).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function Go(t,e){return t===":"?`:${e}`:`${t}:${e}`}function ySe(t,e){let r=q_(t,e),n=r;U_(r)?fSe(r).isFile()&&(n=fI(r)):pSe(r)!==""&&(n=fI(r));let i=mI(t,n);if(i.startsWith("..")||GV(i))return null;let o=n;for(;;){if(hSe(o))return o;if(q_(o)===q_(t))return null;let s=fI(o);if(s===o)return null;let a=mI(t,s);if(a.startsWith("..")||GV(a))return null;o=s}}function H_(t,e){let r=q_(t),n=new Map,i=[];for(let o of e){let s=ySe(r,o);if(!s){i.push(o);continue}let a=gSe(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 Z_=y(()=>{"use strict"});import{existsSync as _Se,readFileSync as bSe}from"node:fs";import{join as vSe}from"node:path";function qc(t="."){let e=vSe(t,".cladding","config.yaml");if(!_Se(e))return hI;try{let n=(0,VV.parse)(bSe(e,"utf8"))?.gate;if(!n)return hI;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 SSe){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 hI}}function WV(t,e){let r=[],n=!1;for(let i of t){let o=wSe.exec(i);if(o){n=!0;for(let s of e)r.push(Go(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 VV,SSe,hI,wSe,G_=y(()=>{"use strict";VV=kt(or(),1);Z_();SSe=["type","lint","test","coverage"],hI={scope:"feature"};wSe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as yI,readFileSync as KV,readdirSync as xSe,statSync as $Se}from"node:fs";import{join as V_}from"node:path";function vI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=V_(t,e);if(yI(r))try{if(JV.test(KV(r,"utf8")))return!0}catch{}}return!1}function YV(t){try{return yI(t)&&JV.test(KV(t,"utf8"))}catch{return!1}}function XV(t,e=0){if(e>4||!yI(t))return!1;let r;try{r=xSe(t)}catch{return!1}for(let n of r){let i=V_(t,n),o=!1;try{o=$Se(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(XV(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&YV(i))return!0}return!1}function ASe(t){if(vI(t))return!0;for(let e of kSe)if(YV(V_(t,e)))return!0;for(let e of ESe)if(XV(V_(t,e)))return!0;return!1}function QV(t="."){let e=qc(t).coverage;return e||(ASe(t)?"kover":"jacoco")}function eW(t="."){return _I[QV(t)]}function tW(t="."){return gI[QV(t)]}var _I,gI,bI,JV,kSe,ESe,W_=y(()=>{"use strict";G_();_I={kover:"koverXmlReport",jacoco:"jacocoTestReport"},gI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},bI=[gI.kover,gI.jacoco],JV=/kover/i;kSe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],ESe=["buildSrc","build-logic"]});import{existsSync as SI,readdirSync as rW}from"node:fs";import{join as K_}from"node:path";function wI(t){return SI(K_(t,"gradlew"))?"./gradlew":"gradle"}function TSe(t){let e=wI(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[eW(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function ISe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function CSe(t,e){for(let r of e)if(SI(K_(t,r)))return r}function DSe(t,e){try{return rW(t).find(n=>n.endsWith(e))}catch{return}}function jSe(t,e){for(let r of NSe)if(r.configs.some(n=>SI(K_(t,n))))return r.gate;return e}function pt(t="."){for(let e of PSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=DSe(t,o):r=CSe(t,[o]),r)break;if(!r||e.requiresSource&&!ISe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:jSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return RSe}var OSe,PSe,RSe,NSe,yn=y(()=>{"use strict";W_();OSe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);PSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit"]},lint:{cmd:"npx",args:["--no-install","eslint","."]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:TSe},{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"]}}}],RSe={language:"unknown",manifest:"",gates:{}};NSe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as MSe,readFileSync as FSe}from"node:fs";import{join as zSe}from"node:path";function cf(t){return t.code==="ENOENT"}function J_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return nW.test(o)||nW.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function zt(t,e,r){return cf(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function sr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bc(t,e){let r=zSe(t,"package.json");if(!MSe(r))return!1;try{return!!JSON.parse(FSe(r,"utf8")).scripts?.[e]}catch{return!1}}var nW,_n=y(()=>{"use strict";nW=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function LSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;if(!n)return[{detector:Y_,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}];let i=et(n.cmd,[...n.args],{cwd:e,reject:!1});return cf(i)?[{detector:Y_,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:J_(i,Y_,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}var Y_,X_,xI=y(()=>{"use strict";Ir();yn();_n();Y_="ARCHITECTURE_VIOLATION";X_={name:Y_,run:LSe}});import iW from"node:process";function ca(t={}){let r=X_.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:USe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` -`)}}var USe,qSe,Q_=y(()=>{"use strict";xI();USe="stage_1.5";qSe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${iW.argv[1]}`;if(qSe){let t=ca();console.log(JSON.stringify(t)),iW.exit(t.exitCode)}});import{existsSync as $I,readdirSync as oW}from"node:fs";import{join as eb}from"node:path";function HSe(t,e){let r=eb(t,e.path);if(!$I(r))return!0;if(e.isDirectory)try{return oW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function ZSe(t){let{cwd:e="."}=t,r=[];for(let i of BSe)HSe(e,i)&&r.push({detector:lf,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=eb(e,"spec.yaml");if($I(n)){let i=WSe(n),o=i?null:GSe(e);if(i)r.push({detector:lf,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:lf,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=VSe(e);s&&r.push({detector:lf,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 GSe(t){for(let e of["spec/features","spec/scenarios"]){let r=eb(t,e);if(!$I(r))continue;let n;try{n=oW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{di(eb(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function VSe(t){try{return Y(t),null}catch(e){return e.message}}function WSe(t){let e;try{e=di(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var lf,BSe,sW,aW=y(()=>{"use strict";at();cy();lf="ABSENCE_OF_GOVERNANCE",BSe=[{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}];sW={name:lf,run:ZSe}});function tb(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function kI(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=tb(r)==="while",o=JSe.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 '${tb(r)}'`}let n=KSe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:tb(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${tb(r)}'`:null}function YSe(t,e){let r=kI(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function cW(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...YSe(r,n));return e}var KSe,JSe,EI=y(()=>{"use strict";KSe={event:"when",state:"while",optional:"where",unwanted:"if"},JSe=/\bwhen\b/i});function pe(t,e,r){let n;try{n=Y(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var _t=y(()=>{"use strict";at()});function XSe(t){let{cwd:e="."}=t;return pe(e,rb,QSe)}function QSe(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:rb,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 cW(t.features))e.push({detector:rb,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var rb,lW,uW=y(()=>{"use strict";EI();_t();rb="AC_DRIFT";lW={name:rb,run:XSe}});function bi(t=".",e){let n=(e??"").trim().toLowerCase()||pt(t).language;return nwe[n]??dW}var ewe,twe,dW,rwe,nwe,Hc=y(()=>{"use strict";yn();ewe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,twe=/^[ \t]*import\s+([\w.]+)/gm,dW={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:ewe,importStyle:"relative"},rwe={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:twe,importStyle:"dotted"},nwe={typescript:dW,kotlin:rwe}});import{existsSync as iwe,readFileSync as owe,readdirSync as swe,statSync as awe}from"node:fs";import{join as pW,relative as fW}from"node:path";function cwe(t,e){if(!iwe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=swe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=pW(i,s),c;try{c=awe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function lwe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function dwe(t){return uwe.test(t)}function fwe(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=bi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>cwe(pW(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=owe(a,"utf8")}catch{continue}let l=c.split(` -`);for(let u=0;u{"use strict";at();Hc();mW="AI_HINTS_FORBIDDEN_PATTERN";uwe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;hW={name:mW,run:fwe}});function pwe(t){let{cwd:e="."}=t,r;try{r=Y(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:yW,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var yW,_W,bW=y(()=>{"use strict";at();yW="AC_DUPLICATE_WITHIN_FEATURE";_W={name:yW,run:pwe}});import{createRequire as mwe}from"module";import{basename as hwe,dirname as TI,normalize as gwe,relative as ywe,resolve as _we,sep as wW}from"path";import*as bwe from"fs";function vwe(t){let e=gwe(t);return e.length>1&&e[e.length-1]===wW&&(e=e.substring(0,e.length-1)),e}function xW(t,e){return t.replace(Swe,e)}function xwe(t){return t==="/"||wwe.test(t)}function AI(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=_we(t)),(n||o)&&(t=vwe(t)),t===".")return"";let s=t[t.length-1]!==i;return xW(s?t+i:t,i)}function $W(t,e){return e+t}function $we(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:xW(ywe(t,n),e.pathSeparator)+e.pathSeparator+r}}function kwe(t){return t}function Ewe(t,e,r){return e+t+r}function Awe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?$we(t,e):n?$W:kwe}function Twe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function Owe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function Cwe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?Owe(t):Twe(t):n&&n.length?Pwe:Iwe:Rwe}function zwe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?Fwe:r&&r.length?n?Dwe:Nwe:n?jwe:Mwe}function qwe(t){return t.group?Uwe:Lwe}function Zwe(t){return t.group?Bwe:Hwe}function Wwe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Vwe:Gwe}function kW(t,e,r){if(r.options.useRealPaths)return Kwe(e,r);let n=TI(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=TI(n)}return r.symlinks.set(t,e),i>1}function Kwe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function nb(t,e,r,n){e(t&&!n?t:null,r)}function ixe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?Jwe:exe:n?e?Ywe:nxe:i?e?Qwe:rxe:e?Xwe:txe}function axe(t){return t?sxe:oxe}function dxe(t,e){return new Promise((r,n)=>{TW(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function TW(t,e,r){new AW(t,e,r).start()}function fxe(t,e){return new AW(t,e).start()}var vW,Swe,wwe,Iwe,Pwe,Rwe,Dwe,Nwe,jwe,Mwe,Fwe,Lwe,Uwe,Bwe,Hwe,Gwe,Vwe,Jwe,Ywe,Xwe,Qwe,exe,txe,rxe,nxe,EW,oxe,sxe,cxe,lxe,uxe,AW,SW,OW,IW,PW=y(()=>{vW=mwe(import.meta.url);Swe=/[\\/]/g;wwe=/^[a-z]:[\\/]$/i;Iwe=(t,e)=>{e.push(t||".")},Pwe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},Rwe=()=>{};Dwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},Nwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},jwe=(t,e,r,n)=>{r.files++},Mwe=(t,e)=>{e.push(t)},Fwe=()=>{};Lwe=t=>t,Uwe=()=>[""].slice(0,0);Bwe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Hwe=()=>{};Gwe=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()&&kW(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},Vwe=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()&&kW(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};Jwe=t=>t.counts,Ywe=t=>t.groups,Xwe=t=>t.paths,Qwe=t=>t.paths.slice(0,t.options.maxFiles),exe=(t,e,r)=>(nb(e,r,t.counts,t.options.suppressErrors),null),txe=(t,e,r)=>(nb(e,r,t.paths,t.options.suppressErrors),null),rxe=(t,e,r)=>(nb(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),nxe=(t,e,r)=>(nb(e,r,t.groups,t.options.suppressErrors),null);EW={withFileTypes:!0},oxe=(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||".",EW,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},sxe=(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||".",EW)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};cxe=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))}},lxe=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}},uxe=class{aborted=!1;abort(){this.aborted=!0}},AW=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=ixe(e,this.isSynchronous),this.root=AI(t,e),this.state={root:xwe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new lxe,options:e,queue:new cxe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new uxe,fs:e.fs||bwe},this.joinPath=Awe(this.root,e),this.pushDirectory=Cwe(this.root,e),this.pushFile=zwe(e),this.getArray=qwe(e),this.groupFiles=Zwe(e),this.resolveSymlink=Wwe(e,this.isSynchronous),this.walkDirectory=axe(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(_=AI(_,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=hwe(_),x=AI(TI(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};SW=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return dxe(this.root,this.options)}withCallback(t){TW(this.root,this.options,t)}sync(){return fxe(this.root,this.options)}},OW=null;try{vW.resolve("picomatch"),OW=vW("picomatch")}catch{}IW=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:wW,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 SW(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new SW(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||OW;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 uf=v((ort,jW)=>{"use strict";var RW="[^\\\\/]",pxe="(?=.)",CW="[^/]",OI="(?:\\/|$)",DW="(?:^|\\/)",II=`\\.{1,2}${OI}`,mxe="(?!\\.)",hxe=`(?!${DW}${II})`,gxe=`(?!\\.{0,1}${OI})`,yxe=`(?!${II})`,_xe="[^.\\/]",bxe=`${CW}*?`,vxe="/",NW={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:pxe,QMARK:CW,END_ANCHOR:OI,DOTS_SLASH:II,NO_DOT:mxe,NO_DOTS:hxe,NO_DOT_SLASH:gxe,NO_DOTS_SLASH:yxe,QMARK_NO_DOT:_xe,STAR:bxe,START_ANCHOR:DW,SEP:vxe},Sxe={...NW,SLASH_LITERAL:"[\\\\/]",QMARK:RW,STAR:`${RW}*?`,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:"\\"},wxe={__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"};jW.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wxe,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?Sxe:NW}}});var df=v(Pr=>{"use strict";var{REGEX_BACKSLASH:xxe,REGEX_REMOVE_BACKSLASH:$xe,REGEX_SPECIAL_CHARS:kxe,REGEX_SPECIAL_CHARS_GLOBAL:Exe}=uf();Pr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Pr.hasRegexChars=t=>kxe.test(t);Pr.isRegexChar=t=>t.length===1&&Pr.hasRegexChars(t);Pr.escapeRegex=t=>t.replace(Exe,"\\$1");Pr.toPosixSlashes=t=>t.replace(xxe,"/");Pr.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};Pr.removeBackslashes=t=>t.replace($xe,e=>e==="\\"?"":e);Pr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Pr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Pr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Pr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Pr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var HW=v((art,BW)=>{"use strict";var MW=df(),{CHAR_ASTERISK:PI,CHAR_AT:Axe,CHAR_BACKWARD_SLASH:ff,CHAR_COMMA:Txe,CHAR_DOT:RI,CHAR_EXCLAMATION_MARK:CI,CHAR_FORWARD_SLASH:qW,CHAR_LEFT_CURLY_BRACE:DI,CHAR_LEFT_PARENTHESES:NI,CHAR_LEFT_SQUARE_BRACKET:Oxe,CHAR_PLUS:Ixe,CHAR_QUESTION_MARK:FW,CHAR_RIGHT_CURLY_BRACE:Pxe,CHAR_RIGHT_PARENTHESES:zW,CHAR_RIGHT_SQUARE_BRACKET:Rxe}=uf(),LW=t=>t===qW||t===ff,UW=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Cxe=(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,E,C={value:"",depth:0,isGlob:!1},k=()=>l>=n,L=()=>c.charCodeAt(l+1),te=()=>(A=E,c.charCodeAt(++l));for(;l0&&(O=c.slice(0,u),c=c.slice(u),d-=u),be&&m===!0&&d>0?(be=c.slice(0,d),P=c.slice(d)):m===!0?(be="",P=c):be=c,be&&be!==""&&be!=="/"&&be!==c&&LW(be.charCodeAt(be.length-1))&&(be=be.slice(0,-1)),r.unescape===!0&&(P&&(P=MW.removeBackslashes(P)),be&&_===!0&&(be=MW.removeBackslashes(be)));let $t={prefix:O,input:t,start:u,base:be,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&($t.maxDepth=0,LW(E)||s.push(C),$t.tokens=s),r.parts===!0||r.tokens===!0){let je;for(let Me=0;Me{"use strict";var pf=uf(),Kr=df(),{MAX_LENGTH:ib,POSIX_REGEX_SOURCE:Dxe,REGEX_NON_SPECIAL_CHARS:Nxe,REGEX_SPECIAL_CHARS_BACKREF:jxe,REPLACEMENTS:ZW}=pf,Mxe=(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=>Kr.escapeRegex(i)).join("..")}return r},Zc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,GW=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},Fxe=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},VW=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Fxe(e))return e.replace(/\\(.)/g,"$1")},zxe=t=>{let e=t.map(VW).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}}}}},Lxe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=VW(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Kr.escapeRegex(r[0]):`[${r.map(i=>Kr.escapeRegex(i)).join("")}]`}*`},Uxe=t=>{let e=0,r=t.trim(),n=jI(r);for(;n;)e++,r=n.body.trim(),n=jI(r);return e},qxe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:pf.DEFAULT_MAX_EXTGLOB_RECURSION,n=GW(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||zxe(n)))return{risky:!0};for(let i of n){let o=Lxe(i);if(o)return{risky:!0,safeOutput:o};if(Uxe(i)>r)return{risky:!0}}return{risky:!1}},MI=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=ZW[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ib,r.maxLength):ib,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=pf.globChars(r.windows),l=pf.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=q=>`(${a}(?:(?!${w}${q.dot?m:u}).)*?)`,A=r.dot?"":h,E=r.dot?_:S,C=r.bash===!0?R(r):x;r.capture&&(C=`(${C})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let k={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=Kr.removePrefix(t,k),i=t.length;let L=[],te=[],be=[],O=o,P,$t=()=>k.index===i-1,je=k.peek=(q=1)=>t[k.index+q],Me=k.advance=()=>t[++k.index]||"",Kt=()=>t.slice(k.index+1),Gt=(q="",ut=0)=>{k.consumed+=q,k.index+=ut},Br=q=>{k.output+=q.output!=null?q.output:q.value,Gt(q.value)},jn=()=>{let q=1;for(;je()==="!"&&(je(2)!=="("||je(3)==="?");)Me(),k.start++,q++;return q%2===0?!1:(k.negated=!0,k.start++,!0)},Bi=q=>{k[q]++,be.push(q)},ko=q=>{k[q]--,be.pop()},Ee=q=>{if(O.type==="globstar"){let ut=k.braces>0&&(q.type==="comma"||q.type==="brace"),U=q.extglob===!0||L.length&&(q.type==="pipe"||q.type==="paren");q.type!=="slash"&&q.type!=="paren"&&!ut&&!U&&(k.output=k.output.slice(0,-O.output.length),O.type="star",O.value="*",O.output=C,k.output+=O.output)}if(L.length&&q.type!=="paren"&&(L[L.length-1].inner+=q.value),(q.value||q.output)&&Br(q),O&&O.type==="text"&&q.type==="text"){O.output=(O.output||O.value)+q.value,O.value+=q.value;return}q.prev=O,s.push(q),O=q},Yh=(q,ut)=>{let U={...l[ut],conditions:1,inner:""};U.prev=O,U.parens=k.parens,U.output=k.output,U.startIndex=k.index,U.tokensIndex=s.length;let Ae=(r.capture?"(":"")+U.open;Bi("parens"),Ee({type:q,value:ut,output:k.output?"":p}),Ee({type:"paren",extglob:!0,value:Me(),output:Ae}),L.push(U)},Rae=q=>{let ut=t.slice(q.startIndex,k.index+1),U=t.slice(q.startIndex+2,k.index),Ae=qxe(U,r);if((q.type==="plus"||q.type==="star")&&Ae.risky){let ot=Ae.safeOutput?(q.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ai=s[q.tokensIndex];ai.type="text",ai.value=ut,ai.output=ot||Kr.escapeRegex(ut);for(let ci=q.tokensIndex+1;ci1&&q.inner.includes("/")&&(ot=R(r)),(ot!==C||$t()||/^\)+$/.test(Kt()))&&(st=q.close=`)$))${ot}`),q.inner.includes("*")&&(jt=Kt())&&/^\.[^\\/.]+$/.test(jt)){let ai=MI(jt,{...e,fastpaths:!1}).output;st=q.close=`)${ai})${ot})`}q.prev.type==="bos"&&(k.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:P,output:st}),ko("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let q=!1,ut=t.replace(jxe,(U,Ae,st,jt,ot,ai)=>jt==="\\"?(q=!0,U):jt==="?"?Ae?Ae+jt+(ot?_.repeat(ot.length):""):ai===0?E+(ot?_.repeat(ot.length):""):_.repeat(st.length):jt==="."?u.repeat(st.length):jt==="*"?Ae?Ae+jt+(ot?C:""):C:Ae?U:`\\${U}`);return q===!0&&(r.unescape===!0?ut=ut.replace(/\\/g,""):ut=ut.replace(/\\+/g,U=>U.length%2===0?"\\\\":U?"\\":"")),ut===t&&r.contains===!0?(k.output=t,k):(k.output=Kr.wrapOutput(ut,k,e),k)}for(;!$t();){if(P=Me(),P==="\0")continue;if(P==="\\"){let U=je();if(U==="/"&&r.bash!==!0||U==="."||U===";")continue;if(!U){P+="\\",Ee({type:"text",value:P});continue}let Ae=/^\\+/.exec(Kt()),st=0;if(Ae&&Ae[0].length>2&&(st=Ae[0].length,k.index+=st,st%2!==0&&(P+="\\")),r.unescape===!0?P=Me():P+=Me(),k.brackets===0){Ee({type:"text",value:P});continue}}if(k.brackets>0&&(P!=="]"||O.value==="["||O.value==="[^")){if(r.posix!==!1&&P===":"){let U=O.value.slice(1);if(U.includes("[")&&(O.posix=!0,U.includes(":"))){let Ae=O.value.lastIndexOf("["),st=O.value.slice(0,Ae),jt=O.value.slice(Ae+2),ot=Dxe[jt];if(ot){O.value=st+ot,k.backtrack=!0,Me(),!o.output&&s.indexOf(O)===1&&(o.output=p);continue}}}(P==="["&&je()!==":"||P==="-"&&je()==="]")&&(P=`\\${P}`),P==="]"&&(O.value==="["||O.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&O.value==="["&&(P="^"),O.value+=P,Br({value:P});continue}if(k.quotes===1&&P!=='"'){P=Kr.escapeRegex(P),O.value+=P,Br({value:P});continue}if(P==='"'){k.quotes=k.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:P});continue}if(P==="("){Bi("parens"),Ee({type:"paren",value:P});continue}if(P===")"){if(k.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Zc("opening","("));let U=L[L.length-1];if(U&&k.parens===U.parens+1){Rae(L.pop());continue}Ee({type:"paren",value:P,output:k.parens?")":"\\)"}),ko("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Zc("closing","]"));P=`\\${P}`}else Bi("brackets");Ee({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||O&&O.type==="bracket"&&O.value.length===1){Ee({type:"text",value:P,output:`\\${P}`});continue}if(k.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Zc("opening","["));Ee({type:"text",value:P,output:`\\${P}`});continue}ko("brackets");let U=O.value.slice(1);if(O.posix!==!0&&U[0]==="^"&&!U.includes("/")&&(P=`/${P}`),O.value+=P,Br({value:P}),r.literalBrackets===!1||Kr.hasRegexChars(U))continue;let Ae=Kr.escapeRegex(O.value);if(k.output=k.output.slice(0,-O.value.length),r.literalBrackets===!0){k.output+=Ae,O.value=Ae;continue}O.value=`(${a}${Ae}|${O.value})`,k.output+=O.value;continue}if(P==="{"&&r.nobrace!==!0){Bi("braces");let U={type:"brace",value:P,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};te.push(U),Ee(U);continue}if(P==="}"){let U=te[te.length-1];if(r.nobrace===!0||!U){Ee({type:"text",value:P,output:P});continue}let Ae=")";if(U.dots===!0){let st=s.slice(),jt=[];for(let ot=st.length-1;ot>=0&&(s.pop(),st[ot].type!=="brace");ot--)st[ot].type!=="dots"&&jt.unshift(st[ot].value);Ae=Mxe(jt,r),k.backtrack=!0}if(U.comma!==!0&&U.dots!==!0){let st=k.output.slice(0,U.outputIndex),jt=k.tokens.slice(U.tokensIndex);U.value=U.output="\\{",P=Ae="\\}",k.output=st;for(let ot of jt)k.output+=ot.output||ot.value}Ee({type:"brace",value:P,output:Ae}),ko("braces"),te.pop();continue}if(P==="|"){L.length>0&&L[L.length-1].conditions++,Ee({type:"text",value:P});continue}if(P===","){let U=P,Ae=te[te.length-1];Ae&&be[be.length-1]==="braces"&&(Ae.comma=!0,U="|"),Ee({type:"comma",value:P,output:U});continue}if(P==="/"){if(O.type==="dot"&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",s.pop(),O=o;continue}Ee({type:"slash",value:P,output:f});continue}if(P==="."){if(k.braces>0&&O.type==="dot"){O.value==="."&&(O.output=u);let U=te[te.length-1];O.type="dots",O.output+=P,O.value+=P,U.dots=!0;continue}if(k.braces+k.parens===0&&O.type!=="bos"&&O.type!=="slash"){Ee({type:"text",value:P,output:u});continue}Ee({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(O&&O.value==="(")&&r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Yh("qmark",P);continue}if(O&&O.type==="paren"){let Ae=je(),st=P;(O.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(st=`\\${P}`),Ee({type:"text",value:P,output:st});continue}if(r.dot!==!0&&(O.type==="slash"||O.type==="bos")){Ee({type:"qmark",value:P,output:S});continue}Ee({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&je()==="("&&(je(2)!=="?"||!/[!=<:]/.test(je(3)))){Yh("negate",P);continue}if(r.nonegate!==!0&&k.index===0){jn();continue}}if(P==="+"){if(r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Yh("plus",P);continue}if(O&&O.value==="("||r.regex===!1){Ee({type:"plus",value:P,output:d});continue}if(O&&(O.type==="bracket"||O.type==="paren"||O.type==="brace")||k.parens>0){Ee({type:"plus",value:P});continue}Ee({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ee({type:"at",extglob:!0,value:P,output:""});continue}Ee({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let U=Nxe.exec(Kt());U&&(P+=U[0],k.index+=U[0].length),Ee({type:"text",value:P});continue}if(O&&(O.type==="globstar"||O.star===!0)){O.type="star",O.star=!0,O.value+=P,O.output=C,k.backtrack=!0,k.globstar=!0,Gt(P);continue}let q=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(q)){Yh("star",P);continue}if(O.type==="star"){if(r.noglobstar===!0){Gt(P);continue}let U=O.prev,Ae=U.prev,st=U.type==="slash"||U.type==="bos",jt=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!st||q[0]&&q[0]!=="/")){Ee({type:"star",value:P,output:""});continue}let ot=k.braces>0&&(U.type==="comma"||U.type==="brace"),ai=L.length&&(U.type==="pipe"||U.type==="paren");if(!st&&U.type!=="paren"&&!ot&&!ai){Ee({type:"star",value:P,output:""});continue}for(;q.slice(0,3)==="/**";){let ci=t[k.index+4];if(ci&&ci!=="/")break;q=q.slice(3),Gt("/**",3)}if(U.type==="bos"&&$t()){O.type="globstar",O.value+=P,O.output=R(r),k.output=O.output,k.globstar=!0,Gt(P);continue}if(U.type==="slash"&&U.prev.type!=="bos"&&!jt&&$t()){k.output=k.output.slice(0,-(U.output+O.output).length),U.output=`(?:${U.output}`,O.type="globstar",O.output=R(r)+(r.strictSlashes?")":"|$)"),O.value+=P,k.globstar=!0,k.output+=U.output+O.output,Gt(P);continue}if(U.type==="slash"&&U.prev.type!=="bos"&&q[0]==="/"){let ci=q[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(U.output+O.output).length),U.output=`(?:${U.output}`,O.type="globstar",O.output=`${R(r)}${f}|${f}${ci})`,O.value+=P,k.output+=U.output+O.output,k.globstar=!0,Gt(P+Me()),Ee({type:"slash",value:"/",output:""});continue}if(U.type==="bos"&&q[0]==="/"){O.type="globstar",O.value+=P,O.output=`(?:^|${f}|${R(r)}${f})`,k.output=O.output,k.globstar=!0,Gt(P+Me()),Ee({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-O.output.length),O.type="globstar",O.output=R(r),O.value+=P,k.output+=O.output,k.globstar=!0,Gt(P);continue}let ut={type:"star",value:P,output:C};if(r.bash===!0){ut.output=".*?",(O.type==="bos"||O.type==="slash")&&(ut.output=A+ut.output),Ee(ut);continue}if(O&&(O.type==="bracket"||O.type==="paren")&&r.regex===!0){ut.output=P,Ee(ut);continue}(k.index===k.start||O.type==="slash"||O.type==="dot")&&(O.type==="dot"?(k.output+=g,O.output+=g):r.dot===!0?(k.output+=b,O.output+=b):(k.output+=A,O.output+=A),je()!=="*"&&(k.output+=p,O.output+=p)),Ee(ut)}for(;k.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing","]"));k.output=Kr.escapeLast(k.output,"["),ko("brackets")}for(;k.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing",")"));k.output=Kr.escapeLast(k.output,"("),ko("parens")}for(;k.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing","}"));k.output=Kr.escapeLast(k.output,"{"),ko("braces")}if(r.strictSlashes!==!0&&(O.type==="star"||O.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),k.backtrack===!0){k.output="";for(let q of k.tokens)k.output+=q.output!=null?q.output:q.value,q.suffix&&(k.output+=q.suffix)}return k};MI.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ib,r.maxLength):ib,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=ZW[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}=pf.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 E=/^(.*?)\.(\w+)$/.exec(A);if(!E)return;let C=x(E[1]);return C?C+o+E[2]:void 0}}},w=Kr.removePrefix(t,b),R=x(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};WW.exports=MI});var XW=v((lrt,YW)=>{"use strict";var Bxe=HW(),FI=KW(),JW=df(),Hxe=uf(),Zxe=t=>t&&typeof t=="object"&&!Array.isArray(t),At=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>At(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=Zxe(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?At.compileRe(t,e):At.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=At(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=At.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};At.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?JW.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=At.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};At.matchBase=(t,e,r)=>(e instanceof RegExp?e:At.makeRe(e,r)).test(JW.basename(t));At.isMatch=(t,e,r)=>At(e,r)(t);At.parse=(t,e)=>Array.isArray(t)?t.map(r=>At.parse(r,e)):FI(t,{...e,fastpaths:!1});At.scan=(t,e)=>Bxe(t,e);At.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=At.toRegex(a,e);return n===!0&&(c.state=t),c};At.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=FI.fastpaths(t,e)),i.output||(i=FI(t,e)),At.compileRe(i,e,r,n)};At.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/$^/}};At.constants=Hxe;YW.exports=At});var rK=v((urt,tK)=>{"use strict";var QW=XW(),Gxe=df();function eK(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Gxe.isWindows()}),QW(t,e,r)}Object.assign(eK,QW);tK.exports=eK});import{readdir as Vxe,readdirSync as Wxe,realpath as Kxe,realpathSync as Jxe,stat as Yxe,statSync as Xxe}from"fs";import{isAbsolute as Qxe,posix as la,resolve as e0e}from"path";import{fileURLToPath as t0e}from"url";function i0e(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]===".."&&n0e.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=>la.relative(t,n)||".":n=>la.relative(t,`${e}/${n}`)||"."}function a0e(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=la.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function sK(t){var e;let r=Gc.default.scan(t,c0e);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function m0e(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gc.default.scan(t);return r.isGlob||r.negated}function mf(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function aK(t){return typeof t=="string"?[t]:t??[]}function zI(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=p0e(o);s=Qxe(s.replace(g0e,""))?la.relative(a,s):la.normalize(s);let c=(i=h0e.exec(s))===null||i===void 0?void 0:i[0],l=sK(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?la.join(o,...d):o}return s}function y0e(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(zI(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(zI(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(zI(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function _0e(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=y0e(t,e,n);t.debug&&mf("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(iK,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gc.default)(i.match,f),m=(0,Gc.default)(i.ignore,f),h=i0e(i.match,f),g=nK(r,d,o),b=o?g:nK(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 IW({filters:[a?(w,R)=>{let A=g(w,R),E=p(A)&&!m(A);return E&&mf(`matched ${A}`),E}:(w,R)=>{let A=g(w,R);return p(A)&&!m(A)}],exclude:a?(w,R)=>{let A=_(w,R);return mf(`${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&&mf("internal properties:",{...n,root:d}),[x,r!==d&&!o&&a0e(r,d)]}function b0e(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function S0e(t){let e={...v0e,...t};return e.cwd=(e.cwd instanceof URL?t0e(e.cwd):e0e(e.cwd)).replace(iK,"/"),e.ignore=aK(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Vxe,readdirSync:e.fs.readdirSync||Wxe,realpath:e.fs.realpath||Kxe,realpathSync:e.fs.realpathSync||Jxe,stat:e.fs.stat||Yxe,statSync:e.fs.statSync||Xxe}),e.debug&&mf("globbing with options:",e),e}function w0e(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=r0e(t)||typeof t=="string",i=aK((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=S0e(n?e:t);return i.length>0?_0e(o,i):[]}function Vo(t,e){let[r,n]=w0e(t,e);return r?b0e(r.sync(),n):[]}var Gc,r0e,iK,oK,n0e,o0e,s0e,c0e,l0e,u0e,d0e,f0e,p0e,h0e,g0e,v0e,hf=y(()=>{PW();Gc=kt(rK(),1),r0e=Array.isArray,iK=/\\/g,oK=process.platform==="win32",n0e=/^(\/?\.\.)+$/;o0e=/^[A-Z]:\/$/i,s0e=oK?t=>o0e.test(t):t=>t==="/";c0e={parts:!0};l0e=/(?t.replace(l0e,"\\$&"),f0e=t=>t.replace(u0e,"\\$&"),p0e=oK?f0e:d0e;h0e=/^(\/?\.\.)+/,g0e=/\\(?=[()[\]{}!*+?@|])/g;v0e={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as ob,readFileSync as x0e,readdirSync as $0e,statSync as cK}from"node:fs";import{join as Vc}from"node:path";function k0e(t){let{cwd:e="."}=t,r,n;try{let c=Y(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=bi(e,n),o=[],{layers:s,forbiddenImports:a}=LI(r);return s.size>0&&(E0e(e,i,s,o),A0e(e,i,s,o)),a.length>0&&T0e(e,i,a,o),o}function LI(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 E0e(t,e,r,n){let i=e.mainRoot,o=Vc(t,i);if(ob(o))for(let s of $0e(o)){let a=Vc(o,s);cK(a).isDirectory()&&(r.has(s)||n.push({detector:sb,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function A0e(t,e,r,n){let i=e.mainRoot,o=Vc(t,i);if(ob(o))for(let s of r){let a=Vc(o,s);ob(a)&&cK(a).isDirectory()||n.push({detector:sb,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 T0e(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Vc(t,i,s.from);if(!ob(a))continue;let c=Vo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Vc(a,l),d;try{d=x0e(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];O0e(p,s.to,e.importStyle)&&n.push({detector:sb,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 O0e(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var sb,lK,UI=y(()=>{"use strict";hf();at();Hc();sb="ARCHITECTURE_FROM_SPEC";lK={name:sb,run:k0e}});import{existsSync as I0e,readFileSync as P0e}from"node:fs";import{join as R0e}from"node:path";function C0e(t){let{cwd:e="."}=t,r=R0e(e,"spec/capabilities.yaml");if(!I0e(r))return[];let n;try{let c=P0e(r,"utf8"),l=uK.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=Y(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:ab,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:ab,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:ab,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var uK,ab,dK,fK=y(()=>{"use strict";uK=kt(or(),1);at();ab="CAPABILITIES_FEATURE_MAPPING";dK={name:ab,run:C0e}});import{existsSync as D0e,readFileSync as N0e}from"node:fs";import{join as j0e}from"node:path";function M0e(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function F0e(t){let{cwd:e="."}=t;return pe(e,qI,r=>z0e(r,e))}function z0e(t,e){let r=bi(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=j0e(e,o);if(!D0e(s))continue;let a=N0e(s,"utf8");M0e(a)||n.push({detector:qI,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var qI,pK,mK=y(()=>{"use strict";Hc();_t();qI="CONVENTION_DRIFT";pK={name:qI,run:F0e}});import{existsSync as BI,readFileSync as hK}from"node:fs";import{join as cb}from"node:path";function L0e(t){return JSON.parse(t).total?.lines?.pct??0}function gK(t){let e=/BI(cb(c.dir,d)));if(!l){s.push(c.path);continue}let u=gK(hK(cb(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:no,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=yK(n,i);return a0?[{detector:no,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function B0e(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=q0e(e,t.focusModules);if(s)return s}let r=bi(e),n=pt(e).language==="kotlin"?bI.find(s=>BI(cb(e,s)))??tW(e):r.coverageSummary,i=cb(e,n);if(!BI(i))return[{detector:no,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=hK(i,"utf8");o=r.coverageFormat==="jacoco-xml"?U0e(s):L0e(s)}catch(s){return[{detector:no,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:no,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=lb?[]:[{detector:no,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${lb}%`}]}var no,lb,_K,bK=y(()=>{"use strict";W_();Hc();Z_();yn();no="COVERAGE_DROP",lb=70;_K={name:no,run:B0e}});import{existsSync as H0e}from"node:fs";import{join as Z0e}from"node:path";function G0e(t){let{cwd:e="."}=t;return pe(e,ub,r=>V0e(r,e))}function V0e(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?H0e(Z0e(e,r.path))?[]:[{detector:ub,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:ub,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var ub,vK,SK=y(()=>{"use strict";_t();ub="DELIVERABLE_INTEGRITY";vK={name:ub,run:G0e}});function W0e(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:HI,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function K0e(t){let{cwd:e="."}=t;return pe(e,HI,r=>W0e(r))}var HI,wK,xK=y(()=>{"use strict";_t();HI="SMOKE_PROBE_DEMAND";wK={name:HI,run:K0e}});function J0e(t){let{cwd:e="."}=t;return pe(e,db,r=>Y0e(r,e))}function Y0e(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=wc(e);if(n===null)return[{detector:db,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=Md(e,o.modules??[]);s!==a&&i.push({detector:db,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var db,fb,ZI=y(()=>{"use strict";Fd();_t();db="STALE_ATTESTATION";fb={name:db,run:J0e}});function X0e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}return Q0e(r)}function Q0e(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:$K,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 $K,pb,GI=y(()=>{"use strict";at();$K="DEPENDENCY_CYCLE";pb={name:$K,run:X0e}});import{appendFileSync as e$e,existsSync as kK,mkdirSync as t$e,readFileSync as r$e}from"node:fs";import{dirname as n$e,join as i$e}from"node:path";function EK(t){return i$e(t,o$e,s$e)}function AK(t){return VI.add(t),()=>VI.delete(t)}function ua(t,e){let r=EK(t),n=n$e(r);kK(n)||t$e(n,{recursive:!0}),e$e(r,`${JSON.stringify(e)} -`,"utf8");for(let i of VI)try{i(t,e)}catch{}}function bn(t){let e=EK(t);if(!kK(e))return[];let r=r$e(e,"utf8").trim();return r.length===0?[]:r.split(` -`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var o$e,s$e,VI,Hn=y(()=>{"use strict";o$e=".cladding",s$e="audit.log.jsonl";VI=new Set});import{existsSync as a$e}from"node:fs";import{join as c$e}from"node:path";function l$e(t){let{cwd:e="."}=t,r=bn(e);if(r.length===0)return[{detector:WI,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&&(a$e(c$e(e,i.artifact))||n.push({detector:WI,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var WI,TK,OK=y(()=>{"use strict";Hn();WI="EVIDENCE_MISMATCH";TK={name:WI,run:l$e}});import{existsSync as u$e,readFileSync as d$e}from"node:fs";import{join as f$e}from"node:path";function p$e(t){let e=f$e(t,CK);if(!u$e(e))return null;try{let n=((0,RK.parse)(d$e(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*PK(t,e){for(let r of t??[])r.startsWith(IK)&&(yield{ref:r,name:r.slice(IK.length),field:e})}function m$e(t){let{cwd:e="."}=t,r=p$e(e);if(r===null)return[];let n;try{n=Y(e)}catch(o){return[{detector:KI,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=[...PK(s.evidence_refs,"evidence_refs"),...PK(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:KI,severity:"warn",path:CK,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var RK,KI,IK,CK,DK,NK=y(()=>{"use strict";RK=kt(or(),1);at();KI="FIXTURE_REFERENCE_INVALID",IK="fixture:",CK="conformance/fixtures.yaml";DK={name:KI,run:m$e}});function h$e(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.secret;if(!n)return[{detector:mb,severity:"info",message:`no secret scanner registered for language '${r.language}'`}];let i=et(n.cmd,[...n.args],{cwd:e,reject:!1});return cf(i)?[{detector:mb,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:J_(i,mb,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}var mb,hb,JI=y(()=>{"use strict";Ir();yn();_n();mb="HARDCODED_SECRET";hb={name:mb,run:h$e}});import{existsSync as Wc,readFileSync as YI}from"node:fs";import{join as da}from"node:path";function g$e(t){return Vo(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function gf(t){if(!Wc(t))return null;try{return JSON.parse(YI(t,"utf8"))}catch{return null}}function y$e(t,e){let r=da(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(YI(r,"utf8"))}catch(c){e.push({detector:io,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:io,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=g$e(t);s!==a&&e.push({detector:io,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function _$e(t,e){for(let r of jK){let n=da(t,r.path);if(!Wc(n))continue;let i=gf(n);if(!i){e.push({detector:io,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:io,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function b$e(t,e){let r=gf(da(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of jK){let s=da(t,o.path);if(!Wc(s))continue;let a=gf(s);a?.version&&a.version!==n&&e.push({detector:io,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=da(t,".claude-plugin","marketplace.json");if(Wc(i)){let o=gf(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:io,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 v$e(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function S$e(t,e){let r=da(t,"src","cli","clad.ts"),n=da(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Wc(r)||!Wc(n))return;let i=v$e(YI(r,"utf8"));if(i.length===0)return;let s=gf(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:io,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 w$e(t){let{cwd:e="."}=t,r=[];return y$e(e,r),S$e(e,r),_$e(e,r),b$e(e,r),r}var io,jK,MK,FK=y(()=>{"use strict";hf();io="HARNESS_INTEGRITY",jK=[{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"]}];MK={name:io,run:w$e}});import{existsSync as x$e,readFileSync as $$e}from"node:fs";import{join as k$e}from"node:path";function A$e(t){let{cwd:e="."}=t;return pe(e,gb,r=>I$e(r,e))}function T$e(){return E$e}function O$e(t){let e=k$e(t,"spec/capabilities.yaml");if(!x$e(e))return!1;try{let r=zK.default.parse($$e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function I$e(t,e){let r=t.features.length;if(r{"use strict";zK=kt(or(),1);_t();gb="HOLLOW_GOVERNANCE",E$e=8;LK={name:gb,run:A$e}});function P$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=[];return qK(r.features.map(i=>i.id),"feature","spec/features/",n),qK((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function qK(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:BK,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var BK,HK,ZK=y(()=>{"use strict";at();BK="ID_COLLISION";HK={name:BK,run:P$e}});import{existsSync as yf,readFileSync as XI,readdirSync as QI,statSync as R$e,writeFileSync as VK}from"node:fs";import{join as oo}from"node:path";function GK(t){if(!yf(t))return 0;try{return QI(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function C$e(t){if(!yf(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=QI(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=oo(n,o),a;try{a=R$e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function D$e(t){let e=oo(t,"spec","capabilities.yaml");if(!yf(e))return 0;try{let r=yb.default.parse(XI(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Wo(t="."){let e=GK(oo(t,"spec","features")),r=GK(oo(t,"spec","scenarios")),n=D$e(t),i=C$e(oo(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function Kc(t,e){let r=oo(t,"spec.yaml");if(!yf(r))return;let n=XI(r,"utf8"),i=N$e(n,e);i!==n&&VK(r,i)}function N$e(t,e){let r=t.includes(`\r + if (condition) { yield value; }`)}});import{Buffer as D_e}from"node:buffer";import{StringDecoder as N_e}from"node:string_decoder";var v_,j_e,M_e,F_e,bO=y(()=>{Vr();v_=(t,e,r)=>{if(r)return;if(t)return{transform:j_e.bind(void 0,new TextEncoder)};let n=new N_e(e);return{transform:M_e.bind(void 0,n),final:F_e.bind(void 0,n)}},j_e=function*(t,e){D_e.isBuffer(e)?yield Yi(e):typeof e=="string"?yield t.encode(e):yield e},M_e=function*(t,e){yield Ft(e)?t.write(e):e},F_e=function*(t){let e=t.end();e!==""&&(yield e)}});import{callbackify as WG}from"node:util";var vO,S_,KG,z_e,JG,L_e,YG=y(()=>{vO=WG(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),S_=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=L_e}=e[r];for await(let i of n(t))yield*S_(i,e,r+1)},KG=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*z_e(r,Number(e),t)},z_e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*S_(n,r,e+1)},JG=WG(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),L_e=function*(t){yield t}});var SO,XG,oa,tf,U_e,q_e,wO=y(()=>{SO=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},XG=(t,e)=>[...e.flatMap(r=>[...oa(r,t,0)]),...tf(t)],oa=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=q_e}=e[r];for(let i of n(t))yield*oa(i,e,r+1)},tf=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*U_e(r,Number(e),t)},U_e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*oa(n,r,e+1)},q_e=function*(t){yield t}});import{Transform as B_e,getDefaultHighWaterMark as QG}from"node:stream";var xO,w_,e9,x_=y(()=>{hr();b_();VG();bO();YG();wO();xO=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=e9(t,s,o),l=ia(e),u=ia(r),d=l?vO.bind(void 0,S_,a):SO.bind(void 0,oa),f=l||u?vO.bind(void 0,KG,a):SO.bind(void 0,tf),p=l||u?JG.bind(void 0,a):void 0;return{stream:new B_e({writableObjectMode:n,writableHighWaterMark:QG(n),readableObjectMode:i,readableHighWaterMark:QG(i),transform(h,g,b){d([h,c,0],this,b)},flush(h){f([c],this,h)},destroy:p})}},w_=(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=e9(s,r,a);t=XG(c,t)}return t},e9=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:HG(n,a)},v_(r,s,n),__(r,o,n,c),{transform:t,final:e},{transform:ZG(i,a)},BG({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)}});var t9,H_e,Z_e,G_e,V_e,r9=y(()=>{x_();Vr();hr();t9=(t,e)=>{for(let r of H_e(t))Z_e(t,r,e)},H_e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Z_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 ${Ho[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>G_e(a,n));r.input=zd(s)},G_e=(t,e)=>{let r=w_(t,e,"utf8",!0);return V_e(r),zd(r)},V_e=t=>{let e=t.find(r=>typeof r!="string"&&!Ft(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 $_,W_e,K_e,n9,i9,J_e,o9,$O=y(()=>{ea();hr();Ac();Lo();$_=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ec(r,n)&&!Wr.has(e)&&W_e(n)&&(t.some(({type:i,value:o})=>i==="native"&&K_e.has(o))||t.every(({type:i})=>gn.has(i))),W_e=t=>t===1||t===2,K_e=new Set(["pipe","overlapped"]),n9=async(t,e,r,n)=>{for await(let i of t)J_e(e)||o9(i,r,n)},i9=(t,e,r)=>{for(let n of t)o9(n,e,r)},J_e=t=>t._readableState.pipes.length>0,o9=(t,e,r)=>{let n=xy(t);mi({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})}});import{writeFileSync as Y_e,appendFileSync as X_e}from"node:fs";var s9,Q_e,ebe,tbe,rbe,nbe,a9=y(()=>{$O();x_();b_();Vr();hr();na();s9=({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)=>Q_e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},Q_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=ZZ(t,o,d),p=Yi(f),{stdioItems:m,objectMode:h}=e[r],g=ebe([p],m,c,n),{serializedResult:b,finalResult:_=b}=tbe({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});rbe({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&&nbe(b,m,i),S}catch(x){return n.error=x,S}},ebe=(t,e,r,n)=>{try{return w_(t,e,r,!1)}catch(i){return n.error=i,t}},tbe=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:zd(t)};let s=N6(t,r);return n[o]?{serializedResult:s,finalResult:_O(s,!i[o],e)}:{serializedResult:s}},rbe=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!$_({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=_O(t,!1,s);try{i9(a,e,n)}catch(c){r.error??=c}},nbe=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>h_.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?X_e(n,t):(r.add(o),Y_e(n,t))}}});var c9,l9=y(()=>{Vr();ef();c9=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,ro(e,r,"all")]:Array.isArray(e)?[ro(t,r,"all"),...e]:Ft(t)&&Ft(e)?pT([t,e]):`${t}${e}`}});import{once as kO}from"node:events";var u9,ibe,d9,f9,obe,EO,AO=y(()=>{Xs();u9=async(t,e)=>{let[r,n]=await ibe(t);return e.isForcefullyTerminated??=!1,[r,n]},ibe=async t=>{let[e,r]=await Promise.allSettled([kO(t,"spawn"),kO(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?d9(t):r.value},d9=async t=>{try{return await kO(t,"exit")}catch{return d9(t)}},f9=async t=>{let[e,r]=await t;if(!obe(e,r)&&EO(e,r))throw new Un;return[e,r]},obe=(t,e)=>t===void 0&&e===void 0,EO=(t,e)=>t!==0||e!==null});var p9,sbe,m9=y(()=>{Xs();na();AO();p9=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=sbe(t,e,r),s=o?.code==="ETIMEDOUT",a=HZ(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},sbe=(t,e,r)=>t!==void 0?t:EO(e,r)?new Un:void 0});import{spawnSync as abe}from"node:child_process";var h9,cbe,lbe,ube,k_,dbe,fbe,pbe,mbe,g9=y(()=>{wT();JT();YT();Qd();f_();LG();ef();r9();a9();na();l9();m9();h9=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=cbe(t,e,r),d=dbe({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Fc(d,c,l)},cbe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=Ey(t,e,r),a=lbe(r),{file:c,commandArguments:l,options:u}=Qy(t,e,a);ube(u);let d=FG(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},lbe=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,ube=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&k_("ipcInput"),t&&k_("ipc: true"),r&&k_("detached: true"),n&&k_("cancelSignal")},k_=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},dbe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=fbe({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}=p9(c,r),{output:m,error:h=l}=s9({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),g=m.map((_,S)=>ro(_,r,S)),b=ro(c9(m,r),r,"all");return mbe({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:b,options:r,command:n,escapedCommand:i,startTime:a})},fbe=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{t9(o,r);let a=pbe(r);return abe(...e_(t,e,a))}catch(a){return Mc({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},pbe=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:u_(e)}),mbe=({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?d_({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):Xd({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 TO,on as hbe}from"node:events";var y9,gbe,ybe,_be,bbe,_9=y(()=>{Rc();Vd();Gd();y9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(Ic({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Gy(t)}),gbe({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),gbe=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{zy(e,i);let o=Bo(t,e,r),s=new AbortController;try{return await Promise.race([ybe(o,n,s),_be(o,r,s),bbe(o,r,s)])}catch(a){throw Pc(t),a}finally{s.abort(),Ly(e,i)}},ybe=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await TO(t,"message",{signal:r});return n}for await(let[n]of hbe(t,"message",{signal:r}))if(e(n))return n},_be=async(t,e,{signal:r})=>{await TO(t,"disconnect",{signal:r}),OH(e)},bbe=async(t,e,{signal:r})=>{let[n]=await TO(t,"strict:error",{signal:r});throw Ny(n,e)}});import{once as v9,on as vbe}from"node:events";var S9,OO,Sbe,wbe,xbe,b9,IO=y(()=>{Rc();Vd();Gd();S9=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>OO({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),OO=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{Ic({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Gy(t)}),zy(e,o);let s=Bo(t,e,r),a=new AbortController,c={};return Sbe(t,s,a),wbe({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),xbe({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},Sbe=async(t,e,r)=>{try{await v9(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},wbe=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await v9(t,"strict:error",{signal:r.signal});n.error=Ny(i,e),r.abort()}catch{}},xbe=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of vbe(r,"message",{signal:o.signal}))b9(s),yield c}catch{b9(s)}finally{o.abort(),Ly(e,a),n||Pc(t),i&&await t}},b9=({error:t})=>{if(t)throw t}});import w9 from"node:process";var x9,$9,k9,PO=y(()=>{Yy();_9();IO();Hy();x9=(t,{ipc:e})=>{Object.assign(t,k9(t,!1,e))},$9=()=>{let t=w9,e=!0,r=w9.channel!==void 0;return{...k9(t,e,r),getCancelSignal:nZ.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},k9=(t,e,r)=>({sendMessage:Jy.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:y9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:S9.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})})});import{ChildProcess as $be}from"node:child_process";import{PassThrough as kbe,Readable as Ebe,Writable as Abe,Duplex as Tbe}from"node:stream";var E9,Obe,rf,Ibe,Pbe,Rbe,Cbe,A9=y(()=>{y_();Qd();f_();E9=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{hO(n);let a=new $be;Obe(a,n),Object.assign(a,{readable:Ibe,writable:Pbe,duplex:Rbe});let c=Mc({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=Cbe(c,s,i);return{subprocess:a,promise:l}},Obe=(t,e)=>{let r=rf(),n=rf(),i=rf(),o=Array.from({length:e.length-3},rf),s=rf(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},rf=()=>{let t=new kbe;return t.end(),t},Ibe=()=>new Ebe({read(){}}),Pbe=()=>new Abe({write(){}}),Rbe=()=>new Tbe({read(){},write(){}}),Cbe=async(t,e,r)=>Fc(t,e,r)});import{createReadStream as T9,createWriteStream as O9}from"node:fs";import{Buffer as Dbe}from"node:buffer";import{Readable as nf,Writable as Nbe,Duplex as jbe}from"node:stream";var P9,of,I9,Mbe,R9=y(()=>{x_();y_();hr();P9=(t,e)=>g_(Mbe,t,e,!1),of=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ho[t]}.`)},I9={fileNumber:of,generator:xO,asyncGenerator:xO,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:jbe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Mbe={input:{...I9,fileUrl:({value:t})=>({stream:T9(t)}),filePath:({value:{file:t}})=>({stream:T9(t)}),webStream:({value:t})=>({stream:nf.fromWeb(t)}),iterable:({value:t})=>({stream:nf.from(t)}),asyncIterable:({value:t})=>({stream:nf.from(t)}),string:({value:t})=>({stream:nf.from(t)}),uint8Array:({value:t})=>({stream:nf.from(Dbe.from(t))})},output:{...I9,fileUrl:({value:t})=>({stream:O9(t)}),filePath:({value:{file:t,append:e}})=>({stream:O9(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Nbe.fromWeb(t)}),iterable:of,asyncIterable:of,string:of,uint8Array:of}}});import{on as Fbe,once as C9}from"node:events";import{PassThrough as zbe,getDefaultHighWaterMark as Lbe}from"node:stream";import{finished as j9}from"node:stream/promises";function sa(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)CO(i);let e=t.some(({readableObjectMode:i})=>i),r=Ube(t,e),n=new RO({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var Ube,RO,qbe,Bbe,Hbe,CO,Zbe,Gbe,Vbe,Wbe,Kbe,M9,F9,DO,z9,Jbe,E_,D9,N9,A_=y(()=>{Ube=(t,e)=>{if(t.length===0)return Lbe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},RO=class extends zbe{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(CO(e),this.#t.has(e))return;this.#t.add(e),this.#n??=qbe(this,this.#t,this.#o);let r=Zbe({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(CO(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)}},qbe=async(t,e,r)=>{E_(t,D9);let n=new AbortController;try{await Promise.race([Bbe(t,n),Hbe(t,e,r,n)])}finally{n.abort(),E_(t,-D9)}},Bbe=async(t,{signal:e})=>{try{await j9(t,{signal:e,cleanup:!0})}catch(r){throw M9(t,r),r}},Hbe=async(t,e,r,{signal:n})=>{for await(let[i]of Fbe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},CO=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Zbe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{E_(t,N9);let a=new AbortController;try{await Promise.race([Gbe(o,e,a),Vbe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),Wbe({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),E_(t,-N9)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?DO(t):Kbe(t))},Gbe=async(t,e,{signal:r})=>{try{await t,r.aborted||DO(e)}catch(n){r.aborted||M9(e,n)}},Vbe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await j9(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;F9(s)?i.add(e):z9(t,s)}},Wbe=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await C9(t,i,{signal:o}),!t.readable)return C9(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},Kbe=t=>{t.writable&&t.end()},M9=(t,e)=>{F9(e)?DO(t):z9(t,e)},F9=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",DO=t=>{(t.readable||t.writable)&&t.destroy()},z9=(t,e)=>{t.destroyed||(t.once("error",Jbe),t.destroy(e))},Jbe=()=>{},E_=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},D9=2,N9=1});import{finished as L9}from"node:stream/promises";var Lc,Ybe,NO,Xbe,jO,T_=y(()=>{Xi();Lc=(t,e)=>{t.pipe(e),Ybe(t,e),Xbe(t,e)},Ybe=async(t,e)=>{if(!(Ln(t)||Ln(e))){try{await L9(t,{cleanup:!0,readable:!0,writable:!1})}catch{}NO(e)}},NO=t=>{t.writable&&t.end()},Xbe=async(t,e)=>{if(!(Ln(t)||Ln(e))){try{await L9(e,{cleanup:!0,readable:!1,writable:!0})}catch{}jO(t)}},jO=t=>{t.readable&&t.destroy()}});var U9,Qbe,eve,tve,rve,nve,q9=y(()=>{A_();Xi();Fy();hr();T_();U9=(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})=>gn.has(c)))Qbe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!gn.has(c)))tve({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]:sa(o);Lc(s,i)}},Qbe=(t,e,r,n)=>{r==="output"?Lc(t.stdio[n],e):Lc(e,t.stdio[n]);let i=eve[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},eve=["stdin","stdout","stderr"],tve=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;rve(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},rve=(t,{signal:e})=>{Ln(t)&&Qs(t,nve,e)},nve=2});var aa,B9=y(()=>{aa=[];aa.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&aa.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&aa.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var O_,MO,FO,ive,zO,I_,ove,LO,UO,qO,H9,l7e,u7e,Z9=y(()=>{B9();O_=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",MO=Symbol.for("signal-exit emitter"),FO=globalThis,ive=Object.defineProperty.bind(Object),zO=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(FO[MO])return FO[MO];ive(FO,MO,{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}},I_=class{},ove=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),LO=class extends I_{onExit(){return()=>{}}load(){}unload(){}},UO=class extends I_{#t=qO.platform==="win32"?"SIGINT":"SIGHUP";#r=new zO;#e;#n;#o;#i={};#s=!1;constructor(e){super(),this.#e=e,this.#i={};for(let r of aa)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(!O_(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 aa)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,aa.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 O_(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"&&O_(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)}},qO=globalThis.process,{onExit:H9,load:l7e,unload:u7e}=ove(O_(qO)?new UO(qO):new LO)});import{addAbortListener as sve}from"node:events";var G9,V9=y(()=>{Z9();G9=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=H9(()=>{t.kill()});sve(n,()=>{i()})}});var K9,ave,cve,W9,lve,J9=y(()=>{fT();ky();qo();$c();K9=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=$y(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=ave(r,n,i),{sourceStream:d,sourceError:f}=lve(t,l),{options:p,fileDescriptors:m}=gi.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:o}},ave=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=cve(t,e,...r),a=My(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},cve=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(W9,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||uT(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]=py(r,...n);return{destination:e(W9)(i,o,s),pipeOptions:s}}if(gi.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}`)},W9=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),lve=(t,e)=>{try{return{sourceStream:Dc(t,e)}}catch(r){return{sourceError:r}}}});var X9,uve,BO,Y9,HO=y(()=>{Qd();T_();X9=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=uve({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw BO({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},uve=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return jO(t),n;if(e!==void 0)return NO(r),e},BO=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Mc({error:t,command:Y9,escapedCommand:Y9,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Y9="source.pipe(destination)"});var Q9,eV=y(()=>{Q9=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 dve}from"node:stream/promises";var tV,fve,pve,mve,P_,hve,gve,rV=y(()=>{A_();Fy();T_();tV=(t,e,r)=>{let n=P_.has(e)?pve(t,e):fve(t,e);return Qs(t,hve,r.signal),Qs(e,gve,r.signal),mve(e),n},fve=(t,e)=>{let r=sa([t]);return Lc(r,e),P_.set(e,r),r},pve=(t,e)=>{let r=P_.get(e);return r.add(t),r},mve=async t=>{try{await dve(t,{cleanup:!0,readable:!1,writable:!0})}catch{}P_.delete(t)},P_=new WeakMap,hve=2,gve=1});import{aborted as yve}from"node:util";var nV,_ve,iV=y(()=>{HO();nV=(t,e)=>t===void 0?[]:[_ve(t,e)],_ve=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await yve(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw BO({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})}});var R_,bve,vve,oV=y(()=>{Ji();J9();HO();eV();rV();iV();R_=(t,...e)=>{if(Et(e[0]))return R_.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=K9(t,...e),i=bve({...n,destination:r});return i.pipe=R_.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},bve=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=vve(t,i);X9({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=tV(e,o,d);return await Promise.race([Q9(u),...nV(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},vve=(t,e)=>Promise.allSettled([t,e])});import{on as Sve}from"node:events";import{getDefaultHighWaterMark as wve}from"node:stream";var C_,xve,ZO,$ve,aV,GO,sV,kve,Eve,D_=y(()=>{bO();b_();wO();C_=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return xve(e,s),aV({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},xve=async(t,e)=>{try{await t}catch{}finally{e.abort()}},ZO=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;$ve(e,s,t);let a=t.readableObjectMode&&!o;return aV({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},$ve=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},aV=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=Sve(t,"data",{signal:e.signal,highWaterMark:sV,highWatermark:sV});return kve({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},GO=wve(!0),sV=GO,kve=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=Eve({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*oa(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*tf(a)}},Eve=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[v_(t,r,!e),__(t,i,!n,{})].filter(Boolean)});import{setImmediate as Ave}from"node:timers/promises";var cV,Tve,Ove,Ive,VO,lV,WO=y(()=>{l_();Vr();$O();D_();na();ef();cV=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=Tve({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([Ove(t),d]);return}let f=gO(c,r),p=ZO({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([Ive({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return m},Tve=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!$_({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=ZO({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await n9(a,t,r,o)},Ove=async t=>{await Ave(),t.readableFlowing===null&&t.resume()},Ive=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await o_(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await s_(r,{maxBuffer:o})):await c_(r,{maxBuffer:o})}catch(a){return lV(UZ({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},VO=async t=>{try{return await t}catch(e){return lV(e)}},lV=({bufferedData:t})=>C6(t)?new Uint8Array(t):t});import{finished as Pve}from"node:stream/promises";var sf,Rve,Cve,Dve,Nve,jve,KO,N_,uV,j_=y(()=>{sf=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=Rve(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],Pve(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||Nve(a,e,r,n)}finally{s.abort()}},Rve=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&Cve(t,r,n),n},Cve=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{Dve(e,r),n.call(t,...i)}},Dve=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},Nve=(t,e,r,n)=>{if(!jve(t,e,r,n))throw t},jve=(t,e,r,n=!0)=>r.propagating?uV(t)||N_(t):(r.propagating=!0,KO(r,e)===n?uV(t):N_(t)),KO=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",N_=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",uV=t=>t?.code==="EPIPE"});var dV,JO,YO=y(()=>{WO();j_();dV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>JO({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),JO=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=sf(t,e,l);if(KO(l,e)){await u;return}let[d]=await Promise.all([cV({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 fV,pV,Mve,Fve,XO=y(()=>{A_();YO();fV=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?sa([t,e].filter(Boolean)):void 0,pV=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>JO({...Mve(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:Fve(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),Mve=({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}},Fve=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode});var mV,hV,gV=y(()=>{Ac();Lo();mV=t=>Ec(t,"ipc"),hV=(t,e)=>{let r=xy(t);mi({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})}});var yV,_V,bV=y(()=>{na();gV();eo();IO();yV=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=mV(o),a=Qi(e,"ipc"),c=Qi(r,"ipc");for await(let l of OO({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(qZ(t,i,c),i.push(l)),s&&hV(l,o);return i},_V=async(t,e)=>(await Promise.allSettled([t]),e)});import{once as zve}from"node:events";var vV,Lve,Uve,qve,SV=y(()=>{ra();ZT();jT();HT();Xi();hr();WO();bV();VT();XO();YO();AO();j_();vV=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 _=u9(t,f),S={originalStreams:h,fileDescriptors:m,subprocess:t,exitPromise:_,propagating:!1},x=dV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),w=pV({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:S}),R=[],A=yV({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:R,verboseInfo:p}),E=Lve(h,t,S),C=Uve(m,S);try{return await Promise.race([Promise.all([{},f9(_),Promise.all(x),w,A,pZ(t,d),...E,...C]),g,qve(t,b),...cZ(t,o,f,b),...TH({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:b}),...sZ({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:b})])}catch(k){return f.terminationReason??="other",Promise.all([{error:k},_,Promise.all(x.map(L=>VO(L))),VO(w),_V(A,R),Promise.allSettled(E),Promise.allSettled(C)])}},Lve=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:sf(n,i,r)),Uve=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Bn(o,{checkOpen:!1})&&!Ln(o)).map(({type:i,value:o,stream:s=o})=>sf(s,n,e,{isSameDirection:gn.has(i),stopOnExit:i==="native"}))),qve=async(t,{signal:e})=>{let[r]=await zve(t,"error",{signal:e});throw r}});var wV,af,Uc,M_=y(()=>{Cc();wV=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),af=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=hi();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Uc=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 xV}from"node:stream/promises";var QO,$V,eI,tI,F_,z_,rI=y(()=>{j_();QO=async t=>{if(t!==void 0)try{await eI(t)}catch{}},$V=async t=>{if(t!==void 0)try{await tI(t)}catch{}},eI=async t=>{await xV(t,{cleanup:!0,readable:!1,writable:!0})},tI=async t=>{await xV(t,{cleanup:!0,readable:!0,writable:!1})},F_=async(t,e)=>{if(await t,e)throw e},z_=(t,e,r)=>{r&&!N_(r)?t.destroy(r):e&&t.destroy()}});import{Readable as Bve}from"node:stream";import{callbackify as Hve}from"node:util";var kV,nI,iI,oI,Zve,sI,aI,EV,cI=y(()=>{ea();qo();D_();Cc();M_();rI();kV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||Wr.has(r),{subprocessStdout:a,waitReadableDestroy:c}=nI(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=iI(a,s),{read:f,onStdoutDataDone:p}=oI({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),m=new Bve({read:f,destroy:Hve(aI.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return sI({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},nI=(t,e,r)=>{let n=Dc(t,e),i=af(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},iI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:GO},oI=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=hi(),s=C_({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){Zve(this,s,o)},onStdoutDataDone:o}},Zve=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},sI=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await tI(t),await n,await QO(i),await e,r.readable&&r.push(null)}catch(o){await QO(i),EV(r,o)}},aI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Uc(r,e)&&(EV(t,n),await F_(e,n))},EV=(t,e)=>{z_(t,t.readable,e)}});import{Writable as Gve}from"node:stream";import{callbackify as AV}from"node:util";var TV,lI,uI,Vve,Wve,dI,fI,OV,pI=y(()=>{qo();M_();rI();TV=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=lI(t,r,e),s=new Gve({...uI(n,t,i),destroy:AV(fI.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return dI(n,s),s},lI=(t,e,r)=>{let n=My(t,e),i=af(r,n,"writableFinal"),o=af(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},uI=(t,e,r)=>({write:Vve.bind(void 0,t),final:AV(Wve.bind(void 0,t,e,r))}),Vve=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},Wve=async(t,e,r)=>{await Uc(r,e)&&(t.writable&&t.end(),await e)},dI=async(t,e,r)=>{try{await eI(t),e.writable&&e.end()}catch(n){await $V(r),OV(e,n)}},fI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Uc(r,e),await Uc(n,e)&&(OV(t,i),await F_(e,i))},OV=(t,e)=>{z_(t,t.writable,e)}});import{Duplex as Kve}from"node:stream";import{callbackify as Jve}from"node:util";var IV,Yve,PV=y(()=>{ea();cI();pI();IV=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||Wr.has(r),{subprocessStdout:c,waitReadableDestroy:l}=nI(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=lI(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:h}=iI(c,a),{read:g,onStdoutDataDone:b}=oI({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),_=new Kve({read:g,...uI(u,t,d),destroy:Jve(Yve.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 sI({subprocessStdout:c,onStdoutDataDone:b,readable:_,subprocess:t,subprocessStdin:u}),dI(u,_,c),_},Yve=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([aI({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),fI({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])}});var mI,Xve,RV=y(()=>{ea();qo();D_();mI=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||Wr.has(e),s=Dc(t,r),a=C_({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return Xve(a,s,t)},Xve=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}}});var CV,DV=y(()=>{M_();cI();pI();PV();RV();CV=(t,{encoding:e})=>{let r=wV();t.readable=kV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=TV.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=IV.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=mI.bind(void 0,t,e),t[Symbol.asyncIterator]=mI.bind(void 0,t,e,{})}});var NV,Qve,eSe,jV=y(()=>{NV=(t,e)=>{for(let[r,n]of eSe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},Qve=(async()=>{})().constructor.prototype,eSe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Qve,t)])});import{setMaxListeners as tSe}from"node:events";import{spawn as rSe}from"node:child_process";var MV,nSe,iSe,oSe,sSe,aSe,FV=y(()=>{l_();wT();JT();qo();YT();PO();Qd();f_();A9();R9();ef();q9();Cy();V9();oV();XO();SV();DV();Cc();jV();MV=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=nSe(t,e,r),{subprocess:f,promise:p}=oSe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=R_.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),NV(f,p),gi.set(f,{options:u,fileDescriptors:d}),f},nSe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=Ey(t,e,r),{file:a,commandArguments:c,options:l}=Qy(t,e,r),u=iSe(l),d=P9(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},iSe=({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}},oSe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=rSe(...e_(t,e,r))}catch(m){return E9({error:m,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;tSe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];U9(c,a,l),G9(c,r,l);let d={},f=hi();c.kill=EH.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=fV(c,r),CV(c,r),x9(c,r);let p=sSe({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}},sSe=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 vV({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)=>ro(x,e,w)),_=ro(h,e,"all"),S=aSe({errorInfo:d,exitCode:f,signal:p,stdio:b,all:_,ipcOutput:g,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Fc(S,n,e)},aSe=({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?Xd({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 yi,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):d_({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u})});var L_,cSe,lSe,zV=y(()=>{Ji();eo();L_=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,cSe(n,t[n],i)]));return{...t,...r}},cSe=(t,e,r)=>lSe.has(t)&&Et(e)&&Et(r)?{...e,...r}:r,lSe=new Set(["env",...yT])});var Zo,uSe,dSe,LV=y(()=>{Ji();fT();U6();g9();FV();zV();Zo=(t,e,r,n)=>{let i=(s,a,c)=>Zo(s,a,r,c),o=(...s)=>uSe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},uSe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Et(o))return i(t,L_(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=dSe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?h9(a,c,l):MV(a,c,l,i)},dSe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=z6(e)?L6(e,r):[e,...r],[s,a,c]=py(...o),l=L_(L_(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 UV,qV,BV,fSe,pSe,HV=y(()=>{UV=({file:t,commandArguments:e})=>BV(t,e),qV=({file:t,commandArguments:e})=>({...BV(t,e),isSync:!0}),BV=(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]=fSe(t);return{file:r,commandArguments:n}},fSe=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(pSe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},pSe=/ +/g});var ZV,GV,mSe,VV,hSe,WV,KV=y(()=>{ZV=(t,e,r)=>{t.sync=e(mSe,r),t.s=t.sync},GV=({options:t})=>VV(t),mSe=({options:t})=>({...VV(t),isSync:!0}),VV=t=>({options:{...hSe(t),...t}}),hSe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},WV={preferLocal:!0}});var ttt,et,rtt,ntt,itt,ott,stt,att,ctt,ltt,Ir=y(()=>{LV();HV();GT();KV();PO();ttt=Zo(()=>({})),et=Zo(()=>({isSync:!0})),rtt=Zo(UV),ntt=Zo(qV),itt=Zo(uZ),ott=Zo(GV,{},WV,ZV),{sendMessage:stt,getOneMessage:att,getEachMessage:ctt,getCancelSignal:ltt}=$9()});import{existsSync as U_,statSync as gSe}from"node:fs";import{dirname as hI,extname as ySe,isAbsolute as JV,join as gI,relative as yI,resolve as q_,sep as _Se}from"node:path";function B_(t){return t==="./gradlew"||t==="gradle"}function bSe(t){return(U_(gI(t,"build.gradle.kts"))||U_(gI(t,"build.gradle")))&&U_(gI(t,"gradle.properties"))}function vSe(t,e){let n=yI(t,e).split(_Se).filter(Boolean);return n.length===0?":":`:${n.join(":")}`}function Go(t,e){return t===":"?`:${e}`:`${t}:${e}`}function SSe(t,e){let r=q_(t,e),n=r;U_(r)?gSe(r).isFile()&&(n=hI(r)):ySe(r)!==""&&(n=hI(r));let i=yI(t,n);if(i.startsWith("..")||JV(i))return null;let o=n;for(;;){if(bSe(o))return o;if(q_(o)===q_(t))return null;let s=hI(o);if(s===o)return null;let a=yI(t,s);if(a.startsWith("..")||JV(a))return null;o=s}}function H_(t,e){let r=q_(t),n=new Map,i=[];for(let o of e){let s=SSe(r,o);if(!s){i.push(o);continue}let a=vSe(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 Z_=y(()=>{"use strict"});import{existsSync as wSe,readFileSync as xSe}from"node:fs";import{join as $Se}from"node:path";function qc(t="."){let e=$Se(t,".cladding","config.yaml");if(!wSe(e))return _I;try{let n=(0,YV.parse)(xSe(e,"utf8"))?.gate;if(!n)return _I;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 kSe){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 _I}}function XV(t,e){let r=[],n=!1;for(let i of t){let o=ESe.exec(i);if(o){n=!0;for(let s of e)r.push(Go(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 YV,kSe,_I,ESe,G_=y(()=>{"use strict";YV=kt(or(),1);Z_();kSe=["type","lint","test","coverage"],_I={scope:"feature"};ESe=/^\{modules:([A-Za-z0-9_.:-]+)\}$/});import{existsSync as vI,readFileSync as QV,readdirSync as ASe,statSync as TSe}from"node:fs";import{join as V_}from"node:path";function xI(t){for(let e of["build.gradle.kts","build.gradle","gradle.properties"]){let r=V_(t,e);if(vI(r))try{if(eW.test(QV(r,"utf8")))return!0}catch{}}return!1}function tW(t){try{return vI(t)&&eW.test(QV(t,"utf8"))}catch{return!1}}function rW(t,e=0){if(e>4||!vI(t))return!1;let r;try{r=ASe(t)}catch{return!1}for(let n of r){let i=V_(t,n),o=!1;try{o=TSe(i).isDirectory()}catch{continue}if(o){if(n==="build"||n===".gradle"||n==="node_modules")continue;if(rW(i,e+1))return!0}else if(/\.(kts|gradle|toml)$/.test(n)&&tW(i))return!0}return!1}function PSe(t){if(xI(t))return!0;for(let e of OSe)if(tW(V_(t,e)))return!0;for(let e of ISe)if(rW(V_(t,e)))return!0;return!1}function nW(t="."){let e=qc(t).coverage;return e||(PSe(t)?"kover":"jacoco")}function iW(t="."){return SI[nW(t)]}function oW(t="."){return bI[nW(t)]}var SI,bI,wI,eW,OSe,ISe,W_=y(()=>{"use strict";G_();SI={kover:"koverXmlReport",jacoco:"jacocoTestReport"},bI={kover:"build/reports/kover/report.xml",jacoco:"build/reports/jacoco/test/jacocoTestReport.xml"},wI=[bI.kover,bI.jacoco],eW=/kover/i;OSe=["build.gradle.kts","build.gradle","settings.gradle.kts","settings.gradle","gradle/libs.versions.toml"],ISe=["buildSrc","build-logic"]});import{existsSync as $I,readdirSync as sW}from"node:fs";import{join as K_}from"node:path";function kI(t){return $I(K_(t,"gradlew"))?"./gradlew":"gradle"}function RSe(t){let e=kI(t);return{type:{cmd:e,args:["compileKotlin","compileTestKotlin"]},lint:{cmd:e,args:["ktlintCheck"]},test:{cmd:e,args:["test"]},coverage:{cmd:e,args:[iW(t)]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}}function DSe(t,e){let r=[t],n=0,i=4e3;for(;r.length>0&&na.name.endsWith(c)))return!0}return!1}function MSe(t,e){for(let r of e)if($I(K_(t,r)))return r}function FSe(t,e){try{return sW(t).find(n=>n.endsWith(e))}catch{return}}function LSe(t,e){for(let r of zSe)if(r.configs.some(n=>$I(K_(t,n))))return r.gate;return e}function pt(t="."){for(let e of NSe){let r;for(let o of e.manifests)if(o.startsWith(".")?r=FSe(t,o):r=MSe(t,[o]),r)break;if(!r||e.requiresSource&&!DSe(t,e.requiresSource))continue;let n=typeof e.gates=="function"?e.gates(t):e.gates,i=e.language==="typescript"&&n.lint?{...n,lint:LSe(t,n.lint)}:n;return{language:e.language,manifest:r,gates:i}}return jSe}var CSe,NSe,jSe,zSe,yn=y(()=>{"use strict";W_();CSe=new Set(["node_modules",".git",".gradle",".idea","build","target","dist","out",".cladding"]);NSe=[{language:"typescript",manifests:["package.json"],gates:{type:{cmd:"npx",args:["--no-install","tsc","--noEmit"]},lint:{cmd:"npx",args:["--no-install","eslint","."]},test:{cmd:"npx",args:["--no-install","vitest","run"]},coverage:{cmd:"npx",args:["--no-install","vitest","run","--coverage"]},secret:{cmd:"npx",args:["--no-install","secretlint","**/*"]},arch:{cmd:"npx",args:["--no-install","madge","--circular","--extensions","ts","."]},smoke:{cmd:"npm",args:["run","--silent","smoke"]},perf:{cmd:"npm",args:["run","--silent","perf"]},visual:{cmd:"npm",args:["run","--silent","visual"]}}},{language:"python",manifests:["pyproject.toml","setup.py","requirements.txt"],gates:{type:{cmd:"mypy",args:["."]},lint:{cmd:"ruff",args:["check","."]},test:{cmd:"pytest",args:[]},coverage:{cmd:"coverage",args:["run","-m","pytest"]},secret:{cmd:"detect-secrets",args:["scan"]},arch:{cmd:"lint-imports",args:[]}}},{language:"rust",manifests:["Cargo.toml"],gates:{type:{cmd:"cargo",args:["check"]},lint:{cmd:"cargo",args:["clippy","--","-D","warnings"]},test:{cmd:"cargo",args:["test"]},coverage:{cmd:"cargo",args:["llvm-cov"]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"go",manifests:["go.mod"],gates:{type:{cmd:"go",args:["vet","./..."]},lint:{cmd:"golangci-lint",args:["run"]},test:{cmd:"go",args:["test","./..."]},coverage:{cmd:"go",args:["test","-cover","./..."]},secret:{cmd:"gitleaks",args:["detect","--no-banner"]}}},{language:"kotlin",manifests:["build.gradle.kts","build.gradle","pom.xml"],requiresSource:[".kt",".kts"],gates:RSe},{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"]}}}],jSe={language:"unknown",manifest:"",gates:{}};zSe=[{configs:["biome.json","biome.jsonc"],gate:{cmd:"npx",args:["--no-install","biome","lint","."]}},{configs:[".oxlintrc.json",".oxlintrc.jsonc","oxlint.config.ts"],gate:{cmd:"npx",args:["--no-install","oxlint"]}}]});import{existsSync as USe,readFileSync as qSe}from"node:fs";import{join as BSe}from"node:path";function cf(t){return t.code==="ENOENT"}function J_(t,e,r,n){let i=t.exitCode??1;if(i===0)return[];let o=(t.stderr??"").toString().trim(),s=(t.stdout??"").toString().trim(),a=(o||s||`exit ${i}`).slice(0,200);return aW.test(o)||aW.test(s)?[{detector:e,severity:"info",message:n(a)}]:[{detector:e,severity:"error",message:r(a)}]}function zt(t,e,r){return cf(r)?{stage:t,pass:!1,exitCode:2,stderr:`'${e}' not installed`}:null}function sr(t,e){if((e.exitCode??1)===0)return{stage:t,pass:!0,exitCode:0};let n=String(e.stderr??"").trim()||String(e.stdout??"").trim();return n?{stage:t,pass:!1,exitCode:1,stderr:n}:{stage:t,pass:!1,exitCode:1}}function Bc(t,e){let r=BSe(t,"package.json");if(!USe(r))return!1;try{return!!JSON.parse(qSe(r,"utf8")).scripts?.[e]}catch{return!1}}var aW,_n=y(()=>{"use strict";aW=/config (is |file )?not found|no such file|ENOENT|cannot find (a |the )?(config|module|package|preset)|require[sd]?\b.{0,40}\bconfig|canceled due to missing packages|could not determine executable/i});function EI(t){Y_=t?new Map:null}function X_(t,e){if(!Y_)return e();let r=Y_.get(t);if(r)return r;let n=e();return Y_.set(t,n),n}var Y_,Q_=y(()=>{"use strict";Y_=null});import{resolve as HSe}from"node:path";function ZSe(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.arch;return n?X_(`arch:${HSe(e)}:${n.cmd}:${n.args.join(" ")}`,()=>{let i=et(n.cmd,[...n.args],{cwd:e,reject:!1});return cf(i)?[{detector:eb,severity:"info",message:`architecture validator '${n.cmd}' not installed`}]:J_(i,eb,o=>`${n.cmd} reported architecture violations: ${o}`,o=>`${n.cmd} could not validate (config/setup gap, not a violation): ${o}`)}):[{detector:eb,severity:"info",message:`no architecture validator registered for language '${r.language}' (compiler may already enforce acyclic imports)`}]}var eb,tb,AI=y(()=>{"use strict";Ir();yn();_n();Q_();eb="ARCHITECTURE_VIOLATION";tb={name:eb,run:ZSe}});import cW from"node:process";function ca(t={}){let r=tb.run(t).filter(o=>o.severity==="error"),n=r.length===0,i={stage:GSe,pass:n,exitCode:n?0:1};return n?i:{...i,stderr:r.map(o=>o.message).join(` +`)}}var GSe,VSe,rb=y(()=>{"use strict";AI();GSe="stage_1.5";VSe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${cW.argv[1]}`;if(VSe){let t=ca();console.log(JSON.stringify(t)),cW.exit(t.exitCode)}});import{existsSync as TI,readdirSync as lW}from"node:fs";import{join as nb}from"node:path";function KSe(t,e){let r=nb(t,e.path);if(!TI(r))return!0;if(e.isDirectory)try{return lW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml")).length===0}catch{return!0}return!1}function JSe(t){let{cwd:e="."}=t,r=[];for(let i of WSe)KSe(e,i)&&r.push({detector:lf,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=nb(e,"spec.yaml");if(TI(n)){let i=QSe(n),o=i?null:YSe(e);if(i)r.push({detector:lf,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:lf,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=XSe(e);s&&r.push({detector:lf,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 YSe(t){for(let e of["spec/features","spec/scenarios"]){let r=nb(t,e);if(!TI(r))continue;let n;try{n=lW(r).filter(i=>i.endsWith(".yaml")||i.endsWith(".yml"))}catch{continue}for(let i of[...n].sort())try{di(nb(r,i))}catch(o){return{path:`${e}/${i}`,reason:o.message}}}return null}function XSe(t){try{return Y(t),null}catch(e){return e.message}}function QSe(t){let e;try{e=di(t)}catch(r){return`unparseable: ${r.message}`}return e===null||typeof e!="object"||Array.isArray(e)?"empty or not a YAML mapping":null}var lf,WSe,uW,dW=y(()=>{"use strict";at();cy();lf="ABSENCE_OF_GOVERNANCE",WSe=[{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}];uW={name:lf,run:JSe}});function ib(t){let e=t.trim().match(/^(\S+)/);return e?e[1].toLowerCase():""}function OI(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=ib(r)==="while",o=twe.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 '${ib(r)}'`}let n=ewe[t];return r.length===0?`ears='${t}' requires condition starting with '${n}' \u2014 empty`:ib(r)!==n?`ears='${t}' requires condition to start with '${n}' \u2014 got '${ib(r)}'`:null}function rwe(t,e){let r=OI(e.ears,e.condition);return r?[{featureId:t.id,acId:e.id,pattern:e.ears??"unspecified",message:r}]:[]}function fW(t){let e=[];for(let r of t)for(let n of r.acceptance_criteria??[])e.push(...rwe(r,n));return e}var ewe,twe,II=y(()=>{"use strict";ewe={event:"when",state:"while",optional:"where",unwanted:"if"},twe=/\bwhen\b/i});function pe(t,e,r){let n;try{n=Y(t)}catch(i){return[{detector:e,severity:"info",message:`spec.yaml not loaded: ${i.message}`}]}return r(n)}var _t=y(()=>{"use strict";at()});function nwe(t){let{cwd:e="."}=t;return pe(e,ob,iwe)}function iwe(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:ob,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 fW(t.features))e.push({detector:ob,severity:"error",message:`${r.featureId}.${r.acId} EARS: ${r.message}`});return e}var ob,pW,mW=y(()=>{"use strict";II();_t();ob="AC_DRIFT";pW={name:ob,run:nwe}});function bi(t=".",e){let n=(e??"").trim().toLowerCase()||pt(t).language;return cwe[n]??hW}var owe,swe,hW,awe,cwe,Hc=y(()=>{"use strict";yn();owe=/(?:import\s+(?:[\s\S]*?\sfrom\s+)?|import\s*\()['"]([^'"]+)['"]\)?/g,swe=/^[ \t]*import\s+([\w.]+)/gm,hW={ext:"ts",extensions:[".ts",".tsx"],sourceRoots:["src"],mainRoot:"src",testGlobs:["tests/**/*.test.ts"],coverageSummary:"coverage/coverage-summary.json",coverageFormat:"istanbul-json",importMatcher:owe,importStyle:"relative"},awe={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:swe,importStyle:"dotted"},cwe={typescript:hW,kotlin:awe}});import{existsSync as lwe,readFileSync as uwe,readdirSync as dwe,statSync as fwe}from"node:fs";import{join as yW,relative as gW}from"node:path";function pwe(t,e){if(!lwe(t))return[];let r=[],n=[t];for(;n.length>0;){let i=n.pop(),o;try{o=dwe(i)}catch{continue}for(let s of o){if(s==="node_modules"||s===".cladding"||s.startsWith("."))continue;let a=yW(i,s),c;try{c=fwe(a)}catch{continue}c.isDirectory()?n.push(a):e.some(l=>s.endsWith(l))&&r.push(a)}}return r}function mwe(t){let e=t.trim();return e.startsWith("//")||e.startsWith("/*")||e.startsWith("*")}function gwe(t){return hwe.test(t)}function ywe(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=r.project.ai_hints?.forbidden_patterns;if(!n||n.length===0)return[];let i=bi(e,r.project?.language),o=i.sourceRoots.flatMap(a=>pwe(yW(e,a),i.extensions));if(o.length===0)return[];let s=[];for(let a of o){let c;try{c=uwe(a,"utf8")}catch{continue}let l=c.split(` +`);for(let u=0;u{"use strict";at();Hc();_W="AI_HINTS_FORBIDDEN_PATTERN";hwe=/\/\/\s*cladding-disable[:\s]+AI_HINTS_FORBIDDEN_PATTERN\b/;bW={name:_W,run:ywe}});function _we(t){let{cwd:e="."}=t,r;try{r=Y(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:SW,severity:"error",message:`${i.id}.${a} appears ${c} times \u2014 AC ids must be unique within a feature`})}return n}var SW,wW,xW=y(()=>{"use strict";at();SW="AC_DUPLICATE_WITHIN_FEATURE";wW={name:SW,run:_we}});import{createRequire as bwe}from"module";import{basename as vwe,dirname as RI,normalize as Swe,relative as wwe,resolve as xwe,sep as EW}from"path";import*as $we from"fs";function kwe(t){let e=Swe(t);return e.length>1&&e[e.length-1]===EW&&(e=e.substring(0,e.length-1)),e}function AW(t,e){return t.replace(Ewe,e)}function Twe(t){return t==="/"||Awe.test(t)}function PI(t,e){let{resolvePaths:r,normalizePath:n,pathSeparator:i}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(r&&(t=xwe(t)),(n||o)&&(t=kwe(t)),t===".")return"";let s=t[t.length-1]!==i;return AW(s?t+i:t,i)}function TW(t,e){return e+t}function Owe(t,e){return function(r,n){return n.startsWith(t)?n.slice(t.length)+r:AW(wwe(t,n),e.pathSeparator)+e.pathSeparator+r}}function Iwe(t){return t}function Pwe(t,e,r){return e+t+r}function Rwe(t,e){let{relativePaths:r,includeBasePath:n}=e;return r&&t?Owe(t,e):n?TW:Iwe}function Cwe(t){return function(e,r){r.push(e.substring(t.length)||".")}}function Dwe(t){return function(e,r,n){let i=e.substring(t.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}function Fwe(t,e){let{includeDirs:r,filters:n,relativePaths:i}=e;return r?i?n&&n.length?Dwe(t):Cwe(t):n&&n.length?jwe:Nwe:Mwe}function Hwe(t){let{excludeFiles:e,filters:r,onlyCounts:n}=t;return e?Bwe:r&&r.length?n?zwe:Lwe:n?Uwe:qwe}function Vwe(t){return t.group?Gwe:Zwe}function Jwe(t){return t.group?Wwe:Kwe}function Qwe(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Xwe:Ywe}function OW(t,e,r){if(r.options.useRealPaths)return exe(e,r);let n=RI(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=RI(n)}return r.symlinks.set(t,e),i>1}function exe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function sb(t,e,r,n){e(t&&!n?t:null,r)}function lxe(t,e){let{onlyCounts:r,group:n,maxFiles:i}=t;return r?e?txe:oxe:n?e?rxe:cxe:i?e?ixe:axe:e?nxe:sxe}function fxe(t){return t?dxe:uxe}function gxe(t,e){return new Promise((r,n)=>{RW(t,e,(i,o)=>{if(i)return n(i);r(o)})})}function RW(t,e,r){new PW(t,e,r).start()}function yxe(t,e){return new PW(t,e).start()}var $W,Ewe,Awe,Nwe,jwe,Mwe,zwe,Lwe,Uwe,qwe,Bwe,Zwe,Gwe,Wwe,Kwe,Ywe,Xwe,txe,rxe,nxe,ixe,oxe,sxe,axe,cxe,IW,uxe,dxe,pxe,mxe,hxe,PW,kW,CW,DW,NW=y(()=>{$W=bwe(import.meta.url);Ewe=/[\\/]/g;Awe=/^[a-z]:[\\/]$/i;Nwe=(t,e)=>{e.push(t||".")},jwe=(t,e,r)=>{let n=t||".";r.every(i=>i(n,!0))&&e.push(n)},Mwe=()=>{};zwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&r.files++},Lwe=(t,e,r,n)=>{n.every(i=>i(t,!1))&&e.push(t)},Uwe=(t,e,r,n)=>{r.files++},qwe=(t,e)=>{e.push(t)},Bwe=()=>{};Zwe=t=>t,Gwe=()=>[""].slice(0,0);Wwe=(t,e,r)=>{t.push({directory:e,files:r,dir:e})},Kwe=()=>{};Ywe=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()&&OW(t,a,e))return n.dequeue(null,e);r(l,a),n.dequeue(null,e)})})},Xwe=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()&&OW(t,s,e))return;r(a,s)}catch(s){if(!o)throw s}};txe=t=>t.counts,rxe=t=>t.groups,nxe=t=>t.paths,ixe=t=>t.paths.slice(0,t.options.maxFiles),oxe=(t,e,r)=>(sb(e,r,t.counts,t.options.suppressErrors),null),sxe=(t,e,r)=>(sb(e,r,t.paths,t.options.suppressErrors),null),axe=(t,e,r)=>(sb(e,r,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),cxe=(t,e,r)=>(sb(e,r,t.groups,t.options.suppressErrors),null);IW={withFileTypes:!0},uxe=(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||".",IW,(s,a=[])=>{i(a,r,n),t.queue.dequeue(t.options.suppressErrors?null:s,t)})},dxe=(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||".",IW)}catch(a){if(!t.options.suppressErrors)throw a}i(s,r,n)};pxe=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))}},mxe=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}},hxe=class{aborted=!1;abort(){this.aborted=!0}},PW=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,r){this.isSynchronous=!r,this.callbackInvoker=lxe(e,this.isSynchronous),this.root=PI(t,e),this.state={root:Twe(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new mxe,options:e,queue:new pxe((n,i)=>this.callbackInvoker(i,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new hxe,fs:e.fs||$we},this.joinPath=Rwe(this.root,e),this.pushDirectory=Fwe(this.root,e),this.pushFile=Hwe(e),this.getArray=Vwe(e),this.groupFiles=Jwe(e),this.resolveSymlink=Qwe(e,this.isSynchronous),this.walkDirectory=fxe(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(_=PI(_,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=vwe(_),x=PI(RI(_),this.state.options);_=this.joinPath(S,x),this.pushFile(_,p,this.state.counts,i)}})}}this.groupFiles(this.state.groups,e,p)}};kW=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return gxe(this.root,this.options)}withCallback(t){RW(this.root,this.options,t)}sync(){return yxe(this.root,this.options)}},CW=null;try{$W.resolve("picomatch"),CW=$W("picomatch")}catch{}DW=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:EW,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 kW(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new kW(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let r=this.globFunction||CW;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 uf=v((mrt,LW)=>{"use strict";var jW="[^\\\\/]",_xe="(?=.)",MW="[^/]",CI="(?:\\/|$)",FW="(?:^|\\/)",DI=`\\.{1,2}${CI}`,bxe="(?!\\.)",vxe=`(?!${FW}${DI})`,Sxe=`(?!\\.{0,1}${CI})`,wxe=`(?!${DI})`,xxe="[^.\\/]",$xe=`${MW}*?`,kxe="/",zW={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_xe,QMARK:MW,END_ANCHOR:CI,DOTS_SLASH:DI,NO_DOT:bxe,NO_DOTS:vxe,NO_DOT_SLASH:Sxe,NO_DOTS_SLASH:wxe,QMARK_NO_DOT:xxe,STAR:$xe,START_ANCHOR:FW,SEP:kxe},Exe={...zW,SLASH_LITERAL:"[\\\\/]",QMARK:jW,STAR:`${jW}*?`,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:"\\"},Axe={__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"};LW.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Axe,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?Exe:zW}}});var df=v(Pr=>{"use strict";var{REGEX_BACKSLASH:Txe,REGEX_REMOVE_BACKSLASH:Oxe,REGEX_SPECIAL_CHARS:Ixe,REGEX_SPECIAL_CHARS_GLOBAL:Pxe}=uf();Pr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Pr.hasRegexChars=t=>Ixe.test(t);Pr.isRegexChar=t=>t.length===1&&Pr.hasRegexChars(t);Pr.escapeRegex=t=>t.replace(Pxe,"\\$1");Pr.toPosixSlashes=t=>t.replace(Txe,"/");Pr.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};Pr.removeBackslashes=t=>t.replace(Oxe,e=>e==="\\"?"":e);Pr.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Pr.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Pr.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Pr.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",o=`${n}(?:${t})${i}`;return e.negated===!0&&(o=`(?:^(?!${o}).*$)`),o};Pr.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var WW=v((grt,VW)=>{"use strict";var UW=df(),{CHAR_ASTERISK:NI,CHAR_AT:Rxe,CHAR_BACKWARD_SLASH:ff,CHAR_COMMA:Cxe,CHAR_DOT:jI,CHAR_EXCLAMATION_MARK:MI,CHAR_FORWARD_SLASH:GW,CHAR_LEFT_CURLY_BRACE:FI,CHAR_LEFT_PARENTHESES:zI,CHAR_LEFT_SQUARE_BRACKET:Dxe,CHAR_PLUS:Nxe,CHAR_QUESTION_MARK:qW,CHAR_RIGHT_CURLY_BRACE:jxe,CHAR_RIGHT_PARENTHESES:BW,CHAR_RIGHT_SQUARE_BRACKET:Mxe}=uf(),HW=t=>t===GW||t===ff,ZW=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Fxe=(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,E,C={value:"",depth:0,isGlob:!1},k=()=>l>=n,L=()=>c.charCodeAt(l+1),te=()=>(A=E,c.charCodeAt(++l));for(;l0&&(O=c.slice(0,u),c=c.slice(u),d-=u),be&&m===!0&&d>0?(be=c.slice(0,d),P=c.slice(d)):m===!0?(be="",P=c):be=c,be&&be!==""&&be!=="/"&&be!==c&&HW(be.charCodeAt(be.length-1))&&(be=be.slice(0,-1)),r.unescape===!0&&(P&&(P=UW.removeBackslashes(P)),be&&_===!0&&(be=UW.removeBackslashes(be)));let $t={prefix:O,input:t,start:u,base:be,glob:P,isBrace:f,isBracket:p,isGlob:m,isExtglob:h,isGlobstar:g,negated:S,negatedExtglob:x};if(r.tokens===!0&&($t.maxDepth=0,HW(E)||s.push(C),$t.tokens=s),r.parts===!0||r.tokens===!0){let je;for(let Me=0;Me{"use strict";var pf=uf(),Kr=df(),{MAX_LENGTH:ab,POSIX_REGEX_SOURCE:zxe,REGEX_NON_SPECIAL_CHARS:Lxe,REGEX_SPECIAL_CHARS_BACKREF:Uxe,REPLACEMENTS:KW}=pf,qxe=(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=>Kr.escapeRegex(i)).join("..")}return r},Zc=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,JW=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},Bxe=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},YW=t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(Bxe(e))return e.replace(/\\(.)/g,"$1")},Hxe=t=>{let e=t.map(YW).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}}}}},Zxe=t=>{let e=0,r=[];for(;ea.trim());if(o.length!==1)return;let s=YW(o[0]);if(!s||s.length!==1)return;r.push(s),e+=i.end+1}return r.length<1?void 0:`${r.length===1?Kr.escapeRegex(r[0]):`[${r.map(i=>Kr.escapeRegex(i)).join("")}]`}*`},Gxe=t=>{let e=0,r=t.trim(),n=LI(r);for(;n;)e++,r=n.body.trim(),n=LI(r);return e},Vxe=(t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:pf.DEFAULT_MAX_EXTGLOB_RECURSION,n=JW(t).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||Hxe(n)))return{risky:!0};for(let i of n){let o=Zxe(i);if(o)return{risky:!0,safeOutput:o};if(Gxe(i)>r)return{risky:!0}}return{risky:!1}},UI=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=KW[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ab,r.maxLength):ab,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=pf.globChars(r.windows),l=pf.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=q=>`(${a}(?:(?!${w}${q.dot?m:u}).)*?)`,A=r.dot?"":h,E=r.dot?_:S,C=r.bash===!0?R(r):x;r.capture&&(C=`(${C})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let k={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=Kr.removePrefix(t,k),i=t.length;let L=[],te=[],be=[],O=o,P,$t=()=>k.index===i-1,je=k.peek=(q=1)=>t[k.index+q],Me=k.advance=()=>t[++k.index]||"",Kt=()=>t.slice(k.index+1),Gt=(q="",ut=0)=>{k.consumed+=q,k.index+=ut},Br=q=>{k.output+=q.output!=null?q.output:q.value,Gt(q.value)},jn=()=>{let q=1;for(;je()==="!"&&(je(2)!=="("||je(3)==="?");)Me(),k.start++,q++;return q%2===0?!1:(k.negated=!0,k.start++,!0)},Bi=q=>{k[q]++,be.push(q)},ko=q=>{k[q]--,be.pop()},Ee=q=>{if(O.type==="globstar"){let ut=k.braces>0&&(q.type==="comma"||q.type==="brace"),U=q.extglob===!0||L.length&&(q.type==="pipe"||q.type==="paren");q.type!=="slash"&&q.type!=="paren"&&!ut&&!U&&(k.output=k.output.slice(0,-O.output.length),O.type="star",O.value="*",O.output=C,k.output+=O.output)}if(L.length&&q.type!=="paren"&&(L[L.length-1].inner+=q.value),(q.value||q.output)&&Br(q),O&&O.type==="text"&&q.type==="text"){O.output=(O.output||O.value)+q.value,O.value+=q.value;return}q.prev=O,s.push(q),O=q},Yh=(q,ut)=>{let U={...l[ut],conditions:1,inner:""};U.prev=O,U.parens=k.parens,U.output=k.output,U.startIndex=k.index,U.tokensIndex=s.length;let Ae=(r.capture?"(":"")+U.open;Bi("parens"),Ee({type:q,value:ut,output:k.output?"":p}),Ee({type:"paren",extglob:!0,value:Me(),output:Ae}),L.push(U)},jae=q=>{let ut=t.slice(q.startIndex,k.index+1),U=t.slice(q.startIndex+2,k.index),Ae=Vxe(U,r);if((q.type==="plus"||q.type==="star")&&Ae.risky){let ot=Ae.safeOutput?(q.output?"":p)+(r.capture?`(${Ae.safeOutput})`:Ae.safeOutput):void 0,ai=s[q.tokensIndex];ai.type="text",ai.value=ut,ai.output=ot||Kr.escapeRegex(ut);for(let ci=q.tokensIndex+1;ci1&&q.inner.includes("/")&&(ot=R(r)),(ot!==C||$t()||/^\)+$/.test(Kt()))&&(st=q.close=`)$))${ot}`),q.inner.includes("*")&&(jt=Kt())&&/^\.[^\\/.]+$/.test(jt)){let ai=UI(jt,{...e,fastpaths:!1}).output;st=q.close=`)${ai})${ot})`}q.prev.type==="bos"&&(k.negatedExtglob=!0)}Ee({type:"paren",extglob:!0,value:P,output:st}),ko("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let q=!1,ut=t.replace(Uxe,(U,Ae,st,jt,ot,ai)=>jt==="\\"?(q=!0,U):jt==="?"?Ae?Ae+jt+(ot?_.repeat(ot.length):""):ai===0?E+(ot?_.repeat(ot.length):""):_.repeat(st.length):jt==="."?u.repeat(st.length):jt==="*"?Ae?Ae+jt+(ot?C:""):C:Ae?U:`\\${U}`);return q===!0&&(r.unescape===!0?ut=ut.replace(/\\/g,""):ut=ut.replace(/\\+/g,U=>U.length%2===0?"\\\\":U?"\\":"")),ut===t&&r.contains===!0?(k.output=t,k):(k.output=Kr.wrapOutput(ut,k,e),k)}for(;!$t();){if(P=Me(),P==="\0")continue;if(P==="\\"){let U=je();if(U==="/"&&r.bash!==!0||U==="."||U===";")continue;if(!U){P+="\\",Ee({type:"text",value:P});continue}let Ae=/^\\+/.exec(Kt()),st=0;if(Ae&&Ae[0].length>2&&(st=Ae[0].length,k.index+=st,st%2!==0&&(P+="\\")),r.unescape===!0?P=Me():P+=Me(),k.brackets===0){Ee({type:"text",value:P});continue}}if(k.brackets>0&&(P!=="]"||O.value==="["||O.value==="[^")){if(r.posix!==!1&&P===":"){let U=O.value.slice(1);if(U.includes("[")&&(O.posix=!0,U.includes(":"))){let Ae=O.value.lastIndexOf("["),st=O.value.slice(0,Ae),jt=O.value.slice(Ae+2),ot=zxe[jt];if(ot){O.value=st+ot,k.backtrack=!0,Me(),!o.output&&s.indexOf(O)===1&&(o.output=p);continue}}}(P==="["&&je()!==":"||P==="-"&&je()==="]")&&(P=`\\${P}`),P==="]"&&(O.value==="["||O.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&O.value==="["&&(P="^"),O.value+=P,Br({value:P});continue}if(k.quotes===1&&P!=='"'){P=Kr.escapeRegex(P),O.value+=P,Br({value:P});continue}if(P==='"'){k.quotes=k.quotes===1?0:1,r.keepQuotes===!0&&Ee({type:"text",value:P});continue}if(P==="("){Bi("parens"),Ee({type:"paren",value:P});continue}if(P===")"){if(k.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Zc("opening","("));let U=L[L.length-1];if(U&&k.parens===U.parens+1){jae(L.pop());continue}Ee({type:"paren",value:P,output:k.parens?")":"\\)"}),ko("parens");continue}if(P==="["){if(r.nobracket===!0||!Kt().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Zc("closing","]"));P=`\\${P}`}else Bi("brackets");Ee({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||O&&O.type==="bracket"&&O.value.length===1){Ee({type:"text",value:P,output:`\\${P}`});continue}if(k.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Zc("opening","["));Ee({type:"text",value:P,output:`\\${P}`});continue}ko("brackets");let U=O.value.slice(1);if(O.posix!==!0&&U[0]==="^"&&!U.includes("/")&&(P=`/${P}`),O.value+=P,Br({value:P}),r.literalBrackets===!1||Kr.hasRegexChars(U))continue;let Ae=Kr.escapeRegex(O.value);if(k.output=k.output.slice(0,-O.value.length),r.literalBrackets===!0){k.output+=Ae,O.value=Ae;continue}O.value=`(${a}${Ae}|${O.value})`,k.output+=O.value;continue}if(P==="{"&&r.nobrace!==!0){Bi("braces");let U={type:"brace",value:P,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};te.push(U),Ee(U);continue}if(P==="}"){let U=te[te.length-1];if(r.nobrace===!0||!U){Ee({type:"text",value:P,output:P});continue}let Ae=")";if(U.dots===!0){let st=s.slice(),jt=[];for(let ot=st.length-1;ot>=0&&(s.pop(),st[ot].type!=="brace");ot--)st[ot].type!=="dots"&&jt.unshift(st[ot].value);Ae=qxe(jt,r),k.backtrack=!0}if(U.comma!==!0&&U.dots!==!0){let st=k.output.slice(0,U.outputIndex),jt=k.tokens.slice(U.tokensIndex);U.value=U.output="\\{",P=Ae="\\}",k.output=st;for(let ot of jt)k.output+=ot.output||ot.value}Ee({type:"brace",value:P,output:Ae}),ko("braces"),te.pop();continue}if(P==="|"){L.length>0&&L[L.length-1].conditions++,Ee({type:"text",value:P});continue}if(P===","){let U=P,Ae=te[te.length-1];Ae&&be[be.length-1]==="braces"&&(Ae.comma=!0,U="|"),Ee({type:"comma",value:P,output:U});continue}if(P==="/"){if(O.type==="dot"&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",s.pop(),O=o;continue}Ee({type:"slash",value:P,output:f});continue}if(P==="."){if(k.braces>0&&O.type==="dot"){O.value==="."&&(O.output=u);let U=te[te.length-1];O.type="dots",O.output+=P,O.value+=P,U.dots=!0;continue}if(k.braces+k.parens===0&&O.type!=="bos"&&O.type!=="slash"){Ee({type:"text",value:P,output:u});continue}Ee({type:"dot",value:P,output:u});continue}if(P==="?"){if(!(O&&O.value==="(")&&r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Yh("qmark",P);continue}if(O&&O.type==="paren"){let Ae=je(),st=P;(O.value==="("&&!/[!=<:]/.test(Ae)||Ae==="<"&&!/<([!=]|\w+>)/.test(Kt()))&&(st=`\\${P}`),Ee({type:"text",value:P,output:st});continue}if(r.dot!==!0&&(O.type==="slash"||O.type==="bos")){Ee({type:"qmark",value:P,output:S});continue}Ee({type:"qmark",value:P,output:_});continue}if(P==="!"){if(r.noextglob!==!0&&je()==="("&&(je(2)!=="?"||!/[!=<:]/.test(je(3)))){Yh("negate",P);continue}if(r.nonegate!==!0&&k.index===0){jn();continue}}if(P==="+"){if(r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Yh("plus",P);continue}if(O&&O.value==="("||r.regex===!1){Ee({type:"plus",value:P,output:d});continue}if(O&&(O.type==="bracket"||O.type==="paren"||O.type==="brace")||k.parens>0){Ee({type:"plus",value:P});continue}Ee({type:"plus",value:d});continue}if(P==="@"){if(r.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ee({type:"at",extglob:!0,value:P,output:""});continue}Ee({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let U=Lxe.exec(Kt());U&&(P+=U[0],k.index+=U[0].length),Ee({type:"text",value:P});continue}if(O&&(O.type==="globstar"||O.star===!0)){O.type="star",O.star=!0,O.value+=P,O.output=C,k.backtrack=!0,k.globstar=!0,Gt(P);continue}let q=Kt();if(r.noextglob!==!0&&/^\([^?]/.test(q)){Yh("star",P);continue}if(O.type==="star"){if(r.noglobstar===!0){Gt(P);continue}let U=O.prev,Ae=U.prev,st=U.type==="slash"||U.type==="bos",jt=Ae&&(Ae.type==="star"||Ae.type==="globstar");if(r.bash===!0&&(!st||q[0]&&q[0]!=="/")){Ee({type:"star",value:P,output:""});continue}let ot=k.braces>0&&(U.type==="comma"||U.type==="brace"),ai=L.length&&(U.type==="pipe"||U.type==="paren");if(!st&&U.type!=="paren"&&!ot&&!ai){Ee({type:"star",value:P,output:""});continue}for(;q.slice(0,3)==="/**";){let ci=t[k.index+4];if(ci&&ci!=="/")break;q=q.slice(3),Gt("/**",3)}if(U.type==="bos"&&$t()){O.type="globstar",O.value+=P,O.output=R(r),k.output=O.output,k.globstar=!0,Gt(P);continue}if(U.type==="slash"&&U.prev.type!=="bos"&&!jt&&$t()){k.output=k.output.slice(0,-(U.output+O.output).length),U.output=`(?:${U.output}`,O.type="globstar",O.output=R(r)+(r.strictSlashes?")":"|$)"),O.value+=P,k.globstar=!0,k.output+=U.output+O.output,Gt(P);continue}if(U.type==="slash"&&U.prev.type!=="bos"&&q[0]==="/"){let ci=q[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(U.output+O.output).length),U.output=`(?:${U.output}`,O.type="globstar",O.output=`${R(r)}${f}|${f}${ci})`,O.value+=P,k.output+=U.output+O.output,k.globstar=!0,Gt(P+Me()),Ee({type:"slash",value:"/",output:""});continue}if(U.type==="bos"&&q[0]==="/"){O.type="globstar",O.value+=P,O.output=`(?:^|${f}|${R(r)}${f})`,k.output=O.output,k.globstar=!0,Gt(P+Me()),Ee({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-O.output.length),O.type="globstar",O.output=R(r),O.value+=P,k.output+=O.output,k.globstar=!0,Gt(P);continue}let ut={type:"star",value:P,output:C};if(r.bash===!0){ut.output=".*?",(O.type==="bos"||O.type==="slash")&&(ut.output=A+ut.output),Ee(ut);continue}if(O&&(O.type==="bracket"||O.type==="paren")&&r.regex===!0){ut.output=P,Ee(ut);continue}(k.index===k.start||O.type==="slash"||O.type==="dot")&&(O.type==="dot"?(k.output+=g,O.output+=g):r.dot===!0?(k.output+=b,O.output+=b):(k.output+=A,O.output+=A),je()!=="*"&&(k.output+=p,O.output+=p)),Ee(ut)}for(;k.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing","]"));k.output=Kr.escapeLast(k.output,"["),ko("brackets")}for(;k.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing",")"));k.output=Kr.escapeLast(k.output,"("),ko("parens")}for(;k.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zc("closing","}"));k.output=Kr.escapeLast(k.output,"{"),ko("braces")}if(r.strictSlashes!==!0&&(O.type==="star"||O.type==="bracket")&&Ee({type:"maybe_slash",value:"",output:`${f}?`}),k.backtrack===!0){k.output="";for(let q of k.tokens)k.output+=q.output!=null?q.output:q.value,q.suffix&&(k.output+=q.suffix)}return k};UI.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ab,r.maxLength):ab,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=KW[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}=pf.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 E=/^(.*?)\.(\w+)$/.exec(A);if(!E)return;let C=x(E[1]);return C?C+o+E[2]:void 0}}},w=Kr.removePrefix(t,b),R=x(w);return R&&r.strictSlashes!==!0&&(R+=`${s}?`),R};XW.exports=UI});var rK=v((_rt,tK)=>{"use strict";var Wxe=WW(),qI=QW(),eK=df(),Kxe=uf(),Jxe=t=>t&&typeof t=="object"&&!Array.isArray(t),At=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(f=>At(f,e,r));return f=>{for(let p of u){let m=p(f);if(m)return m}return!1}}let n=Jxe(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?At.compileRe(t,e):At.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=At(i.ignore,u,r)}let l=(u,d=!1)=>{let{isMatch:f,match:p,output:m}=At.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};At.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?eK.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=At.matchBase(t,e,r,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};At.matchBase=(t,e,r)=>(e instanceof RegExp?e:At.makeRe(e,r)).test(eK.basename(t));At.isMatch=(t,e,r)=>At(e,r)(t);At.parse=(t,e)=>Array.isArray(t)?t.map(r=>At.parse(r,e)):qI(t,{...e,fastpaths:!1});At.scan=(t,e)=>Wxe(t,e);At.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=At.toRegex(a,e);return n===!0&&(c.state=t),c};At.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=qI.fastpaths(t,e)),i.output||(i=qI(t,e)),At.compileRe(i,e,r,n)};At.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/$^/}};At.constants=Kxe;tK.exports=At});var sK=v((brt,oK)=>{"use strict";var nK=rK(),Yxe=df();function iK(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Yxe.isWindows()}),nK(t,e,r)}Object.assign(iK,nK);oK.exports=iK});import{readdir as Xxe,readdirSync as Qxe,realpath as e0e,realpathSync as t0e,stat as r0e,statSync as n0e}from"fs";import{isAbsolute as i0e,posix as la,resolve as o0e}from"path";import{fileURLToPath as s0e}from"url";function l0e(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]===".."&&c0e.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=>la.relative(t,n)||".":n=>la.relative(t,`${e}/${n}`)||"."}function f0e(t,e){if(e.startsWith(`${t}/`)){let r=e.slice(t.length+1);return n=>`${r}/${n}`}return r=>{let n=la.relative(t,`${e}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function uK(t){var e;let r=Gc.default.scan(t,p0e);return!((e=r.parts)===null||e===void 0)&&e.length?r.parts:[t]}function b0e(t,e){if(e?.caseSensitiveMatch===!1)return!0;let r=Gc.default.scan(t);return r.isGlob||r.negated}function mf(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function dK(t){return typeof t=="string"?[t]:t??[]}function BI(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=_0e(o);s=i0e(s.replace(S0e,""))?la.relative(a,s):la.normalize(s);let c=(i=v0e.exec(s))===null||i===void 0?void 0:i[0],l=uK(s);if(c){let d=(c.length+1)/3,f=0,p=a.split("/");for(;fm.length&&(r.root=m,r.depthOffset=-d+f)}if(!n&&r.depthOffset>=0){var u;(u=r.commonPath)!==null&&u!==void 0||(r.commonPath=l);let d=[],f=Math.min(r.commonPath.length,l.length);for(let p=0;p0?la.join(o,...d):o}return s}function w0e(t,e,r){let n=[],i=[];for(let o of t.ignore)o&&(o[0]!=="!"||o[1]==="(")&&i.push(BI(o,t,r,!0));for(let o of e)o&&(o[0]!=="!"||o[1]==="("?n.push(BI(o,t,r,!1)):(o[1]!=="!"||o[2]==="(")&&i.push(BI(o.slice(1),t,r,!0)));return{match:n,ignore:i}}function x0e(t,e){let r=t.cwd,n={root:r,depthOffset:0},i=w0e(t,e,n);t.debug&&mf("internal processing patterns:",i);let{absolute:o,caseSensitiveMatch:s,debug:a,dot:c,followSymbolicLinks:l,onlyDirectories:u}=t,d=n.root.replace(cK,""),f={dot:c,nobrace:t.braceExpansion===!1,nocase:!s,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},p=(0,Gc.default)(i.match,f),m=(0,Gc.default)(i.ignore,f),h=l0e(i.match,f),g=aK(r,d,o),b=o?g:aK(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 DW({filters:[a?(w,R)=>{let A=g(w,R),E=p(A)&&!m(A);return E&&mf(`matched ${A}`),E}:(w,R)=>{let A=g(w,R);return p(A)&&!m(A)}],exclude:a?(w,R)=>{let A=_(w,R);return mf(`${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&&mf("internal properties:",{...n,root:d}),[x,r!==d&&!o&&f0e(r,d)]}function $0e(t,e){if(e)for(let r=t.length-1;r>=0;r--)t[r]=e(t[r]);return t}function E0e(t){let e={...k0e,...t};return e.cwd=(e.cwd instanceof URL?s0e(e.cwd):o0e(e.cwd)).replace(cK,"/"),e.ignore=dK(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||Xxe,readdirSync:e.fs.readdirSync||Qxe,realpath:e.fs.realpath||e0e,realpathSync:e.fs.realpathSync||t0e,stat:e.fs.stat||r0e,statSync:e.fs.statSync||n0e}),e.debug&&mf("globbing with options:",e),e}function A0e(t,e={}){var r;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=a0e(t)||typeof t=="string",i=dK((r=n?t:t.patterns)!==null&&r!==void 0?r:"**/*"),o=E0e(n?e:t);return i.length>0?x0e(o,i):[]}function Vo(t,e){let[r,n]=A0e(t,e);return r?$0e(r.sync(),n):[]}var Gc,a0e,cK,lK,c0e,u0e,d0e,p0e,m0e,h0e,g0e,y0e,_0e,v0e,S0e,k0e,hf=y(()=>{NW();Gc=kt(sK(),1),a0e=Array.isArray,cK=/\\/g,lK=process.platform==="win32",c0e=/^(\/?\.\.)+$/;u0e=/^[A-Z]:\/$/i,d0e=lK?t=>u0e.test(t):t=>t==="/";p0e={parts:!0};m0e=/(?t.replace(m0e,"\\$&"),y0e=t=>t.replace(h0e,"\\$&"),_0e=lK?y0e:g0e;v0e=/^(\/?\.\.)+/,S0e=/\\(?=[()[\]{}!*+?@|])/g;k0e={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0}});import{existsSync as cb,readFileSync as T0e,readdirSync as O0e,statSync as fK}from"node:fs";import{join as Vc}from"node:path";function I0e(t){let{cwd:e="."}=t,r,n;try{let c=Y(e);r=c.architecture,n=c.project?.language}catch{return[]}if(!r)return[];let i=bi(e,n),o=[],{layers:s,forbiddenImports:a}=HI(r);return s.size>0&&(P0e(e,i,s,o),R0e(e,i,s,o)),a.length>0&&C0e(e,i,a,o),o}function HI(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 P0e(t,e,r,n){let i=e.mainRoot,o=Vc(t,i);if(cb(o))for(let s of O0e(o)){let a=Vc(o,s);fK(a).isDirectory()&&(r.has(s)||n.push({detector:lb,severity:"warn",path:`${i}/${s}/`,message:`${i}/${s}/ is not declared in spec/architecture.yaml layers \u2014 add it or remove the directory`}))}}function R0e(t,e,r,n){let i=e.mainRoot,o=Vc(t,i);if(cb(o))for(let s of r){let a=Vc(o,s);cb(a)&&fK(a).isDirectory()||n.push({detector:lb,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 C0e(t,e,r,n){let i=e.mainRoot,o=e.importMatcher;for(let s of r){let a=Vc(t,i,s.from);if(!cb(a))continue;let c=Vo([`**/*.${e.ext}`],{cwd:a,dot:!1});for(let l of c){let u=Vc(a,l),d;try{d=T0e(u,"utf8")}catch{continue}let f;for(o.lastIndex=0;(f=o.exec(d))!==null;){let p=f[1];D0e(p,s.to,e.importStyle)&&n.push({detector:lb,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 D0e(t,e,r){return r==="dotted"?t.split(".").includes(e):t.startsWith(".")?t.split("/").includes(e):!1}var lb,pK,ZI=y(()=>{"use strict";hf();at();Hc();lb="ARCHITECTURE_FROM_SPEC";pK={name:lb,run:I0e}});import{existsSync as N0e,readFileSync as j0e}from"node:fs";import{join as M0e}from"node:path";function F0e(t){let{cwd:e="."}=t,r=M0e(e,"spec/capabilities.yaml");if(!N0e(r))return[];let n;try{let c=j0e(r,"utf8"),l=mK.default.parse(c);if(!l||typeof l!="object")return[];n=l}catch{return[]}let i=n.capabilities??[];if(i.length===0)return[];let o;try{let c=Y(e);o=new Set(c.features.map(l=>l.id))}catch{return[]}let s=[],a=new Set;for(let c of i){if(typeof c!="object"||c===null)continue;let l=String(c.id??"(unnamed)"),u=Array.isArray(c.features)?c.features:[];if(u.length===0){s.push({detector:ub,severity:"warn",path:"spec/capabilities.yaml",message:`capability "${l}" has no features mapped \u2014 bind at least one feature via the features[] field, or remove the capability if it's no longer relevant`});continue}for(let d of u){let f=String(d);o.has(f)?a.add(f):s.push({detector:ub,severity:"error",path:"spec/capabilities.yaml",message:`capability "${l}" references feature ${f} which does not exist in spec.yaml \u2014 either add the feature or remove it from this capability's features[]`})}}for(let c of o)a.has(c)||s.push({detector:ub,severity:"info",path:"spec.yaml",message:`feature ${c} is not claimed by any capability \u2014 if it's user-facing, consider adding it to a capability's features[] in spec/capabilities.yaml`});return s}var mK,ub,hK,gK=y(()=>{"use strict";mK=kt(or(),1);at();ub="CAPABILITIES_FEATURE_MAPPING";hK={name:ub,run:F0e}});import{existsSync as z0e,readFileSync as L0e}from"node:fs";import{join as U0e}from"node:path";function q0e(t){let e=t.trimStart();return e.startsWith("//")||e.startsWith("/*")}function B0e(t){let{cwd:e="."}=t;return pe(e,GI,r=>H0e(r,e))}function H0e(t,e){let r=bi(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=U0e(e,o);if(!z0e(s))continue;let a=L0e(s,"utf8");q0e(a)||n.push({detector:GI,severity:"warn",path:o,message:`${o} has no file-header comment \u2014 Why>What guardrail recommends a one-line intent`})}return n}var GI,yK,_K=y(()=>{"use strict";Hc();_t();GI="CONVENTION_DRIFT";yK={name:GI,run:B0e}});import{existsSync as VI,readFileSync as bK}from"node:fs";import{join as db}from"node:path";function Z0e(t){return JSON.parse(t).total?.lines?.pct??0}function vK(t){let e=/VI(db(c.dir,d)));if(!l){s.push(c.path);continue}let u=vK(bK(db(c.dir,l),"utf8"));u&&(n+=u.missed,i+=u.covered,o++)}if(o===0)return[{detector:no,severity:"info",message:`no module coverage report present for ${r.map(c=>c.path).join(", ")} \u2014 run stage_2.2 first`}];let a=SK(n,i);return a0?[{detector:no,severity:"info",message:`module coverage ${a.toFixed(1)}% OK; no report yet for ${s.join(", ")}`}]:[]}function W0e(t){let{cwd:e="."}=t;if(t.focusModules&&t.focusModules.length>0){let s=V0e(e,t.focusModules);if(s)return s}let r=bi(e),n=pt(e).language==="kotlin"?wI.find(s=>VI(db(e,s)))??oW(e):r.coverageSummary,i=db(e,n);if(!VI(i))return[{detector:no,severity:"info",message:`${n} not present \u2014 run stage_2.2 first`}];let o;try{let s=bK(i,"utf8");o=r.coverageFormat==="jacoco-xml"?G0e(s):Z0e(s)}catch(s){return[{detector:no,severity:"warn",message:`${n} unparseable: ${s.message}`}]}return o===null?[{detector:no,severity:"warn",message:`${n} contained no line-coverage counter`}]:o>=fb?[]:[{detector:no,severity:"warn",message:`line coverage ${o.toFixed(1)}% < floor ${fb}%`}]}var no,fb,wK,xK=y(()=>{"use strict";W_();Hc();Z_();yn();no="COVERAGE_DROP",fb=70;wK={name:no,run:W0e}});import{existsSync as K0e}from"node:fs";import{join as J0e}from"node:path";function Y0e(t){let{cwd:e="."}=t;return pe(e,pb,r=>X0e(r,e))}function X0e(t,e){let r=t.project.deliverable,n=t.features.filter(i=>i.status==="done"&&(i.modules?.length??0)>0);return r?K0e(J0e(e,r.path))?[]:[{detector:pb,severity:"error",path:r.path,message:`project.deliverable.path '${r.path}' is declared but does not exist on disk.`}]:n.length===0?[]:[{detector:pb,severity:"warn",message:`${n.length} done feature(s) ship modules but project.deliverable is not declared \u2014 the gate cannot smoke-test the shipped entry, so a broken entry point could ship green. Declare project.deliverable {path, is_safe_to_smoke: true} to enable DELIVERABLE_SMOKE (stage_2.4).`}]}var pb,$K,kK=y(()=>{"use strict";_t();pb="DELIVERABLE_INTEGRITY";$K={name:pb,run:Y0e}});function Q0e(t){let e=(t.features??[]).filter(i=>i.status==="done");return e.length===0?[]:!t.project?.deliverable?[]:(t.project?.smoke??[]).length>0?[]:[{detector:WI,severity:"warn",path:"spec.yaml",message:`${e.length} feature(s) are done and the project ships a runnable deliverable, but no functional smoke probe is declared (project.smoke) \u2014 an exit-only deliverable is liveness, not AC-verification. Declare a smoke probe with an expect.token so the gate re-executes the shipped entry against its AC result.`}]}function e$e(t){let{cwd:e="."}=t;return pe(e,WI,r=>Q0e(r))}var WI,EK,AK=y(()=>{"use strict";_t();WI="SMOKE_PROBE_DEMAND";EK={name:WI,run:e$e}});function t$e(t){let{cwd:e="."}=t;return pe(e,mb,r=>r$e(r,e))}function r$e(t,e){let r=(t.features??[]).filter(o=>o.status==="done"&&(o.modules??[]).length>0);if(r.length===0)return[];let n=wc(e);if(n===null)return[{detector:mb,severity:"info",path:"spec/attestation.yaml",message:"no verification attestation \u2014 when this tree was last verified is unknown. Run `clad check --tier=pre-push --strict` GREEN once to attest (the gate writes spec/attestation.yaml)."}];let i=[];for(let o of r){let s=n.get(o.id),a=Md(e,o.modules??[]);s!==a&&i.push({detector:mb,severity:"warn",path:"spec/attestation.yaml",message:s===void 0?`${o.id} is done but has no attestation entry \u2014 its modules were never verified by an attested gate. Run \`clad check --tier=pre-push --strict\` to attest.`:`${o.id}'s modules changed since the last attested verification \u2014 shipped code is running ahead of its verification. Run \`clad check --tier=pre-push --strict\` to re-verify and re-attest.`})}return i}var mb,hb,KI=y(()=>{"use strict";Fd();_t();mb="STALE_ATTESTATION";hb={name:mb,run:t$e}});function n$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}return i$e(r)}function i$e(t){let e=new Set(t.features.map(d=>d.id)),r=new Map;for(let d of t.features)r.set(d.id,(d.depends_on??[]).filter(f=>e.has(f)));let n=0,i=1,o=2,s=new Map;for(let d of r.keys())s.set(d,n);let a=[],c=new Set,l=[];function u(d){s.set(d,i),l.push(d);for(let f of r.get(d)??[]){let p=s.get(f);if(p===i){let m=l.indexOf(f),h=l.slice(m).concat(f),g=[...h].sort().join(",");c.has(g)||(c.add(g),a.push({detector:TK,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 TK,gb,JI=y(()=>{"use strict";at();TK="DEPENDENCY_CYCLE";gb={name:TK,run:n$e}});import{appendFileSync as o$e,existsSync as OK,mkdirSync as s$e,readFileSync as a$e}from"node:fs";import{dirname as c$e,join as l$e}from"node:path";function IK(t){return l$e(t,u$e,d$e)}function PK(t){return YI.add(t),()=>YI.delete(t)}function ua(t,e){let r=IK(t),n=c$e(r);OK(n)||s$e(n,{recursive:!0}),o$e(r,`${JSON.stringify(e)} +`,"utf8");for(let i of YI)try{i(t,e)}catch{}}function bn(t){let e=IK(t);if(!OK(e))return[];let r=a$e(e,"utf8").trim();return r.length===0?[]:r.split(` +`).filter(n=>n.length>0).map(n=>JSON.parse(n))}var u$e,d$e,YI,Hn=y(()=>{"use strict";u$e=".cladding",d$e="audit.log.jsonl";YI=new Set});import{existsSync as f$e}from"node:fs";import{join as p$e}from"node:path";function m$e(t){let{cwd:e="."}=t,r=bn(e);if(r.length===0)return[{detector:XI,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&&(f$e(p$e(e,i.artifact))||n.push({detector:XI,severity:"error",path:i.artifact,message:`evidence ${i.id} references missing artifact '${i.artifact}'`}));return n}var XI,RK,CK=y(()=>{"use strict";Hn();XI="EVIDENCE_MISMATCH";RK={name:XI,run:m$e}});import{existsSync as h$e,readFileSync as g$e}from"node:fs";import{join as y$e}from"node:path";function _$e(t){let e=y$e(t,MK);if(!h$e(e))return null;try{let n=((0,jK.parse)(g$e(e,"utf8"))?.fixtures??[]).map(i=>i.name).filter(Boolean);return new Set(n)}catch{return null}}function*NK(t,e){for(let r of t??[])r.startsWith(DK)&&(yield{ref:r,name:r.slice(DK.length),field:e})}function b$e(t){let{cwd:e="."}=t,r=_$e(e);if(r===null)return[];let n;try{n=Y(e)}catch(o){return[{detector:QI,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=[...NK(s.evidence_refs,"evidence_refs"),...NK(s.test_refs,"test_refs")];for(let{ref:c,name:l,field:u}of a)r.has(l)||i.push({detector:QI,severity:"warn",path:MK,message:`${o.id}.${s.id} cites '${c}' in ${u} but no fixture named '${l}' is registered in conformance/fixtures.yaml`})}return i}var jK,QI,DK,MK,FK,zK=y(()=>{"use strict";jK=kt(or(),1);at();QI="FIXTURE_REFERENCE_INVALID",DK="fixture:",MK="conformance/fixtures.yaml";FK={name:QI,run:b$e}});import{resolve as v$e}from"node:path";function S$e(t){let{cwd:e="."}=t,r=pt(e),n=r.gates.secret;return n?X_(`secret:${v$e(e)}:${n.cmd}:${n.args.join(" ")}`,()=>{let i=et(n.cmd,[...n.args],{cwd:e,reject:!1});return cf(i)?[{detector:yb,severity:"info",message:`secret scanner '${n.cmd}' not installed`}]:J_(i,yb,o=>`${n.cmd} reported secrets: ${o}`,o=>`${n.cmd} could not scan (config/setup gap, not a secret): ${o}`)}):[{detector:yb,severity:"info",message:`no secret scanner registered for language '${r.language}'`}]}var yb,_b,eP=y(()=>{"use strict";Ir();yn();_n();Q_();yb="HARDCODED_SECRET";_b={name:yb,run:S$e}});import{existsSync as Wc,readFileSync as tP}from"node:fs";import{join as da}from"node:path";function w$e(t){return Vo(["src/stages/detectors/*.ts"],{cwd:t,dot:!1}).filter(r=>!/[/\\](index|with-spec)\.ts$/.test(r)).length}function gf(t){if(!Wc(t))return null;try{return JSON.parse(tP(t,"utf8"))}catch{return null}}function x$e(t,e){let r=da(t,"plugins","claude-code",".claude-plugin","plugin.json"),n;try{n=JSON.parse(tP(r,"utf8"))}catch(c){e.push({detector:io,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:io,severity:"warn",message:`plugin.json current.detectors='${i}' is not in 'N/M' form`});return}let s=Number(o[1]),a=w$e(t);s!==a&&e.push({detector:io,severity:"error",message:`plugin.json current.detectors='${i}' but stages/detectors/contains ${a} non-index .ts file(s)`})}function $$e(t,e){for(let r of LK){let n=da(t,r.path);if(!Wc(n))continue;let i=gf(n);if(!i){e.push({detector:io,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:io,severity:"error",message:`${r.host}: ${r.path} is missing required field '${String(o)}'`})}}function k$e(t,e){let r=gf(da(t,"package.json"));if(!r?.version)return;let n=r.version;for(let o of LK){let s=da(t,o.path);if(!Wc(s))continue;let a=gf(s);a?.version&&a.version!==n&&e.push({detector:io,severity:"error",message:`${o.host}: ${o.path} version='${a.version}' but package.json version='${n}' \u2014 bump them in lockstep`})}let i=da(t,".claude-plugin","marketplace.json");if(Wc(i)){let o=gf(i);for(let s of o?.plugins??[])s?.version&&s.version!==n&&e.push({detector:io,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 E$e(t){let e=t.match(/TIER_STAGES[\s\S]*?\ball:\s*\[([^\]]*)\]/);return e?[...e[1].matchAll(/['"]([^'"]+)['"]/g)].map(r=>r[1]):[]}function A$e(t,e){let r=da(t,"src","cli","clad.ts"),n=da(t,"plugins","claude-code",".claude-plugin","plugin.json");if(!Wc(r)||!Wc(n))return;let i=E$e(tP(r,"utf8"));if(i.length===0)return;let s=gf(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:io,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 T$e(t){let{cwd:e="."}=t,r=[];return x$e(e,r),A$e(e,r),$$e(e,r),k$e(e,r),r}var io,LK,UK,qK=y(()=>{"use strict";hf();io="HARNESS_INTEGRITY",LK=[{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"]}];UK={name:io,run:T$e}});import{existsSync as O$e,readFileSync as I$e}from"node:fs";import{join as P$e}from"node:path";function C$e(t){let{cwd:e="."}=t;return pe(e,bb,r=>j$e(r,e))}function D$e(){return R$e}function N$e(t){let e=P$e(t,"spec/capabilities.yaml");if(!O$e(e))return!1;try{let r=BK.default.parse(I$e(e,"utf8"));if(!r||typeof r!="object")return!1;let n=r.capabilities;return!Array.isArray(n)||n.length===0}catch{return!1}}function j$e(t,e){let r=t.features.length;if(r{"use strict";BK=kt(or(),1);_t();bb="HOLLOW_GOVERNANCE",R$e=8;HK={name:bb,run:C$e}});function M$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=[];return GK(r.features.map(i=>i.id),"feature","spec/features/",n),GK((r.scenarios??[]).map(i=>i.id),"scenario","spec/scenarios/",n),n}function GK(t,e,r,n){let i=new Map;for(let o of t)i.set(o,(i.get(o)??0)+1);for(let[o,s]of i)s>1&&n.push({detector:VK,severity:"error",message:`${e} id '${o}' appears ${s} times across ${r} \u2014 every ${e} must have a unique id; resolve the duplicate`})}var VK,WK,KK=y(()=>{"use strict";at();VK="ID_COLLISION";WK={name:VK,run:M$e}});import{existsSync as yf,readFileSync as rP,readdirSync as nP,statSync as F$e,writeFileSync as YK}from"node:fs";import{join as oo}from"node:path";function JK(t){if(!yf(t))return 0;try{return nP(t).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).length}catch{return 0}}function z$e(t){if(!yf(t))return 0;let e=0,r=[t];for(;r.length>0;){let n=r.pop(),i;try{i=nP(n)}catch{continue}for(let o of i){if(o==="node_modules"||o===".cladding"||o.startsWith("."))continue;let s=oo(n,o),a;try{a=F$e(s)}catch{continue}a.isDirectory()?r.push(s):(o.endsWith(".test.ts")||o.endsWith(".test.tsx"))&&e++}}return e}function L$e(t){let e=oo(t,"spec","capabilities.yaml");if(!yf(e))return 0;try{let r=vb.default.parse(rP(e,"utf8"));return Array.isArray(r?.capabilities)?r.capabilities.length:0}catch{return 0}}function Wo(t="."){let e=JK(oo(t,"spec","features")),r=JK(oo(t,"spec","scenarios")),n=L$e(t),i=z$e(oo(t,"tests")),o=new Date().toISOString().slice(0,10);return{features:e,scenarios:r,capabilities:n,test_files:i,last_synced:o}}function Kc(t,e){let r=oo(t,"spec.yaml");if(!yf(r))return;let n=rP(r,"utf8"),i=U$e(n,e);i!==n&&YK(r,i)}function U$e(t,e){let r=t.includes(`\r `)?`\r `:` `,n=t.split(/\r?\n/),i=n.findIndex(d=>/^inventory:\s*$/.test(d)),o=["# Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand.","inventory:",` features: ${e.features??0}`,` scenarios: ${e.scenarios??0}`,` capabilities: ${e.capabilities??0}`,` test_files: ${e.test_files??0}`,` last_synced: ${JSON.stringify(e.last_synced??"")}`],s=d=>r===`\r @@ -249,20 +249,20 @@ ${o.join(` `)}let a=i;a>0&&/Auto-maintained by `clad sync`/.test(n[a-1])&&(a-=1);let c=i+1;for(;ci+1);)c++;let l=n.slice(0,a),u=n.slice(c);for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();return l.push(""),s([...l,...o,"",...u.filter((d,f)=>!(f===0&&d.trim()===""))].join(` `).replace(/\n{3,}/g,` -`))}function fa(t="."){let e=oo(t,"spec","features");if(!yf(e))return!1;let r=[];for(let i of QI(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,yb.parse)(XI(oo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` +`))}function fa(t="."){let e=oo(t,"spec","features");if(!yf(e))return!1;let r=[];for(let i of nP(e).sort())if(!(!i.endsWith(".yaml")&&!i.endsWith(".yml")))try{let o=(0,vb.parse)(rP(oo(e,i),"utf8"));if(!o?.id)continue;let s=o.slug??i.replace(/\.(ya?ml)$/,"");r.push(` ${o.id}: {slug: ${s}, status: ${o.status??"planned"}, modules: ${(o.modules??[]).length}}`)}catch{continue}r.sort();let n="# Cladding \xB7 Tier C \u2014 generated feature index (`clad sync`). Do not edit by hand.\n# One line per feature \u2192 1-file lookup + line-independent merges\n# (suggested .gitattributes: `spec/index.yaml merge=union`).\nfeatures:\n"+r.join(` `)+` -`;return VK(oo(t,"spec","index.yaml"),n,"utf8"),!0}var yb,_f=y(()=>{"use strict";yb=kt(or(),1)});import{existsSync as WK,readFileSync as KK,readdirSync as j$e}from"node:fs";import{join as eP}from"node:path";function M$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=Wo(e),i=r.inventory;if(!i){let s=JK.filter(([c])=>(n[c]??0)>0);if(s.length===0)return tP(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...tP(e),{detector:bf,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of JK){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:bf,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...tP(e)),o}function tP(t){let e=eP(t,"spec","index.yaml"),r=eP(t,"spec","features");if(!WK(e)||!WK(r))return[];let n=new Map;try{for(let l of KK(e,"utf8").split(` -`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of j$e(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=KK(eP(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:bf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:bf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var bf,JK,YK,XK=y(()=>{"use strict";_f();at();bf="INVENTORY_DRIFT",JK=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];YK={name:bf,run:M$e}});import{existsSync as F$e,readFileSync as z$e}from"node:fs";import{join as L$e}from"node:path";function q$e(t){let{cwd:e="."}=t,r=L$e(e,"src","spec","schema.json"),n=[];if(F$e(r)){let i;try{i=JSON.parse(z$e(r,"utf8"))}catch(o){n.push({detector:vf,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of U$e)i.required?.includes(o)||n.push({detector:vf,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:vf,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=Y(e);i.schema!==QK&&n.push({detector:vf,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${QK}'`})}catch{}return n}var vf,U$e,QK,e3,t3=y(()=>{"use strict";at();vf="META_INTEGRITY",U$e=["schema","project","features"],QK="0.1";e3={name:vf,run:q$e}});function B$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=[];return r3(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),r3((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function r3(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:n3,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var n3,i3,o3=y(()=>{"use strict";at();n3="SLUG_CONFLICT";i3={name:n3,run:B$e}});import{existsSync as H$e}from"node:fs";import{join as Z$e}from"node:path";function G$e(t){let{cwd:e="."}=t;return pe(e,rP,r=>V$e(r,e))}function V$e(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=Z$e(e,i);H$e(o)||r.push({detector:rP,severity:"error",path:i,message:`feature ${n.id} declares module '${i}' but the file does not exist`})}return r}var rP,_b,nP=y(()=>{"use strict";_t();rP="MISSING_IMPLEMENTATION";_b={name:rP,run:G$e}});function W$e(t){let{cwd:e="."}=t;return pe(e,iP,K$e)}function K$e(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:iP,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var iP,bb,oP=y(()=>{"use strict";_t();iP="MISSING_TESTS";bb={name:iP,run:W$e}});import{existsSync as J$e,readFileSync as Y$e}from"node:fs";import{join as s3}from"node:path";function a3(t){if(J$e(t))try{return JSON.parse(Y$e(t,"utf8"))}catch{return}}function tke(t){let{cwd:e="."}=t,r=a3(s3(e,X$e)),n=a3(s3(e,Q$e));if(!r||!n)return[{detector:sP,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>eke&&i.push({detector:sP,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var sP,X$e,Q$e,eke,c3,l3=y(()=>{"use strict";sP="PERFORMANCE_DRIFT",X$e="perf/baseline.json",Q$e="perf/current.json",eke=10;c3={name:sP,run:tke}});import{existsSync as rke}from"node:fs";import{join as nke}from"node:path";function oke(t){let{cwd:e="."}=t;return pe(e,aP,r=>cke(r,e))}function ske(){return ike}function ake(t,e){return(t.modules??[]).some(r=>rke(nke(e,r)))}function cke(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||ake(s,e)||r.push(s.id);let n=ske();if(r.length<=n)return[];let i=r.slice(0,u3).join(", "),o=r.length>u3?", \u2026":"";return[{detector:aP,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var aP,ike,u3,d3,f3=y(()=>{"use strict";_t();aP="PLANNED_BACKLOG",ike=5,u3=8;d3={name:aP,run:oke}});import{existsSync as lke,readFileSync as uke}from"node:fs";import{join as dke}from"node:path";function mke(t){let{cwd:e="."}=t;return pe(e,cP,r=>gke(r,e))}function hke(){return fke}function gke(t,e){if(t.features.lengthn.includes(i))?[{detector:cP,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Refine it with \`clad refine\` or by hand.`}]:[]}var cP,fke,pke,p3,m3=y(()=>{"use strict";_t();cP="PROJECT_CONTEXT_DRIFT",fke=8,pke=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];p3={name:cP,run:mke}});function h3(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:vb,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function yke(t){let{cwd:e="."}=t;return pe(e,vb,_ke)}function _ke(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...h3(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:vb,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...h3(e,n.features,`scenario ${n.id}.features`));return r}var vb,Sb,lP=y(()=>{"use strict";_t();vb="REFERENCE_INTEGRITY";Sb={name:vb,run:yke}});function wb(t=""){return new RegExp(bke,t)}var bke,uP=y(()=>{"use strict";bke=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as vke,readdirSync as Ske,readFileSync as wke,statSync as xke,writeFileSync as $ke}from"node:fs";import{dirname as kke,join as Sf,normalize as Eke,relative as Ake}from"node:path";function Pke(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function g3(t){return t.split("\\").join("/")}function Rke(t){return Tke.some(e=>t===e||t.startsWith(`${e}/`))}function Cke(t){let e=Sf(t,"docs");if(!vke(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Ske(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Sf(i,s),c;try{c=xke(a)}catch{continue}let l=g3(Ake(t,a));Rke(l)||(c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l))}}return r.sort()}function Dke(t,e){if(/^[a-z]+:/i.test(e))return null;let r=Eke(Sf(kke(t),e));return g3(r)}function wf(t="."){let e=[];for(let r of Cke(t)){let n;try{n=wke(Sf(t,r),"utf8")}catch{continue}let i=n.includes(Oke),o=Pke(n),s=i?[]:[...new Set(o.match(wb("g"))??[])].sort(),a=new Set;for(let c of o.matchAll(Ike)){let l=Dke(r,c[1]);l&&a.add(l)}e.push({doc:r,features:s,doc_links:[...a].sort()})}return{docs:e}}function y3(t="."){let e=wf(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return $ke(Sf(t,"spec","_doc-links.yaml"),`${r.join(` +`;return YK(oo(t,"spec","index.yaml"),n,"utf8"),!0}var vb,_f=y(()=>{"use strict";vb=kt(or(),1)});import{existsSync as XK,readFileSync as QK,readdirSync as q$e}from"node:fs";import{join as iP}from"node:path";function B$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=Wo(e),i=r.inventory;if(!i){let s=e3.filter(([c])=>(n[c]??0)>0);if(s.length===0)return oP(e);let a=s.map(([c,l])=>`${n[c]??0} ${l}`).join(", ");return[...oP(e),{detector:bf,severity:"warn",path:"spec.yaml",message:`spec.yaml has no inventory: block, but the project has ${a} on disk \u2014 run \`clad sync\` to record the inventory so anyone reading spec.yaml sees its real scale.`}]}let o=[];for(let[s,a]of e3){let c=i[s]??0,l=n[s]??0;c!==l&&o.push({detector:bf,severity:"error",path:"spec.yaml",message:`spec.yaml inventory.${s} declares ${c} but the project has ${l} ${a} on disk \u2014 run \`clad sync\` (a stale inventory hides created/deleted shards from anyone reading spec.yaml).`})}return o.push(...oP(e)),o}function oP(t){let e=iP(t,"spec","index.yaml"),r=iP(t,"spec","features");if(!XK(e)||!XK(r))return[];let n=new Map;try{for(let l of QK(e,"utf8").split(` +`)){let u=l.match(/^ (F-[\w-]+):.*\bstatus:\s*['"]?([\w-]+)['"]?/);if(u){n.set(u[1],u[2]);continue}let d=l.match(/^ (F-[\w-]+):/);d&&n.set(d[1],"planned")}}catch{return[]}let i=new Map;try{for(let l of q$e(r)){if(!l.endsWith(".yaml")&&!l.endsWith(".yml"))continue;let u=QK(iP(r,l),"utf8"),d=u.match(/^id:\s*['"]?(F-[\w-]+)['"]?/m);if(!d)continue;let f=u.match(/^status:\s*['"]?([\w-]+)['"]?/m);i.set(d[1],f?f[1]:"planned")}}catch{return[]}let o=[],s=[...i.keys()].filter(l=>!n.has(l)).sort(),a=[...n.keys()].filter(l=>!i.has(l)).sort();if(s.length>0||a.length>0){let l=[];s.length>0&&l.push(`missing from index: ${s.join(", ")}`),a.length>0&&l.push(`in index but not on disk: ${a.join(", ")}`),o.push({detector:bf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml disagrees with spec/features/ (${l.join("; ")}) \u2014 run \`clad sync\` to regenerate (a stale index silently misleads agents that trust it for lookup).`})}let c=[...i.keys()].filter(l=>n.has(l)&&n.get(l)!==i.get(l)).sort().map(l=>`${l} (index: ${n.get(l)}, shard: ${i.get(l)})`);return c.length>0&&o.push({detector:bf,severity:"error",path:"spec/index.yaml",message:`spec/index.yaml status disagrees with spec/features/ for ${c.join("; ")} \u2014 run \`clad sync\` to regenerate (a stale status silently misleads agents that trust the index).`}),o}var bf,e3,t3,r3=y(()=>{"use strict";_f();at();bf="INVENTORY_DRIFT",e3=[["features","feature shard(s)"],["scenarios","scenario shard(s)"],["capabilities","capabilit(ies)"],["test_files","test file(s)"]];t3={name:bf,run:B$e}});import{existsSync as H$e,readFileSync as Z$e}from"node:fs";import{join as G$e}from"node:path";function W$e(t){let{cwd:e="."}=t,r=G$e(e,"src","spec","schema.json"),n=[];if(H$e(r)){let i;try{i=JSON.parse(Z$e(r,"utf8"))}catch(o){n.push({detector:vf,severity:"error",message:`spec/schema.json unreadable or invalid JSON: ${o.message}`})}if(i)for(let o of V$e)i.required?.includes(o)||n.push({detector:vf,severity:"error",message:`spec/schema.json does not require root key '${o}'`}),i.properties?.[o]||n.push({detector:vf,severity:"error",message:`spec/schema.json does not declare property '${o}'`})}try{let i=Y(e);i.schema!==n3&&n.push({detector:vf,severity:"error",message:`spec.yaml schema='${i.schema}' but supported version is '${n3}'`})}catch{}return n}var vf,V$e,n3,i3,o3=y(()=>{"use strict";at();vf="META_INTEGRITY",V$e=["schema","project","features"],n3="0.1";i3={name:vf,run:W$e}});function K$e(t){let{cwd:e="."}=t,r;try{r=Y(e)}catch{return[]}let n=[];return s3(r.features.map(i=>({id:i.id,slug:i.slug})),"features",n),s3((r.scenarios??[]).map(i=>({id:i.id,slug:i.slug})),"scenarios",n),n}function s3(t,e,r){let n=new Map;for(let i of t){if(!i.slug)continue;let o=n.get(i.slug);o?r.push({detector:a3,severity:"error",message:`slug '${i.slug}' is used by both ${o} and ${i.id} in ${e}/ \u2014 two items in the same namespace cannot share a slug; pick a different slug for one`}):n.set(i.slug,i.id)}}var a3,c3,l3=y(()=>{"use strict";at();a3="SLUG_CONFLICT";c3={name:a3,run:K$e}});import{existsSync as J$e}from"node:fs";import{join as Y$e}from"node:path";function X$e(t){let{cwd:e="."}=t;return pe(e,sP,r=>Q$e(r,e))}function Q$e(t,e){let r=[];for(let n of t.features)for(let i of n.modules??[]){let o=Y$e(e,i);J$e(o)||r.push({detector:sP,severity:"error",path:i,message:`feature ${n.id} declares module '${i}' but the file does not exist`})}return r}var sP,Sb,aP=y(()=>{"use strict";_t();sP="MISSING_IMPLEMENTATION";Sb={name:sP,run:X$e}});function eke(t){let{cwd:e="."}=t;return pe(e,cP,tke)}function tke(t){let e=[];for(let r of t.features)if(r.status==="done")for(let n of r.acceptance_criteria??[]){let o=(n.test_refs??[]).filter(c=>!c.startsWith("derived:")).length>0,s=(n.evidence_refs?.length??0)>0,a=!o&&!s&&(n.test_refs?.length??0)>0;!o&&!s&&e.push({detector:cP,severity:"error",message:`${r.id}.${n.id} declares no test_refs or evidence_refs \u2014 AC is unverified`+(a?" (a 'derived:' candidate exists \u2014 confirm it by removing the prefix, or author a real ref)":"")})}return e}var cP,wb,lP=y(()=>{"use strict";_t();cP="MISSING_TESTS";wb={name:cP,run:eke}});import{existsSync as rke,readFileSync as nke}from"node:fs";import{join as u3}from"node:path";function d3(t){if(rke(t))try{return JSON.parse(nke(t,"utf8"))}catch{return}}function ake(t){let{cwd:e="."}=t,r=d3(u3(e,ike)),n=d3(u3(e,oke));if(!r||!n)return[{detector:uP,severity:"info",message:"perf baseline or current missing \u2014 run stage_3.2 with --record first"}];let i=[];for(let[o,s]of Object.entries(r.metrics??{})){let a=n.metrics?.[o];if(!a||typeof s.value!="number"||typeof a.value!="number"||s.value===0)continue;let c=(a.value-s.value)/s.value*100;c>ske&&i.push({detector:uP,severity:"warn",message:`${o} regressed ${c.toFixed(1)}% (baseline ${s.value}${s.unit??""} \u2192 current ${a.value}${a.unit??""})`})}return i}var uP,ike,oke,ske,f3,p3=y(()=>{"use strict";uP="PERFORMANCE_DRIFT",ike="perf/baseline.json",oke="perf/current.json",ske=10;f3={name:uP,run:ake}});import{existsSync as cke}from"node:fs";import{join as lke}from"node:path";function dke(t){let{cwd:e="."}=t;return pe(e,dP,r=>mke(r,e))}function fke(){return uke}function pke(t,e){return(t.modules??[]).some(r=>cke(lke(e,r)))}function mke(t,e){let r=[];for(let s of t.features)s.status!=="planned"&&s.status!=="in_progress"||pke(s,e)||r.push(s.id);let n=fke();if(r.length<=n)return[];let i=r.slice(0,m3).join(", "),o=r.length>m3?", \u2026":"";return[{detector:dP,severity:"warn",message:`${r.length} planned/in_progress features have NO code on disk (> ${n} tolerated) \u2014 the spec has raced ahead of the code. Work one feature end-to-end before authoring the next (docs/feature-cycle.md). Stalled: ${i}${o}`}]}var dP,uke,m3,h3,g3=y(()=>{"use strict";_t();dP="PLANNED_BACKLOG",uke=5,m3=8;h3={name:dP,run:dke}});import{existsSync as hke,readFileSync as gke}from"node:fs";import{join as yke}from"node:path";function vke(t){let{cwd:e="."}=t;return pe(e,fP,r=>wke(r,e))}function Ske(){return _ke}function wke(t,e){if(t.features.lengthn.includes(i))?[{detector:fP,severity:"warn",path:"docs/project-context.md",message:`${t.features.length} features but docs/project-context.md is still the unrefined init template (it still carries the placeholder prompts) \u2014 the Why/What/Purpose narrative was never filled in. Refine it with \`clad refine\` or by hand.`}]:[]}var fP,_ke,bke,y3,_3=y(()=>{"use strict";_t();fP="PROJECT_CONTEXT_DRIFT",_ke=8,bke=["Refine by hand or re-run with LLM available","What gap or pain led to this project","What does success look like"];y3={name:fP,run:vke}});function b3(t,e,r){return e?e.filter(n=>!t.has(n)).map(n=>({detector:xb,severity:"error",message:`${r} references unknown id '${n}'`})):[]}function xke(t){let{cwd:e="."}=t;return pe(e,xb,$ke)}function $ke(t){let e=new Set(t.features.map(n=>n.id)),r=[];for(let n of t.features)r.push(...b3(e,n.depends_on,`feature ${n.id}.depends_on`)),n.superseded_by&&!e.has(n.superseded_by)&&r.push({detector:xb,severity:"error",message:`feature ${n.id}.superseded_by references unknown id '${n.superseded_by}'`});for(let n of t.scenarios??[])r.push(...b3(e,n.features,`scenario ${n.id}.features`));return r}var xb,$b,pP=y(()=>{"use strict";_t();xb="REFERENCE_INTEGRITY";$b={name:xb,run:xke}});function kb(t=""){return new RegExp(kke,t)}var kke,mP=y(()=>{"use strict";kke=String.raw`\bF-(?:\d{3,}|[0-9a-f]{6,8})\b`});import{existsSync as Eke,readdirSync as Ake,readFileSync as Tke,statSync as Oke,writeFileSync as Ike}from"node:fs";import{dirname as Pke,join as Sf,normalize as Rke,relative as Cke}from"node:path";function Mke(t){return t.replace(/```[\s\S]*?```/g," ").replace(/~~~[\s\S]*?~~~/g," ").replace(/`[^`\n]*`/g," ")}function v3(t){return t.split("\\").join("/")}function Fke(t){return Dke.some(e=>t===e||t.startsWith(`${e}/`))}function zke(t){let e=Sf(t,"docs");if(!Eke(e))return[];let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Ake(i)}catch{continue}for(let s of o){if(s.startsWith("."))continue;let a=Sf(i,s),c;try{c=Oke(a)}catch{continue}let l=v3(Cke(t,a));Fke(l)||(c.isDirectory()?n.push(a):s.endsWith(".md")&&r.push(l))}}return r.sort()}function Lke(t,e){if(/^[a-z]+:/i.test(e))return null;let r=Rke(Sf(Pke(t),e));return v3(r)}function wf(t="."){let e=[];for(let r of zke(t)){let n;try{n=Tke(Sf(t,r),"utf8")}catch{continue}let i=n.includes(Nke),o=Mke(n),s=i?[]:[...new Set(o.match(kb("g"))??[])].sort(),a=new Set;for(let c of o.matchAll(jke)){let l=Lke(r,c[1]);l&&a.add(l)}e.push({doc:r,features:s,doc_links:[...a].sort()})}return{docs:e}}function S3(t="."){let e=wf(t);if(e.docs.length===0)return!1;let r=["# Cladding \xB7 Tier C \u2014 generated doc\u2192spec / doc\u2192doc link index (`clad sync`). Do not edit by hand.","# Source of truth is the docs themselves; DOC_LINK_INTEGRITY validates resolution.",'schema: "0.1"',"docs:"];for(let n of e.docs)n.features.length===0&&n.doc_links.length===0||(r.push(` ${JSON.stringify(n.doc)}:`),n.features.length>0&&r.push(` features: [${n.features.join(", ")}]`),n.doc_links.length>0&&r.push(` doc_links: [${n.doc_links.map(i=>JSON.stringify(i)).join(", ")}]`));return Ike(Sf(t,"spec","_doc-links.yaml"),`${r.join(` `)} -`,"utf8"),!0}var Tke,Oke,Ike,xb=y(()=>{"use strict";uP();Tke=["docs/ab-evaluation","docs/ab-evaluation-extended","docs/dogfood","docs/benchmarks"],Oke="clad-doc-links: ignore",Ike=/\]\(\s*([^)\s]+?\.md)(?:#[^)]*)?\s*\)/g});import{existsSync as Nke}from"node:fs";import{join as jke}from"node:path";function Mke(t){let{cwd:e="."}=t;return pe(e,$b,r=>Fke(r,e))}function Fke(t,e){let r=new Set((t.features??[]).map(i=>i.id)),n=[];for(let i of wf(e).docs){for(let o of i.doc_links)Nke(jke(e,o))||n.push({detector:$b,severity:"error",path:i.doc,message:`doc '${i.doc}' links to missing file '${o}'`});for(let o of i.features)r.has(o)||n.push({detector:$b,severity:"warn",path:i.doc,message:`doc '${i.doc}' references unknown feature '${o}' \u2014 archived/renamed? If it is an illustrative example, add a \`clad-doc-links: ignore\` marker to the doc.`})}return n}var $b,kb,dP=y(()=>{"use strict";xb();_t();$b="DOC_LINK_INTEGRITY";kb={name:$b,run:Mke}});function Lke(t){let{cwd:e="."}=t;return pe(e,xf,r=>qke(r))}function Uke(){return zke}function qke(t){let e=[],r=t.features.length,n=t.scenarios??[];r>=Uke()&&n.length===0&&e.push({detector:xf,severity:"warn",path:"spec/scenarios/",message:`${r} features but no scenarios declared \u2014 cross-feature user-journey flows are not captured. Author at least one with \`clad_create_scenario\`.`});for(let o of n)(o.features??[]).length===0&&e.push({detector:xf,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} binds no features (features: []) \u2014 a scenario must cover at least one feature's flow, or it should be removed.`});let i=new Map(t.features.filter(o=>typeof o.slug=="string"&&o.slug.length>0).map(o=>[o.slug,o.id]));for(let o of n){if(!o.flow)continue;let s=new Set(o.features??[]),a=new Map;for(let c of o.flow.matchAll(/\(([^)]+)\)/g))for(let l of c[1].split(/[,/·]/)){let u=l.trim(),d=i.get(u);d&&!s.has(d)&&a.set(u,d)}if(a.size>0){let c=[...a].map(([l,u])=>`${l} (${u})`).join(", ");e.push({detector:xf,severity:"warn",path:"spec/scenarios/",message:`scenario ${o.id} flow references ${c} but features[] does not bind ${a.size===1?"it":"them"} \u2014 bind every feature the flow walks, or trim the flow so coverage is not under-stated.`})}}return e}var xf,zke,_3,b3=y(()=>{"use strict";_t();xf="SCENARIO_COVERAGE",zke=8;_3={name:xf,run:Lke}});import{createHash as Bke}from"node:crypto";function Hke(t){return!Number.isFinite(t)||t<=0?0:t>=1?1:t}function $f(t,e=0){if(t.oracle_policy){let r=t.oracle_policy;return{mandateActive:!0,reportOnly:!1,exhaustive:!1,alwaysEars:new Set(r.always_ears??v3),sample:Hke(r.sample??0)}}return t.require_oracles===!0?{mandateActive:!0,reportOnly:!1,exhaustive:!0,alwaysEars:new Set,sample:1}:t.require_oracles===void 0&&e>=8?{mandateActive:!0,reportOnly:!0,exhaustive:!1,alwaysEars:new Set(v3),sample:0}:{mandateActive:!1,reportOnly:!1,exhaustive:!1,alwaysEars:new Set,sample:0}}function kf(t){return(t.features??[]).filter(e=>e.status==="done").length}function Zke(t,e){return e<=0?!1:e>=1?!0:parseInt(Bke("sha256").update(t).digest("hex").slice(0,8),16)%1e40})}return r}var v3,Eb=y(()=>{"use strict";v3=["unwanted"]});import{existsSync as Gke,readdirSync as Vke}from"node:fs";import{join as w3}from"node:path";import x3 from"node:process";function Wke(t){let e=!1,r=n=>{for(let i of Vke(n,{withFileTypes:!0})){if(e)return;let o=w3(n,i.name);i.isDirectory()?r(o):(/\.(test|spec)\.[cm]?[jt]sx?$/.test(i.name)||/_test\.py$/.test(i.name))&&(e=!0)}};try{r(t)}catch{}return e}function fP(t={}){let{cwd:e="."}=t,r=w3(e,Ko);if(!Gke(r)||!Wke(r))return{stage:Ab,pass:!1,exitCode:2,stderr:`no spec-conformance oracles under ${Ko}/ \u2014 skipped`};let n=pt(e),i=n.gates.test;if(!i?.cmd||!i.args)return{stage:Ab,pass:!1,exitCode:2,stderr:`no test runner registered for language '${n.language}'`};let o=et(i.cmd,[...i.args,Ko],{cwd:e,reject:!1}),s=zt(Ab,i.cmd,o);return s||sr(Ab,o)}var Ab,Ko,Kke,pP=y(()=>{"use strict";Ir();yn();_n();Ab="stage_2.3",Ko="tests/oracle";Kke=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${x3.argv[1]}`;if(Kke){let t=fP();console.log(JSON.stringify(t)),x3.exit(t.exitCode)}});import{existsSync as Jke}from"node:fs";import{join as Yke}from"node:path";function Xke(t){let{cwd:e="."}=t;return pe(e,Zn,r=>Qke(r,e))}function Qke(t,e){let r=[],n=$f(t.project,kf(t)),i=n.reportOnly?"info":"error",o=n.mandateActive?bn(e):[],s=o.filter(l=>l.kind==="oracle"),a=new Set(["agent:developer","agent:specialists"]),c=l=>o.find(u=>u.featureId===l&&a.has(u.stage))?.identity.name;for(let l of t.features)if(l.status==="done")for(let u of l.acceptance_criteria??[]){let d=u.oracle_refs??[];if(Ef(n,l.id,u)&&d.length===0){let f=n.exhaustive?"project.require_oracles is set":u.ears&&n.alwaysEars.has(u.ears)?`oracle_policy.always_ears includes '${u.ears}'`:"selected by oracle_policy.sample";r.push({detector:Zn,severity:i,message:`${l.id}.${u.id} done AC lacks a spec-conformance oracle (${f}; declare oracle_refs under ${Ko}/)`+(n.reportOnly?" [report-only \u2014 the graduated default enforces in 0.7]":"")})}for(let f of d){if(!Jke(Yke(e,f))){r.push({detector:Zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' resolves to nothing on disk`});continue}if(f.startsWith(`${Ko}/`)||r.push({detector:Zn,severity:"warn",path:f,message:`${l.id}.${u.id} oracle_ref '${f}' lives outside ${Ko}/ \u2014 stage_2.3 only runs ${Ko}/, so this oracle will not execute`}),!n.mandateActive)continue;let p=s.find(g=>g.featureId===l.id&&g.acId===u.id&&g.artifact===f);if(!p){r.push({detector:Zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' has no authoring-provenance record \u2014 author it via 'clad oracle' (or clad_author_oracle) so impl-blindness can be verified`});continue}let m=c(l.id);m&&p.identity.name===m?r.push({detector:Zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: authored by the implementer ('${m}')`}):m||r.push({detector:Zn,severity:"info",message:`${l.id}.${u.id} oracle author\u2260implementer not verified \u2014 no implementer identity recorded (no clad drive history to compare)`});let h=(p.readManifest??[]).filter(g=>(l.modules??[]).includes(g));h.length>0&&r.push({detector:Zn,severity:"error",path:f,message:`${l.id}.${u.id} oracle '${f}' is NOT impl-blind: author read implementation file(s) the feature owns (${h.join(", ")})`}),p.blind===!1&&r.push({detector:Zn,severity:"info",message:`${l.id}.${u.id} oracle '${f}' provenance is self-reported (host-protocol), not cladding-controlled \u2014 manifest checked, blindness unproven`})}}if(n.mandateActive&&!n.exhaustive){let l=t.features.filter(u=>u.status==="done").flatMap(u=>u.acceptance_criteria??[]).filter(u=>!u.ears).length;l>0&&r.push({detector:Zn,severity:"info",message:`${l} done AC(s) carry no EARS tag and are invisible to the risk-weighted oracle mandate \u2014 tag them (ubiquitous/event/state/optional/unwanted/complex) for the mandate to mean anything.`})}return r}var Zn,$3,k3=y(()=>{"use strict";Hn();Eb();pP();_t();Zn="SPEC_CONFORMANCE";$3={name:Zn,run:Xke}});function eEe(t){let{cwd:e="."}=t,r=bn(e);if(r.length===0)return[{detector:mP,severity:"info",message:"no audit log present \u2014 detector is opt-in on prior stage_4 runs"}];let n=Date.now(),i=[];for(let o of r){let s=Date.parse(o.identity.timestamp);if(Number.isNaN(s))continue;let a=(n-s)/(1e3*60*60*24);a>E3&&i.push({detector:mP,severity:"warn",message:`evidence ${o.id} is ${Math.round(a)} days old (floor ${E3})`})}return i}var mP,E3,A3,T3=y(()=>{"use strict";Hn();mP="STALE_EVIDENCE",E3=90;A3={name:mP,run:eEe}});import{existsSync as O3}from"node:fs";import{join as I3}from"node:path";function tEe(t){let{cwd:e="."}=t;return pe(e,Jc,r=>rEe(r,e))}function rEe(t,e){let r=[];for(let n of t.features){if(n.archived_at&&n.status!=="archived"&&r.push({detector:Jc,severity:"warn",message:`feature ${n.id} has archived_at but status='${n.status}' (expected 'archived')`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`archived_at already set but status is '${n.status}'`}}}),n.superseded_by&&!n.archived_at&&r.push({detector:Jc,severity:"warn",message:`feature ${n.id} has superseded_by but no archived_at`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:`superseded by ${n.superseded_by} but missing archived_at`}}}),n.status==="archived"){let i=(n.modules??[]).filter(o=>O3(I3(e,o)));i.length>0&&r.push({detector:Jc,severity:"warn",message:`feature ${n.id} is archived but ${i.length} module(s) still exist: ${i.join(", ")}`})}(n.status==="planned"||n.status==="in_progress")&&(n.modules?.length??0)>0&&!(n.modules??[]).some(i=>O3(I3(e,i)))&&r.push({detector:Jc,severity:"warn",message:`feature ${n.id} (status='${n.status}') declares ${n.modules?.length??0} module(s) but none exist on disk \u2014 consider archiving`,suggestion:{action:"propose-archive",args:{featureId:n.id,reason:"all declared modules vanished from disk"}}})}return r}var Jc,Tb,hP=y(()=>{"use strict";_t();Jc="STALE_SPECIFICATION";Tb={name:Jc,run:tEe}});import{existsSync as P3,statSync as R3}from"node:fs";import{join as C3}from"node:path";function iEe(t,e){let r=0;for(let n of e){let i=C3(t,n);if(!P3(i))continue;let o=R3(i).mtimeMs;o>r&&(r=o)}return r}function oEe(t){let{cwd:e="."}=t;return pe(e,gP,r=>sEe(r,e))}function sEe(t,e){let r=bi(e,t.project?.language),n=t.features.flatMap(a=>a.modules??[]),i=iEe(e,n);if(i===0)return[];let o=Vo([...r.testGlobs],{cwd:e,dot:!1});if(o.length===0)return[];let s=[];for(let a of o){let c=C3(e,a);if(!P3(c))continue;let l=R3(c).mtimeMs,u=(i-l)/(1e3*60*60*24);u>nEe&&s.push({detector:gP,severity:"warn",path:a,message:`${a} is ${Math.round(u)} days older than newest source module`})}return s}var gP,nEe,Ob,yP=y(()=>{"use strict";hf();Hc();_t();gP="STALE_TESTS",nEe=30;Ob={name:gP,run:oEe}});import{existsSync as aEe}from"node:fs";import{join as cEe}from"node:path";function lEe(t){let{cwd:e="."}=t;return pe(e,Af,r=>uEe(r,e))}function uEe(t,e){let r=[];for(let n of t.features){let i=n.modules??[],o=n.acceptance_criteria??[];if(n.status==="done"&&i.length===0&&o.length===0){r.push({detector:Af,severity:"error",message:`feature ${n.id} status='done' but declares no modules and no acceptance_criteria \u2014 nothing to verify (hollow completion)`});continue}if(i.length===0)continue;let s=i.filter(a=>!aEe(cEe(e,a)));s.length!==0&&(n.status==="done"?r.push({detector:Af,severity:"error",message:`feature ${n.id} status='done' but ${s.length}/${i.length} module(s) missing: ${s.join(", ")}`}):n.status==="in_progress"&&s.length===i.length&&r.push({detector:Af,severity:"warn",message:`feature ${n.id} status='in_progress' but every declared module is missing \u2014 likely a stale start`}))}return r}var Af,Ib,_P=y(()=>{"use strict";_t();Af="STATUS_DRIFT";Ib={name:Af,run:lEe}});function dEe(t){let{cwd:e="."}=t;return pe(e,Pb,r=>fEe(r,e))}function fEe(t,e){let r=pt(e).language;return r==="unknown"?[{detector:Pb,severity:"info",message:"no manifest matched \u2014 language cannot be cross-checked"}]:t.project.language===r?[]:[{detector:Pb,severity:"warn",message:`spec.project.language='${t.project.language}' but the manifest chain detects '${r}'`}]}var Pb,D3,N3=y(()=>{"use strict";yn();_t();Pb="TECH_STACK_MISMATCH";D3={name:Pb,run:dEe}});function gEe(t){if((t.features??[]).length`${i}/${o}/**/*.${n}`)}function yEe(t){let{cwd:e="."}=t;return pe(e,bP,r=>_Ee(r,e))}function _Ee(t,e){let r=new Set;for(let o of t.features)for(let s of o.modules??[])r.add(s);let n=Vo([...gEe(t)],{cwd:e,dot:!1}),i=[];for(let o of n)r.has(o)||i.push({detector:bP,severity:"error",path:o,message:`file '${o}' is not claimed by any feature in spec.yaml`});return i}var bP,j3,pEe,mEe,hEe,Rb,vP=y(()=>{"use strict";hf();UI();_t();bP="UNMAPPED_ARTIFACT",j3=["src/stages/**/*.ts","src/spec/**/*.ts"],pEe={typescript:"ts",javascript:"js",python:"py",rust:"rs",go:"go",kotlin:"kt"},mEe={kotlin:"src/main/kotlin"},hEe=8;Rb={name:bP,run:yEe}});import{existsSync as M3}from"node:fs";import{join as F3}from"node:path";function vEe(t){return bEe.some(e=>t.startsWith(e))}function SEe(t){let{cwd:e="."}=t;return pe(e,SP,r=>wEe(r,e))}function wEe(t,e){let r=[];for(let n of t.features)if(n.status==="done")for(let i of n.acceptance_criteria??[])for(let o of i.test_refs??[]){if(vEe(o))continue;let s=o.split("#",1)[0];M3(F3(e,o))||s&&M3(F3(e,s))||r.push({detector:SP,severity:"error",path:o,message:`${n.id}.${i.id} test_ref '${o}' resolves to nothing on disk \u2014 a test_ref must be a real file path (e.g. 'tests/x.test.ts', optionally with a '#' anchor) or a 'self-dogfood: +`}function tw(t){return`${JSON.stringify(t,null,2)} +`}function gX(t){let e=new Map(t.nodes.map(s=>[s.id,s])),r=new Map,n=new Map;for(let s of t.edges)(r.get(s.from)??r.set(s.from,[]).get(s.from)).push({other:s.to,kind:s.kind}),(n.get(s.to)??n.set(s.to,[]).get(s.to)).push({other:s.from,kind:s.kind});let i=s=>{let a=e.get(s);return a?`[[${fX(a)}|${a.label.replace(/[[\]|]/g," ")}]]`:`[[${s.replace(/[[\]|]/g," ")}]]`},o=new Map;for(let s of t.nodes){let a=["---",`kind: ${s.kind}`,...s.tier?[`tier: ${s.tier}`]:[],...s.status?[`status: ${s.status}`]:[],`id: ${JSON.stringify(s.id)}`,"---",`# ${s.label}`,""],c=(r.get(s.id)??[]).slice().sort(pX);if(c.length>0){a.push("## Links");for(let u of c)a.push(`- ${u.kind} \u2192 ${i(u.other)}`);a.push("")}let l=(n.get(s.id)??[]).slice().sort(pX);if(l.length>0){a.push("## Backlinks");for(let u of l)a.push(`- ${i(u.other)} \u2192 ${u.kind}`);a.push("")}o.set(`${s.kind}/${fX(s)}.md`,`${a.join(` +`)}`)}return o}function pX(t,e){return t.kind.localeCompare(e.kind)||t.other.localeCompare(e.other)}import{readFileSync as PNe}from"node:fs";import{dirname as RNe,join as uD}from"node:path";import{fileURLToPath as CNe}from"node:url";var dD=RNe(CNe(import.meta.url));function yX(t){for(let e of[uD(dD,"viewer",t),uD(dD,"..","graph","viewer",t),uD(dD,"..","..","dist","viewer",t)])try{return PNe(e,"utf8")}catch{}throw new Error(`cladding: viewer asset not found: ${t}`)}function _X(t){return JSON.stringify(t).replace(/0?` `:"";return` @@ -701,19 +701,19 @@ ${r} ${o} -`}GI();dP();nP();oP();lP();ZI();yP();_P();vP();wP();Fp();uP();at();var TNe=[bb,Cb,_b,Rb,Sb,kb,pb,Ib,Ob,fb];function ONe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[Le.module(n),Le.test(n),Le.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=wb().exec(t.message??"");return r&&e.has(Le.feature(r[0]))?[Le.feature(r[0])]:[]}function ew(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ks(e,Y(e))}catch{}try{for(let o of TNe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of ONe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ks(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}cD();at();zo();var PNe=new Set(["mermaid","dot","json","obsidian","html"]);function gX(t={}){try{let e=t.format??"mermaid";if(!PNe.has(e)){B("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=Y(),i=Pa(n,".");if(t.focus){let s=WS(n,i,t.focus);if(s.length===0){B("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){B("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=VS(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=fX(i);for(let[c,l]of a){let u=INe(s,c);lD(dD(u),{recursive:!0}),uD(u,l,"utf8")}B("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){B("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=QS(i,ew(i,"."));lD(dD(t.out),{recursive:!0}),uD(t.out,s,"utf8"),B("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?dX(i):r==="json"?XS(i):uX(i);t.out?(lD(dD(t.out),{recursive:!0}),uD(t.out,o,"utf8"),B("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){B("fail","graph",e.message),process.exit(1)}}function yX(){try{let t=Pa(Y(),".");process.stdout.write(hX(tw(t)),()=>process.exit(0))}catch(t){B("fail","graph",t.message),process.exit(1)}}Fp();import{createServer as RNe}from"node:http";import{existsSync as CNe,watch as DNe}from"node:fs";import{join as NNe}from"node:path";at();zo();function jNe(t={}){let e=t.cwd??".",r=new Set,n=()=>Pa(Y(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh +`}JI();hP();aP();lP();pP();KI();SP();wP();$P();EP();Fp();mP();at();var DNe=[wb,jb,Sb,Nb,$b,Tb,gb,Cb,Rb,hb];function NNe(t,e){if(t.path){let n=t.path.split("#")[0].trim(),i=[Le.module(n),Le.test(n),Le.doc(n)].filter(o=>e.has(o));if(i.length>0)return i}let r=kb().exec(t.message??"");return r&&e.has(Le.feature(r[0]))?[Le.feature(r[0])]:[]}function nw(t,e="."){let r=new Set(t.nodes.map(o=>o.id)),n={};try{Ks(e,Y(e))}catch{}try{for(let o of DNe){let s=[];try{s=o.run({cwd:e})}catch{continue}for(let a of s)if(!(a.severity!=="error"&&a.severity!=="warn"))for(let c of NNe(a,r)){let l=n[c]??(n[c]={severity:"warn",count:0,detectors:new Set});l.count+=1,l.detectors.add(a.detector),a.severity==="error"&&(l.severity="error")}}}finally{Ks(e,null)}let i={};for(let o of Object.keys(n).sort()){let s=n[o];i[o]={severity:s.severity,count:s.count,detectors:[...s.detectors].sort()}}return i}fD();at();zo();var MNe=new Set(["mermaid","dot","json","obsidian","html"]);function vX(t={}){try{let e=t.format??"mermaid";if(!MNe.has(e)){B("fail","graph",`unknown --format '${e}' \u2014 use mermaid | dot | json | obsidian | html`),process.exit(1);return}let r=e,n=Y(),i=Pa(n,".");if(t.focus){let s=YS(n,i,t.focus);if(s.length===0){B("fail","graph",`no node matches '${t.focus}' \u2014 try a feature id (F-\u2026), slug, or module path`),process.exit(1);return}let a=t.depth!==void 0?Number(t.depth):1/0;if(Number.isNaN(a)||a<0){B("fail","graph",`--depth must be a non-negative number, got '${t.depth}'`),process.exit(1);return}i=JS(i,s,a)}if(r==="obsidian"){let s=t.out??".cladding/graph",a=gX(i);for(let[c,l]of a){let u=jNe(s,c);pD(hD(u),{recursive:!0}),mD(u,l,"utf8")}B("pass","graph",`wrote ${a.size} note(s) to ${s} \u2014 open it as an Obsidian vault`),process.exit(0);return}if(r==="html"){if(!t.out){B("fail","graph","--format html requires --out (a single self-contained .html file)"),process.exit(1);return}let s=rw(i,nw(i,"."));pD(hD(t.out),{recursive:!0}),mD(t.out,s,"utf8"),B("pass","graph",`wrote a self-contained viewer to ${t.out} \u2014 open it in a browser (offline)`),process.exit(0);return}let o=r==="dot"?hX(i):r==="json"?tw(i):mX(i);t.out?(pD(hD(t.out),{recursive:!0}),mD(t.out,o,"utf8"),B("pass","graph",`wrote ${r} graph to ${t.out}`),process.exit(0)):process.stdout.write(o,()=>process.exit(0))}catch(e){B("fail","graph",e.message),process.exit(1)}}function SX(){try{let t=Pa(Y(),".");process.stdout.write(bX(iw(t)),()=>process.exit(0))}catch(t){B("fail","graph",t.message),process.exit(1)}}Fp();import{createServer as FNe}from"node:http";import{existsSync as zNe,watch as LNe}from"node:fs";import{join as UNe}from"node:path";at();zo();function qNe(t={}){let e=t.cwd??".",r=new Set,n=()=>Pa(Y(e),e),i=()=>{for(let u of r)try{u.write(`data: refresh -`)}catch{r.delete(u)}},o=RNe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=XS(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(ew(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected +`)}catch{r.delete(u)}},o=FNe((u,d)=>{let f=(u.url??"/").split("?")[0],p=(u.headers.host??"").split(":")[0];if(p&&p!=="localhost"&&p!=="127.0.0.1"&&p!=="[::1]"&&p!=="::1"){d.writeHead(403,{"Content-Type":"text/plain"}),d.end("forbidden host");return}try{if(f==="/graph.json"){let m=tw(n());d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/health.json"){let m=JSON.stringify(nw(n(),e));d.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"}),d.end(m);return}if(f==="/events"){d.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),d.write(`: connected -`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=QS(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=NNe(e,u);if(CNe(d))try{let f=DNe(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 +`),r.add(d),u.on("close",()=>r.delete(d));return}if(f==="/"||f==="/index.html"){let m=rw(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=UNe(e,u);if(zNe(d))try{let f=LNe(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 _X(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await jNe({port:e,cwd:t.cwd??"."});B("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){B("fail","graph",r.message),process.exit(1)}}var MNe=["stage_1.1","stage_2.1","stage_2.3"];function FNe(t){return(t.features??[]).filter(e=>e.status==="done")}function zNe(t,e){let r=FNe(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 bX(t,e){let r=[];for(let n of MNe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=zNe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}Q_();import vX from"node:process";function LNe(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 rw(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=LNe(n,t);i.pass||r.push(i)}return r}Hn();var fD="stage_4.1";function pD(t={}){let{cwd:e="."}=t,r=bn(e);if(r.length===0)return{stage:fD,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=rw(r);if(n.length===0)return{stage:fD,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:fD,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var UNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${vX.argv[1]}`;if(UNe){let t=pD();console.log(JSON.stringify(t)),vX.exit(t.exitCode)}Ir();import SX from"node:process";var nw="stage_1.4";function mD(t={}){let{cwd:e="."}=t,r;try{r=et("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:nw,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:nw,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:nw,pass:!0,exitCode:0}:{stage:nw,pass:!1,exitCode:1,stderr:`working tree dirty: -${n}`}}var qNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${SX.argv[1]}`;if(qNe){let t=mD();console.log(JSON.stringify(t)),SX.exit(t.exitCode)}Ir();zp();_n();import wX from"node:process";var iw="stage_2.2";function hD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=as("coverage",t))}catch(a){return{stage:iw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:iw,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=et(r,[...n],{cwd:e,reject:!1}),s=zt(iw,r,o);return s||sr(iw,o)}var ZNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${wX.argv[1]}`;if(ZNe){let t=hD();console.log(JSON.stringify(t)),wX.exit(t.exitCode)}Nb();gD();Ir();yn();_n();import $X from"node:process";var sw="stage_3.2";function yD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:sw,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:sw,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(sw,i,s);return a||sr(sw,s)}var VNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${$X.argv[1]}`;if(VNe){let t=yD();console.log(JSON.stringify(t)),$X.exit(t.exitCode)}Ir();at();_n();import{existsSync as WNe}from"node:fs";import{resolve as kX}from"node:path";import EX from"node:process";var Wt="stage_2.4",AX=5e3;function _D(t={}){let{cwd:e="."}=t,r,n=[],i=!1;try{let f=Y(e);r=f.project.deliverable,n=f.project.smoke??[],i=f.features.some(p=>p.status==="done")}catch{return{stage:Wt,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return KNe(e,n[0],i);if(!r)return{stage:Wt,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:Wt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:Wt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let o=kX(e,r.path);if(!WNe(o))return{stage:Wt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let s=r.timeout_ms??AX,a;try{a=et(o,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:s})}catch(f){a=f}let c=zt(Wt,r.path,a);if(c)return c;if(a.timedOut)return{stage:Wt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${s}ms (hung or too slow)`};let l=r.expect_exit??0,u=a.exitCode??1;if(u===l)return{stage:Wt,pass:!0,exitCode:0,disposition:"liveness"};let d=String(a.stderr??"").trim()||String(a.stdout??"").trim();return{stage:Wt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${u}, expected ${l}${d?` \u2014 ${d.slice(0,200)}`:""}`}}function KNe(t,e,r){if(e.kind==="none")return{stage:Wt,pass:!0,exitCode:0,disposition:"na"};if(!r)return{stage:Wt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 smoke probe skipped"};let n=e.run??[];if(n.length===0)return{stage:Wt,pass:!1,exitCode:2,stderr:"cli smoke probe has no run argv \u2014 skipped"};let[i,...o]=n,s=i.startsWith(".")||i.startsWith("/")?kX(t,i):i,a=AX,c;try{c=et(s,[...o],{cwd:t,reject:!1,timeout:a})}catch(p){c=p}let l=zt(Wt,i,c);if(l)return l;if(c.timedOut)return{stage:Wt,pass:!1,exitCode:1,stderr:`smoke probe '${n.join(" ")}' timed out after ${a}ms`};let u=e.expect?.exit??0,d=c.exitCode??1;if(d!==u){let p=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:Wt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe exited ${d}, expected ${u}${p?` \u2014 ${p.slice(0,200)}`:""}`}}let f=e.expect?.token;return f?String(c.stdout??"").includes(f)?{stage:Wt,pass:!0,exitCode:0,disposition:"pass"}:{stage:Wt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe ran (exit ${d}) but stdout did not contain the AC token ${JSON.stringify(f)}`}:{stage:Wt,pass:!0,exitCode:0,disposition:"liveness"}}var JNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${EX.argv[1]}`;if(JNe){let t=_D();console.log(JSON.stringify(t)),EX.exit(t.exitCode)}Ir();yn();_n();import TX from"node:process";var aw="stage_3.1";function bD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:aw,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:aw,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(aw,i,s);return a||sr(aw,s)}var YNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${TX.argv[1]}`;if(YNe){let t=bD();console.log(JSON.stringify(t)),TX.exit(t.exitCode)}pP();vD();SD();Ir();zp();_n();import PX from"node:process";var uw="stage_2.1";function wD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=as("test",t))}catch(a){return{stage:uw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:uw,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${i}'`};let o=et(r,[...n],{cwd:e,reject:!1}),s=zt(uw,r,o);return s||sr(uw,o)}var eje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${PX.argv[1]}`;if(eje){let t=wD();console.log(JSON.stringify(t)),PX.exit(t.exitCode)}Ir();yn();_n();import RX from"node:process";var dw="stage_3.3";function xD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:dw,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:dw,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(dw,i,s);return a||sr(dw,s)}var tje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${RX.argv[1]}`;if(tje){let t=xD();console.log(JSON.stringify(t)),RX.exit(t.exitCode)}var rje=new Set(["fail","pending_env","advisory"]);function Ra(t){return rje.has(t)}function CX(t){return t.disposition??(t.pass?"pass":t.exitCode===2?"skip":"fail")}function DX(t,e){return Ra(e)?t.disposition?1:t.exitCode:0}hP();kD();AD();_f();xb();var BX=kt(or(),1);import{existsSync as TD,readFileSync as bje,readdirSync as qX,statSync as vje,writeFileSync as Sje}from"node:fs";import{basename as Bp,join as Hp,relative as UX}from"node:path";var wje=["self-dogfood:","fixture:","derived:"],HX=/\.(test|spec)\.[jt]sx?$/;function ZX(t,e=t,r=[]){let n;try{n=qX(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=Hp(e,i);try{vje(o).isDirectory()?ZX(t,o,r):HX.test(i)&&r.push(o)}catch{continue}}return r}function GX(t="."){let e=Hp(t,"spec","features"),r=Hp(t,"tests"),n=[],i=[];if(!TD(e)||!TD(r))return{repaired:n,suggested:i};let o=ZX(r),s=new Map;for(let a of o){let c=UX(t,a).split("\\").join("/"),l=s.get(Bp(a))??[];l.push(c),s.set(Bp(a),l)}for(let a of qX(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=Hp(e,a),l,u;try{l=bje(c,"utf8"),u=(0,BX.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(wje.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(TD(Hp(t,b)))continue;let _=s.get(Bp(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=>Bp(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>UX(t,h).split("\\").join("/")).find(h=>{let g=Bp(h).replace(HX,"");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 +`)}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 wX(t={}){let e=t.port!==void 0?Number(t.port):3e3;try{let r=await qNe({port:e,cwd:t.cwd??"."});B("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){B("fail","graph",r.message),process.exit(1)}}var BNe=["stage_1.1","stage_2.1","stage_2.3"];function HNe(t){return(t.features??[]).filter(e=>e.status==="done")}function ZNe(t,e){let r=HNe(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 xX(t,e){let r=[];for(let n of BNe){if(!e.some(s=>s.stage===n&&s.status==="skip"))continue;let o=ZNe(t,n);o&&r.push({stage:n,label:"Verification",message:o})}return r}rb();import $X from"node:process";function GNe(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 ow(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=GNe(n,t);i.pass||r.push(i)}return r}Hn();var gD="stage_4.1";function yD(t={}){let{cwd:e="."}=t,r=bn(e);if(r.length===0)return{stage:gD,pass:!1,exitCode:2,stderr:"no audit log present \u2014 record evidence before running stage_4.1"};let n=ow(r);if(n.length===0)return{stage:gD,pass:!0,exitCode:0};let i=n.map(o=>`${o.acId}: ${o.reason}`).join("; ");return{stage:gD,pass:!1,exitCode:1,stderr:`anti-self-cert guard: ${i}`}}var VNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${$X.argv[1]}`;if(VNe){let t=yD();console.log(JSON.stringify(t)),$X.exit(t.exitCode)}Ir();import kX from"node:process";var sw="stage_1.4";function _D(t={}){let{cwd:e="."}=t,r;try{r=et("git",["status","--porcelain"],{cwd:e,reject:!1})}catch(i){if(i.code==="ENOENT")return{stage:sw,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:sw,pass:!1,exitCode:2,stderr:i}}let n=(r.stdout??"").toString().trim();return n.length===0?{stage:sw,pass:!0,exitCode:0}:{stage:sw,pass:!1,exitCode:1,stderr:`working tree dirty: +${n}`}}var WNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${kX.argv[1]}`;if(WNe){let t=_D();console.log(JSON.stringify(t)),kX.exit(t.exitCode)}Ir();zp();_n();import EX from"node:process";var aw="stage_2.2";function bD(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=as("coverage",t))}catch(a){return{stage:aw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:aw,pass:!1,exitCode:2,stderr:`no coverage runner registered for language '${i}'`};let o=et(r,[...n],{cwd:e,reject:!1}),s=zt(aw,r,o);return s||sr(aw,o)}var YNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${EX.argv[1]}`;if(YNe){let t=bD();console.log(JSON.stringify(t)),EX.exit(t.exitCode)}Fb();Q_();vD();Ir();yn();_n();import TX from"node:process";var lw="stage_3.2";function SD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.perf,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:lw,pass:!1,exitCode:2,stderr:`no perf runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:lw,pass:!1,exitCode:2,stderr:"perf npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(lw,i,s);return a||sr(lw,s)}var QNe=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${TX.argv[1]}`;if(QNe){let t=SD();console.log(JSON.stringify(t)),TX.exit(t.exitCode)}Ir();at();_n();import{existsSync as eje}from"node:fs";import{resolve as OX}from"node:path";import IX from"node:process";var Wt="stage_2.4",PX=5e3;function wD(t={}){let{cwd:e="."}=t,r,n=[],i=!1;try{let f=Y(e);r=f.project.deliverable,n=f.project.smoke??[],i=f.features.some(p=>p.status==="done")}catch{return{stage:Wt,pass:!1,exitCode:2,stderr:"spec.yaml not loaded \u2014 deliverable smoke skipped"}}if(n.length>0)return tje(e,n[0],i);if(!r)return{stage:Wt,pass:!1,exitCode:2,stderr:"no project.deliverable declared \u2014 skipped"};if(r.is_safe_to_smoke!==!0)return{stage:Wt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not marked is_safe_to_smoke \u2014 skipped`};if(!i)return{stage:Wt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 deliverable smoke skipped"};let o=OX(e,r.path);if(!eje(o))return{stage:Wt,pass:!1,exitCode:2,stderr:`deliverable '${r.path}' not found \u2014 see DELIVERABLE_INTEGRITY`};let s=r.timeout_ms??PX,a;try{a=et(o,[...r.smoke_args??[]],{cwd:e,reject:!1,timeout:s})}catch(f){a=f}let c=zt(Wt,r.path,a);if(c)return c;if(a.timedOut)return{stage:Wt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' timed out after ${s}ms (hung or too slow)`};let l=r.expect_exit??0,u=a.exitCode??1;if(u===l)return{stage:Wt,pass:!0,exitCode:0,disposition:"liveness"};let d=String(a.stderr??"").trim()||String(a.stdout??"").trim();return{stage:Wt,pass:!1,exitCode:1,stderr:`deliverable '${r.path}' exited ${u}, expected ${l}${d?` \u2014 ${d.slice(0,200)}`:""}`}}function tje(t,e,r){if(e.kind==="none")return{stage:Wt,pass:!0,exitCode:0,disposition:"na"};if(!r)return{stage:Wt,pass:!1,exitCode:2,stderr:"no done feature yet \u2014 smoke probe skipped"};let n=e.run??[];if(n.length===0)return{stage:Wt,pass:!1,exitCode:2,stderr:"cli smoke probe has no run argv \u2014 skipped"};let[i,...o]=n,s=i.startsWith(".")||i.startsWith("/")?OX(t,i):i,a=PX,c;try{c=et(s,[...o],{cwd:t,reject:!1,timeout:a})}catch(p){c=p}let l=zt(Wt,i,c);if(l)return l;if(c.timedOut)return{stage:Wt,pass:!1,exitCode:1,stderr:`smoke probe '${n.join(" ")}' timed out after ${a}ms`};let u=e.expect?.exit??0,d=c.exitCode??1;if(d!==u){let p=String(c.stderr??"").trim()||String(c.stdout??"").trim();return{stage:Wt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe exited ${d}, expected ${u}${p?` \u2014 ${p.slice(0,200)}`:""}`}}let f=e.expect?.token;return f?String(c.stdout??"").includes(f)?{stage:Wt,pass:!0,exitCode:0,disposition:"pass"}:{stage:Wt,pass:!1,exitCode:1,disposition:"fail",stderr:`smoke probe ran (exit ${d}) but stdout did not contain the AC token ${JSON.stringify(f)}`}:{stage:Wt,pass:!0,exitCode:0,disposition:"liveness"}}var rje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${IX.argv[1]}`;if(rje){let t=wD();console.log(JSON.stringify(t)),IX.exit(t.exitCode)}Ir();yn();_n();import RX from"node:process";var uw="stage_3.1";function xD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.smoke,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:uw,pass:!1,exitCode:2,stderr:`no smoke runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:uw,pass:!1,exitCode:2,stderr:"smoke npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(uw,i,s);return a||sr(uw,s)}var nje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${RX.argv[1]}`;if(nje){let t=xD();console.log(JSON.stringify(t)),RX.exit(t.exitCode)}yP();$D();kD();Ir();zp();_n();import NX from"node:process";var pw="stage_2.1";function ED(t={}){let{cwd:e="."}=t,r,n,i;try{({cmd:r,args:n,language:i}=as("test",t))}catch(a){return{stage:pw,pass:!1,exitCode:1,stderr:a.message}}if(!r||!n)return{stage:pw,pass:!1,exitCode:2,stderr:`no unit test runner registered for language '${i}'`};let o=et(r,[...n],{cwd:e,reject:!1}),s=zt(pw,r,o);return s||sr(pw,o)}var sje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${NX.argv[1]}`;if(sje){let t=ED();console.log(JSON.stringify(t)),NX.exit(t.exitCode)}Ir();yn();_n();import jX from"node:process";var mw="stage_3.3";function AD(t={}){let{cwd:e="."}=t,r=pt(e),n=r.gates.visual,i=t.cmd??n?.cmd,o=t.args??n?.args;if(!i||!o)return{stage:mw,pass:!1,exitCode:2,stderr:`no visual runner registered for language '${r.language}'`};if(i==="npm"&&o[0]==="run"&&!Bc(e,o[o.length-1]))return{stage:mw,pass:!1,exitCode:2,stderr:"visual npm script not defined"};let s=et(i,[...o],{cwd:e,reject:!1}),a=zt(mw,i,s);return a||sr(mw,s)}var aje=!globalThis.__CLADDING_BUNDLED&&import.meta.url===`file://${jX.argv[1]}`;if(aje){let t=AD();console.log(JSON.stringify(t)),jX.exit(t.exitCode)}var cje=new Set(["fail","pending_env","advisory"]);function Ra(t){return cje.has(t)}function MX(t){return t.disposition??(t.pass?"pass":t.exitCode===2?"skip":"fail")}function FX(t,e){return Ra(e)?t.disposition?1:t.exitCode:0}bP();OD();PD();_f();Eb();var VX=kt(or(),1);import{existsSync as RD,readFileSync as kje,readdirSync as GX,statSync as Eje,writeFileSync as Aje}from"node:fs";import{basename as Bp,join as Hp,relative as ZX}from"node:path";var Tje=["self-dogfood:","fixture:","derived:"],WX=/\.(test|spec)\.[jt]sx?$/;function KX(t,e=t,r=[]){let n;try{n=GX(e)}catch{return r}for(let i of n){if(i.startsWith("."))continue;let o=Hp(e,i);try{Eje(o).isDirectory()?KX(t,o,r):WX.test(i)&&r.push(o)}catch{continue}}return r}function JX(t="."){let e=Hp(t,"spec","features"),r=Hp(t,"tests"),n=[],i=[];if(!RD(e)||!RD(r))return{repaired:n,suggested:i};let o=KX(r),s=new Map;for(let a of o){let c=ZX(t,a).split("\\").join("/"),l=s.get(Bp(a))??[];l.push(c),s.set(Bp(a),l)}for(let a of GX(e)){if(!a.endsWith(".yaml")&&!a.endsWith(".yml"))continue;let c=Hp(e,a),l,u;try{l=kje(c,"utf8"),u=(0,VX.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(Tje.some(x=>g.startsWith(x)))continue;let b=g.split("#",1)[0];if(RD(Hp(t,b)))continue;let _=s.get(Bp(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=>Bp(h).replace(/\.[jt]sx?$/,"")),m=o.map(h=>ZX(t,h).split("\\").join("/")).find(h=>{let g=Bp(h).replace(WX,"");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&&Sje(c,l,"utf8")}return{repaired:n,suggested:i}}Fd();import{existsSync as xje,readFileSync as $je}from"node:fs";import{join as kje}from"node:path";function Eje(t,e){let r=kje(t,e);if(!xje(r))return[];let n=[];for(let i of $je(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 VX(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=>Eje(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 WX(t){let e=[];e.push(`# Spec-conformance oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` -`)}Eb();at();zo();Hn();Fd();var Aje={ALL_FEATURES_DONE:"All work complete.",MAX_ITERATIONS:"Stopped \u2014 reached the iteration limit.",WALL_CLOCK:"Stopped \u2014 exceeded the time budget.",BUDGET_EXCEEDED:"Stopped \u2014 budget exhausted.",BLOCKED_FEATURE:"Stopped \u2014 a feature is blocked by dependencies.",RETRY_THRESHOLD:"Stopped \u2014 a feature failed too many times.",GATE_NO_PROGRESS:"Stopped \u2014 gates are not making progress.",HUMAN_REQUIRED:"Paused \u2014 needs human sign-off.",TRANSPORT_AUTH_FAILED:"Stopped \u2014 agent rejected the credentials. Check your API key.",TRANSPORT_RATE_LIMITED:"Stopped \u2014 agent is rate-limited. Try again after the cooldown.",TRANSPORT_NETWORK:"Stopped \u2014 could not reach the agent over the network.",LLM_UNAVAILABLE:"Stopped \u2014 could not reach the agent.",UNCAUGHT_ERROR:"Stopped \u2014 unexpected error."},Tje={"stage_1.1":"Type","stage_1.2":"Lint","stage_1.3":"Drift","stage_1.4":"Commit","stage_1.5":"Architecture","stage_1.6":"Secret","stage_2.1":"Unit tests","stage_2.2":"Coverage","stage_2.3":"Spec conformance","stage_2.4":"Deliverable smoke","stage_3.1":"Smoke","stage_3.2":"Performance","stage_3.3":"Visual","stage_4.1":"Audit","stage_4.2":"UAT"};function OD(t,e){let r=e.features.find(n=>n.id===t);return r&&r.title?r.title:t}function KX(t,e){let r=Aje[t.class]??"Stopped.",n=Oje(t.detail,e);return n?`${r} ${n}`:r}function _w(t){return Tje[t]??t}function Oje(t,e){return t?t.replace(/\bF-\d{3,}\b/g,r=>{let n=OD(r,e);return n===r?r:`"${n}"`}):""}var JX=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"];function Ije(t,e,r){if(e.startsWith("stage_4")){let n=bn(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return rw(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function Pje(t,e,r){let n=t.modules??[];if(t.status!=="done"||n.length===0)return"\xB7";if(e===null)return"-";let i=e.get(t.id);return i===void 0?"!":i===Md(r,n)?"\u2713":"!"}function YX(t,e=".",r={}){let n=r.internal??!1,i=wc(e),o=[...JX.map(l=>n?l.replace("stage_",""):Rje(l)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,c=t.features.map(l=>({featureId:l.id,title:l.title||l.id,cells:[...JX.map(u=>Ije(l,u,e)),Pje(l,i,e)]})).map(l=>{let u=l.cells.join(" ");return n?`${l.featureId.padEnd(12)} ${u} ${l.title}`:`${l.title.padEnd(35).slice(0,35)} ${u}`});return[s,...c].join(` -`)}function Rje(t){return _w(t).slice(0,3)}async function HZe(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(Qse(),Xse)),Promise.resolve().then(()=>(iae(),nae)),Promise.resolve().then(()=>(Nf(),QJ))]),i=e({cwd:t.cwd});n(i.server);let o=new r;K.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} -`),await i.connect(o)}async function ZZe(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await WY({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});for(let o of n.created)B("pass",`created ${o}`);for(let o of n.skipped)B("skip",o);for(let o of n.proposals??[])B("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(B("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){K.stdout.write(` +${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&Aje(c,l,"utf8")}return{repaired:n,suggested:i}}Fd();import{existsSync as Oje,readFileSync as Ije}from"node:fs";import{join as Pje}from"node:path";function Rje(t,e){let r=Pje(t,e);if(!Oje(r))return[];let n=[];for(let i of Ije(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 YX(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=>Rje(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 XX(t){let e=[];e.push(`# Spec-conformance oracle brief \u2014 ${t.featureId}: ${t.featureTitle}`),e.push("#"),e.push("# Author a conformance TEST SUITE from THIS SPECIFICATION ONLY. You have NOT been"),e.push("# shown the implementation and MUST NOT read it. Assert ONLY what the acceptance"),e.push("# criteria literally require; when the spec is silent on an edge, write a WEAKER"),e.push("# assertion, not a stronger guess (an over-strict oracle falsely fails correct code)."),e.push(""),e.push("## Acceptance criteria (the spec)");for(let r of t.acs)e.push(`- ${r.id}${r.ears?` [${r.ears}]`:""}: ${r.text??""}`.trimEnd()),r.condition&&e.push(` when: ${r.condition}`),r.action&&e.push(` system shall: ${r.action}`),r.response&&e.push(` so that: ${r.response}`);e.push(""),e.push("## Public surface to call (signatures only \u2014 NO implementation shown)"),t.signatures.length===0&&e.push(" (no export signatures extracted \u2014 call the API exactly as the criteria describe)");for(let r of t.signatures)e.push(` ${r}`);return e.push(""),e.push("## Write the suite under tests/oracle/ (the dir stage_2.3 runs), then record it with"),e.push("## the clad_author_oracle MCP tool so its impl-blind provenance is gate-verified."),e.join(` +`)}Ob();at();zo();Hn();Fd();var Cje={ALL_FEATURES_DONE:"All work complete.",MAX_ITERATIONS:"Stopped \u2014 reached the iteration limit.",WALL_CLOCK:"Stopped \u2014 exceeded the time budget.",BUDGET_EXCEEDED:"Stopped \u2014 budget exhausted.",BLOCKED_FEATURE:"Stopped \u2014 a feature is blocked by dependencies.",RETRY_THRESHOLD:"Stopped \u2014 a feature failed too many times.",GATE_NO_PROGRESS:"Stopped \u2014 gates are not making progress.",HUMAN_REQUIRED:"Paused \u2014 needs human sign-off.",TRANSPORT_AUTH_FAILED:"Stopped \u2014 agent rejected the credentials. Check your API key.",TRANSPORT_RATE_LIMITED:"Stopped \u2014 agent is rate-limited. Try again after the cooldown.",TRANSPORT_NETWORK:"Stopped \u2014 could not reach the agent over the network.",LLM_UNAVAILABLE:"Stopped \u2014 could not reach the agent.",UNCAUGHT_ERROR:"Stopped \u2014 unexpected error."},Dje={"stage_1.1":"Type","stage_1.2":"Lint","stage_1.3":"Drift","stage_1.4":"Commit","stage_1.5":"Architecture","stage_1.6":"Secret","stage_2.1":"Unit tests","stage_2.2":"Coverage","stage_2.3":"Spec conformance","stage_2.4":"Deliverable smoke","stage_3.1":"Smoke","stage_3.2":"Performance","stage_3.3":"Visual","stage_4.1":"Audit","stage_4.2":"UAT"};function CD(t,e){let r=e.features.find(n=>n.id===t);return r&&r.title?r.title:t}function QX(t,e){let r=Cje[t.class]??"Stopped.",n=Nje(t.detail,e);return n?`${r} ${n}`:r}function Sw(t){return Dje[t]??t}function Nje(t,e){return t?t.replace(/\bF-\d{3,}\b/g,r=>{let n=CD(r,e);return n===r?r:`"${n}"`}):""}var e7=["stage_1.1","stage_1.2","stage_1.3","stage_1.4","stage_1.5","stage_1.6","stage_2.1","stage_2.2","stage_3.1","stage_3.2","stage_3.3","stage_4.1","stage_4.2"];function jje(t,e,r){if(e.startsWith("stage_4")){let n=bn(r);if(n.length===0)return"\xB7";let i=(t.acceptance_criteria??[]).map(s=>s.id);return ow(n).filter(s=>i.includes(s.acId)).length>0?"\u2717":"\u2713"}return"-"}function Mje(t,e,r){let n=t.modules??[];if(t.status!=="done"||n.length===0)return"\xB7";if(e===null)return"-";let i=e.get(t.id);return i===void 0?"!":i===Md(r,n)?"\u2713":"!"}function t7(t,e=".",r={}){let n=r.internal??!1,i=wc(e),o=[...e7.map(l=>n?l.replace("stage_",""):Fje(l)),"att"],s=n?`feature ${o.join(" ")}`:`feature${" ".repeat(28)}${o.join(" ")}`,c=t.features.map(l=>({featureId:l.id,title:l.title||l.id,cells:[...e7.map(u=>jje(l,u,e)),Mje(l,i,e)]})).map(l=>{let u=l.cells.join(" ");return n?`${l.featureId.padEnd(12)} ${u} ${l.title}`:`${l.title.padEnd(35).slice(0,35)} ${u}`});return[s,...c].join(` +`)}function Fje(t){return Sw(t).slice(0,3)}async function JZe(t){let[{buildServer:e},{StdioServerTransport:r},{setHostMcpServer:n}]=await Promise.all([Promise.resolve().then(()=>(nae(),rae)),Promise.resolve().then(()=>(cae(),aae)),Promise.resolve().then(()=>(Nf(),n8))]),i=e({cwd:t.cwd});n(i.server);let o=new r;K.stderr.write(`\xB7 serve stdio transport \xB7 cwd=${t.cwd??"."} +`),await i.connect(o)}async function YZe(t,e){let r=t&&t.length>0?t.join(" ").trim():void 0,n=await XY({projectName:e.name,force:e.force,scan:e.scan,noLlm:e.noLlm,roots:e.roots?e.roots.split(",").map(o=>o.trim()).filter(Boolean):void 0,intent:r,withHook:e.withHook,withCi:e.withCi});for(let o of n.created)B("pass",`created ${o}`);for(let o of n.skipped)B("skip",o);for(let o of n.proposals??[])B("note","proposal",o);let i=n.onboardingMode?`language: ${n.language} \xB7 mode: ${n.onboardingMode}`:`language: ${n.language}`;if(B("note","init done",i),n.clarifyingQuestions&&n.clarifyingQuestions.length>0){K.stdout.write(` \u{1F4A1} \uB2E4\uC74C \uC815\uBCF4\uAC00 \uC788\uC73C\uBA74 \uB354 \uC815\uD655\uD55C \uC2A4\uD399\uC774 \uB429\uB2C8\uB2E4: `);for(let[o,s]of n.clarifyingQuestions.entries())K.stdout.write(` ${o+1}. ${s} `);K.stdout.write(` @@ -723,30 +723,30 @@ ${_} - "derived:${m}"`),i.push({shard:a,ref:`derived:${m}`}),d=!0}d&&Sje(c,l,"u `),K.stdout.write(` \uC608: clad init \uACB0\uC81C SaaS for B2B `),K.stdout.write(` \uAE30\uC874 seeds \uB294 .cladding/scan/*.proposal \uB85C \uBD84\uAE30\uB429\uB2C8\uB2E4. -`));K.exit(0)}async function GZe(t,e){B("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Oae(),Tae)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)B(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),K.stdout.write(`${JSON.stringify(n,null,2)} -`);else{let s=Y(e.cwd??"."),a=n.featuresTouched.map(l=>OD(l,s)),c=`${KX(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;B(i,"run",c),a.length>0&&K.stdout.write(`Touched: ${a.join(", ")} -`)}let o=n.stubsCreated.length>0;o&&B("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),K.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function VZe(t={}){try{let e=Y(),r=Wo(".");Kc(".",r),fa("."),y3(".");let n=GX(".");for(let o of n.repaired)B("note","test_refs",`repaired ${o.from} \u2192 ${o.to} (${o.shard})`);for(let o of n.suggested)B("note","test_refs",`suggested ${o.ref} (${o.shard}) \u2014 confirm by removing the 'derived:' prefix`);let i=yw(".");if(i&&B("note","deliverable",`auto-detected entry '${i.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`),t.proposeArchive){let s=Tb.run({cwd:"."}).filter(a=>a.suggestion?.action==="propose-archive");if(s.length===0){B("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),K.exit(0);return}for(let a of s){let c=a.suggestion?.args??{},l=String(c.featureId??"?"),u=String(c.reason??a.message);B("note",`propose-archive \xB7 ${l}`,u)}B("pass","sync",`${e.features.length} features \xB7 ${s.length} archive candidate(s)`),K.exit(0);return}B("pass","sync",`${e.features.length} features valid`),K.exit(0)}catch(e){B("fail","sync",e.message),K.exit(1)}}function WZe(t){if(!t){B("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),K.exit(2);return}let e=fw(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";B("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),K.exit(0)}function KZe(t,e={}){if(!t){B("fail","rollback","feature id required (e.g. clad rollback F-001)"),K.exit(2);return}let r=pw(".",t);if(!r){B("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),K.exit(1);return}mw(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";B("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?K.stdout.write(`Run: git checkout ${r.gitHead} +`));K.exit(0)}async function XZe(t,e){B("note","run","EXPERIMENTAL \u2014 prefer the host-delegated path (clad serve + your AI host). See docs/feature-cycle.md \xA7 Execution surface.");let{runDriveLoop:r}=await Promise.resolve().then(()=>(Cae(),Rae)),n=await r({cwd:e.cwd,goal:t,budget:{maxIterations:Number(e.maxIterations),maxWallClockMs:Number(e.maxWallClockMs),maxRetriesPerFeature:Number(e.maxRetries)}}),i=n.halt.class==="ALL_FEATURES_DONE"?"pass":"note";if(e.json)B(i,"run",`halt=${n.halt.class} iter=${n.iterations} features=${n.featuresTouched.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`),K.stdout.write(`${JSON.stringify(n,null,2)} +`);else{let s=Y(e.cwd??"."),a=n.featuresTouched.map(l=>CD(l,s)),c=`${QX(n.halt,s)} iter=${n.iterations} features=${a.length} stubs=${n.stubsCreated.length} gates=${n.gateRuns}`;B(i,"run",c),a.length>0&&K.stdout.write(`Touched: ${a.join(", ")} +`)}let o=n.stubsCreated.length>0;o&&B("fail","run",`produced ${n.stubsCreated.length} empty auto-stub(s) and implemented nothing \u2014 the headless code-author needs a real LLM transport (set ANTHROPIC_API_KEY) or use the host-delegated path (clad serve + your AI host). This run did NOT do the work.`),K.exit(n.halt.class==="ALL_FEATURES_DONE"&&!o?0:1)}function QZe(t={}){try{let e=Y(),r=Wo(".");Kc(".",r),fa("."),S3(".");let n=JX(".");for(let o of n.repaired)B("note","test_refs",`repaired ${o.from} \u2192 ${o.to} (${o.shard})`);for(let o of n.suggested)B("note","test_refs",`suggested ${o.ref} (${o.shard}) \u2014 confirm by removing the 'derived:' prefix`);let i=vw(".");if(i&&B("note","deliverable",`auto-detected entry '${i.path}' \u2014 the gate now smoke-tests it (stage_2.4). Opt out with is_safe_to_smoke: false.`),t.proposeArchive){let s=Pb.run({cwd:"."}).filter(a=>a.suggestion?.action==="propose-archive");if(s.length===0){B("pass","sync",`${e.features.length} features \xB7 0 archive candidates`),K.exit(0);return}for(let a of s){let c=a.suggestion?.args??{},l=String(c.featureId??"?"),u=String(c.reason??a.message);B("note",`propose-archive \xB7 ${l}`,u)}B("pass","sync",`${e.features.length} features \xB7 ${s.length} archive candidate(s)`),K.exit(0);return}B("pass","sync",`${e.features.length} features valid`),K.exit(0)}catch(e){B("fail","sync",e.message),K.exit(1)}}function eGe(t){if(!t){B("fail","checkpoint","feature id required (e.g. clad checkpoint F-001)"),K.exit(2);return}let e=hw(".",t),r=e.gitHead?e.gitHead.slice(0,12):"(no git)";B("pass",`checkpoint \xB7 ${t}`,`head=${r} digest=${e.specDigest.slice(0,12)}`),K.exit(0)}function tGe(t,e={}){if(!t){B("fail","rollback","feature id required (e.g. clad rollback F-001)"),K.exit(2);return}let r=gw(".",t);if(!r){B("fail",`rollback \xB7 ${t}`,"no prior checkpoint recorded"),K.exit(1);return}yw(".",t,r,e.reason);let n=r.gitHead?r.gitHead.slice(0,12):"(no git)";B("note",`rollback \xB7 ${t}`,`recorded \u2014 run the printed command to apply (cladding does not execute git) \xB7 target head=${n} ts=${r.timestamp}`),r.gitHead?K.stdout.write(`Run: git checkout ${r.gitHead} `):K.stdout.write(`No git head pinned \u2014 restore spec.yaml manually from VCS history. -`),K.exit(0)}async function JZe(t){let e=await K1({force:t.force,quiet:t.quiet});K.exit(e.errors.length>0?1:0)}async function YZe(){B("note","update","reconciling the current project after the engine upgrade");let t=await bJ(".",{wireHosts:async()=>(await K1({quiet:!0})).errors.length});if(B(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),!t.isProject){B("skip","spec","no spec.yaml here \u2014 run `clad init` to put this project under cladding"),K.exit(t.code);return}B("pass","spec",`inventory synced \xB7 ${t.features} features`),B(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),B(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)B("note","deprecated",r);K.stdout.write(` +`),K.exit(0)}async function rGe(t){let e=await Q1({force:t.force,quiet:t.quiet});K.exit(e.errors.length>0?1:0)}async function nGe(){B("note","update","reconciling the current project after the engine upgrade");let t=await xJ(".",{wireHosts:async()=>(await Q1({quiet:!0})).errors.length});if(B(t.wiringErrors>0?"fail":"pass","hosts",t.wiringErrors>0?`${t.wiringErrors} wiring error(s)`:"re-wired"),!t.isProject){B("skip","spec","no spec.yaml here \u2014 run `clad init` to put this project under cladding"),K.exit(t.code);return}B("pass","spec",`inventory synced \xB7 ${t.features} features`),B(t.claudeMd==="refreshed-stale"?"note":"pass","CLAUDE.md",t.claudeMd),B(t.agentsMd==="refreshed-stale"?"note":"pass","AGENTS.md",t.agentsMd);for(let r of t.deprecations)B("note","deprecated",r);K.stdout.write(` \u2192 drift check (report-only \xB7 does not block, does not edit your spec): -`),M2({tier:"pre-commit",strict:!0}).anyFailed?K.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):B("pass","drift","clean against the stricter detectors"),K.exit(t.code)}var XZe={"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 M2(t){let e=t.tier??"all",r=XZe[e];if(!r)return t.json?K.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} -`):B("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0};let n={focusModules:t.focusModules},o=[["stage_1.1",()=>Up(n)],["stage_1.2",()=>Lp(n)],["stage_1.3",()=>so({...n,strict:t.strict})],["stage_1.4",mD],["stage_1.5",ca],["stage_1.6",Of],["stage_2.1",()=>wD(n)],["stage_2.2",()=>hD(n)],["stage_2.3",fP],["stage_2.4",_D],["stage_3.1",bD],["stage_3.2",yD],["stage_3.3",xD],["stage_4.1",pD],["stage_4.2",qp]].filter(([u])=>r.includes(u)),s=0,a=!1,c=u=>u==="pass"?"pass":u==="liveness"?"note":u==="na"?"skip":Ra(u)?"fail":"skip",l=[];for(let[u,d]of o){let f=d({}),p=t.internal?u:_w(u),m=CX(f);Ra(m)&&(a=!0,s=Math.max(s,DX(f,m))),l.push({stage:u,label:p,status:m,exitCode:f.exitCode,stderr:f.stderr,findings:f.findings}),t.json||(B(c(m),p),Ra(m)&&sGe(f))}if(t.strict)try{let u=Y();for(let d of bX(u,l))s=Math.max(s,1),a=!0,l.push({stage:d.stage,label:d.label,status:"fail",exitCode:1,stderr:d.message}),t.json||B("fail",d.label,d.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let u=l.find(m=>m.stage==="stage_1.3"),d=(u?.findings??[]).filter(m=>m.severity==="error"||m.severity==="warn"),f=u?.status==="fail"&&d.length>0&&d.every(m=>m.detector==="STALE_ATTESTATION"),p=l.every(m=>m.stage==="stage_1.3"||!Ra(m.status));if(f&&p&&u&&(u.status="pass",u.exitCode=0,u.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",a=l.some(m=>Ra(m.status)),s=a?Math.max(1,s):0,t.json||B("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!a)try{S6(".",Y())&&(t.json||B("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json?K.stdout.write(`${JSON.stringify({tier:e,worst:s,anyFailed:a,stages:l},null,2)} -`):a&&K.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),Ki(".","gate_run",{tier:e,strict:t.strict===!0,worst:s,anyFailed:a}),{worst:s,anyFailed:a}}function QZe(t){try{let e=Y(),r=Ol(e,t);K.stdout.write(`${JSON.stringify(r,null,2)} -`),K.exit("not_found"in r?1:0)}catch(e){B("fail","context",e.message),K.exit(1)}}function eGe(t,e={}){try{let r=Y(),n=e.depth!==void 0?Number(e.depth):void 0,i=Jr(r,t,{depth:n});K.stdout.write(`${JSON.stringify(i,null,2)} -`),K.exit("not_found"in i?1:0)}catch(r){B("fail","impact",r.message),K.exit(1)}}function tGe(t={}){try{let e=Y(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=Db(e,o=>{try{return Pae(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});K.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} -`),K.exit(0)}catch(e){B("fail","infer-deps",e.message),K.exit(1)}}function rGe(t={}){try{let e=Y(),n=sX(e,i=>{try{return Pae(i,"utf8")}catch{return null}},".");if(t.json)K.stdout.write(`${JSON.stringify(n,null,2)} +`),U2({tier:"pre-commit",strict:!0}).anyFailed?K.stdout.write("\n\u2139 The findings above are the bar this upgrade raised \u2014 not a failed update. Reconcile them in YOUR spec when ready (`clad check --strict` for the full gate).\n"):B("pass","drift","clean against the stricter detectors"),K.exit(t.code)}var iGe={"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 U2(t){let e=t.tier??"all",r=iGe[e];if(!r)return t.json?K.stdout.write(`${JSON.stringify({tier:e,error:`unknown tier '${e}'`,worst:2,anyFailed:!0,stages:[]},null,2)} +`):B("fail","check",`unknown --tier '${e}' (expected: pre-commit | pre-push | all)`),{worst:2,anyFailed:!0};let n={focusModules:t.focusModules},o=[["stage_1.1",()=>Up(n)],["stage_1.2",()=>Lp(n)],["stage_1.3",()=>so({...n,strict:t.strict})],["stage_1.4",_D],["stage_1.5",ca],["stage_1.6",Of],["stage_2.1",()=>ED(n)],["stage_2.2",()=>bD(n)],["stage_2.3",gP],["stage_2.4",wD],["stage_3.1",xD],["stage_3.2",SD],["stage_3.3",AD],["stage_4.1",yD],["stage_4.2",qp]].filter(([u])=>r.includes(u)),s=0,a=!1,c=u=>u==="pass"?"pass":u==="liveness"?"note":u==="na"?"skip":Ra(u)?"fail":"skip",l=[];EI(!0);try{for(let[u,d]of o){let f=d({}),p=t.internal?u:Sw(u),m=MX(f);Ra(m)&&(a=!0,s=Math.max(s,FX(f,m))),l.push({stage:u,label:p,status:m,exitCode:f.exitCode,stderr:f.stderr,findings:f.findings}),t.json||(B(c(m),p),Ra(m)&&fGe(f))}}finally{EI(!1)}if(t.strict)try{let u=Y();for(let d of xX(u,l))s=Math.max(s,1),a=!0,l.push({stage:d.stage,label:d.label,status:"fail",exitCode:1,stderr:d.message}),t.json||B("fail",d.label,d.message)}catch{}if(t.strict&&(e==="pre-push"||e==="all")){let u=l.find(m=>m.stage==="stage_1.3"),d=(u?.findings??[]).filter(m=>m.severity==="error"||m.severity==="warn"),f=u?.status==="fail"&&d.length>0&&d.every(m=>m.detector==="STALE_ATTESTATION"),p=l.every(m=>m.stage==="stage_1.3"||!Ra(m.status));if(f&&p&&u&&(u.status="pass",u.exitCode=0,u.stderr="stale attestation exempted \u2014 this run re-verified and re-attests",a=l.some(m=>Ra(m.status)),s=a?Math.max(1,s):0,t.json||B("note","attestation","stale entries re-verified by this run \u2014 re-attesting")),!a)try{k6(".",Y())&&(t.json||B("note","attestation","spec/attestation.yaml refreshed (verified tree stamped)"))}catch{}}return t.json?K.stdout.write(`${JSON.stringify({tier:e,worst:s,anyFailed:a,stages:l},null,2)} +`):a&&K.stdout.write("\n\u2139 Run `clad doctor` for the event log, or `clad sync` to validate spec shards. Drift findings above name the offending detector.\n"),Ki(".","gate_run",{tier:e,strict:t.strict===!0,worst:s,anyFailed:a}),{worst:s,anyFailed:a}}function oGe(t){try{let e=Y(),r=Ol(e,t);K.stdout.write(`${JSON.stringify(r,null,2)} +`),K.exit("not_found"in r?1:0)}catch(e){B("fail","context",e.message),K.exit(1)}}function sGe(t,e={}){try{let r=Y(),n=e.depth!==void 0?Number(e.depth):void 0,i=Jr(r,t,{depth:n});K.stdout.write(`${JSON.stringify(i,null,2)} +`),K.exit("not_found"in i?1:0)}catch(r){B("fail","impact",r.message),K.exit(1)}}function aGe(t={}){try{let e=Y(),r=t.ambiguity!==void 0?Number(t.ambiguity):void 0,i=Mb(e,o=>{try{return Nae(o,"utf8")}catch{return null}},r!==void 0?{maxOwnerAmbiguity:r}:{});K.stdout.write(`${JSON.stringify({suggestions:i.suggestions,new_edges:i.edges.length,already_declared:i.alreadyDeclared.length,dynamic_import_files:i.dynamicImportFiles},null,2)} +`),K.exit(0)}catch(e){B("fail","infer-deps",e.message),K.exit(1)}}function cGe(t={}){try{let e=Y(),n=uX(e,i=>{try{return Nae(i,"utf8")}catch{return null}},".");if(t.json)K.stdout.write(`${JSON.stringify(n,null,2)} `);else{let i=n.context,o=i.truncatedCount>0?`budget enforces ${i.medianShrinkTruncated}x on ${i.truncatedCount} capped feature(s) (cap-driven)`:"no feature hit the budget cap",s=i.fitsCount>0?`${i.medianShrinkFit}x on ${i.fitsCount} fitting`:"none fit untruncated",a=[`graph efficiency \xB7 ${n.measured}/${n.featureCount} features`,` context: working-set ${i.medianSliceTokens} tok vs naive ${i.medianNaiveTokens} tok \u2014 ${o}, ${s}`,` uncapped structural slice = ${i.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)}`," (deterministic upper bound vs the shard+all-modules baseline \u2014 not an agent-adoption measurement)"];K.stdout.write(`${a.join(` `)} -`)}K.exit(0)}catch(e){B("fail","measure",e.message),K.exit(1)}}function nGe(t){let e;if(t.feature)try{let n=(Y().features??[]).find(i=>i.id===t.feature||i.slug===t.feature);n||(B("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),K.exit(1)),e=n.modules}catch(r){B("fail","check",r.message),K.exit(1)}K.exit(M2({...t,focusModules:e}).worst)}function iGe(t){let e=A6(".",t,{checkStages:M2,onIndex:fa});B(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),K.exit(e.code)}function oGe(t,e={}){let r=e.cwd??".",n;try{n=Y(r)}catch(o){B("fail","oracle",`spec not loaded: ${o.message}`),K.exit(1);return}if(e.required){t&&K.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') -`);let o=S3(n);if(o.length===0){K.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. +`)}K.exit(0)}catch(e){B("fail","measure",e.message),K.exit(1)}}function lGe(t){let e;if(t.feature)try{let n=(Y().features??[]).find(i=>i.id===t.feature||i.slug===t.feature);n||(B("fail","check",`no feature '${t.feature}' in spec \u2014 cannot scope gate`),K.exit(1)),e=n.modules}catch(r){B("fail","check",r.message),K.exit(1)}K.exit(U2({...t,focusModules:e}).worst)}function uGe(t){let e=P6(".",t,{checkStages:U2,onIndex:fa});B(e.ok?"pass":"fail",`done \xB7 ${t}`,e.reason),K.exit(e.code)}function dGe(t,e={}){let r=e.cwd??".",n;try{n=Y(r)}catch(o){B("fail","oracle",`spec not loaded: ${o.message}`),K.exit(1);return}if(e.required){t&&K.stdout.write(`(note: --required lists the whole-project worklist; ignoring '${t}') +`);let o=k3(n);if(o.length===0){K.stdout.write(`No oracles required \u2014 set project.oracle_policy or require_oracles, or no done ACs match the policy. `),K.exit(0);return}let s=o.filter(a=>!a.hasOracle);for(let a of o){let c=a.hasOracle?"\u2713":"\xB7",l=a.hasOracle?"":" \u2190 needs an impl-blind oracle";K.stdout.write(` ${c} ${a.featureId}.${a.acId} [${a.reason}${a.ears?`:${a.ears}`:""}]${l} `)}K.stdout.write(` ${o.length} AC(s) required, ${s.length} missing an oracle. -`),K.exit(s.length>0?1:0);return}if(!t){B("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),K.exit(1);return}let i=VX(n,t,e.ac,r);if(!i||i.acs.length===0){B("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),K.exit(1);return}K.stdout.write(`${WX(i)} -`),K.exit(0)}function sGe(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=i.path?` ${i.path}`:"";K.stdout.write(` [${i.detector}]${o} \u2014 ${Iae(i.message,140)} +`),K.exit(s.length>0?1:0);return}if(!t){B("fail","oracle","provide a to print its blind brief, or --required to list the ACs the policy needs an oracle for"),K.exit(1);return}let i=YX(n,t,e.ac,r);if(!i||i.acs.length===0){B("fail","oracle",`no acceptance criteria for ${t}${e.ac?`.${e.ac}`:""} \u2014 nothing to author a blind oracle from`),K.exit(1);return}K.stdout.write(`${XX(i)} +`),K.exit(0)}function fGe(t){if(t.findings&&t.findings.length>0){let e=t.findings.filter(i=>i.severity==="error"),r=t.findings.filter(i=>i.severity==="warn"),n=e.length>0?e:r;for(let i of n.slice(0,3)){let o=i.path?` ${i.path}`:"";K.stdout.write(` [${i.detector}]${o} \u2014 ${Dae(i.message,140)} `)}n.length>3&&K.stdout.write(` \u2026 and ${n.length-3} more finding(s) `);return}if(t.stderr&&t.stderr.trim().length>0){let e=t.stderr.split(` -`).find(r=>r.trim().length>0);e&&K.stdout.write(` ${Iae(e.trim(),160)} -`)}}function Iae(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function aGe(t){let e=Y();K.stdout.write(`${YX(e,".",{internal:t.internal})} -`),K.exit(0)}function cGe(t){let e=oE(t);B("note",`route \u2192 ${e}`,t),K.exit(e==="unknown"?1:0)}var lGe={refine:"clarify",panel:"status",drive:"run"};function uGe(t){let e=t?lGe[t]:void 0;e&&K.stderr.write(`cladding: '${t}' is now '${e}' \u2014 the old verb is removed in 0.8 -`)}function dGe(){let t=new Y2;t.name("clad").description("Reference Ironclad CLI").version("0.7.1"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init \uACB0\uC81C SaaS for B2B`) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").action(ZZe),t.command("run [goal]").alias("drive").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(GZe),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(VZe),t.command("setup").description("Wire cladding into installed AI tool host channels (Claude Code / Codex / Gemini)").option("--force","overwrite directory-copy wires (Windows fallback) even when changes detected").option("--quiet","suppress stdout output").action(JZe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: re-wire hosts + sync inventory + refresh the managed CLAUDE.md/AGENTS.md section, then report (without blocking) what the now-stricter detectors flag").action(YZe),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(nGe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(WZe),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(iGe),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)=>oGe(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(KZe),t.command("status").alias("panel").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").action(aGe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(QZe),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)=>eGe(r,n)),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>tGe(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full per-feature report as JSON").action(r=>rGe(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=>gX(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>yX()),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=>{_X(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").action(r=>h6(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(cGe),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(fJ),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(HZe),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").action($6),t.command("clarify [answer...]").alias("refine").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, e.g. `clad clarify \uBC95\uC778 \uC0AC\uC5C5\uC790\uB9CC`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(eX),t}var fGe=!!globalThis.__CLADDING_BUNDLED,pGe=fGe||import.meta.url===`file://${K.argv[1]}`;pGe&&(uGe(K.argv[2]),dGe().parse());export{lGe as RENAMED_VERBS,XZe as TIER_STAGES,dGe as createProgram,uGe as printVerbDeprecationNotice,nGe as runCheckCommand,M2 as runCheckStages,WZe as runCheckpointCommand,QZe as runContextCommand,iGe as runDoneCommand,eGe as runImpactCommand,tGe as runInferDepsCommand,ZZe as runInitCommand,rGe as runMeasureCommand,oGe as runOracleCommand,KZe as runRollbackCommand,cGe as runRouteCommand,GZe as runRunCommand,HZe as runServeCommand,JZe as runSetupCommand,aGe as runStatusCommand,VZe as runSyncCommand,YZe as runUpdateCommand}; +`).find(r=>r.trim().length>0);e&&K.stdout.write(` ${Dae(e.trim(),160)} +`)}}function Dae(t,e){return t.length<=e?t:`${t.slice(0,e-1)}\u2026`}function pGe(t){let e=Y();K.stdout.write(`${t7(e,".",{internal:t.internal})} +`),K.exit(0)}function mGe(t){let e=cE(t);B("note",`route \u2192 ${e}`,t),K.exit(e==="unknown"?1:0)}var hGe={refine:"clarify",panel:"status",drive:"run"};function gGe(t){let e=t?hGe[t]:void 0;e&&K.stderr.write(`cladding: '${t}' is now '${e}' \u2014 the old verb is removed in 0.8 +`)}function yGe(){let t=new tU;t.name("clad").description("Reference Ironclad CLI").version("0.7.1"),t.command("init [intent...]").description("Scaffold a cladding workspace. Pass a free-text project description as positional argument (e.g. `clad init \uACB0\uC81C SaaS for B2B`) to drive intent-aware onboarding \u2014 the LLM dispatcher then produces domain-aware capabilities/architecture/project-context plus product-level follow-up questions. Bare `clad init` keeps the v0.3.42 behaviour (greenfield seeds, or observed scan when \u22653 source files exist).").option("-n, --name ","Project name (default: cwd basename)").option("-f, --force","Overwrite existing spec.yaml").option("--scan","Force-walk the existing codebase. Default auto-detects (\u22653 source files trigger scan). Use --no-scan to skip even when source is present.").option("--no-llm","Force the deterministic interpreter (skip the LLM dispatcher chain). Intent text falls back to a deterministic quote in project-context.md.").option("--roots ","Override scanner source roots, comma-separated (e.g. packages/a/src,packages/b/src). Otherwise inferred from manifests + directory heuristics.").option("--with-hook","Install git pre-commit (cheap tier) AND pre-push (strict tier) hooks. Opt-in; cladding never touches .git without it.").option("--with-ci","Scaffold .github/workflows/cladding.yml running the strict pre-push gate \u2014 the authoritative enforcement layer.").action(YZe),t.command("run [goal]").alias("drive").description("(experimental) Headless autonomous loop \u2014 iterate ready features, dispatch developer + reviewer personas, run L1 gates, record evidence. The supported, exercised path is host-delegated (clad serve + your AI host loops the cadence); this loop needs a real LLM transport and is not auto-invoked").option("--cwd ","target project directory (default cwd)").option("--max-iterations ","cap iterations (default 50)","50").option("--max-wall-clock-ms ","cap wall clock (default 600000)","600000").option("--max-retries ","cap retries per feature (default 3)","3").option("--json","emit the raw internal result (Iron Core view); default is a plain Soft Shell summary").action(XZe),t.command("sync").description("Validate spec.yaml against schema and report").option("--propose-archive","list STALE_SPECIFICATION findings whose suggestion.action is propose-archive (Phased Decommissioning Tier 2)").action(QZe),t.command("setup").description("Wire cladding into installed AI tool host channels (Claude Code / Codex / Gemini)").option("--force","overwrite directory-copy wires (Windows fallback) even when changes detected").option("--quiet","suppress stdout output").action(rGe),t.command("update").description("Run from a project dir AFTER `npm update -g cladding`: re-wire hosts + sync inventory + refresh the managed CLAUDE.md/AGENTS.md section, then report (without blocking) what the now-stricter detectors flag").action(nGe),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(lGe),t.command("checkpoint ").description("Record a checkpoint event pinning git HEAD + spec digest for the feature (iron-law \xA72.5)").action(eGe),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(uGe),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)=>dGe(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(tGe),t.command("status").alias("panel").description("Render the feature \xD7 stage integrity matrix (business titles; use --internal for raw F-NNN ids)").option("--internal","show internal F-NNN ids and stage codes").action(pGe),t.command("context ").description("Print the context slice for one feature \u2014 id (F-\u2026), slug, or module path (F-d2c806)").action(oGe),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)=>sGe(r,n)),t.command("infer-deps").description("Suggest feature depends_on edges from the code import graph \u2014 the dependency edges cladding never auto-produced (F-2be3e3bb). Prints reviewable suggestions; does not write the spec.").option("--ambiguity ","emit edges for imports owned by \u2264 N features (default 1 = unambiguous single-owner only)").action(r=>aGe(r)),t.command("measure").description("Report the search + context efficiency the graph provides per feature \u2014 working-set tokens vs the naive baseline, dependency depth/edges resolved, regression-set coverage (F-16138071). Deterministic; no agent.").option("--json","emit the full per-feature report as JSON").action(r=>cGe(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=>vX(r)),e.command("stats").description("Report node/edge counts by kind and the top hubs by degree").action(()=>SX()),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=>{wX(r)}),t.command("changelog").description("Render shipped changes since a git ref into human-facing documents (F-904495a5). Default: capability-grouped markdown from feature titles + acceptance sentences (no internal ids). --json emits the deterministic manifest hosts render release notes from; --audit the id-keeping verification table; --catalog the full capability \u2192 feature \u2192 acceptance catalog.").option("--since ","git ref to diff from (default: the latest tag via `git describe --tags --abbrev=0`)").option("--json","print the deterministic ChangelogManifest as JSON (byte-identical across runs on the same state)").option("--audit","print the audit table \u2014 feature | AC | EARS | verification refs, each marked resolved \u2713/\u2717").option("--catalog","print the full capability \u2192 feature \u2192 acceptance listing of the living spec (no git range)").action(r=>b6(r)),t.command("route ").description("Classify a natural-language prompt to a verb").action(mGe),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(gJ),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(JZe),t.command("doctor").description("Summarise .cladding/events.log.jsonl \u2014 sentinel-miss frequency by phase/cause/fallback plus the top missed sentinels (LLM dispatcher health check)").option("--cwd ","project directory to read events from (default cwd)").option("--json","emit the raw DoctorReport for tooling; default is the human-readable surface").action(T6),t.command("clarify [answer...]").alias("refine").description("Advance the onboarding Q&A loop. Pass the user's answer to the next pending question as a positional (no quotes needed, e.g. `clad clarify \uBC95\uC778 \uC0AC\uC5C5\uC790\uB9CC`); the LLM refines spec/docs based on the full Q-A history and may emit new follow-up questions. Reads/writes `.cladding/onboarding/state.yaml`. Requires `clad init ` to have started a session first.").option("--cwd ","project directory containing .cladding/onboarding/state.yaml (default cwd)").option("--no-llm","force the deterministic interpreter (preserves current artifacts, logs the answer)").option("--json","emit the raw RefineReport for tooling; default is the human-readable surface").action(iX),t}var _Ge=!!globalThis.__CLADDING_BUNDLED,bGe=_Ge||import.meta.url===`file://${K.argv[1]}`;bGe&&(gGe(K.argv[2]),yGe().parse());export{hGe as RENAMED_VERBS,iGe as TIER_STAGES,yGe as createProgram,gGe as printVerbDeprecationNotice,lGe as runCheckCommand,U2 as runCheckStages,eGe as runCheckpointCommand,oGe as runContextCommand,uGe as runDoneCommand,sGe as runImpactCommand,aGe as runInferDepsCommand,YZe as runInitCommand,cGe as runMeasureCommand,dGe as runOracleCommand,tGe as runRollbackCommand,mGe as runRouteCommand,XZe as runRunCommand,JZe as runServeCommand,rGe as runSetupCommand,pGe as runStatusCommand,QZe as runSyncCommand,nGe as runUpdateCommand}; diff --git a/spec.yaml b/spec.yaml index 6c74ff9a..688bf76b 100644 --- a/spec.yaml +++ b/spec.yaml @@ -49,8 +49,8 @@ project: # Auto-maintained by `clad sync` (F-5b9f9f). Do not edit by hand. inventory: - features: 200 + features: 201 scenarios: 2 capabilities: 6 - test_files: 171 - last_synced: "2026-07-02" + test_files: 172 + last_synced: "2026-07-03" diff --git a/spec/attestation.yaml b/spec/attestation.yaml index c985a4a5..43efecd1 100644 --- a/spec/attestation.yaml +++ b/spec/attestation.yaml @@ -8,11 +8,11 @@ attested: F-002: c116a9d32f862ee9 F-003: c9578f9a6e70dcdf F-004: 791125e674b98fb5 - F-005: 70c3b7166f297bff - F-006: 488cb6f2d452a286 + F-005: 3e4bf76de9589d84 + F-006: adaccec4f53e75ba F-007: d1c159c46d5a454f F-008: 86cb22d725182847 - F-009: 80831c8be1440e79 + F-009: 20b0a33a31f10db9 F-00eb1a: 4dfd6110051f8854 F-010: 049a2581168f569f F-011: efd71e966a937fab @@ -28,7 +28,7 @@ attested: F-020: 2c5f4a94e3e57e9b F-021: 8a1a82a59a1c45c7 F-022: 8f596a1c737f6d42 - F-02343cd1: ef8aab92031314d2 + F-02343cd1: d6caf08fa4289f96 F-023: 0c14948e5a91bb0f F-024: f67a86816b06f8ee F-025: 187339b684896b8e @@ -46,17 +46,17 @@ attested: F-037: 7f811c5c8bc0e8e3 F-038: 1338100beadb15a6 F-039: 2e60f3d899b72d7f - F-040: 0022fc69f6ab5be9 + F-040: 850a0d474567478a F-041: cddb50fc41e49066 F-042: d1f661281bb9fb6e F-043: 2c5f4a94e3e57e9b - F-044: c695f1e075720068 + F-044: e2937118c3b962a5 F-045: b494c9a80442ac20 F-046: 4b563fce74b6bb4b F-047: baf5a2dbb9bb5a4b - F-048: 53be306a5be0c15c + F-048: 60e0421ddf7d4ccf F-049: 46e2ac1a6cce6a91 - F-051: 1608ae5d01801633 + F-051: 034791d3ab6cbeb9 F-052: 61e043371b9f7c71 F-053: 13a90cd08aec07ae F-054: 5f5d30500bd8cd7f @@ -69,7 +69,7 @@ attested: F-061: c16123610e8fe7fc F-062: 0ab83282a7f7b1ef F-063: d1aa5d1a0e591012 - F-064: e4f9fdc234fff67e + F-064: a65a37112e0ebbd5 F-065: e6ed3ef916201947 F-066: a65820bfcb3568ba F-067: 6e6dbd05bf314b56 @@ -79,84 +79,85 @@ attested: F-070: e50bb5d3addc7720 F-071: 3183a483a8015d4c F-072: 44e1d39139c816cc - F-073: a8a4d62847d4421d + F-073: 05e1593edeb7e340 F-074: 2f9e24856e9409cb - F-075: d56a5678b54aa783 + F-075: d93d153ee03826d2 F-076: a1a83ee1367c9a62 F-077: b05585ff764719ca F-078: b00a896e952776b8 - F-079: c4a31cfa2a639cdd + F-079: 8eae345f74ae6728 F-080: 1c19da74d32894e6 F-081: 248f9660cfb1b02b F-098d3b: 42d61bf806ce462b - F-09d68b: 9625119c4e3530ee + F-09d68b: 7da9d3c496b3e376 F-0ed2db: f94e2f45a16ff99c - F-0f2984d0: 9a54160a1ad31390 + F-0f2984d0: f7e6d6ada6b54be6 F-12d740: 84ad71574d306c81 F-15999130: 894b484b7a93690c - F-16138071: d59e2605e3dcaba5 + F-16138071: 4ff40974cfb46706 F-16746b: 2f98a1261b9b1fc2 F-17df0a: 915d13b33258d3fc F-18e951: d907c170a230e052 F-1c9166: 2ce80010271bbbed - F-1d23a6: 9f6255b60fea3094 + F-1d23a6: d1d2e051a24ae7e2 F-1edb38: 64283112a3ab96ce F-24062d: 805125645f7661ff F-245bd5: a8372aeb83acc411 - F-2be3e3bb: 9a54160a1ad31390 + F-2be3e3bb: f7e6d6ada6b54be6 F-2de65d: 84ad71574d306c81 F-315fd7: c3b042c80fa7c187 F-31eeb8: d88a9880d29ae411 - F-32b1e0: c1fc15020d878236 + F-32b1e0: edfc8ec05a88784a F-3788c2: af9778dea8687b29 F-37b4a8: e067655bad681488 - F-3a5339: 73f69ea99b45711e + F-3a5339: 17a1c49e257cf786 F-3b3690: 6a36aad282d36f3a F-40327b: 8295358f7b813c8a - F-417ff0: f438ae2713e9bfbf + F-417ff0: 13ba6b4cecf5ff7f F-42af48: 7702447a407758a1 F-43d8e3: bbea25941e2b675d F-4747ef: c255a18b6849d002 F-4db939: b2c386ca4e18c117 F-50ff43: fac674314685a912 F-551a1c: 29d021f9f2993cca - F-569f4b37: 9d7cf792bf270ce5 - F-56abaa: a0b445d1dbb2247a + F-569f4b37: 5505250443eef17a + F-56abaa: 898edf4db58c3e8f F-570a3f: 5e39856f9d2aa4b1 F-59f093: 26735424fba6308c + F-5a49899e: c6d5b4bc89e7af0f F-5b188856: d1e2e4184aa76c12 - F-5b9f9f: b5251329ea5686c2 + F-5b9f9f: c2a09072457331b9 F-5d3ed2: 9452eac28760fb99 F-5f6b45: 15323c4f5b619de7 - F-64a5c159: a8afca34fb00d0f3 + F-64a5c159: bdcbc5f7c85a8e96 F-65814a: 2136c8b8c94ef535 - F-67d2e9: d2f84f17aa36ae99 + F-67d2e9: 0c08d95939b2d8f9 F-67e33f: 679be18899f2ed8f F-6d943d: 2b53bfced7b1e70d F-6f80e7: 0c0e5b71ae22cc26 F-7076f7: 7e819e0d440f3ffe - F-7794a6bc: 01f721a95af19e48 + F-7794a6bc: 5a8b76db4f0d2ebc F-77f7ead0: 4fd1ec36a5726fe9 F-78b50d: 688e6afe2352a034 F-7afbd4: 18ce48352bee0fce - F-7ce18e: 0cbbcbe6fee8562e + F-7ce18e: d0e5b06ba935d3e2 F-7fa4a7: 19b7709a0b2202e3 - F-80d19d: b6f506d5ee3b85c8 + F-80d19d: ec79f2f124649682 F-836a90: 202d204521160071 F-8f419e: f3473746f4e252bc - F-904495a5: b290a98b9decc1f1 - F-9064ff: 410b0478070cdd8f + F-904495a5: be7ea96b82caa688 + F-9064ff: ce2df48e279b6f17 F-94dda4: 8dfb0267c45534f9 F-95a096: e8ed4fb958234914 F-96250595: 41b790c427d2b01b F-96700032: 5ae97b4c82c14acc F-99c6e5: 8a8724852f1d6059 F-9a3b61: 786eeefef2d25138 - F-9b643e: 651f27c726dae8d3 + F-9b643e: 6cb4362985fe67e2 F-9d168287: a7f7788dea42b0d9 F-a04cd9: e65d87671306d305 F-a4b512: d136f2a1bbc4383a - F-a5228c: a577e4a2a2f0c0ff + F-a5228c: 31b090abf7faa4cc F-aa7197: 7f561e4f3c902716 F-ae61c1: 7c3c8622e5375754 F-aee1da: a6d7525a6c547877 @@ -166,35 +167,35 @@ attested: F-b2094740: f379bf4feef6771a F-b43066: 9402b630adcf1eae F-b61449: 7095ce00662e987d - F-b84c38: 5df890ae36e3d072 - F-b99577: fc7df479ea92f0dd + F-b84c38: d2b5bcfe39837e24 + F-b99577: 7abceb0436930ac0 F-ba2e05: 158e77c8af32514a F-ba4b7a: c282e0e915ed547c - F-bb15e6: ea9b217fd8ac6fe0 + F-bb15e6: f24bc6c7adabeeea F-bd07d7: 4bf7e1baddf5d754 - F-bdcd90: e19b8ee840ef58c4 - F-c037ae: 0601d791da73a6f3 - F-c2c996: d82fdaab2e6ded77 - F-c48eb2: 899bf69592c91775 + F-bdcd90: c7ea572163e0d332 + F-c037ae: 07237097afba0425 + F-c2c996: df88728c4577167a + F-c48eb2: e91d35edc68565e5 F-c4c5ae: 18200d79542ae22e F-c6a32fff: 00f44ae222503b95 F-c8aef8: 02e07f929a1d0ded F-cd0415: 9cf6ce40e2a8b381 F-cfba0c: 077c03b8a96f562b F-d12edf: c19aa5d1007e0b8f - F-d2c806: 1cf20a658d36f4db + F-d2c806: 0150f6ef75aaf92a F-d3bde4: 915d13b33258d3fc - F-d49585: ca1e61197a081bd6 - F-d6b93648: 17a042248a45dbcc + F-d49585: 85a520622759cbf0 + F-d6b93648: 8aef22fc6905f130 F-d7312b: d5592f2eb809487f F-d8223c: 0501e9564231899b F-d980359c: 8f1559276afc5c03 F-dd51b42c: 496eeffa2641169d F-dddb89: f5625354e55eba9b - F-e0f6c7: 36f3f085741af993 + F-e0f6c7: 7521bc0e1058406b F-eb732f: d8abb536ff850a7a F-ee47fc2b: adb87c97b8ccf6e1 - F-ee5f643e: cf9efe9caa0956af + F-ee5f643e: bb0026a646c4d717 F-ef2fd9: b3a1dcd1e750a714 F-f334fa: 5207f35968a0c9b2 F-f44d1b: 62e0779d9c0ef11f diff --git a/spec/features/gate-scanner-memo-5a49899e.yaml b/spec/features/gate-scanner-memo-5a49899e.yaml new file mode 100644 index 00000000..99026dec --- /dev/null +++ b/spec/features/gate-scanner-memo-5a49899e.yaml @@ -0,0 +1,38 @@ +id: F-5a49899e +slug: gate-scanner-memo +title: "Gate-scoped scanner memoization — spawn secretlint/madge ONCE per gate, not twice (the dedup secret.ts already claims)" +status: done +modules: + - src/stages/scanner-cache.ts + - src/stages/detectors/hardcoded-secret.ts + - src/stages/detectors/architecture-violation.ts + - src/cli/clad.ts + - src/stages/secret.ts +acceptance_criteria: + - id: AC-10a55b5a + ears: ubiquitous + action: "memoize an external-scanner detector's findings by (cwd, cmd, args) within a primed gate pass so the underlying tool runs at most once" + response: "scanner-cache.ts exposes primeScannerCache(on)/memoizeScan(key, run); HARDCODED_SECRET (secretlint) and ARCHITECTURE_VIOLATION (madge) route their execaSync through memoizeScan" + text: "The system shall memoize external-scanner detector results within a primed gate pass." + test_refs: ["tests/stages/scanner-cache.test.ts"] + - id: AC-762ad120 + ears: event + condition: "when the Drift stage and the Secret/Arch stage both invoke the same scanner detector in one gate run" + action: "spawn the external tool only once (the second invocation is a cache hit)" + response: "clad check primes the cache around the stage loop, so stage_1.3's HARDCODED_SECRET/ARCHITECTURE_VIOLATION and stage_1.6/1.5's re-invocation share one spawn — the dedup secret.ts's comment already promises" + text: "When two stages invoke the same scanner in one gate, the system shall spawn the tool only once." + test_refs: ["tests/stages/scanner-cache.test.ts"] + - id: AC-17bf2e7c + ears: state + condition: "while no gate cache is primed (a standalone detector call, or the MCP read path)" + action: "run the tool directly with no caching" + response: "memoizeScan with a null cache calls run() verbatim — behavior outside a primed gate is byte-for-byte unchanged" + text: "While no cache is primed, the system shall run the scanner directly (unchanged behavior)." + test_refs: ["tests/stages/scanner-cache.test.ts"] + - id: AC-6e6daf3a + ears: unwanted + condition: "if the cache was primed for a gate run" + action: "clear it in a finally so a long-lived process never serves a stale scan across runs" + response: "clad check clears the cache in a finally after the stage loop; a fresh Map is created per gate run, so the MCP server's long-lived process cannot carry a scan across requests" + text: "If the cache was primed, then the system shall clear it in a finally to avoid stale cross-run scans." + test_refs: ["tests/stages/scanner-cache.test.ts"] diff --git a/spec/index.yaml b/spec/index.yaml index d987955b..2a485f54 100644 --- a/spec/index.yaml +++ b/spec/index.yaml @@ -123,6 +123,7 @@ features: F-56abaa: {slug: intent-aware-init, status: done, modules: 5} F-570a3f: {slug: mcp-structural-channel, status: done, modules: 1} F-59f093: {slug: multidev-integration-test-and-scenario-regex, status: done, modules: 3} + F-5a49899e: {slug: gate-scanner-memo, status: done, modules: 5} F-5b188856: {slug: graph-color-groups, status: done, modules: 4} F-5b9f9f: {slug: spec-yaml-inventory-and-hints, status: done, modules: 6} F-5d3ed2: {slug: postmortem-on-rollback, status: done, modules: 2} diff --git a/src/cli/clad.ts b/src/cli/clad.ts index edf5ed84..00b52a02 100644 --- a/src/cli/clad.ts +++ b/src/cli/clad.ts @@ -33,6 +33,7 @@ import {runAudit} from '../stages/audit.js'; import {runCommit} from '../stages/commit.js'; import {runCov} from '../stages/cov.js'; import {runDrift} from '../stages/drift.js'; +import {primeScannerCache} from '../stages/scanner-cache.js'; import {runLint} from '../stages/lint.js'; import {runPerf} from '../stages/perf.js'; import {runSecret} from '../stages/secret.js'; @@ -466,6 +467,13 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier const pulseKindOf = (s: GateStatus): PulseKind => s === 'pass' ? 'pass' : s === 'liveness' ? 'note' : s === 'na' ? 'skip' : isBlocking(s) ? 'fail' : 'skip'; const collected: {stage: string; label: string; status: GateStatus; exitCode: number; stderr?: string; findings?: readonly DriftFinding[]}[] = []; + // Gate-scoped scanner memo (F-5a49899e): the Drift stage and the Secret/Arch + // stages each reach HARDCODED_SECRET / ARCHITECTURE_VIOLATION, which shell out + // to secretlint / madge (~4.4s / ~1.4s). Priming the memo here makes the second + // invocation a cache hit, so each tool spawns once per gate instead of twice. + // Cleared in finally — the long-lived MCP server must not carry a scan across runs. + primeScannerCache(true); + try { for (const [name, run] of stages) { const r = run({}) as { pass: boolean; @@ -492,6 +500,9 @@ export function runCheckStages(opts: {internal?: boolean; strict?: boolean; tier if (isBlocking(status)) printStageDetails(r); } } + } finally { + primeScannerCache(false); + } // STRICT SKIP-POLICY (F-67d2e9, generalizes the 0.5.x unit-only guard). // Under --strict, a skipped stage the spec DEMANDS is a fail: 1.1 when a // declared language ships done features, 2.1 when done features declare diff --git a/src/stages/detectors/architecture-violation.ts b/src/stages/detectors/architecture-violation.ts index d6689a27..031c6f71 100644 --- a/src/stages/detectors/architecture-violation.ts +++ b/src/stages/detectors/architecture-violation.ts @@ -7,11 +7,14 @@ // imports (rust, go, java) do not register an arch gate — the detector // emits a single `info` finding for them. +import {resolve} from 'node:path'; + import {execaSync} from 'execa'; import {detectToolchain} from '../toolchain/detect.js'; import type {CommandStageOptions, DriftDetector, DriftFinding} from '../types.js'; import {classifyScannerExit, isMissingBinary} from '../util.js'; +import {memoizeScan} from '../scanner-cache.js'; const NAME = 'ARCHITECTURE_VIOLATION'; @@ -40,28 +43,28 @@ function runArchitectureViolation(opts: CommandStageOptions): readonly DriftFind }, ]; } - const proc = execaSync(spec.cmd, [...spec.args], {cwd, reject: false}); - // execaSync(reject:false) RETURNS (does not throw) on a missing binary, so - // ENOENT must be detected on the RESULT — a try/catch here would be dead code - // and let a registered-but-uninstalled validator fall through to a FALSE - // "architecture violations" error finding (a missing tool is a config gap). - if (isMissingBinary(proc)) { - return [ - { - detector: NAME, - severity: 'info', - message: `architecture validator '${spec.cmd}' not installed`, - }, - ]; - } - // The validator RAN but exited non-zero. A real cycle/boundary violation blocks - // (error); a config/setup gap (validator present but unconfigured) skips (info). - return classifyScannerExit( - proc, - NAME, - (detail) => `${spec.cmd} reported architecture violations: ${detail}`, - (detail) => `${spec.cmd} could not validate (config/setup gap, not a violation): ${detail}`, - ); + // Gate-scoped memo (F-5a49899e): the Drift stage AND the Arch stage both reach + // this detector in one gate run — without memoization madge spawns twice + // (~1.4s each). Keyed by (cwd, cmd, args); a pass-through when no gate cache is + // primed, so behavior outside a gate is unchanged. + return memoizeScan(`arch:${resolve(cwd)}:${spec.cmd}:${spec.args.join(' ')}`, () => { + const proc = execaSync(spec.cmd, [...spec.args], {cwd, reject: false}); + // execaSync(reject:false) RETURNS (does not throw) on a missing binary, so + // ENOENT must be detected on the RESULT — a try/catch here would be dead code + // and let a registered-but-uninstalled validator fall through to a FALSE + // "architecture violations" error finding (a missing tool is a config gap). + if (isMissingBinary(proc)) { + return [{detector: NAME, severity: 'info', message: `architecture validator '${spec.cmd}' not installed`}]; + } + // The validator RAN but exited non-zero. A real cycle/boundary violation blocks + // (error); a config/setup gap (validator present but unconfigured) skips (info). + return classifyScannerExit( + proc, + NAME, + (detail) => `${spec.cmd} reported architecture violations: ${detail}`, + (detail) => `${spec.cmd} could not validate (config/setup gap, not a violation): ${detail}`, + ); + }); } export const architectureViolation: DriftDetector = { diff --git a/src/stages/detectors/hardcoded-secret.ts b/src/stages/detectors/hardcoded-secret.ts index 99143b88..bded0e08 100644 --- a/src/stages/detectors/hardcoded-secret.ts +++ b/src/stages/detectors/hardcoded-secret.ts @@ -9,11 +9,14 @@ // emit a single `info` finding rather than failing the run — a missing // scanner is a configuration gap, not a security finding. +import {resolve} from 'node:path'; + import {execaSync} from 'execa'; import {detectToolchain} from '../toolchain/detect.js'; import type {CommandStageOptions, DriftDetector, DriftFinding} from '../types.js'; import {classifyScannerExit, isMissingBinary} from '../util.js'; +import {memoizeScan} from '../scanner-cache.js'; const NAME = 'HARDCODED_SECRET'; @@ -42,29 +45,29 @@ function runHardcodedSecret(opts: CommandStageOptions): readonly DriftFinding[] }, ]; } - const proc = execaSync(spec.cmd, [...spec.args], {cwd, reject: false}); - // execaSync(reject:false) RETURNS (does not throw) on a missing binary, so - // ENOENT must be detected on the RESULT — a try/catch here would be dead code - // and let a registered-but-uninstalled scanner fall through to a FALSE - // "reported secrets" error finding (a missing tool is a config gap, not a hit). - if (isMissingBinary(proc)) { - return [ - { - detector: NAME, - severity: 'info', - message: `secret scanner '${spec.cmd}' not installed`, - }, - ]; - } - // The scanner RAN but exited non-zero. A real secret hit blocks (error); a - // config/setup gap (e.g. no `.secretlintrc`) skips (info) — secretlint exits - // non-zero with "config is not found", which must NOT be reported as a secret. - return classifyScannerExit( - proc, - NAME, - (detail) => `${spec.cmd} reported secrets: ${detail}`, - (detail) => `${spec.cmd} could not scan (config/setup gap, not a secret): ${detail}`, - ); + // Gate-scoped memo (F-5a49899e): the Drift stage AND the Secret stage both + // reach this detector in one gate run — without memoization secretlint spawns + // twice (~4.4s each). Keyed by (cwd, cmd, args); a pass-through when no gate + // cache is primed (standalone / MCP), so behavior outside a gate is unchanged. + return memoizeScan(`secret:${resolve(cwd)}:${spec.cmd}:${spec.args.join(' ')}`, () => { + const proc = execaSync(spec.cmd, [...spec.args], {cwd, reject: false}); + // execaSync(reject:false) RETURNS (does not throw) on a missing binary, so + // ENOENT must be detected on the RESULT — a try/catch here would be dead code + // and let a registered-but-uninstalled scanner fall through to a FALSE + // "reported secrets" error finding (a missing tool is a config gap, not a hit). + if (isMissingBinary(proc)) { + return [{detector: NAME, severity: 'info', message: `secret scanner '${spec.cmd}' not installed`}]; + } + // The scanner RAN but exited non-zero. A real secret hit blocks (error); a + // config/setup gap (e.g. no `.secretlintrc`) skips (info) — secretlint exits + // non-zero with "config is not found", which must NOT be reported as a secret. + return classifyScannerExit( + proc, + NAME, + (detail) => `${spec.cmd} reported secrets: ${detail}`, + (detail) => `${spec.cmd} could not scan (config/setup gap, not a secret): ${detail}`, + ); + }); } export const hardcodedSecret: DriftDetector = { diff --git a/src/stages/scanner-cache.ts b/src/stages/scanner-cache.ts new file mode 100644 index 00000000..3a3acb46 --- /dev/null +++ b/src/stages/scanner-cache.ts @@ -0,0 +1,46 @@ +// Cladding · gate-scoped external-scanner memo (F-5a49899e). +// +// HARDCODED_SECRET (secretlint) and ARCHITECTURE_VIOLATION (madge) shell out to +// an external tool — measured at ~4.4s and ~1.4s respectively, together ~97% of +// the drift stage. They run TWICE per gate: once inside the Drift stage +// (stage_1.3, which sweeps every detector) and again as their own dedicated +// stage (Secret stage_1.6 / Arch stage_1.5, thin adapters over the same +// detector). `secret.ts` even documents that the layering "avoids spawning the +// scanner twice" — but nothing enforced it, so a full gate paid ~5.8s of pure +// duplicate subprocess time. +// +// This is the missing enforcement: a GATE-scoped memo, mirroring the run-scoped +// spec cache (F-cd0415). `clad check` primes it around the stage loop and clears +// it in a finally; within that window the second invocation of an identical +// (cwd, cmd, args) scan is a cache hit, so the tool spawns once. Outside a primed +// window (a standalone detector call, the MCP read path) `memoizeScan` is a +// pass-through — behavior is byte-for-byte unchanged. A fresh Map per gate run +// means the long-lived MCP server never serves a stale scan across requests. + +import type {DriftFinding} from './types.js'; + +let cache: Map | null = null; + +/** + * Prime (true) or clear (false) the gate-scoped scanner cache. Callers MUST + * clear in a `finally` — a primed cache outliving its gate run would serve a + * stale scan. Priming installs a FRESH map, so each gate run is isolated. + */ +export function primeScannerCache(on: boolean): void { + cache = on ? new Map() : null; +} + +/** + * Run `compute` (the external-tool invocation) memoized by `key` for the current + * gate pass. With no cache primed, runs `compute` verbatim — no caching, no + * behavior change. With a cache primed, an identical key returns the cached + * findings instead of re-spawning the tool. + */ +export function memoizeScan(key: string, compute: () => readonly DriftFinding[]): readonly DriftFinding[] { + if (!cache) return compute(); + const hit = cache.get(key); + if (hit) return hit; + const result = compute(); + cache.set(key, result); + return result; +} diff --git a/src/stages/secret.ts b/src/stages/secret.ts index f7ceea0f..9e729e4f 100644 --- a/src/stages/secret.ts +++ b/src/stages/secret.ts @@ -8,7 +8,10 @@ // Thin adapter over the HARDCODED_SECRET drift detector: the detector // owns the tool invocation, this stage maps its findings to a StageResult. // Keeping the two layered avoids spawning the scanner twice when both -// `runSecret` and `runDrift` execute in the same pipeline. +// `runSecret` and `runDrift` execute in the same pipeline — ENFORCED since +// F-5a49899e by the gate-scoped scanner memo (detectors/scanner-cache.ts): +// `clad check` primes it around the stage loop, so the detector's secretlint +// spawn from the Drift stage is reused here instead of re-run. import process from 'node:process'; diff --git a/tests/stages/scanner-cache.test.ts b/tests/stages/scanner-cache.test.ts new file mode 100644 index 00000000..0edb481c --- /dev/null +++ b/tests/stages/scanner-cache.test.ts @@ -0,0 +1,70 @@ +import {afterEach, beforeEach, describe, expect, it} from 'vitest'; +import {primeScannerCache, memoizeScan} from '../../src/stages/scanner-cache.js'; +import type {DriftFinding} from '../../src/stages/types.js'; + +describe('scanner-cache (F-5a49899e)', () => { + let calls = 0; + const compute = (): readonly DriftFinding[] => { + calls++; + return [{detector: 'X', severity: 'info', message: `m${calls}`}] as const; + }; + + beforeEach(() => { + calls = 0; + primeScannerCache(false); // start unprimed/clean + }); + + afterEach(() => { + primeScannerCache(false); // leave clean — no cross-test leakage + }); + + it('no cache primed → pass-through (compute runs every call)', () => { + memoizeScan('k', compute); + memoizeScan('k', compute); + expect(calls).toBe(2); + }); + + it('primed → second call is a hit (compute once, same reference)', () => { + primeScannerCache(true); + const a = memoizeScan('k', compute); + const b = memoizeScan('k', compute); + expect(calls).toBe(1); + expect(a).toBe(b); + }); + + it('primed, different keys compute independently', () => { + primeScannerCache(true); + memoizeScan('k1', compute); + memoizeScan('k2', compute); + expect(calls).toBe(2); + }); + + it('clearing restores pass-through', () => { + primeScannerCache(true); + memoizeScan('k', compute); + expect(calls).toBe(1); + + primeScannerCache(false); + const before = calls; + memoizeScan('k', compute); + memoizeScan('k', compute); + // every post-clear call must run compute + expect(calls - before).toBe(2); + }); + + it('re-priming installs a FRESH cache (does not remember prior key)', () => { + primeScannerCache(true); + memoizeScan('k', compute); + expect(calls).toBe(1); + + primeScannerCache(true); // brand-new empty cache + memoizeScan('k', compute); + expect(calls).toBe(2); + }); + + it('returned findings are the compute output', () => { + primeScannerCache(true); + const result = memoizeScan('k', compute); + expect(result).toEqual([{detector: 'X', severity: 'info', message: 'm1'}]); + }); +});