@redocly/cli 2.71.2 → 2.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES +29 -7
- package/lib/chunks/{AZ5LIJEO.js → 2DXUH2SS.js} +1 -1
- package/lib/chunks/{UYZXI3NO.js → 2X2KHSF3.js} +1 -1
- package/lib/chunks/{BPJTNQBC.js → 42X6IAVM.js} +1 -1
- package/lib/chunks/44US4AGQ.js +13 -0
- package/lib/chunks/{R32HBYOH.js → 4AXMK6B2.js} +1 -1
- package/lib/chunks/4ZCKAKVF.js +199 -0
- package/lib/chunks/{N4GCIKY4.js → 5F7XFPS7.js} +1 -1
- package/lib/chunks/{YF4FMOTE.js → 6234PJEZ.js} +1 -1
- package/lib/chunks/{4H3DPQDW.js → 62SOICN7.js} +1 -1
- package/lib/chunks/{BOTTA3HA.js → 6JFL6L56.js} +1 -1
- package/lib/chunks/{NEWT5A6S.js → 6RTITFQA.js} +1 -1
- package/lib/chunks/{KJNBOXDI.js → 6XDKNFYM.js} +3 -3
- package/lib/chunks/{L325HIGK.js → 76AJ5P4Y.js} +1 -1
- package/lib/chunks/{JRVXIEVC.js → 7HTKK26B.js} +1 -1
- package/lib/chunks/{2TG3DP4I.js → A7XJ7Y3N.js} +1 -1
- package/lib/chunks/AB4FYNJN.js +22 -0
- package/lib/chunks/BJ6Z66KZ.js +7 -0
- package/lib/chunks/{XVS7B4RZ.js → BL2KWYMY.js} +1 -1
- package/lib/chunks/{BIS2ZFGS.js → BTLP7Z6A.js} +1 -1
- package/lib/chunks/{AXGFQS75.js → BXMYSHQY.js} +2 -2
- package/lib/chunks/{JOUEVI3E.js → BY22HEXP.js} +1 -1
- package/lib/chunks/D2BBHPMR.js +7 -0
- package/lib/chunks/{5CR6AOLY.js → D3C6XIMY.js} +3 -3
- package/lib/chunks/{DWXDCKZ7.js → DNDYWJHC.js} +1 -1
- package/lib/chunks/{ORWIUECT.js → E6QTRG6I.js} +1 -1
- package/lib/chunks/EHMG7I34.js +9 -0
- package/lib/chunks/{UTEOWLD5.js → EL6MGCYE.js} +1 -1
- package/lib/chunks/EVCSNWMN.js +7 -0
- package/lib/chunks/{KLGUZBJO.js → FJBULQ4P.js} +1 -1
- package/lib/chunks/{IQLQH23V.js → FLL7MTDS.js} +1 -1
- package/lib/chunks/{CRJEY7P3.js → FM7Y6KMP.js} +1 -1
- package/lib/chunks/{CR5TYFBN.js → FMMOQ6SE.js} +2 -2
- package/lib/chunks/{CZX7WE2R.js → FRC2YJS4.js} +1 -1
- package/lib/chunks/{W7TN2XCW.js → GHJGHHQP.js} +1 -1
- package/lib/chunks/{BH4FA7AH.js → GKPSJEG5.js} +1 -1
- package/lib/chunks/{UVKUPD4U.js → GMMFZFKJ.js} +1 -1
- package/lib/chunks/{MJ2NI6MR.js → GW4PLLFM.js} +1 -1
- package/lib/chunks/{5AVTCY6F.js → HIMEF7J2.js} +1 -1
- package/lib/chunks/{U4MI7HDM.js → HJ5KS42K.js} +1 -1
- package/lib/chunks/{DZT5NLUB.js → HXOTKK2E.js} +1 -1
- package/lib/chunks/{HP7UD4BA.js → IFGXTL5P.js} +1 -1
- package/lib/chunks/{XQEXWC5L.js → IHUHQ7PO.js} +1 -1
- package/lib/chunks/{3FR3456Q.js → IJYEZR53.js} +1 -1
- package/lib/chunks/{JO76DPXR.js → IKSSZYHA.js} +1 -1
- package/lib/chunks/{I4TK6NG7.js → IMNPDC6N.js} +1 -1
- package/lib/chunks/{7JS7JGWP.js → IO7M7MGV.js} +1 -1
- package/lib/chunks/{LY6BDOEF.js → J3TXBQDL.js} +1 -1
- package/lib/chunks/{HRZLSSOF.js → JZV7EL4R.js} +1 -1
- package/lib/chunks/{EHJ3FMW6.js → K6HV4EJS.js} +1 -1
- package/lib/chunks/{OFIQ2EST.js → KVXVR5Y4.js} +33 -33
- package/lib/chunks/{LKNL5LEV.js → L4HVZOFP.js} +1 -1
- package/lib/chunks/{Z6GFQV2Y.js → L5AG5NJZ.js} +1 -1
- package/lib/chunks/{ZXOX7NF2.js → LTJXST6M.js} +1 -1
- package/lib/chunks/MO6NEDYO.js +17 -0
- package/lib/chunks/{FDKY4PGX.js → NDECHUWV.js} +1 -1
- package/lib/chunks/{HMYFTLS7.js → NFGCHP5P.js} +1 -1
- package/lib/chunks/{GFSMOHUE.js → NNBSSORJ.js} +1 -1
- package/lib/chunks/{ADACRYTN.js → OLAN2CVV.js} +1 -1
- package/lib/chunks/{CER2D6ZD.js → OOKU5T7P.js} +7 -7
- package/lib/chunks/{U2F3JOT2.js → OQRUWVII.js} +1 -1
- package/lib/chunks/{WO6IIVA3.js → Q5WCA45H.js} +8 -8
- package/lib/chunks/{6X42UQ3O.js → QGKTPGO7.js} +1 -1
- package/lib/chunks/{DM4EUYBB.js → QQ2PGWE6.js} +2 -2
- package/lib/chunks/QYBWIG5Y.js +59 -0
- package/lib/chunks/{QTSECOQB.js → RC4LK3ZS.js} +2 -2
- package/lib/chunks/{NXREEI2S.js → RL2EIWFM.js} +1 -1
- package/lib/chunks/{4S6LRPCX.js → RQMFL6Q4.js} +1 -1
- package/lib/chunks/S3B562IT.js +7 -0
- package/lib/chunks/{P5T6BIKW.js → SPIFPTTE.js} +1 -1
- package/lib/chunks/SUQ7ZWYJ.js +7 -0
- package/lib/chunks/{VJZDR6KS.js → TFPMT2XD.js} +1529 -4
- package/lib/chunks/{FAFMGLT6.js → TVUYXOSQ.js} +1 -1
- package/lib/chunks/{T77BOGYV.js → UFDBFVRI.js} +1 -1
- package/lib/chunks/{HTFKP5HH.js → UH4Q6U6X.js} +1 -1
- package/lib/chunks/{LET2MPMU.js → UKVHQIBO.js} +1 -1
- package/lib/chunks/{SSEMMWPY.js → VF2YOZ3U.js} +1 -1
- package/lib/chunks/{5HPO77VR.js → VO775J6V.js} +2 -2
- package/lib/chunks/WKBXTA7Y.js +53 -0
- package/lib/chunks/{YWRFPTTI.js → WRGAJXOK.js} +1 -1
- package/lib/chunks/{3EQNI6CT.js → XKENZH7W.js} +1 -1
- package/lib/chunks/{QXXAC25O.js → YB52VXMW.js} +1 -1
- package/lib/chunks/{VPTYPV6P.js → ZSQF6YOF.js} +1 -1
- package/lib/chunks/{TH44RKLO.js → ZYHLWT2C.js} +1 -1
- package/lib/eject-assets/AGENTS.md +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/java/client.ts +66 -0
- package/lib/eject-assets/generators/java/descriptor.ts +72 -0
- package/lib/eject-assets/generators/java/index.ts +245 -0
- package/lib/eject-assets/generators/java/models.ts +362 -0
- package/lib/eject-assets/generators/java/naming.ts +135 -0
- package/lib/eject-assets/generators/java/operations.ts +300 -0
- package/lib/eject-assets/generators/java/pagination.ts +94 -0
- package/lib/eject-assets/generators/java/types.ts +103 -0
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/eject-assets/skills/client-generators/SKILL.md +1 -1
- package/lib/eject-assets/skills/java-generator/SKILL.md +161 -0
- package/lib/index.js +91 -90
- package/lib/skills/redocly-cli/SKILL.md +3 -1
- package/package.json +1 -1
- package/lib/chunks/2ZEKFWJQ.js +0 -13
- package/lib/chunks/3VOQMXIZ.js +0 -7
- package/lib/chunks/7GADNOVY.js +0 -9
- package/lib/chunks/FRQHCFKP.js +0 -199
- package/lib/chunks/J2EPFEBO.js +0 -17
- package/lib/chunks/JZATGVUO.js +0 -53
- package/lib/chunks/KNMNSDHR.js +0 -7
- package/lib/chunks/U5DIFWGH.js +0 -7
package/lib/index.js
CHANGED
|
@@ -5,19 +5,19 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as Kn,f as te}from"./chunks/U5DIFWGH.js";import{a as Xn,c as Jn}from"./chunks/LRRSU5UY.js";import{a as Jt,b as ei,c as ti,d as ri,e as ni,f as ii}from"./chunks/5HPO77VR.js";import{a as Aa}from"./chunks/ERBLCNSR.js";import{a as He,b as Bn,c as Yn,g as Qn}from"./chunks/3VOQMXIZ.js";import{a as Zn}from"./chunks/TH44RKLO.js";import{a as Vn}from"./chunks/BH4FA7AH.js";import{L as qn,O as Mn,W as Nt,Z as At,_ as Kt,a as Dn,ba as it,c as ke,da as Fn,fa as z,ga as Un,ha as kn,k as vr,la as ge,ma as Xt,pa as Gn,sa as zn,ta as Wn,ya as Hn}from"./chunks/FRQHCFKP.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as U,e as Yt}from"./chunks/RFWIIJFG.js";var St=U((nd,si)=>{"use strict";var Sa="2.0.0",Ca=Number.MAX_SAFE_INTEGER||9007199254740991,Ra=16,ja=250,xa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];si.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ra,MAX_SAFE_BUILD_LENGTH:ja,MAX_SAFE_INTEGER:Ca,RELEASE_TYPES:xa,SEMVER_SPEC_VERSION:Sa,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Tt=U((id,oi)=>{"use strict";var $a=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};oi.exports=$a});var Ct=U((Ge,ai)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:_r,MAX_SAFE_BUILD_LENGTH:va,MAX_LENGTH:_a}=St(),Ia=Tt();Ge=ai.exports={};var Pa=Ge.re=[],La=Ge.safeRe=[],R=Ge.src=[],Na=Ge.safeSrc=[],j=Ge.t={},Ta=0,Ir="[a-zA-Z0-9-]",Da=[["\\s",1],["\\d",_a],[Ir,va]],qa=r=>{for(let[e,t]of Da)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},G=(r,e,t)=>{let n=qa(e),i=Ta++;Ia(r,i,e),j[r]=i,R[i]=e,Na[i]=n,Pa[i]=new RegExp(e,t?"g":void 0),La[i]=new RegExp(n,t?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ir}*`);G("MAINVERSION",`(${R[j.NUMERICIDENTIFIER]})\\.(${R[j.NUMERICIDENTIFIER]})\\.(${R[j.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${R[j.NUMERICIDENTIFIERLOOSE]})\\.(${R[j.NUMERICIDENTIFIERLOOSE]})\\.(${R[j.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${R[j.NONNUMERICIDENTIFIER]}|${R[j.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${R[j.NONNUMERICIDENTIFIER]}|${R[j.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${R[j.PRERELEASEIDENTIFIER]}(?:\\.${R[j.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${R[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[j.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${Ir}+`);G("BUILD",`(?:\\+(${R[j.BUILDIDENTIFIER]}(?:\\.${R[j.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${R[j.MAINVERSION]}${R[j.PRERELEASE]}?${R[j.BUILD]}?`);G("FULL",`^${R[j.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${R[j.MAINVERSIONLOOSE]}${R[j.PRERELEASELOOSE]}?${R[j.BUILD]}?`);G("LOOSE",`^${R[j.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${R[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${R[j.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${R[j.XRANGEIDENTIFIER]})(?:\\.(${R[j.XRANGEIDENTIFIER]})(?:\\.(${R[j.XRANGEIDENTIFIER]})(?:${R[j.PRERELEASE]})?${R[j.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${R[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[j.XRANGEIDENTIFIERLOOSE]})(?:${R[j.PRERELEASELOOSE]})?${R[j.BUILD]}?)?)?`);G("XRANGE",`^${R[j.GTLT]}\\s*${R[j.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${R[j.GTLT]}\\s*${R[j.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${_r}})(?:\\.(\\d{1,${_r}}))?(?:\\.(\\d{1,${_r}}))?`);G("COERCE",`${R[j.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",R[j.COERCEPLAIN]+`(?:${R[j.PRERELEASE]})?(?:${R[j.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",R[j.COERCE],!0);G("COERCERTLFULL",R[j.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${R[j.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";G("TILDE",`^${R[j.LONETILDE]}${R[j.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${R[j.LONETILDE]}${R[j.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${R[j.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";G("CARET",`^${R[j.LONECARET]}${R[j.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${R[j.LONECARET]}${R[j.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${R[j.GTLT]}\\s*(${R[j.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${R[j.GTLT]}\\s*(${R[j.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${R[j.GTLT]}\\s*(${R[j.LOOSEPLAIN]}|${R[j.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${R[j.XRANGEPLAIN]})\\s+-\\s+(${R[j.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${R[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[j.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Qt=U((sd,ci)=>{"use strict";var Ma=Object.freeze({loose:!0}),Fa=Object.freeze({}),Ua=r=>r?typeof r!="object"?Ma:r:Fa;ci.exports=Ua});var Pr=U((od,fi)=>{"use strict";var li=/^[0-9]+$/,ui=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=li.test(r),n=li.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ka=(r,e)=>ui(e,r);fi.exports={compareIdentifiers:ui,rcompareIdentifiers:ka}});var ye=U((ad,pi)=>{"use strict";var Zt=Tt(),{MAX_LENGTH:di,MAX_SAFE_INTEGER:er}=St(),{safeRe:tr,t:rr}=Ct(),Ga=Qt(),{compareIdentifiers:Lr}=Pr(),za=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(Lr(r[n],t[n])!==0)return!1;return!0},Nr=class r{constructor(e,t){if(t=Ga(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>di)throw new TypeError(`version is longer than ${di} characters`);Zt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?tr[rr.LOOSE]:tr[rr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>er||this.major<0)throw new TypeError("Invalid major version");if(this.minor>er||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>er||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<er)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Zt("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(Zt("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Lr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(Zt("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Lr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?tr[rr.PRERELEASELOOSE]:tr[rr.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),za(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};pi.exports=Nr});var Xe=U((cd,mi)=>{"use strict";var hi=ye(),Wa=(r,e,t=!1)=>{if(r instanceof hi)return r;try{return new hi(r,e)}catch(n){if(!t)return null;throw n}};mi.exports=Wa});var yi=U((ld,gi)=>{"use strict";var Ha=Xe(),Va=(r,e)=>{let t=Ha(r,e);return t?t.version:null};gi.exports=Va});var wi=U((ud,bi)=>{"use strict";var Ba=Xe(),Ya=(r,e)=>{let t=Ba(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};bi.exports=Ya});var Ai=U((fd,Oi)=>{"use strict";var Ei=ye(),Ka=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ei(r instanceof Ei?r.version:r,t).inc(e,n,i).version}catch{return null}};Oi.exports=Ka});var Ri=U((dd,Ci)=>{"use strict";var Si=Xe(),Xa=(r,e)=>{let t=Si(r,null,!0),n=Si(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};Ci.exports=Xa});var xi=U((pd,ji)=>{"use strict";var Ja=ye(),Qa=(r,e)=>new Ja(r,e).major;ji.exports=Qa});var vi=U((hd,$i)=>{"use strict";var Za=ye(),ec=(r,e)=>new Za(r,e).minor;$i.exports=ec});var Ii=U((md,_i)=>{"use strict";var tc=ye(),rc=(r,e)=>new tc(r,e).patch;_i.exports=rc});var Li=U((gd,Pi)=>{"use strict";var nc=Xe(),ic=(r,e)=>{let t=nc(r,e);return t&&t.prerelease.length?t.prerelease:null};Pi.exports=ic});var _e=U((yd,Ti)=>{"use strict";var Ni=ye(),sc=(r,e,t)=>new Ni(r,t).compare(new Ni(e,t));Ti.exports=sc});var qi=U((bd,Di)=>{"use strict";var oc=_e(),ac=(r,e,t)=>oc(e,r,t);Di.exports=ac});var Fi=U((wd,Mi)=>{"use strict";var cc=_e(),lc=(r,e)=>cc(r,e,!0);Mi.exports=lc});var nr=U((Ed,ki)=>{"use strict";var Ui=ye(),uc=(r,e,t)=>{let n=new Ui(r,t),i=new Ui(e,t);return n.compare(i)||n.compareBuild(i)};ki.exports=uc});var zi=U((Od,Gi)=>{"use strict";var fc=nr(),dc=(r,e)=>r.sort((t,n)=>fc(t,n,e));Gi.exports=dc});var Hi=U((Ad,Wi)=>{"use strict";var pc=nr(),hc=(r,e)=>r.sort((t,n)=>pc(n,t,e));Wi.exports=hc});var Dt=U((Sd,Vi)=>{"use strict";var mc=_e(),gc=(r,e,t)=>mc(r,e,t)>0;Vi.exports=gc});var ir=U((Cd,Bi)=>{"use strict";var yc=_e(),bc=(r,e,t)=>yc(r,e,t)<0;Bi.exports=bc});var Tr=U((Rd,Yi)=>{"use strict";var wc=_e(),Ec=(r,e,t)=>wc(r,e,t)===0;Yi.exports=Ec});var Dr=U((jd,Ki)=>{"use strict";var Oc=_e(),Ac=(r,e,t)=>Oc(r,e,t)!==0;Ki.exports=Ac});var sr=U((xd,Xi)=>{"use strict";var Sc=_e(),Cc=(r,e,t)=>Sc(r,e,t)>=0;Xi.exports=Cc});var or=U(($d,Ji)=>{"use strict";var Rc=_e(),jc=(r,e,t)=>Rc(r,e,t)<=0;Ji.exports=jc});var qr=U((vd,Qi)=>{"use strict";var xc=Tr(),$c=Dr(),vc=Dt(),_c=sr(),Ic=ir(),Pc=or(),Lc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return xc(r,t,n);case"!=":return $c(r,t,n);case">":return vc(r,t,n);case">=":return _c(r,t,n);case"<":return Ic(r,t,n);case"<=":return Pc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Qi.exports=Lc});var es=U((_d,Zi)=>{"use strict";var Nc=ye(),Tc=Xe(),{safeRe:ar,t:cr}=Ct(),Dc=(r,e)=>{if(r instanceof Nc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?ar[cr.COERCEFULL]:ar[cr.COERCE]);else{let u=e.includePrerelease?ar[cr.COERCERTLFULL]:ar[cr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Tc(`${n}.${i}.${s}${o}${c}`,e)};Zi.exports=Dc});var rs=U((Id,ts)=>{"use strict";var qc=Xe(),Mc=St(),Fc=ye(),Uc=(r,e,t)=>{if(!Mc.RELEASE_TYPES.includes(e))return null;let n=kc(r,t);return n&&Gc(n,e)},kc=(r,e)=>{let t=r instanceof Fc?r.version:r;return qc(t,e)},Gc=(r,e)=>{if(zc(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},zc=r=>r.startsWith("pre");ts.exports=Uc});var is=U((Pd,ns)=>{"use strict";var Mr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};ns.exports=Mr});var Ie=U((Ld,cs)=>{"use strict";var Wc=/\s+/g,Fr=class r{constructor(e,t){if(t=Vc(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Ur)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(Wc," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!os(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&tl(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(el,"");let n=((this.options.includePrerelease&&Qc)|(this.options.loose&&Zc))+":"+e,i=ss.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[be.HYPHENRANGELOOSE]:Ae[be.HYPHENRANGE];e=e.replace(o,dl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[be.COMPARATORTRIM],Kc),re("comparator trim",e),e=e.replace(Ae[be.TILDETRIM],Xc),re("tilde trim",e),e=e.replace(Ae[be.CARETTRIM],Jc),re("caret trim",e);let c=e.split(" ").map(l=>rl(l,this.options)).join(" ").split(/\s+/).map(l=>fl(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[be.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Ur(l,this.options));for(let l of p){if(os(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return ss.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>as(n,t)&&e.set.some(i=>as(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Bc(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(pl(this.set[t],e,this.options))return!0;return!1}};cs.exports=Fr;var Hc=is(),ss=new Hc,Vc=Qt(),Ur=qt(),re=Tt(),Bc=ye(),{safeRe:Ae,src:Yc,t:be,comparatorTrimReplace:Kc,tildeTrimReplace:Xc,caretTrimReplace:Jc}=Ct(),{FLAG_INCLUDE_PRERELEASE:Qc,FLAG_LOOSE:Zc}=St(),el=new RegExp(Yc[be.BUILD],"g"),os=r=>r.value==="<0.0.0-0",tl=r=>r.value==="",as=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},rl=(r,e)=>(r=r.replace(Ae[be.BUILD],""),re("comp",r,e),r=ol(r,e),re("caret",r),r=il(r,e),re("tildes",r),r=cl(r,e),re("xrange",r),r=ul(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",nl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),il=(r,e)=>r.trim().split(/\s+/).map(t=>sl(t,e)).join(" "),sl=(r,e)=>{let t=e.loose?Ae[be.TILDELOOSE]:Ae[be.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},ol=(r,e)=>r.trim().split(/\s+/).map(t=>al(t,e)).join(" "),al=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[be.CARETLOOSE]:Ae[be.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},cl=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>ll(t,e)).join(" ")),ll=(r,e)=>{r=r.trim();let t=e.loose?Ae[be.XRANGELOOSE]:Ae[be.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),nl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},ul=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[be.STAR],"")),fl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?be.GTE0PRE:be.GTE0],"")),dl=r=>(e,t,n,i,s,o,c,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),pl=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Ur.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var qt=U((Nd,hs)=>{"use strict";var Mt=Symbol("SemVer ANY"),zr=class r{static get ANY(){return Mt}constructor(e,t){if(t=ls(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Gr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Mt?this.value="":this.value=this.operator+this.semver.version,Gr("comp",this)}parse(e){let t=this.options.loose?us[fs.COMPARATORLOOSE]:us[fs.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ds(n[2],this.options.loose):this.semver=Mt}toString(){return this.value}test(e){if(Gr("Comparator.test",e,this.options.loose),this.semver===Mt||e===Mt)return!0;if(typeof e=="string")try{e=new ds(e,this.options)}catch{return!1}return kr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ps(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ps(this.value,t).test(e.semver):(t=ls(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||kr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||kr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hs.exports=zr;var ls=Qt(),{safeRe:us,t:fs}=Ct(),kr=qr(),Gr=Tt(),ds=ye(),ps=Ie()});var Ft=U((Td,ms)=>{"use strict";var hl=Ie(),ml=(r,e,t)=>{try{e=new hl(e,t)}catch{return!1}return e.test(r)};ms.exports=ml});var ys=U((Dd,gs)=>{"use strict";var gl=Ie(),yl=(r,e)=>new gl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));gs.exports=yl});var ws=U((qd,bs)=>{"use strict";var bl=ye(),wl=Ie(),El=(r,e,t)=>{let n=null,i=null,s=null;try{s=new wl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new bl(n,t))}),n};bs.exports=El});var Os=U((Md,Es)=>{"use strict";var Ol=ye(),Al=Ie(),Sl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Al(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Ol(n,t))}),n};Es.exports=Sl});var Cs=U((Fd,Ss)=>{"use strict";var Wr=ye(),Cl=Ie(),As=Dt(),Rl=(r,e)=>{r=new Cl(r,e);let t=new Wr("0.0.0");if(r.test(t)||(t=new Wr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let c=new Wr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||As(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||As(t,s))&&(t=s)}return t&&r.test(t)?t:null};Ss.exports=Rl});var js=U((Ud,Rs)=>{"use strict";var jl=Ie(),xl=(r,e)=>{try{return new jl(r,e).range||"*"}catch{return null}};Rs.exports=xl});var lr=U((kd,_s)=>{"use strict";var $l=ye(),vs=qt(),{ANY:vl}=vs,_l=Ie(),Il=Ft(),xs=Dt(),$s=ir(),Pl=or(),Ll=sr(),Nl=(r,e,t,n)=>{r=new $l(r,n),e=new _l(e,n);let i,s,o,c,u;switch(t){case">":i=xs,s=Pl,o=$s,c=">",u=">=";break;case"<":i=$s,s=Ll,o=xs,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Il(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(y=>{y.semver===vl&&(y=new vs(">=0.0.0")),l=l||y,b=b||y,i(y.semver,l.semver,n)?l=y:o(y.semver,b.semver,n)&&(b=y)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};_s.exports=Nl});var Ps=U((Gd,Is)=>{"use strict";var Tl=lr(),Dl=(r,e,t)=>Tl(r,e,">",t);Is.exports=Dl});var Ns=U((zd,Ls)=>{"use strict";var ql=lr(),Ml=(r,e,t)=>ql(r,e,"<",t);Ls.exports=Ml});var qs=U((Wd,Ds)=>{"use strict";var Ts=Ie(),Fl=(r,e,t)=>(r=new Ts(r,t),e=new Ts(e,t),r.intersects(e,t));Ds.exports=Fl});var Fs=U((Hd,Ms)=>{"use strict";var Ul=Ft(),kl=_e();Ms.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>kl(h,l,t));for(let h of o)Ul(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Hs=U((Vd,Ws)=>{"use strict";var Us=Ie(),Br=qt(),{ANY:Hr}=Br,Vr=Ft(),Yr=_e(),Gl=(r,e,t={})=>{if(r===e)return!0;r=new Us(r,t),e=new Us(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=Wl(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},zl=[new Br(">=0.0.0-0")],ks=[new Br(">=0.0.0")],Wl=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Hr){if(e.length===1&&e[0].semver===Hr)return!0;t.includePrerelease?r=zl:r=ks}if(e.length===1&&e[0].semver===Hr){if(t.includePrerelease)return!0;e=ks}let n=new Set,i,s;for(let y of r)y.operator===">"||y.operator===">="?i=Gs(i,y,t):y.operator==="<"||y.operator==="<="?s=zs(s,y,t):n.add(y.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Yr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let y of n){if(i&&!Vr(y,String(i),t)||s&&!Vr(y,String(s),t))return null;for(let E of e)if(!Vr(y,String(E),t))return!1;return!0}let c,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let y of e){if(h=h||y.operator===">"||y.operator===">=",p=p||y.operator==="<"||y.operator==="<=",i){if(b&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===b.major&&y.semver.minor===b.minor&&y.semver.patch===b.patch&&(b=!1),y.operator===">"||y.operator===">="){if(c=Gs(i,y,t),c===y&&c!==i)return!1}else if(i.operator===">="&&!y.test(i.semver))return!1}if(s){if(l&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===l.major&&y.semver.minor===l.minor&&y.semver.patch===l.patch&&(l=!1),y.operator==="<"||y.operator==="<="){if(u=zs(s,y,t),u===y&&u!==s)return!1}else if(s.operator==="<="&&!y.test(s.semver))return!1}if(!y.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Gs=(r,e,t)=>{if(!r)return e;let n=Yr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},zs=(r,e,t)=>{if(!r)return e;let n=Yr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Ws.exports=Gl});var ur=U((Bd,Ys)=>{"use strict";var Kr=Ct(),Vs=St(),Hl=ye(),Bs=Pr(),Vl=Xe(),Bl=yi(),Yl=wi(),Kl=Ai(),Xl=Ri(),Jl=xi(),Ql=vi(),Zl=Ii(),eu=Li(),tu=_e(),ru=qi(),nu=Fi(),iu=nr(),su=zi(),ou=Hi(),au=Dt(),cu=ir(),lu=Tr(),uu=Dr(),fu=sr(),du=or(),pu=qr(),hu=es(),mu=rs(),gu=qt(),yu=Ie(),bu=Ft(),wu=ys(),Eu=ws(),Ou=Os(),Au=Cs(),Su=js(),Cu=lr(),Ru=Ps(),ju=Ns(),xu=qs(),$u=Fs(),vu=Hs();Ys.exports={parse:Vl,valid:Bl,clean:Yl,inc:Kl,diff:Xl,major:Jl,minor:Ql,patch:Zl,prerelease:eu,compare:tu,rcompare:ru,compareLoose:nu,compareBuild:iu,sort:su,rsort:ou,gt:au,lt:cu,eq:lu,neq:uu,gte:fu,lte:du,cmp:pu,coerce:hu,truncate:mu,Comparator:gu,Range:yu,satisfies:bu,toComparators:wu,maxSatisfying:Eu,minSatisfying:Ou,minVersion:Au,validRange:Su,outside:Cu,gtr:Ru,ltr:ju,intersects:xu,simplifyRange:$u,subset:vu,SemVer:Hl,re:Kr.re,src:Kr.src,tokens:Kr.t,SEMVER_SPEC_VERSION:Vs.SEMVER_SPEC_VERSION,RELEASE_TYPES:Vs.RELEASE_TYPES,compareIdentifiers:Bs.compareIdentifiers,rcompareIdentifiers:Bs.rcompareIdentifiers}});var fr=Yt(ur(),1);import*as Ut from"node:process";try{let r=Yn?.node;typeof r=="string"&&!fr.satisfies(Ut.version,r)&&z.warn(`
|
|
9
|
-
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${
|
|
10
|
-
|
|
11
|
-
`)
|
|
12
|
-
`).map(
|
|
13
|
-
`)}rowToString(e,t){return this.rasterize(e).forEach((n,
|
|
14
|
-
`):
|
|
15
|
-
`),s.border&&(
|
|
16
|
-
`),i+=r.charAt(s);return t&&n&&(i=`${t}${i}${n}`),i}function Qr(r){return Xs(r,{stringWidth:e=>[...e].length,stripAnsi:Jr,wrap:Qs})}import{dirname as Zs,resolve as eo}from"path";import{readdirSync as qu,statSync as Mu}from"fs";function to(r,e){let t=eo(".",r),n;for(Mu(t).isDirectory()||(t=Zs(t));;){if(n=e(t,qu(t)),n)return eo(t,n);if(t=Zs(n=t),n===t)break}}import{inspect as tf}from"util";import{readFileSync as rf}from"fs";import{fileURLToPath as ho}from"url";import{format as Uu}from"util";import{readFileSync as ku}from"fs";import{normalize as Gu,resolve as zu}from"path";function st(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function hr(r,e){let t=r.toLowerCase();e=e||"-";let n="";for(let i=0;i<r.length;i++){let s=t.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${e}${t.charAt(i)}`:n+=o}return n}function mr(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function ro(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,t=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!i){t!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var Pe;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Pe||(Pe={}));var Ve,gr=class{constructor(e){Ve=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=ro(e),s=Fu(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),y=Object.create(null),E=n.__||Ve.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},x=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,A=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let m=typeof f=="object"?f.key:f,O=Object.keys(f).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();O&&(d[O][m]=!0),d.arrays[m]=!0,d.keys.push(m)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(f){d.bools[f]=!0,d.keys.push(f)}),[].concat(n.string||[]).filter(Boolean).forEach(function(f){d.strings[f]=!0,d.keys.push(f)}),[].concat(n.number||[]).filter(Boolean).forEach(function(f){d.numbers[f]=!0,d.keys.push(f)}),[].concat(n.count||[]).filter(Boolean).forEach(function(f){d.counts[f]=!0,d.keys.push(f)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(f){d.normalize[f]=!0,d.keys.push(f)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([f,m])=>{typeof m=="number"&&(d.nargs[f]=m,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,m])=>{typeof m=="function"&&(d.coercions[f]=m,d.keys.push(f))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(f){d.configs[f]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([f,m])=>{(typeof m=="boolean"||typeof m=="function")&&(d.configs[f]=m)})),Lt(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(f){(d.aliases[f]||[]).forEach(function(m){c[m]=c[f]})});let C=null;$r();let B=[],W=Object.assign(Object.create(null),{_:[]}),Me={};for(let f=0;f<i.length;f++){let m=i[f],O=m.replace(/^-{3,}/,"---"),w,g,$,v,q,pe;if(m!=="--"&&Q(m))bt(m);else if(O.match(/---+(=|$)/)){bt(m);continue}else if(m.match(/^--.+=/)||!o["short-option-groups"]&&m.match(/^-.+=/))v=m.match(/^--?([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&(T(v[1],d.arrays)?f=Et(f,v[1],i,v[2]):T(v[1],d.nargs)!==!1?f=wt(f,v[1],i,v[2]):J(v[1],v[2]));else if(m.match(A)&&o["boolean-negation"])v=m.match(A),v!==null&&Array.isArray(v)&&v.length>=2&&(g=v[1],J(g,T(g,d.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!o["short-option-groups"]&&m.match(/^-[^-]+/))v=m.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(g=v[1],T(g,d.arrays)?f=Et(f,g,i):T(g,d.nargs)!==!1?f=wt(f,g,i):(q=i[f+1],q!==void 0&&(!q.match(/^-/)||q.match(x))&&!T(g,d.bools)&&!T(g,d.counts)||/^(true|false)$/.test(q)?(J(g,q),f++):J(g,V(g))));else if(m.match(/^-.\..+=/))v=m.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&J(v[1],v[2]);else if(m.match(/^-.\..+/)&&!m.match(x))q=i[f+1],v=m.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(g=v[1],q!==void 0&&!q.match(/^-/)&&!T(g,d.bools)&&!T(g,d.counts)?(J(g,q),f++):J(g,V(g)));else if(m.match(/^-[^-]+/)&&!m.match(x)){$=m.slice(1,-1).split(""),w=!1;for(let Oe=0;Oe<$.length;Oe++){if(q=m.slice(Oe+2),$[Oe+1]&&$[Oe+1]==="="){pe=m.slice(Oe+3),g=$[Oe],T(g,d.arrays)?f=Et(f,g,i,pe):T(g,d.nargs)!==!1?f=wt(f,g,i,pe):J(g,pe),w=!0;break}if(q==="-"){J($[Oe],q);continue}if(/[A-Za-z]/.test($[Oe])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){J($[Oe],q),w=!0;break}if($[Oe+1]&&$[Oe+1].match(/\W/)){J($[Oe],q),w=!0;break}else J($[Oe],V($[Oe]))}g=m.slice(-1)[0],!w&&g!=="-"&&(T(g,d.arrays)?f=Et(f,g,i):T(g,d.nargs)!==!1?f=wt(f,g,i):(q=i[f+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(x))&&!T(g,d.bools)&&!T(g,d.counts)||/^(true|false)$/.test(q)?(J(g,q),f++):J(g,V(g))))}else if(m.match(/^-[0-9]$/)&&m.match(x)&&T(m.slice(1),d.bools))g=m.slice(1),J(g,V(g));else if(m==="--"){B=i.slice(f+1);break}else if(o["halt-at-non-option"]){B=i.slice(f);break}else bt(m)}se(W,!0),se(W,!1),N(W),ee(),Ke(W,d.aliases,c,!0),Y(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||J(f,0)}),h&&B.length&&(W[l]=[]),B.forEach(function(f){W[l].push(f)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(W).filter(f=>f!=="--"&&f.includes("-")).forEach(f=>{delete W[f]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(f=>s[f])).forEach(f=>{o["camel-case-expansion"]&&f.includes("-")&&delete W[f.split(".").map(m=>st(m)).join(".")],delete W[f]});function bt(f){let m=S("_",f);(typeof m=="string"||typeof m=="number")&&W._.push(m)}function wt(f,m,O,w){let g,$=T(m,d.nargs);if($=typeof $!="number"||isNaN($)?1:$,$===0)return fe(w)||(C=Error(E("Argument unexpected for: %s",m))),J(m,V(m)),f;let v=fe(w)?0:1;if(o["nargs-eats-options"])O.length-(f+1)+v<$&&(C=Error(E("Not enough arguments following: %s",m))),v=$;else{for(g=f+1;g<O.length&&(!O[g].match(/^-[^0-9]/)||O[g].match(x)||Q(O[g]));g++)v++;v<$&&(C=Error(E("Not enough arguments following: %s",m)))}let q=Math.min(v,$);for(!fe(w)&&q>0&&(J(m,w),q--),g=f+1;g<q+f+1;g++)J(m,O[g]);return f+q}function Et(f,m,O,w){let g=[],$=w||O[f+1],v=T(m,d.nargs);if(T(m,d.bools)&&!/^(true|false)$/.test($))g.push(!0);else if(fe($)||fe(w)&&/^-/.test($)&&!x.test($)&&!Q($)){if(c[m]!==void 0){let q=c[m];g=Array.isArray(q)?q:[q]}}else{fe(w)||g.push(P(m,w));for(let q=f+1;q<O.length&&!(!o["greedy-arrays"]&&g.length>0||v&&typeof v=="number"&&g.length>=v||($=O[q],/^-/.test($)&&!x.test($)&&!Q($)));q++)f=q,g.push(P(m,$))}return typeof v=="number"&&(v&&g.length<v||isNaN(v)&&g.length===0)&&(C=Error(E("Not enough arguments following: %s",m))),J(m,g),f}function J(f,m){if(/-/.test(f)&&o["camel-case-expansion"]){let g=f.split(".").map(function($){return st($)}).join(".");Pt(f,g)}let O=P(f,m),w=f.split(".");We(W,w,O),d.aliases[f]&&d.aliases[f].forEach(function(g){let $=g.split(".");We(W,$,O)}),w.length>1&&o["dot-notation"]&&(d.aliases[w[0]]||[]).forEach(function(g){let $=g.split("."),v=[].concat(w);v.shift(),$=$.concat(v),(d.aliases[f]||[]).includes($.join("."))||We(W,$,O)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function($){Object.defineProperty(Me,$,{enumerable:!0,get(){return m},set(v){m=typeof v=="string"?Ve.normalize(v):v}})})}function Pt(f,m){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[m],b[m]=!0),d.aliases[m]&&d.aliases[m].length||Pt(m,f)}function P(f,m){typeof m=="string"&&(m[0]==="'"||m[0]==='"')&&m[m.length-1]===m[0]&&(m=m.substring(1,m.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof m=="string"&&(m=m==="true");let O=Array.isArray(m)?m.map(function(w){return S(f,w)}):S(f,m);return T(f,d.counts)&&(fe(O)||typeof O=="boolean")&&(O=Zr()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(m)?O=m.map(w=>Ve.normalize(w)):O=Ve.normalize(m)),O}function S(f,m){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(m)&&(mr(m)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!fe(m)&&T(f,d.numbers))&&(m=Number(m)),m}function N(f){let m=Object.create(null);Ke(m,d.aliases,c),Object.keys(d.configs).forEach(function(O){let w=f[O]||m[O];if(w)try{let g=null,$=Ve.resolve(Ve.cwd(),w),v=d.configs[O];if(typeof v=="function"){try{g=v($)}catch(q){g=q}if(g instanceof Error){C=g;return}}else g=Ve.require($);F(g)}catch(g){g.name==="PermissionDenied"?C=g:f[O]&&(C=Error(E("Invalid JSON config file: %s",w)))}})}function F(f,m){Object.keys(f).forEach(function(O){let w=f[O],g=m?m+"."+O:O;typeof w=="object"&&w!==null&&!Array.isArray(w)&&o["dot-notation"]?F(w,g):(!Z(W,g.split("."))||T(g,d.arrays)&&o["combine-arrays"])&&J(g,w)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,m){if(typeof p>"u")return;let O=typeof p=="string"?p:"",w=Ve.env();Object.keys(w).forEach(function(g){if(O===""||g.lastIndexOf(O,0)===0){let $=g.split("__").map(function(v,q){return q===0&&(v=v.substring(O.length)),st(v)});(m&&d.configs[$.join(".")]||!m)&&!Z(f,$)&&J($.join("."),w[g])}})}function Y(f){let m,O=new Set;Object.keys(f).forEach(function(w){if(!O.has(w)&&(m=T(w,d.coercions),typeof m=="function"))try{let g=S(w,m(f[w]));[].concat(d.aliases[w]||[],w).forEach($=>{O.add($),f[$]=g})}catch(g){C=g}})}function ue(f){return d.keys.forEach(m=>{~m.indexOf(".")||typeof f[m]>"u"&&(f[m]=void 0)}),f}function Ke(f,m,O,w=!1){Object.keys(O).forEach(function(g){Z(f,g.split("."))||(We(f,g.split("."),O[g]),w&&(y[g]=!0),(m[g]||[]).forEach(function($){Z(f,$.split("."))||We(f,$.split("."),O[g])}))})}function Z(f,m){let O=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(g){O=O[g]||{}});let w=m[m.length-1];return typeof O!="object"?!1:w in O}function We(f,m,O){let w=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(pe){pe=no(pe),typeof w=="object"&&w[pe]===void 0&&(w[pe]={}),typeof w[pe]!="object"||Array.isArray(w[pe])?(Array.isArray(w[pe])?w[pe].push({}):w[pe]=[w[pe],{}],w=w[pe][w[pe].length-1]):w=w[pe]});let g=no(m[m.length-1]),$=T(m.join("."),d.arrays),v=Array.isArray(O),q=o["duplicate-arguments-array"];!q&&T(g,d.nargs)&&(q=!0,(!fe(w[g])&&d.nargs[g]===1||Array.isArray(w[g])&&w[g].length===d.nargs[g])&&(w[g]=void 0)),O===Zr()?w[g]=Zr(w[g]):Array.isArray(w[g])?q&&$&&v?w[g]=o["flatten-duplicate-arrays"]?w[g].concat(O):(Array.isArray(w[g][0])?w[g]:[w[g]]).concat([O]):!q&&!!$==!!v?w[g]=O:w[g]=w[g].concat([O]):w[g]===void 0&&$?w[g]=v?O:[O]:q&&!(w[g]===void 0||T(g,d.counts)||T(g,d.bools))?w[g]=[w[g],O]:w[g]=O}function Lt(...f){f.forEach(function(m){Object.keys(m||{}).forEach(function(O){d.aliases[O]||(d.aliases[O]=[].concat(s[O]||[]),d.aliases[O].concat(O).forEach(function(w){if(/-/.test(w)&&o["camel-case-expansion"]){let g=st(w);g!==O&&d.aliases[O].indexOf(g)===-1&&(d.aliases[O].push(g),b[g]=!0)}}),d.aliases[O].concat(O).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&o["camel-case-expansion"]){let g=hr(w,"-");g!==O&&d.aliases[O].indexOf(g)===-1&&(d.aliases[O].push(g),b[g]=!0)}}),d.aliases[O].forEach(function(w){d.aliases[w]=[O].concat(d.aliases[O].filter(function(g){return w!==g}))}))})})}function T(f,m){let O=[].concat(d.aliases[f]||[],f),w=Object.keys(m),g=O.find($=>w.includes($));return g?m[g]:!1}function Ot(f){let m=Object.keys(d);return[].concat(m.map(w=>d[w])).some(function(w){return Array.isArray(w)?w.includes(f):w[f]})}function Tn(f,...m){return[].concat(...m).some(function(w){let g=f.match(w);return g&&Ot(g[1])})}function D(f){if(f.match(x)||!f.match(/^-[^-]+/))return!1;let m=!0,O,w=f.slice(1).split("");for(let g=0;g<w.length;g++){if(O=f.slice(g+2),!Ot(w[g])){m=!1;break}if(w[g+1]&&w[g+1]==="="||O==="-"||/[A-Za-z]/.test(w[g])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||w[g+1]&&w[g+1].match(/\W/))break}return m}function Q(f){return o["unknown-options-as-args"]&&X(f)}function X(f){return f=f.replace(/^-{3,}/,"--"),f.match(x)||D(f)?!1:!Tn(f,/^-+([^=]+?)=[\s\S]*$/,A,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function V(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in c?c[f]:le(Ce(f))}function le(f){return{[Pe.BOOLEAN]:!0,[Pe.STRING]:"",[Pe.NUMBER]:void 0,[Pe.ARRAY]:[]}[f]}function Ce(f){let m=Pe.BOOLEAN;return T(f,d.strings)?m=Pe.STRING:T(f,d.numbers)?m=Pe.NUMBER:T(f,d.bools)?m=Pe.BOOLEAN:T(f,d.arrays)&&(m=Pe.ARRAY),m}function fe(f){return f===void 0}function $r(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(C=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(C=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(Me,W),configuration:o,defaulted:Object.assign({},y),error:C,newAliases:Object.assign({},b)}}};function Fu(r){let e=[],t=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){e.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(c){return e[s].indexOf(c)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,c,u){return u.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function Zr(r){return r!==void 0?r+1:1}function no(r){return r==="__proto__"?"___proto___":r}var io=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<io)throw Error(`yargs parser supports a minimum Node.js version of ${io}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Wu=process?process.env:{},so=new gr({cwd:process.cwd,env:()=>Wu,format:Uu,normalize:Gu,resolve:zu,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return ku(r,"utf8");throw Error("only .json config files are supported in ESM")}}),kt=function(e,t){return so.parse(e.slice(),t).argv};kt.detailed=function(r,e){return so.parse(r.slice(),e)};kt.camelCase=st;kt.decamelize=hr;kt.looksLikeNumber=mr;var en=kt;import{basename as nf,dirname as sf,extname as of,relative as af,resolve as fo}from"path";function oo(){return Hu()?0:1}function Hu(){return Vu()&&!process.defaultApp}function Vu(){return!!process.versions.electron}function tn(r){return r.slice(oo()+1)}function ao(){return process.argv[oo()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as Bu,statSync as Yu,writeFile as Ku}from"fs";import{format as Xu}from"util";import{resolve as Ju}from"path";var co={fs:{readFileSync:Bu,writeFile:Ku},format:Xu,resolve:Ju,exists:r=>{try{return Yu(r).isFile()}catch{return!1}}};var Fe,rn=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Fe.format.apply(Fe.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(i),Fe.format.apply(Fe.format,c.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(i,s){let o=t[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Fe.fs.writeFile(o,c,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Fe.fs.readFileSync&&(e=JSON.parse(Fe.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Fe.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let i=Fe.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return Fe.exists(e)}};function lo(r,e){Fe=e;let t=new rn(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var Qu=r=>lo(r,co),uo=Qu;var cf="require is not supported by ESM",po="loading a directory of commands is not supported yet for ESM",lf=ho(import.meta.url).split("node_modules")[0],uf=ho(import.meta.url),nn={assert:{notStrictEqual:Zu,strictEqual:ef},cliui:Qr,findUp:to,getEnv:r=>process.env[r],inspect:tf,getCallerFile:()=>{throw new ne(po)},getProcessArgvBin:ao,mainFilename:lf||process.cwd(),Parser:en,path:{basename:nf,dirname:sf,extname:of,relative:af,resolve:fo},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:rf,require:()=>{throw new ne(cf)},requireDirectory:()=>{throw new ne(po)},stringWidth:r=>[...r].length,y18n:uo({directory:fo(uf,"../../../locales"),updateFiles:!1})};function Se(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function sn(r,e){e.assert.strictEqual(typeof r,"string")}function Rt(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function Je(r){let t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return t.forEach((o,c)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===t.length-1&&(u=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),s}var ff=["first","second","third","fourth","fifth","sixth"];function _(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[Je(`cmd ${r}`),e,t]}try{let i=0,[s,o,c]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=c||u.length;if(p<s.demanded.length)throw new ne(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let h=s.demanded.length+s.optional.length;if(p>h)throw new ne(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),y=mo(b);l.cmd.filter(d=>d===y||d==="*").length===0&&go(y,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),y=mo(b);l.cmd.filter(d=>d===y||d==="*").length===0&&go(y,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function mo(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function go(r,e,t){throw new ne(`Invalid ${ff[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var yr=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(_("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");let s=e[i];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let i=e;i.applyBeforeValidation=t,i.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function yo(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function ot(r,e,t,n){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(ie(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,c])=>Object.assign(o,c));{let o=s(i,e);return ie(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function at(r,e,t=n=>{throw n}){try{let n=df(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function df(r){return typeof r=="function"}function on(r){if(typeof Ue>"u")return null;for(let e=0,t=Object.keys(Ue.cache),n;e<t.length;e++)if(n=Ue.cache[t[e]],n.exports===r)return n;return null}var jt=/(^\*)|(^\$0)/,an=class{constructor(e,t,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,c,u)=>{let p=s(o,c,u);if(p){if(this.requireCache.has(c))return p;this.requireCache.add(c),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let c=[],u=yo(s);if(i=i||(()=>{}),Array.isArray(e))if(pf(e))[e,...c]=e;else for(let p of e)this.addHandler(p);else if(mf(e)){let p=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(p=[].concat(p).concat(e.aliases)),this.addHandler(p,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(bo(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=Je(e);c=c.map(b=>Je(b).cmd);let h=!1,l=[p.cmd].concat(c).filter(b=>jt.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],c=l.slice(1),e=e.replace(jt,p.cmd)),c.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,c,o),this.handlers[p.cmd]={original:e,description:t,handler:i,builder:n||{},middlewares:u,deprecated:o,demanded:p.demanded,optional:p.optional},h&&(this.defaultCommand=this.handlers[p.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,i,s,o){let c=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=t.getInternalMethods().getContext(),p=u.commands.slice(),h=!e;e&&(u.commands.push(e),u.fullCommands.push(c.original));let l=this.applyBuilderUpdateUsageAndParse(h,c,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,c,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,c,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,c,u){let p=t.builder,h=n;if(br(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=Eo(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,c)))}else hf(p)&&(h=n.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{h.option(l,p[l])}));return this.parseAndUpdateUsage(e,t,h,s,o,c)}parseAndUpdateUsage(e,t,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=jt.test(t.original)?t.original.replace(jt,"").trim():t.original,i=e.filter(s=>!jt.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,c));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=ot(n,c,p,!0),!c.getInternalMethods().getHasOutput()){let h=c.getInternalMethods().runValidation(o,u,c.parsed.error,e);n=at(n,l=>(h(l),l))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let h=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,h,!1,!1),n=ot(n,c,p,!1),n=at(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{c.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(e,t,n,i){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,c)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,c)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),i),c}populatePositional(e,t,n){let i=e.cmd[0];e.variadic?n[i]=t._.splice(0).map(String):t._.length&&(n[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=Je(e);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let p of Object.keys(n.alias))s.alias[p]=(s.alias[p]||[]).concat(n.alias[p]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(p=>{t[p].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[p]=!0),o.push(`--${p}`),o.push(h)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let p=Object.keys(t);Object.keys(t).forEach(h=>{p.push(...u.aliases[h])}),Object.keys(u.argv).forEach(h=>{p.indexOf(h)!==-1&&(t[h]||(t[h]=u.argv[h]),e[h]=u.argv[h])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=jt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(br(t))return t(e,!0);bo(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=on(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let i of[e,t,n]){if(typeof i=="string"||i===!1)return i;Se(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Se(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function wo(r,e,t,n){return new an(r,e,t,n)}function bo(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function pf(r){return r.every(e=>typeof e=="string")}function br(r){return typeof r=="function"}function hf(r){return typeof r=="object"}function mf(r){return typeof r=="object"&&!Array.isArray(r)}function Qe(r={},e=()=>!0){let t={};return Rt(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function Ze(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function gf(r){return typeof r=="boolean"}function Ao(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(S){i.push(S)};let s=null,o=!0;n.showHelpOnFail=function(S=!0,N){function F(){return typeof S=="string"?[!0,S]:[S,N]}let[ee,se]=F();return s=se,o=ee,n};let c=!1;n.fail=function(S,N){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(gf(se)){if(N)throw N;if(S)throw Error(S)}else se(S,N,n)}else{if(r.getExitProcess()&&Ze(!0),c||(c=!0,o&&(r.showHelp("error"),F.error()),(S||N)&&F.error(S||N),s&&((S||N)&&F.error(""),F.error(s))),N=N||new ne(S),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,N);throw N}};let u=[],p=!1;n.usage=(P,S)=>P===null?(p=!0,u=[],n):(p=!1,u.push([P,S||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=(P,S)=>{h.push([P,S||""])};let l=[];n.command=function(S,N,F,ee,se=!1){F&&(l=l.map(Y=>(Y[2]=!1,Y))),l.push([S,N||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(S,N){Array.isArray(S)?S.forEach(F=>{n.describe(F,N)}):typeof S=="object"?Object.keys(S).forEach(F=>{n.describe(F,S[F])}):b[S]=N},n.getDescriptions=()=>b;let y=[];n.epilog=P=>{y.push(P)};let E=!1,d;n.wrap=P=>{E=!0,d=P};function x(){return E||(d=Et(),E=!0),d}let A="__yargsString__:";n.deferY18nLookup=P=>A+P,n.help=function(){if(W)return W;B();let S=r.customScriptName?r.$0:e.path.basename(r.$0),N=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),Y=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(N)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(Y.default)),ue=ue.filter(bt),ue=Object.keys(ue.reduce((D,Q)=>(Q!=="_"&&(D[Q]=!0),D),{}));let Ke=x(),Z=e.cliui({width:Ke,wrap:!!Ke});if(!p){if(u.length)u.forEach(D=>{Z.div(`${D[0].replace(/\$0/g,S)}`),D[1]&&Z.div({text:`${D[1]}`,padding:[1,0,0,0]})}),Z.div();else if(l.length){let D=null;F._?D=`${S} <${t("command")}>
|
|
17
|
-
`:
|
|
18
|
-
`,
|
|
19
|
-
`);
|
|
20
|
-
`)}return
|
|
8
|
+
import{a as zr}from"./chunks/ERBLCNSR.js";import{a as ti,f as Q}from"./chunks/S3B562IT.js";import{a as ni,c as ii}from"./chunks/LRRSU5UY.js";import{a as At,b as oi,c as ai,d as ci,e as li,f as di}from"./chunks/VO775J6V.js";import{a as Fe,b as Xn,c as ei,g as ri}from"./chunks/D2BBHPMR.js";import{a as Xt}from"./chunks/BJ6Z66KZ.js";import{a as si}from"./chunks/ZYHLWT2C.js";import{a as Qn,u as Zn}from"./chunks/GKPSJEG5.js";import{$ as Ot,Da as Jn,Q as qn,T as Wn,a as zn,c as Ie,ca as dt,da as Rt,ga as ye,ia as Gn,k as Zt,ka as k,la as Hn,ma as Bn,qa as de,ra as It,ua as Kn,xa as Yn,y as Un,ya as Vn}from"./chunks/4ZCKAKVF.js";import"./chunks/6RTITFQA.js";import{a as Re,e as Pt}from"./chunks/RFWIIJFG.js";var $t=Pt(Xt(),1);import*as Ct from"node:process";try{let i=ei?.node;typeof i=="string"&&!$t.satisfies(Ct.version,i)&&k.warn(`
|
|
9
|
+
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${i}", Current "${Ct.version}"
|
|
10
|
+
|
|
11
|
+
`),$t.major(Ct.version)===20&&k.info(At([Ot(Rt("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ct.version}.`,"",`Update Node.js: ${ye("https://nodejs.org/en/download")}`]))}catch{}var Fr=Pt(zr(),1);import*as kr from"node:path";import{notStrictEqual as ds,strictEqual as fs}from"assert";var Ur={right:Br,center:Kr},qr=0,Lt=1,Wr=2,Mt=3,en=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
12
|
+
`).map(r=>r.split(" ")),n=0;return t.forEach(r=>{r.length>1&&be.stringWidth(r[0])>n&&(n=Math.min(Math.floor(this.width*.5),be.stringWidth(r[0])))}),t.forEach(r=>{this.div(...r.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&r.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=be.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
|
|
13
|
+
`)}rowToString(e,t){return this.rasterize(e).forEach((n,r)=>{let s="";n.forEach((o,c)=>{let{width:h}=e[c],y=this.negatePadding(e[c]),m=o;if(y>be.stringWidth(o)&&(m+=" ".repeat(y-be.stringWidth(o))),e[c].align&&e[c].align!=="left"&&this.wrap){let g=Ur[e[c].align];m=g(m,y),be.stringWidth(m)<y&&(m+=" ".repeat((h||0)-be.stringWidth(m)-1))}let u=e[c].padding||[0,0,0,0];u[Mt]&&(s+=" ".repeat(u[Mt])),s+=fi(e[c],m,"| "),s+=m,s+=fi(e[c],m," |"),u[Lt]&&(s+=" ".repeat(u[Lt])),r===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,s=t.text,o=be.stringWidth(s.trimRight());return t.span?this.wrap?r<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(r-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],n=this.columnWidths(e),r;return e.forEach((s,o)=>{s.width=n[o],this.wrap?r=be.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
14
|
+
`):r=s.text.split(`
|
|
15
|
+
`),s.border&&(r.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(r.unshift(...new Array(s.padding[qr]||0).fill("")),r.push(...new Array(s.padding[Wr]||0).fill(""))),r.forEach((c,h)=>{t[h]||t.push([]);let y=t[h];for(let m=0;m<o;m++)y[m]===void 0&&y.push("");y.push(c)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[Mt]||0)+(e.padding[Lt]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||be.stringWidth(o.text));let t=e.length,n=this.width,r=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),s=t?Math.floor(n/t):0;return r.map((o,c)=>o===void 0?Math.max(s,Gr(e[c])):o)}};function fi(i,e,t){return i.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Gr(i){let e=i.padding||[],t=1+(e[Mt]||0)+(e[Lt]||0);return i.border?t+4:t}function Hr(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Br(i,e){i=i.trim();let t=be.stringWidth(i);return t<e?" ".repeat(e-t)+i:i}function Kr(i,e){i=i.trim();let t=be.stringWidth(i);return t>=e?i:" ".repeat(e-t>>1)+i}var be;function ui(i,e){return be=e,new en({width:i?.width||Hr(),wrap:i?.wrap})}var pi=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function tn(i){return i.replace(pi,"")}function hi(i,e){let[t,n]=i.match(pi)||["",""];i=tn(i);let r="";for(let s=0;s<i.length;s++)s!==0&&s%e===0&&(r+=`
|
|
16
|
+
`),r+=i.charAt(s);return t&&n&&(r=`${t}${r}${n}`),r}function nn(i){return ui(i,{stringWidth:e=>[...e].length,stripAnsi:tn,wrap:hi})}import{dirname as mi,resolve as gi}from"path";import{readdirSync as Yr,statSync as Vr}from"fs";function yi(i,e){let t=gi(".",i),n;for(Vr(t).isDirectory()||(t=mi(t));;){if(n=e(t,Yr(t)),n)return gi(t,n);if(t=mi(n=t),n===t)break}}import{inspect as us}from"util";import{readFileSync as ps}from"fs";import{fileURLToPath as Pi}from"url";import{format as Qr}from"util";import{readFileSync as Zr}from"fs";import{normalize as Xr,resolve as es}from"path";function Ke(i){if(i!==i.toLowerCase()&&i!==i.toUpperCase()||(i=i.toLowerCase()),i.indexOf("-")===-1&&i.indexOf("_")===-1)return i;{let t="",n=!1,r=i.match(/^-+/);for(let s=r?r[0].length:0;s<i.length;s++){let o=i.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function Dt(i,e){let t=i.toLowerCase();e=e||"-";let n="";for(let r=0;r<i.length;r++){let s=t.charAt(r),o=i.charAt(r);s!==o&&r>0?n+=`${e}${t.charAt(r)}`:n+=o}return n}function Nt(i){return i==null?!1:typeof i=="number"||/^0x[0-9a-f]+$/i.test(i)?!0:/^0[^.]/.test(i)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(i)}function bi(i){if(Array.isArray(i))return i.map(o=>typeof o!="string"?o+"":o);i=i.trim();let e=0,t=null,n=null,r=null,s=[];for(let o=0;o<i.length;o++){if(t=n,n=i.charAt(o),n===" "&&!r){t!==" "&&e++;continue}n===r?r=null:(n==="'"||n==='"')&&!r&&(r=n),s[e]||(s[e]=""),s[e]+=n}return s}var Ce;(function(i){i.BOOLEAN="boolean",i.STRING="string",i.NUMBER="number",i.ARRAY="array"})(Ce||(Ce={}));var Me,Tt=class{constructor(e){Me=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),r=bi(e),s=Jr(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),h=n.configObjects||[],y=n.envPrefix,m=o["populate--"],u=m?"--":"_",g=Object.create(null),w=Object.create(null),O=n.__||Me.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(l){let f=typeof l=="object"?l.key:l,A=Object.keys(l).map(function(b){return{boolean:"bools",string:"strings",number:"numbers"}[b]}).filter(Boolean).pop();A&&(d[A][f]=!0),d.arrays[f]=!0,d.keys.push(f)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(l){d.bools[l]=!0,d.keys.push(l)}),[].concat(n.string||[]).filter(Boolean).forEach(function(l){d.strings[l]=!0,d.keys.push(l)}),[].concat(n.number||[]).filter(Boolean).forEach(function(l){d.numbers[l]=!0,d.keys.push(l)}),[].concat(n.count||[]).filter(Boolean).forEach(function(l){d.counts[l]=!0,d.keys.push(l)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(l){d.normalize[l]=!0,d.keys.push(l)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([l,f])=>{typeof f=="number"&&(d.nargs[l]=f,d.keys.push(l))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([l,f])=>{typeof f=="function"&&(d.coercions[l]=f,d.keys.push(l))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(l){d.configs[l]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([l,f])=>{(typeof f=="boolean"||typeof f=="function")&&(d.configs[l]=f)})),wt(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(l){(d.aliases[l]||[]).forEach(function(f){c[f]=c[l]})});let j=null;Qt();let G=[],z=Object.assign(Object.create(null),{_:[]}),Ee={};for(let l=0;l<r.length;l++){let f=r[l],A=f.replace(/^-{3,}/,"---"),b,p,x,v,D,ae;if(f!=="--"&&Y(f))ot(f);else if(A.match(/---+(=|$)/)){ot(f);continue}else if(f.match(/^--.+=/)||!o["short-option-groups"]&&f.match(/^-.+=/))v=f.match(/^--?([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&(L(v[1],d.arrays)?l=ct(l,v[1],r,v[2]):L(v[1],d.nargs)!==!1?l=at(l,v[1],r,v[2]):K(v[1],v[2]));else if(f.match(C)&&o["boolean-negation"])v=f.match(C),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],K(p,L(p,d.arrays)?[!1]:!1));else if(f.match(/^--.+/)||!o["short-option-groups"]&&f.match(/^-[^-]+/))v=f.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],L(p,d.arrays)?l=ct(l,p,r):L(p,d.nargs)!==!1?l=at(l,p,r):(D=r[l+1],D!==void 0&&(!D.match(/^-/)||D.match(S))&&!L(p,d.bools)&&!L(p,d.counts)||/^(true|false)$/.test(D)?(K(p,D),l++):K(p,q(p))));else if(f.match(/^-.\..+=/))v=f.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&K(v[1],v[2]);else if(f.match(/^-.\..+/)&&!f.match(S))D=r[l+1],v=f.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],D!==void 0&&!D.match(/^-/)&&!L(p,d.bools)&&!L(p,d.counts)?(K(p,D),l++):K(p,q(p)));else if(f.match(/^-[^-]+/)&&!f.match(S)){x=f.slice(1,-1).split(""),b=!1;for(let pe=0;pe<x.length;pe++){if(D=f.slice(pe+2),x[pe+1]&&x[pe+1]==="="){ae=f.slice(pe+3),p=x[pe],L(p,d.arrays)?l=ct(l,p,r,ae):L(p,d.nargs)!==!1?l=at(l,p,r,ae):K(p,ae),b=!0;break}if(D==="-"){K(x[pe],D);continue}if(/[A-Za-z]/.test(x[pe])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&L(D,d.bools)===!1){K(x[pe],D),b=!0;break}if(x[pe+1]&&x[pe+1].match(/\W/)){K(x[pe],D),b=!0;break}else K(x[pe],q(x[pe]))}p=f.slice(-1)[0],!b&&p!=="-"&&(L(p,d.arrays)?l=ct(l,p,r):L(p,d.nargs)!==!1?l=at(l,p,r):(D=r[l+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(S))&&!L(p,d.bools)&&!L(p,d.counts)||/^(true|false)$/.test(D)?(K(p,D),l++):K(p,q(p))))}else if(f.match(/^-[0-9]$/)&&f.match(S)&&L(f.slice(1),d.bools))p=f.slice(1),K(p,q(p));else if(f==="--"){G=r.slice(l+1);break}else if(o["halt-at-non-option"]){G=r.slice(l);break}else ot(f)}ee(z,!0),ee(z,!1),$(z),J(),Te(z,d.aliases,c,!0),H(z),o["set-placeholder-key"]&&se(z),Object.keys(d.counts).forEach(function(l){V(z,l.split("."))||K(l,0)}),m&&G.length&&(z[u]=[]),G.forEach(function(l){z[u].push(l)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(z).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete z[l]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(l=>s[l])).forEach(l=>{o["camel-case-expansion"]&&l.includes("-")&&delete z[l.split(".").map(f=>Ke(f)).join(".")],delete z[l]});function ot(l){let f=_("_",l);(typeof f=="string"||typeof f=="number")&&z._.push(f)}function at(l,f,A,b){let p,x=L(f,d.nargs);if(x=typeof x!="number"||isNaN(x)?1:x,x===0)return oe(b)||(j=Error(O("Argument unexpected for: %s",f))),K(f,q(f)),l;let v=oe(b)?0:1;if(o["nargs-eats-options"])A.length-(l+1)+v<x&&(j=Error(O("Not enough arguments following: %s",f))),v=x;else{for(p=l+1;p<A.length&&(!A[p].match(/^-[^0-9]/)||A[p].match(S)||Y(A[p]));p++)v++;v<x&&(j=Error(O("Not enough arguments following: %s",f)))}let D=Math.min(v,x);for(!oe(b)&&D>0&&(K(f,b),D--),p=l+1;p<D+l+1;p++)K(f,A[p]);return l+D}function ct(l,f,A,b){let p=[],x=b||A[l+1],v=L(f,d.nargs);if(L(f,d.bools)&&!/^(true|false)$/.test(x))p.push(!0);else if(oe(x)||oe(b)&&/^-/.test(x)&&!S.test(x)&&!Y(x)){if(c[f]!==void 0){let D=c[f];p=Array.isArray(D)?D:[D]}}else{oe(b)||p.push(R(f,b));for(let D=l+1;D<A.length&&!(!o["greedy-arrays"]&&p.length>0||v&&typeof v=="number"&&p.length>=v||(x=A[D],/^-/.test(x)&&!S.test(x)&&!Y(x)));D++)l=D,p.push(R(f,x))}return typeof v=="number"&&(v&&p.length<v||isNaN(v)&&p.length===0)&&(j=Error(O("Not enough arguments following: %s",f))),K(f,p),l}function K(l,f){if(/-/.test(l)&&o["camel-case-expansion"]){let p=l.split(".").map(function(x){return Ke(x)}).join(".");bt(l,p)}let A=R(l,f),b=l.split(".");Le(z,b,A),d.aliases[l]&&d.aliases[l].forEach(function(p){let x=p.split(".");Le(z,x,A)}),b.length>1&&o["dot-notation"]&&(d.aliases[b[0]]||[]).forEach(function(p){let x=p.split("."),v=[].concat(b);v.shift(),x=x.concat(v),(d.aliases[l]||[]).includes(x.join("."))||Le(z,x,A)}),L(l,d.normalize)&&!L(l,d.arrays)&&[l].concat(d.aliases[l]||[]).forEach(function(x){Object.defineProperty(Ee,x,{enumerable:!0,get(){return f},set(v){f=typeof v=="string"?Me.normalize(v):v}})})}function bt(l,f){d.aliases[l]&&d.aliases[l].length||(d.aliases[l]=[f],g[f]=!0),d.aliases[f]&&d.aliases[f].length||bt(f,l)}function R(l,f){typeof f=="string"&&(f[0]==="'"||f[0]==='"')&&f[f.length-1]===f[0]&&(f=f.substring(1,f.length-1)),(L(l,d.bools)||L(l,d.counts))&&typeof f=="string"&&(f=f==="true");let A=Array.isArray(f)?f.map(function(b){return _(l,b)}):_(l,f);return L(l,d.counts)&&(oe(A)||typeof A=="boolean")&&(A=rn()),L(l,d.normalize)&&L(l,d.arrays)&&(Array.isArray(f)?A=f.map(b=>Me.normalize(b)):A=Me.normalize(f)),A}function _(l,f){return!o["parse-positional-numbers"]&&l==="_"||!L(l,d.strings)&&!L(l,d.bools)&&!Array.isArray(f)&&(Nt(f)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${f}`)))||!oe(f)&&L(l,d.numbers))&&(f=Number(f)),f}function $(l){let f=Object.create(null);Te(f,d.aliases,c),Object.keys(d.configs).forEach(function(A){let b=l[A]||f[A];if(b)try{let p=null,x=Me.resolve(Me.cwd(),b),v=d.configs[A];if(typeof v=="function"){try{p=v(x)}catch(D){p=D}if(p instanceof Error){j=p;return}}else p=Me.require(x);T(p)}catch(p){p.name==="PermissionDenied"?j=p:l[A]&&(j=Error(O("Invalid JSON config file: %s",b)))}})}function T(l,f){Object.keys(l).forEach(function(A){let b=l[A],p=f?f+"."+A:A;typeof b=="object"&&b!==null&&!Array.isArray(b)&&o["dot-notation"]?T(b,p):(!V(z,p.split("."))||L(p,d.arrays)&&o["combine-arrays"])&&K(p,b)})}function J(){typeof h<"u"&&h.forEach(function(l){T(l)})}function ee(l,f){if(typeof y>"u")return;let A=typeof y=="string"?y:"",b=Me.env();Object.keys(b).forEach(function(p){if(A===""||p.lastIndexOf(A,0)===0){let x=p.split("__").map(function(v,D){return D===0&&(v=v.substring(A.length)),Ke(v)});(f&&d.configs[x.join(".")]||!f)&&!V(l,x)&&K(x.join("."),b[p])}})}function H(l){let f,A=new Set;Object.keys(l).forEach(function(b){if(!A.has(b)&&(f=L(b,d.coercions),typeof f=="function"))try{let p=_(b,f(l[b]));[].concat(d.aliases[b]||[],b).forEach(x=>{A.add(x),l[x]=p})}catch(p){j=p}})}function se(l){return d.keys.forEach(f=>{~f.indexOf(".")||typeof l[f]>"u"&&(l[f]=void 0)}),l}function Te(l,f,A,b=!1){Object.keys(A).forEach(function(p){V(l,p.split("."))||(Le(l,p.split("."),A[p]),b&&(w[p]=!0),(f[p]||[]).forEach(function(x){V(l,x.split("."))||Le(l,x.split("."),A[p])}))})}function V(l,f){let A=l;o["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(p){A=A[p]||{}});let b=f[f.length-1];return typeof A!="object"?!1:b in A}function Le(l,f,A){let b=l;o["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(ae){ae=wi(ae),typeof b=="object"&&b[ae]===void 0&&(b[ae]={}),typeof b[ae]!="object"||Array.isArray(b[ae])?(Array.isArray(b[ae])?b[ae].push({}):b[ae]=[b[ae],{}],b=b[ae][b[ae].length-1]):b=b[ae]});let p=wi(f[f.length-1]),x=L(f.join("."),d.arrays),v=Array.isArray(A),D=o["duplicate-arguments-array"];!D&&L(p,d.nargs)&&(D=!0,(!oe(b[p])&&d.nargs[p]===1||Array.isArray(b[p])&&b[p].length===d.nargs[p])&&(b[p]=void 0)),A===rn()?b[p]=rn(b[p]):Array.isArray(b[p])?D&&x&&v?b[p]=o["flatten-duplicate-arrays"]?b[p].concat(A):(Array.isArray(b[p][0])?b[p]:[b[p]]).concat([A]):!D&&!!x==!!v?b[p]=A:b[p]=b[p].concat([A]):b[p]===void 0&&x?b[p]=v?A:[A]:D&&!(b[p]===void 0||L(p,d.counts)||L(p,d.bools))?b[p]=[b[p],A]:b[p]=A}function wt(...l){l.forEach(function(f){Object.keys(f||{}).forEach(function(A){d.aliases[A]||(d.aliases[A]=[].concat(s[A]||[]),d.aliases[A].concat(A).forEach(function(b){if(/-/.test(b)&&o["camel-case-expansion"]){let p=Ke(b);p!==A&&d.aliases[A].indexOf(p)===-1&&(d.aliases[A].push(p),g[p]=!0)}}),d.aliases[A].concat(A).forEach(function(b){if(b.length>1&&/[A-Z]/.test(b)&&o["camel-case-expansion"]){let p=Dt(b,"-");p!==A&&d.aliases[A].indexOf(p)===-1&&(d.aliases[A].push(p),g[p]=!0)}}),d.aliases[A].forEach(function(b){d.aliases[b]=[A].concat(d.aliases[A].filter(function(p){return b!==p}))}))})})}function L(l,f){let A=[].concat(d.aliases[l]||[],l),b=Object.keys(f),p=A.find(x=>b.includes(x));return p?f[p]:!1}function lt(l){let f=Object.keys(d);return[].concat(f.map(b=>d[b])).some(function(b){return Array.isArray(b)?b.includes(l):b[l]})}function kn(l,...f){return[].concat(...f).some(function(b){let p=l.match(b);return p&<(p[1])})}function M(l){if(l.match(S)||!l.match(/^-[^-]+/))return!1;let f=!0,A,b=l.slice(1).split("");for(let p=0;p<b.length;p++){if(A=l.slice(p+2),!lt(b[p])){f=!1;break}if(b[p+1]&&b[p+1]==="="||A==="-"||/[A-Za-z]/.test(b[p])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(A)||b[p+1]&&b[p+1].match(/\W/))break}return f}function Y(l){return o["unknown-options-as-args"]&&B(l)}function B(l){return l=l.replace(/^-{3,}/,"--"),l.match(S)||M(l)?!1:!kn(l,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function q(l){return!L(l,d.bools)&&!L(l,d.counts)&&`${l}`in c?c[l]:re(me(l))}function re(l){return{[Ce.BOOLEAN]:!0,[Ce.STRING]:"",[Ce.NUMBER]:void 0,[Ce.ARRAY]:[]}[l]}function me(l){let f=Ce.BOOLEAN;return L(l,d.strings)?f=Ce.STRING:L(l,d.numbers)?f=Ce.NUMBER:L(l,d.bools)?f=Ce.BOOLEAN:L(l,d.arrays)&&(f=Ce.ARRAY),f}function oe(l){return l===void 0}function Qt(){Object.keys(d.counts).find(l=>L(l,d.arrays)?(j=Error(O("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):L(l,d.nargs)?(j=Error(O("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(Ee,z),configuration:o,defaulted:Object.assign({},w),error:j,newAliases:Object.assign({},g)}}};function Jr(i){let e=[],t=Object.create(null),n=!0;for(Object.keys(i).forEach(function(r){e.push([].concat(i[r],r))});n;){n=!1;for(let r=0;r<e.length;r++)for(let s=r+1;s<e.length;s++)if(e[r].filter(function(c){return e[s].indexOf(c)!==-1}).length){e[r]=e[r].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(r){r=r.filter(function(o,c,h){return h.indexOf(o)===c});let s=r.pop();s!==void 0&&typeof s=="string"&&(t[s]=r)}),t}function rn(i){return i!==void 0?i+1:1}function wi(i){return i==="__proto__"?"___proto___":i}var Oi=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<Oi)throw Error(`yargs parser supports a minimum Node.js version of ${Oi}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ts=process?process.env:{},Ai=new Tt({cwd:process.cwd,env:()=>ts,format:Qr,normalize:Xr,resolve:es,require:i=>{if(typeof Re<"u")return Re(i);if(i.match(/\.json$/))return Zr(i,"utf8");throw Error("only .json config files are supported in ESM")}}),_t=function(e,t){return Ai.parse(e.slice(),t).argv};_t.detailed=function(i,e){return Ai.parse(i.slice(),e)};_t.camelCase=Ke;_t.decamelize=Dt;_t.looksLikeNumber=Nt;var sn=_t;import{basename as hs,dirname as ms,extname as gs,relative as ys,resolve as vi}from"path";function Ci(){return ns()?0:1}function ns(){return is()&&!process.defaultApp}function is(){return!!process.versions.electron}function on(i){return i.slice(Ci()+1)}function _i(){return process.argv[Ci()]}var Z=class i extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,i)}};import{readFileSync as rs,statSync as ss,writeFile as os}from"fs";import{format as as}from"util";import{resolve as cs}from"path";var ji={fs:{readFileSync:rs,writeFile:os},format:as,resolve:cs,exists:i=>{try{return ss(i).isFile()}catch{return!1}}};var Pe,an=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Pe.format.apply(Pe.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),r=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][r===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(r),Pe.format.apply(Pe.format,c.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(r,s){let o=t[s+1];n+=r,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,r=t.locale,s=t.cb,o=this._resolveLocaleFile(n,r),c=JSON.stringify(this.cache[r],null,2);Pe.fs.writeFile(o,c,"utf-8",function(h){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(h)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Pe.fs.readFileSync&&(e=JSON.parse(Pe.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Pe.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let r=Pe.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return Pe.exists(e)}};function Si(i,e){Pe=e;let t=new an(i);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var ls=i=>Si(i,ji),xi=ls;var bs="require is not supported by ESM",Ei="loading a directory of commands is not supported yet for ESM",ws=Pi(import.meta.url).split("node_modules")[0],Os=Pi(import.meta.url),cn={assert:{notStrictEqual:ds,strictEqual:fs},cliui:nn,findUp:yi,getEnv:i=>process.env[i],inspect:us,getCallerFile:()=>{throw new Z(Ei)},getProcessArgvBin:_i,mainFilename:ws||process.cwd(),Parser:sn,path:{basename:hs,dirname:ms,extname:gs,relative:ys,resolve:vi},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:ps,require:()=>{throw new Z(bs)},requireDirectory:()=>{throw new Z(Ei)},stringWidth:i=>[...i].length,y18n:xi({directory:vi(Os,"../../../locales"),updateFiles:!1})};function he(i,e,t,n){t.assert.notStrictEqual(i,e,n)}function ln(i,e){e.assert.strictEqual(typeof i,"string")}function ft(i){return Object.keys(i)}function X(i){return!!i&&!!i.then&&typeof i.then=="function"}function ke(i){let t=i.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=t.shift();if(!r)throw new Error(`No command found in: ${i}`);let s={cmd:r.replace(n,""),demanded:[],optional:[]};return t.forEach((o,c)=>{let h=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===t.length-1&&(h=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:h}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:h})}),s}var As=["first","second","third","fourth","fifth","sixth"];function E(i,e,t){function n(){return typeof i=="object"?[{demanded:[],optional:[]},i,e]:[ke(`cmd ${i}`),e,t]}try{let r=0,[s,o,c]=n(),h=[].slice.call(o);for(;h.length&&h[h.length-1]===void 0;)h.pop();let y=c||h.length;if(y<s.demanded.length)throw new Z(`Not enough arguments provided. Expected ${s.demanded.length} but received ${h.length}.`);let m=s.demanded.length+s.optional.length;if(y>m)throw new Z(`Too many arguments provided. Expected max ${m} but received ${y}.`);s.demanded.forEach(u=>{let g=h.shift(),w=Ri(g);u.cmd.filter(d=>d===w||d==="*").length===0&&Ii(w,u.cmd,r),r+=1}),s.optional.forEach(u=>{if(h.length===0)return;let g=h.shift(),w=Ri(g);u.cmd.filter(d=>d===w||d==="*").length===0&&Ii(w,u.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function Ri(i){return Array.isArray(i)?"array":i===null?"null":typeof i}function Ii(i,e,t){throw new Z(`Invalid ${As[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${i}.`)}var Ft=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(E("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let r=0;r<e.length;r++){if(typeof e[r]!="function")throw Error("middleware must be a function");let s=e[r];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let r=e;r.applyBeforeValidation=t,r.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let s=[...n[t]||[],t];return r.option?!s.includes(r.option):!0}),e.option=t,this.addMiddleware(e,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function $i(i){return i?i.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Ye(i,e,t,n){return t.reduce((r,s)=>{if(s.applyBeforeValidation!==n)return r;if(X(r))return r.then(o=>Promise.all([o,s(o,e)])).then(([o,c])=>Object.assign(o,c));{let o=s(r,e);return X(o)?o.then(c=>Object.assign(r,c)):Object.assign(r,o)}},i)}function Ve(i,e,t=n=>{throw n}){try{let n=Cs(i)?i():i;return X(n)?n.then(r=>e(r)):e(n)}catch(n){return t(n)}}function Cs(i){return typeof i=="function"}function dn(i){if(typeof Re>"u")return null;for(let e=0,t=Object.keys(Re.cache),n;e<t.length;e++)if(n=Re.cache[t[e]],n.exports===i)return n;return null}var ut=/(^\*)|(^\$0)/,fn=class{constructor(e,t,n,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let s=typeof r.visit=="function"?r.visit:o=>o;r.visit=(o,c,h)=>{let y=s(o,c,h);if(y){if(this.requireCache.has(c))return y;this.requireCache.add(c),this.addHandler(y)}return y},this.shim.requireDirectory({require:t,filename:n},e,r)}addHandler(e,t,n,r,s,o){let c=[],h=$i(s);if(r=r||(()=>{}),Array.isArray(e))if(_s(e))[e,...c]=e;else for(let y of e)this.addHandler(y);else if(Ss(e)){let y=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(y=[].concat(y).concat(e.aliases)),this.addHandler(y,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Li(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let y=ke(e);c=c.map(g=>ke(g).cmd);let m=!1,u=[y.cmd].concat(c).filter(g=>ut.test(g)?(m=!0,!1):!0);u.length===0&&m&&u.push("$0"),m&&(y.cmd=u[0],c=u.slice(1),e=e.replace(ut,y.cmd)),c.forEach(g=>{this.aliasMap[g]=y.cmd}),t!==!1&&this.usage.command(e,t,m,c,o),this.handlers[y.cmd]={original:e,description:t,handler:r,builder:n||{},middlewares:h,deprecated:o,demanded:y.demanded,optional:y.optional},m&&(this.defaultCommand=this.handlers[y.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,r,s,o){let c=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,h=t.getInternalMethods().getContext(),y=h.commands.slice(),m=!e;e&&(h.commands.push(e),h.fullCommands.push(c.original));let u=this.applyBuilderUpdateUsageAndParse(m,c,t,n.aliases,y,r,s,o);return X(u)?u.then(g=>this.applyMiddlewareAndGetResult(m,c,g.innerArgv,h,s,g.aliases,t)):this.applyMiddlewareAndGetResult(m,c,u.innerArgv,h,s,u.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,r,s,o,c,h){let y=t.builder,m=n;if(kt(y)){let u=y(n.getInternalMethods().reset(r),h);if(X(u))return u.then(g=>(m=Di(g)?g:n,this.parseAndUpdateUsage(e,t,m,s,o,c)))}else js(y)&&(m=n.getInternalMethods().reset(r),Object.keys(t.builder).forEach(u=>{m.option(u,y[u])}));return this.parseAndUpdateUsage(e,t,m,s,o,c)}parseAndUpdateUsage(e,t,n,r,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return X(c)?c.then(h=>({aliases:n.parsed.aliases,innerArgv:h})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=ut.test(t.original)?t.original.replace(ut,"").trim():t.original,r=e.filter(s=>!ut.test(s));return r.push(n),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,r,s,o,c){let h={};if(s)return n;c.getInternalMethods().getHasOutput()||(h=this.populatePositionals(t,n,r,c));let y=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=Ye(n,c,y,!0),!c.getInternalMethods().getHasOutput()){let m=c.getInternalMethods().runValidation(o,h,c.parsed.error,e);n=Ve(n,u=>(m(u),u))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let m=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,m,!1,!1),n=Ye(n,c,y,!1),n=Ve(n,u=>{let g=t.handler(u);return X(g)?g.then(()=>u):u}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),X(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(u=>{try{c.getInternalMethods().getUsageInstance().fail(null,u)}catch{}})}return e||(r.commands.pop(),r.fullCommands.pop()),n}populatePositionals(e,t,n,r){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let h=s.shift();this.populatePositional(h,t,c)}for(;o.length;){let h=o.shift();this.populatePositional(h,t,c)}return t._=n.commands.concat(t._.map(h=>""+h)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),r),c}populatePositional(e,t,n){let r=e.cmd[0];e.variadic?n[r]=t._.splice(0).map(String):t._.length&&(n[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=ke(e);return n.demanded.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(r=>{let[s,...o]=r.cmd;r.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,r){let s=Object.assign({},r.getOptions());s.default=Object.assign(n.default,s.default);for(let y of Object.keys(n.alias))s.alias[y]=(s.alias[y]||[]).concat(n.alias[y]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(y=>{t[y].map(m=>{s.configuration["unknown-options-as-args"]&&(s.key[y]=!0),o.push(`--${y}`),o.push(m)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),h=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(h.error)r.getInternalMethods().getUsageInstance().fail(h.error.message,h.error);else{let y=Object.keys(t);Object.keys(t).forEach(m=>{y.push(...h.aliases[m])}),Object.keys(h.argv).forEach(m=>{y.indexOf(m)!==-1&&(t[m]||(t[m]=h.argv[m]),e[m]=h.argv[m])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=ut.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(kt(t))return t(e,!0);Li(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=dn(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let r of[e,t,n]){if(typeof r=="string"||r===!1)return r;he(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();he(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Mi(i,e,t,n){return new fn(i,e,t,n)}function Li(i){return typeof i=="object"&&!!i.builder&&typeof i.handler=="function"}function _s(i){return i.every(e=>typeof e=="string")}function kt(i){return typeof i=="function"}function js(i){return typeof i=="object"}function Ss(i){return typeof i=="object"&&!Array.isArray(i)}function ze(i={},e=()=>!0){let t={};return ft(i).forEach(n=>{e(n,i[n])&&(t[n]=i[n])}),t}function Ue(i){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(i)})}function xs(i){return typeof i=="boolean"}function Ti(i,e){let t=e.y18n.__,n={},r=[];n.failFn=function(_){r.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,$){function T(){return typeof _=="string"?[!0,_]:[_,$]}let[J,ee]=T();return s=ee,o=J,n};let c=!1;n.fail=function(_,$){let T=i.getInternalMethods().getLoggerInstance();if(r.length)for(let J=r.length-1;J>=0;--J){let ee=r[J];if(xs(ee)){if($)throw $;if(_)throw Error(_)}else ee(_,$,n)}else{if(i.getExitProcess()&&Ue(!0),c||(c=!0,o&&(i.showHelp("error"),T.error()),(_||$)&&T.error(_||$),s&&((_||$)&&T.error(""),T.error(s))),$=$||new Z(_),i.getExitProcess())return i.exit(1);if(i.getInternalMethods().hasParseCallback())return i.exit(1,$);throw $}};let h=[],y=!1;n.usage=(R,_)=>R===null?(y=!0,h=[],n):(y=!1,h.push([R,_||""]),n),n.getUsage=()=>h,n.getUsageDisabled=()=>y,n.getPositionalGroupName=()=>t("Positionals:");let m=[];n.example=(R,_)=>{m.push([R,_||""])};let u=[];n.command=function(_,$,T,J,ee=!1){T&&(u=u.map(H=>(H[2]=!1,H))),u.push([_,$||"",T,J,ee])},n.getCommands=()=>u;let g={};n.describe=function(_,$){Array.isArray(_)?_.forEach(T=>{n.describe(T,$)}):typeof _=="object"?Object.keys(_).forEach(T=>{n.describe(T,_[T])}):g[_]=$},n.getDescriptions=()=>g;let w=[];n.epilog=R=>{w.push(R)};let O=!1,d;n.wrap=R=>{O=!0,d=R};function S(){return O||(d=ct(),O=!0),d}let C="__yargsString__:";n.deferY18nLookup=R=>C+R,n.help=function(){if(z)return z;G();let _=i.customScriptName?i.$0:e.path.basename(i.$0),$=i.getDemandedOptions(),T=i.getDemandedCommands(),J=i.getDeprecatedOptions(),ee=i.getGroups(),H=i.getOptions(),se=[];se=se.concat(Object.keys(g)),se=se.concat(Object.keys($)),se=se.concat(Object.keys(T)),se=se.concat(Object.keys(H.default)),se=se.filter(ot),se=Object.keys(se.reduce((M,Y)=>(Y!=="_"&&(M[Y]=!0),M),{}));let Te=S(),V=e.cliui({width:Te,wrap:!!Te});if(!y){if(h.length)h.forEach(M=>{V.div(`${M[0].replace(/\$0/g,_)}`),M[1]&&V.div({text:`${M[1]}`,padding:[1,0,0,0]})}),V.div();else if(u.length){let M=null;T._?M=`${_} <${t("command")}>
|
|
17
|
+
`:M=`${_} [${t("command")}]
|
|
18
|
+
`,V.div(`${M}`)}}if(u.length>1||u.length===1&&!u[0][2]){V.div(t("Commands:"));let M=i.getInternalMethods().getContext(),Y=M.commands.length?`${M.commands.join(" ")} `:"";i.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(u=u.sort((B,q)=>B[0].localeCompare(q[0]))),u.forEach(B=>{let q=`${_} ${Y}${B[0].replace(/^\$0 ?/,"")}`;V.span({text:q,padding:[0,2,0,2],width:j(u,Te,`${_}${Y}`)+4},{text:B[1]});let re=[];B[2]&&re.push(`[${t("default")}]`),B[3]&&B[3].length&&re.push(`[${t("aliases:")} ${B[3].join(", ")}]`),B[4]&&(typeof B[4]=="string"?re.push(`[${t("deprecated: %s",B[4])}]`):re.push(`[${t("deprecated")}]`)),re.length?V.div({text:re.join(" "),padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}let Le=(Object.keys(H.alias)||[]).concat(Object.keys(i.parsed.newAliases)||[]);se=se.filter(M=>!i.parsed.newAliases[M]&&Le.every(Y=>(H.alias[Y]||[]).indexOf(M)===-1));let wt=t("Options:");ee[wt]||(ee[wt]=[]),Ee(se,H.alias,ee,wt);let L=M=>/^--/.test(zt(M)),lt=Object.keys(ee).filter(M=>ee[M].length>0).map(M=>{let Y=ee[M].filter(ot).map(B=>{if(~Le.indexOf(B))return B;for(let q=0,re;(re=Le[q])!==void 0;q++)if(~(H.alias[re]||[]).indexOf(B))return re;return B});return{groupName:M,normalizedKeys:Y}}).filter(({normalizedKeys:M})=>M.length>0).map(({groupName:M,normalizedKeys:Y})=>{let B=Y.reduce((q,re)=>(q[re]=[re].concat(H.alias[re]||[]).map(me=>M===n.getPositionalGroupName()?me:(/^[0-9]$/.test(me)?~H.boolean.indexOf(re)?"-":"--":me.length>1?"--":"-")+me).sort((me,oe)=>L(me)===L(oe)?0:L(me)?1:-1).join(", "),q),{});return{groupName:M,normalizedKeys:Y,switches:B}});if(lt.filter(({groupName:M})=>M!==n.getPositionalGroupName()).some(({normalizedKeys:M,switches:Y})=>!M.every(B=>L(Y[B])))&<.filter(({groupName:M})=>M!==n.getPositionalGroupName()).forEach(({normalizedKeys:M,switches:Y})=>{M.forEach(B=>{L(Y[B])&&(Y[B]=vs(Y[B],4))})}),lt.forEach(({groupName:M,normalizedKeys:Y,switches:B})=>{V.div(M),Y.forEach(q=>{let re=B[q],me=g[q]||"",oe=null;~me.lastIndexOf(C)&&(me=t(me.substring(C.length))),~H.boolean.indexOf(q)&&(oe=`[${t("boolean")}]`),~H.count.indexOf(q)&&(oe=`[${t("count")}]`),~H.string.indexOf(q)&&(oe=`[${t("string")}]`),~H.normalize.indexOf(q)&&(oe=`[${t("string")}]`),~H.array.indexOf(q)&&(oe=`[${t("array")}]`),~H.number.indexOf(q)&&(oe=`[${t("number")}]`);let Qt=f=>typeof f=="string"?`[${t("deprecated: %s",f)}]`:`[${t("deprecated")}]`,l=[q in J?Qt(J[q]):null,oe,q in $?`[${t("required")}]`:null,H.choices&&H.choices[q]?`[${t("choices:")} ${n.stringifiedValues(H.choices[q])}]`:null,at(H.default[q],H.defaultDescription[q])].filter(Boolean).join(" ");V.span({text:zt(re),padding:[0,2,0,2+Ni(re)],width:j(B,Te)+4},me),l?V.div({text:l,padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}),m.length&&(V.div(t("Examples:")),m.forEach(M=>{M[0]=M[0].replace(/\$0/g,_)}),m.forEach(M=>{M[1]===""?V.div({text:M[0],padding:[0,2,0,2]}):V.div({text:M[0],padding:[0,2,0,2],width:j(m,Te)+4},{text:M[1]})}),V.div()),w.length>0){let M=w.map(Y=>Y.replace(/\$0/g,_)).join(`
|
|
19
|
+
`);V.div(`${M}
|
|
20
|
+
`)}return V.toString().replace(/\s*$/,"")};function j(R,_,$){let T=0;return Array.isArray(R)||(R=Object.values(R).map(J=>[J])),R.forEach(J=>{T=Math.max(e.stringWidth($?`${$} ${zt(J[0])}`:zt(J[0]))+Ni(J[0]),T)}),_&&(T=Math.min(T,parseInt((_*.5).toString(),10))),T}function G(){let R=i.getDemandedOptions(),_=i.getOptions();(Object.keys(_.alias)||[]).forEach($=>{_.alias[$].forEach(T=>{g[T]&&n.describe($,g[T]),T in R&&i.demandOption($,R[T]),~_.boolean.indexOf(T)&&i.boolean($),~_.count.indexOf(T)&&i.count($),~_.string.indexOf(T)&&i.string($),~_.normalize.indexOf(T)&&i.normalize($),~_.array.indexOf(T)&&i.array($),~_.number.indexOf(T)&&i.number($)})})}let z;n.cacheHelpMessage=function(){z=this.help()},n.clearCachedHelpMessage=function(){z=void 0},n.hasCachedHelpMessage=function(){return!!z};function Ee(R,_,$,T){let J=[],ee=null;return Object.keys($).forEach(H=>{J=J.concat($[H])}),R.forEach(H=>{ee=[H].concat(_[H]),ee.some(se=>J.indexOf(se)!==-1)||$[T].push(H)}),J}function ot(R){return i.getOptions().hiddenOptions.indexOf(R)<0||i.parsed.argv[i.getOptions().showHiddenOpt]}n.showHelp=R=>{let _=i.getInternalMethods().getLoggerInstance();R||(R="error"),(typeof R=="function"?R:_[R])(n.help())},n.functionDescription=R=>["(",R.name?e.Parser.decamelize(R.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(_,$){let T="",J=$||", ",ee=[].concat(_);return!_||!ee.length||ee.forEach(H=>{T.length&&(T+=J),T+=JSON.stringify(H)}),T};function at(R,_){let $=`[${t("default:")} `;if(R===void 0&&!_)return null;if(_)$+=_;else switch(typeof R){case"string":$+=`"${R}"`;break;case"object":$+=JSON.stringify(R);break;default:$+=R}return`${$}]`}function ct(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let K=null;n.version=R=>{K=R},n.showVersion=R=>{let _=i.getInternalMethods().getLoggerInstance();R||(R="error"),(typeof R=="function"?R:_[R])(K)},n.reset=function(_){return s=null,c=!1,h=[],y=!1,w=[],m=[],u=[],g=ze(g,$=>!_[$]),n};let bt=[];return n.freeze=function(){bt.push({failMessage:s,failureOutput:c,usages:h,usageDisabled:y,epilogs:w,examples:m,commands:u,descriptions:g})},n.unfreeze=function(){let _=bt.pop();_&&({failMessage:s,failureOutput:c,usages:h,usageDisabled:y,epilogs:w,examples:m,commands:u,descriptions:g}=_)},n}function un(i){return typeof i=="object"}function vs(i,e){return un(i)?{text:i.text,indentation:i.indentation+e}:{text:i,indentation:e}}function Ni(i){return un(i)?i.indentation:0}function zt(i){return un(i)?i.text:i}var Fi=`###-begin-{{app_name}}-completions-###
|
|
21
21
|
#
|
|
22
22
|
# yargs command completion script
|
|
23
23
|
#
|
|
@@ -45,7 +45,7 @@ _{{app_name}}_yargs_completions()
|
|
|
45
45
|
}
|
|
46
46
|
complete -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
47
47
|
###-end-{{app_name}}-completions-###
|
|
48
|
-
`,
|
|
48
|
+
`,ki=`#compdef {{app_name}}
|
|
49
49
|
###-begin-{{app_name}}-completions-###
|
|
50
50
|
#
|
|
51
51
|
# yargs command completion script
|
|
@@ -64,105 +64,106 @@ _{{app_name}}_yargs_completions()
|
|
|
64
64
|
}
|
|
65
65
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
66
66
|
###-end-{{app_name}}-completions-###
|
|
67
|
-
`;var
|
|
68
|
-
${
|
|
69
|
-
`)}`:"";e.fail(
|
|
70
|
-
${n("Argument: %s, Given: %s, Choices: %s",
|
|
71
|
-
`;b.forEach(E=>{y+=E}),e.fail(y)}};let u={};s.conflicts=function(l,b){_("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(y=>{s.conflicts(y,l[y])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(y=>s.conflicts(l,y)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(y=>{y&&l[b]!==void 0&&l[y]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,y))})})},s.recommendCommands=function(l,b){b=b.sort((x,A)=>A.length-x.length);let E=null,d=1/0;for(let x=0,A;(A=b[x])!==void 0;x++){let C=jo(l,A);C<=3&&C<d&&(d=C,E=A)}E&&e.fail(n("Did you mean %s?",E))},s.reset=function(l){return o=Qe(o,b=>!l[b]),u=Qe(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();Se(l,void 0,t),{implied:o,conflicting:u}=l},s}var un=[],Gt;function zt(r,e,t,n){Gt=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Af(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}Of(o),un.push(o),i=s?JSON.parse(Gt.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=zt(i,Gt.path.dirname(o),t,Gt)}return un=[],t?vo(i,r):Object.assign({},i,r)}function Of(r){if(un.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function Af(r,e){return Gt.path.resolve(r,e)}function vo(r,e){let t={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,r);for(let i of Object.keys(e))n(e[i])&&n(t[i])?t[i]=vo(r[i],e[i]):t[i]=e[i];return t}var I=function(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t},a=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,ct,Wt,Le,xe,Er,et,lt,Ne,Or,Te,ze,$e,De,xt,he,L,Ar,Sr,ve,ut,$t,ft,tt,Cr,M,dt,pt,ht,k,Be,oe;function Vo(r){return(e=[],t=r.process.cwd(),n)=>{let i=new On(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var _o=Symbol("copyDoubleDash"),Io=Symbol("copyDoubleDash"),fn=Symbol("deleteFromParserHintObject"),Po=Symbol("freeze"),Lo=Symbol("getDollarZero"),mt=Symbol("getParserConfiguration"),dn=Symbol("guessLocale"),No=Symbol("guessVersion"),To=Symbol("parsePositionalNumbers"),pn=Symbol("pkgUp"),rt=Symbol("populateParserHintArray"),vt=Symbol("populateParserHintSingleValueDictionary"),hn=Symbol("populateParserHintArrayDictionary"),mn=Symbol("populateParserHintDictionary"),gn=Symbol("sanitizeKey"),yn=Symbol("setKey"),bn=Symbol("unfreeze"),Do=Symbol("validateAsync"),qo=Symbol("getCommandInstance"),Mo=Symbol("getContext"),Fo=Symbol("getHasOutput"),Uo=Symbol("getLoggerInstance"),ko=Symbol("getParseContext"),Go=Symbol("getUsageInstance"),zo=Symbol("getValidationInstance"),Rr=Symbol("hasParseCallback"),gt=Symbol("postProcess"),Wo=Symbol("rebase"),wn=Symbol("reset"),Ht=Symbol("runYargsParserAndExecuteCommands"),En=Symbol("runValidation"),Ho=Symbol("setHasOutput"),On=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),ct.set(this,void 0),Wt.set(this,{commands:[],fullCommands:[]}),Le.set(this,null),xe.set(this,null),Er.set(this,"show-hidden"),et.set(this,null),lt.set(this,!0),Ne.set(this,!0),Or.set(this,[]),Te.set(this,void 0),ze.set(this,{}),$e.set(this,!1),De.set(this,null),xt.set(this,void 0),he.set(this,""),L.set(this,void 0),Ar.set(this,void 0),Sr.set(this,{}),ve.set(this,null),ut.set(this,null),$t.set(this,{}),ft.set(this,{}),tt.set(this,void 0),Cr.set(this,!1),M.set(this,void 0),dt.set(this,!1),pt.set(this,!1),ht.set(this,!1),k.set(this,void 0),Be.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,tt,e),I(this,ct,t),I(this,Ar,n),I(this,Te,new yr(this)),this.$0=this[Lo](),this[wn](),I(this,ce,a(this,ce)),I(this,k,a(this,k)),I(this,oe,a(this,oe)),I(this,L,a(this,L)),a(this,L).showHiddenOpt=a(this,Er),I(this,xt,this[Io]())}addHelpOpt(e,t){let n="help";return _("[string|boolean] [string]",[e,t],arguments.length),a(this,De)&&(this[fn](a(this,De)),I(this,De,null)),e===!1&&t===void 0?this:(I(this,De,typeof e=="string"?e:n),this.boolean(a(this,De)),this.describe(a(this,De),t||a(this,k).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(_("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,Er);return this.boolean(n),this.describe(n,t||a(this,k).deferY18nLookup("Show hidden options")),a(this,L).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return _("<object|string|array> [string|array]",[e,t],arguments.length),this[hn](this.alias.bind(this),"alias",e,t),this}array(e){return _("<array|string>",[e],arguments.length),this[rt]("array",e),this}boolean(e){return _("<array|string>",[e],arguments.length),this[rt]("boolean",e),this}check(e,t){return _("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>at(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,k).fail(s.toString(),s):a(this,k).fail(a(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,k).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return _("<object|string|array> [string|array]",[e,t],arguments.length),this[hn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(_("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new ne("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new ne("coerce callback must be provided");return a(this,L).key[e]=!0,a(this,Te).addCoerceMiddleware((n,i)=>{let s;return at(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return _("<string|object> [string|array]",[e,t],arguments.length),a(this,oe).conflicts(e,t),this}config(e="config",t,n){return _("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=zt(e,a(this,ct),this[mt]()["deep-merge-config"]||!1,a(this,M)),a(this,L).configObjects=(a(this,L).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,k).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{a(this,L).config[i]=n||!0}),this)}completion(e,t,n){return _("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,xe,e||a(this,xe)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,xe),t),n&&a(this,Le).registerFunction(n),this}command(e,t,n,i,s,o){return _("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),a(this,ce).addHandler(e,t,n,i,s,o),this}commands(e,t,n,i,s,o){return this.command(e,t,n,i,s,o)}commandDir(e,t){_("<string> [object]",[e,t],arguments.length);let n=a(this,Ar)||a(this,M).require;return a(this,ce).addDirectory(e,n,a(this,M).getCallerFile(),t),this}count(e){return _("<array|string>",[e],arguments.length),this[rt]("count",e),this}default(e,t,n){return _("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(sn(e,a(this,M)),a(this,L).defaultDescription[e]=n),typeof t=="function"&&(sn(e,a(this,M)),a(this,L).defaultDescription[e]||(a(this,L).defaultDescription[e]=a(this,k).functionDescription(t)),t=t.call()),this[vt](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,i){return _("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,i],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),a(this,L).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{Se(n,!0,a(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(Se(n,!0,a(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{Se(n,!0,a(this,M)),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return _("<object|string|array> [string]",[e,t],arguments.length),this[vt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return _("<string> [string|boolean]",[e,t],arguments.length),a(this,L).deprecatedOptions[e]=t,this}describe(e,t){return _("<object|string|array> [string]",[e,t],arguments.length),this[yn](e,!0),a(this,k).describe(e,t),this}detectLocale(e){return _("<boolean>",[e],arguments.length),I(this,lt,e),this}env(e){return _("[string|boolean]",[e],arguments.length),e===!1?delete a(this,L).envPrefix:a(this,L).envPrefix=e||"",this}epilogue(e){return _("<string>",[e],arguments.length),a(this,k).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return _("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,k).example(e,t),this}exit(e,t){I(this,$e,!0),I(this,et,t),a(this,Ne)&&a(this,M).process.exit(e)}exitProcess(e=!0){return _("[boolean]",[e],arguments.length),I(this,Ne,e),this}fail(e){if(_("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return a(this,k).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return _("<array> [function]",[e,t],arguments.length),t?a(this,Le).getCompletion(e,t):new Promise((n,i)=>{a(this,Le).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return _([],0),a(this,L).demandedOptions}getDemandedCommands(){return _([],0),a(this,L).demandedCommands}getDeprecatedOptions(){return _([],0),a(this,L).deprecatedOptions}getDetectLocale(){return a(this,lt)}getExitProcess(){return a(this,Ne)}getGroups(){return Object.assign({},a(this,ze),a(this,ft))}getHelp(){if(I(this,$e,!0),!a(this,k).hasCachedHelpMessage()){if(!this.parsed){let t=this[Ht](a(this,tt),void 0,void 0,0,!0);if(ie(t))return t.then(()=>a(this,k).help())}let e=a(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>a(this,k).help())}return Promise.resolve(a(this,k).help())}getOptions(){return a(this,L)}getStrict(){return a(this,dt)}getStrictCommands(){return a(this,pt)}getStrictOptions(){return a(this,ht)}global(e,t){return _("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,L).local=a(this,L).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,L).local.indexOf(n)===-1&&a(this,L).local.push(n)}),this}group(e,t){_("<string|array> <string>",[e,t],arguments.length);let n=a(this,ft)[t]||a(this,ze)[t];a(this,ft)[t]&&delete a(this,ft)[t];let i={};return a(this,ze)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return _("<string>",[e],arguments.length),a(this,L).hiddenOptions.push(e),this}implies(e,t){return _("<string|object> [number|string|array]",[e,t],arguments.length),a(this,oe).implies(e,t),this}locale(e){return _("[string]",[e],arguments.length),e?(I(this,lt,!1),a(this,M).y18n.setLocale(e),this):(this[dn](),a(this,M).y18n.getLocale())}middleware(e,t,n){return a(this,Te).addMiddleware(e,!!t,n)}nargs(e,t){return _("<string|object|array> [number]",[e,t],arguments.length),this[vt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return _("<array|string>",[e],arguments.length),this[rt]("normalize",e),this}number(e){return _("<array|string>",[e],arguments.length),this[rt]("number",e),this}option(e,t){if(_("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),a(this,L).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let i=t.demand||t.required||t.require;i&&this.demand(e,i),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(a(this,L).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){_("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[Po](),typeof e>"u"&&(e=a(this,tt)),typeof t=="object"&&(I(this,ut,t),t=n),typeof t=="function"&&(I(this,ve,t),t=!1),t||I(this,tt,e),a(this,ve)&&I(this,Ne,!1);let i=this[Ht](e,!!t),s=this.parsed;return a(this,Le).setParsed(this.parsed),ie(i)?i.then(o=>(a(this,ve)&&a(this,ve).call(this,a(this,et),o,a(this,he)),o)).catch(o=>{throw a(this,ve)&&a(this,ve)(o,this.parsed.argv,a(this,he)),o}).finally(()=>{this[bn](),this.parsed=s}):(a(this,ve)&&a(this,ve).call(this,a(this,et),i,a(this,he)),this[bn](),this.parsed=s,i)}parseAsync(e,t,n){let i=this.parse(e,t,n);return ie(i)?i:Promise.resolve(i)}parseSync(e,t,n){let i=this.parse(e,t,n);if(ie(i))throw new ne(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return _("<object>",[e],arguments.length),I(this,Sr,e),this}pkgConf(e,t){_("<string> [string]",[e,t],arguments.length);let n=null,i=this[pn](t||a(this,ct));return i[e]&&typeof i[e]=="object"&&(n=zt(i[e],t||a(this,ct),this[mt]()["deep-merge-config"]||!1,a(this,M)),a(this,L).configObjects=(a(this,L).configObjects||[]).concat(n)),this}positional(e,t){_("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Qe(t,(o,c)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(u=!1),u});let i=a(this,Wt).fullCommands[a(this,Wt).fullCommands.length-1],s=i?a(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Rt(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,k).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return _("[boolean]",[e],arguments.length),I(this,Cr,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return _("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,L).narg[e]?this:(this[vt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return _("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,xt).log(a(this,Le).generateCompletionScript(e,t||a(this,xe)||"completion")),this}showHelp(e){if(_("[string|function]",[e],arguments.length),I(this,$e,!0),!a(this,k).hasCachedHelpMessage()){if(!this.parsed){let n=this[Ht](a(this,tt),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{a(this,k).showHelp(e)}),this}let t=a(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{a(this,k).showHelp(e)}),this}return a(this,k).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return _("[boolean|string] [string]",[e,t],arguments.length),a(this,k).showHelpOnFail(e,t),this}showVersion(e){return _("[string|function]",[e],arguments.length),a(this,k).showVersion(e),this}skipValidation(e){return _("<array|string>",[e],arguments.length),this[rt]("skipValidation",e),this}strict(e){return _("[boolean]",[e],arguments.length),I(this,dt,e!==!1),this}strictCommands(e){return _("[boolean]",[e],arguments.length),I(this,pt,e!==!1),this}strictOptions(e){return _("[boolean]",[e],arguments.length),I(this,ht,e!==!1),this}string(e){return _("<array|string>",[e],arguments.length),this[rt]("string",e),this}terminalWidth(){return _([],0),a(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return _("<object>",[e],arguments.length),I(this,lt,!1),a(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(_("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(Se(e,null,a(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new ne(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,k).usage(e),this}version(e,t,n){let i="version";if(_("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,Be)&&(this[fn](a(this,Be)),a(this,k).version(void 0),I(this,Be,null)),arguments.length===0)n=this[No](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=t,t=void 0);return I(this,Be,typeof e=="string"?e:i),t=t||a(this,k).deferY18nLookup("Show version number"),a(this,k).version(n||void 0),this.boolean(a(this,Be)),this.describe(a(this,Be),t),this}wrap(e){return _("<number|null|undefined>",[e],arguments.length),a(this,k).wrap(e),this}[(ce=new WeakMap,ct=new WeakMap,Wt=new WeakMap,Le=new WeakMap,xe=new WeakMap,Er=new WeakMap,et=new WeakMap,lt=new WeakMap,Ne=new WeakMap,Or=new WeakMap,Te=new WeakMap,ze=new WeakMap,$e=new WeakMap,De=new WeakMap,xt=new WeakMap,he=new WeakMap,L=new WeakMap,Ar=new WeakMap,Sr=new WeakMap,ve=new WeakMap,ut=new WeakMap,$t=new WeakMap,ft=new WeakMap,tt=new WeakMap,Cr=new WeakMap,M=new WeakMap,dt=new WeakMap,pt=new WeakMap,ht=new WeakMap,k=new WeakMap,Be=new WeakMap,oe=new WeakMap,_o)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Io](){return{log:(...e)=>{this[Rr]()||console.log(...e),I(this,$e,!0),a(this,he).length&&I(this,he,a(this,he)+`
|
|
72
|
-
`),
|
|
73
|
-
`),
|
|
74
|
-
\u274C The ejectable generator sources are missing from ${
|
|
75
|
-
In a checkout of the CLI, build them first: npm run prepare -w ${
|
|
76
|
-
`)}function
|
|
67
|
+
`;var pn=class{constructor(e,t,n,r){var s,o,c;this.yargs=e,this.usage=t,this.command=n,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(c=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(e,t,n,r){let s=this.command.getCommandHandlers();for(let c=0,h=e.length;c<h;++c)if(s[e[c]]&&s[e[c]].builder){let y=s[e[c]].builder;if(kt(y)){let m=this.yargs.getInternalMethods().reset();return y(m,!0),m.argv}}let o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),r(null,o)}commandCompletions(e,t,n){let r=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&r[r.length-1]!==n&&this.usage.getCommands().forEach(s=>{let o=ke(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let c=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(e,t,n,r){if(r.match(/^-/)||r===""&&e.length===0){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(c=>{let h=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!this.argsContainKey(t,n,c,h)&&(this.completeOptionKey(c,e,r),h&&s.default[c]&&this.completeOptionKey(`no-${c}`,e,r))})}}argsContainKey(e,t,n,r){if(e.indexOf(`--${n}`)!==-1||r&&e.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[n])if(t[s]!==void 0)return!0}return!1}completeOptionKey(e,t,n){let r=this.usage.getDescriptions(),s=h=>/^--/.test(h),o=h=>/^[^0-9]$/.test(h),c=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(c+e);else{let h=r[e]||"";t.push(c+`${e.replace(/:/g,"\\:")}:${h.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,r){if(he(this.customCompletionFunction,null,this.shim),Ps(this.customCompletionFunction)){let s=this.customCompletionFunction(n,t);return X(s)?s.then(o=>{this.shim.process.nextTick(()=>{r(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{r(o,void 0)})}):r(null,s)}else return Rs(this.customCompletionFunction)?this.customCompletionFunction(n,t,(s=r)=>this.defaultCompletion(e,t,n,s),s=>{r(null,s)}):this.customCompletionFunction(n,t,s=>{r(null,s)})}getCompletion(e,t){let n=e.length?e[e.length-1]:"",r=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return X(r)?r.then(s):s(r)}generateCompletionScript(e,t){let n=this.zshShell?ki:Fi,r=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,r),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function zi(i,e,t,n){return new pn(i,e,t,n)}function Ps(i){return i.length<3}function Rs(i){return i.length>3}function Ui(i,e){if(i.length===0)return e.length;if(e.length===0)return i.length;let t=[],n;for(n=0;n<=e.length;n++)t[n]=[n];let r;for(r=0;r<=i.length;r++)t[0][r]=r;for(n=1;n<=e.length;n++)for(r=1;r<=i.length;r++)e.charAt(n-1)===i.charAt(r-1)?t[n][r]=t[n-1][r-1]:t[n][r]=Math.min(t[n-1][r-1]+1,Math.min(t[n][r-1]+1,t[n-1][r]+1));return t[e.length][i.length]}var qi=["$0","--","_"];function Wi(i,e,t){let n=t.y18n.__,r=t.y18n.__n,s={};s.nonOptionCount=function(u){let g=i.getDemandedCommands(),O=u._.length+(u["--"]?u["--"].length:0)-i.getInternalMethods().getContext().commands.length;g._&&(O<g._.min||O>g._.max)&&(O<g._.min?g._.minMsg!==void 0?e.fail(g._.minMsg?g._.minMsg.replace(/\$0/g,O.toString()).replace(/\$1/,g._.min.toString()):null):e.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",O,O.toString(),g._.min.toString())):O>g._.max&&(g._.maxMsg!==void 0?e.fail(g._.maxMsg?g._.maxMsg.replace(/\$0/g,O.toString()).replace(/\$1/,g._.max.toString()):null):e.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",O,O.toString(),g._.max.toString()))))},s.positionalCount=function(u,g){g<u&&e.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",g,g+"",u+""))},s.requiredArguments=function(u,g){let w=null;for(let O of Object.keys(g))(!Object.prototype.hasOwnProperty.call(u,O)||typeof u[O]>"u")&&(w=w||{},w[O]=g[O]);if(w){let O=[];for(let S of Object.keys(w)){let C=w[S];C&&O.indexOf(C)<0&&O.push(C)}let d=O.length?`
|
|
68
|
+
${O.join(`
|
|
69
|
+
`)}`:"";e.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(w).length,Object.keys(w).join(", ")+d))}},s.unknownArguments=function(u,g,w,O,d=!0){let S=i.getInternalMethods().getCommandInstance().getCommands(),C=[],j=i.getInternalMethods().getContext();Object.keys(u).forEach(G=>{qi.indexOf(G)===-1&&!Object.prototype.hasOwnProperty.call(w,G)&&!Object.prototype.hasOwnProperty.call(i.getInternalMethods().getParseContext(),G)&&!s.isValidAndSomeAliasIsNotNew(G,g)&&C.push(G)}),d&&(j.commands.length>0||S.length>0||O)&&u._.slice(j.commands.length).forEach(G=>{S.indexOf(""+G)===-1&&C.push(""+G)}),C.length>0&&e.fail(r("Unknown argument: %s","Unknown arguments: %s",C.length,C.join(", ")))},s.unknownCommands=function(u){let g=i.getInternalMethods().getCommandInstance().getCommands(),w=[],O=i.getInternalMethods().getContext();return(O.commands.length>0||g.length>0)&&u._.slice(O.commands.length).forEach(d=>{g.indexOf(""+d)===-1&&w.push(""+d)}),w.length>0?(e.fail(r("Unknown command: %s","Unknown commands: %s",w.length,w.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(u,g){if(!Object.prototype.hasOwnProperty.call(g,u))return!1;let w=i.parsed.newAliases;return[u,...g[u]].some(O=>!Object.prototype.hasOwnProperty.call(w,O)||!w[u])},s.limitedChoices=function(u){let g=i.getOptions(),w={};if(!Object.keys(g.choices).length)return;Object.keys(u).forEach(S=>{qi.indexOf(S)===-1&&Object.prototype.hasOwnProperty.call(g.choices,S)&&[].concat(u[S]).forEach(C=>{g.choices[S].indexOf(C)===-1&&C!==void 0&&(w[S]=(w[S]||[]).concat(C))})});let O=Object.keys(w);if(!O.length)return;let d=n("Invalid values:");O.forEach(S=>{d+=`
|
|
70
|
+
${n("Argument: %s, Given: %s, Choices: %s",S,e.stringifiedValues(w[S]),e.stringifiedValues(g.choices[S]))}`}),e.fail(d)};let o={};s.implies=function(u,g){E("<string|object> [array|number|string]",[u,g],arguments.length),typeof u=="object"?Object.keys(u).forEach(w=>{s.implies(w,u[w])}):(i.global(u),o[u]||(o[u]=[]),Array.isArray(g)?g.forEach(w=>s.implies(u,w)):(he(g,void 0,t),o[u].push(g)))},s.getImplied=function(){return o};function c(m,u){let g=Number(u);return u=isNaN(g)?u:g,typeof u=="number"?u=m._.length>=u:u.match(/^--no-.+/)?(u=u.match(/^--no-(.+)/)[1],u=!m[u]):u=m[u],u}s.implications=function(u){let g=[];if(Object.keys(o).forEach(w=>{let O=w;(o[w]||[]).forEach(d=>{let S=O,C=d;S=c(u,S),d=c(u,d),S&&!d&&g.push(` ${O} -> ${C}`)})}),g.length){let w=`${n("Implications failed:")}
|
|
71
|
+
`;g.forEach(O=>{w+=O}),e.fail(w)}};let h={};s.conflicts=function(u,g){E("<string|object> [array|string]",[u,g],arguments.length),typeof u=="object"?Object.keys(u).forEach(w=>{s.conflicts(w,u[w])}):(i.global(u),h[u]||(h[u]=[]),Array.isArray(g)?g.forEach(w=>s.conflicts(u,w)):h[u].push(g))},s.getConflicting=()=>h,s.conflicting=function(u){Object.keys(u).forEach(g=>{h[g]&&h[g].forEach(w=>{w&&u[g]!==void 0&&u[w]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",g,w))})})},s.recommendCommands=function(u,g){g=g.sort((S,C)=>C.length-S.length);let O=null,d=1/0;for(let S=0,C;(C=g[S])!==void 0;S++){let j=Ui(u,C);j<=3&&j<d&&(d=j,O=C)}O&&e.fail(n("Did you mean %s?",O))},s.reset=function(u){return o=ze(o,g=>!u[g]),h=ze(h,g=>!u[g]),s};let y=[];return s.freeze=function(){y.push({implied:o,conflicting:h})},s.unfreeze=function(){let u=y.pop();he(u,void 0,t),{implied:o,conflicting:h}=u},s}var hn=[],jt;function St(i,e,t,n){jt=n;let r={};if(Object.prototype.hasOwnProperty.call(i,"extends")){if(typeof i.extends!="string")return r;let s=/\.json|\..*rc$/.test(i.extends),o=null;if(s)o=$s(e,i.extends);else try{o=Re.resolve(i.extends)}catch{return i}Is(o),hn.push(o),r=s?JSON.parse(jt.readFileSync(o,"utf8")):Re(i.extends),delete i.extends,r=St(r,jt.path.dirname(o),t,jt)}return hn=[],t?Gi(r,i):Object.assign({},r,i)}function Is(i){if(hn.indexOf(i)>-1)throw new Z(`Circular extended configurations: '${i}'.`)}function $s(i,e){return jt.path.resolve(i,e)}function Gi(i,e){let t={};function n(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(t,i);for(let r of Object.keys(e))n(e[r])&&n(t[r])?t[r]=Gi(i[r],e[r]):t[r]=e[r];return t}var P=function(i,e,t){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");return e.set(i,t),t},a=function(i,e){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return e.get(i)},ie,Je,xt,_e,we,Ut,qe,Qe,je,qt,Se,$e,Oe,xe,pt,ce,I,Wt,Gt,Ae,Ze,ht,Xe,We,Ht,N,et,tt,nt,F,De,te;function ar(i){return(e=[],t=i.process.cwd(),n)=>{let r=new Sn(e,t,n,i);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Hi=Symbol("copyDoubleDash"),Bi=Symbol("copyDoubleDash"),mn=Symbol("deleteFromParserHintObject"),Ki=Symbol("freeze"),Yi=Symbol("getDollarZero"),it=Symbol("getParserConfiguration"),gn=Symbol("guessLocale"),Vi=Symbol("guessVersion"),Ji=Symbol("parsePositionalNumbers"),yn=Symbol("pkgUp"),Ge=Symbol("populateParserHintArray"),mt=Symbol("populateParserHintSingleValueDictionary"),bn=Symbol("populateParserHintArrayDictionary"),wn=Symbol("populateParserHintDictionary"),On=Symbol("sanitizeKey"),An=Symbol("setKey"),Cn=Symbol("unfreeze"),Qi=Symbol("validateAsync"),Zi=Symbol("getCommandInstance"),Xi=Symbol("getContext"),er=Symbol("getHasOutput"),tr=Symbol("getLoggerInstance"),nr=Symbol("getParseContext"),ir=Symbol("getUsageInstance"),rr=Symbol("getValidationInstance"),Bt=Symbol("hasParseCallback"),rt=Symbol("postProcess"),sr=Symbol("rebase"),_n=Symbol("reset"),vt=Symbol("runYargsParserAndExecuteCommands"),jn=Symbol("runValidation"),or=Symbol("setHasOutput"),Sn=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,ie.set(this,void 0),Je.set(this,void 0),xt.set(this,{commands:[],fullCommands:[]}),_e.set(this,null),we.set(this,null),Ut.set(this,"show-hidden"),qe.set(this,null),Qe.set(this,!0),je.set(this,!0),qt.set(this,[]),Se.set(this,void 0),$e.set(this,{}),Oe.set(this,!1),xe.set(this,null),pt.set(this,void 0),ce.set(this,""),I.set(this,void 0),Wt.set(this,void 0),Gt.set(this,{}),Ae.set(this,null),Ze.set(this,null),ht.set(this,{}),Xe.set(this,{}),We.set(this,void 0),Ht.set(this,!1),N.set(this,void 0),et.set(this,!1),tt.set(this,!1),nt.set(this,!1),F.set(this,void 0),De.set(this,null),te.set(this,void 0),P(this,N,r),P(this,We,e),P(this,Je,t),P(this,Wt,n),P(this,Se,new Ft(this)),this.$0=this[Yi](),this[_n](),P(this,ie,a(this,ie)),P(this,F,a(this,F)),P(this,te,a(this,te)),P(this,I,a(this,I)),a(this,I).showHiddenOpt=a(this,Ut),P(this,pt,this[Bi]())}addHelpOpt(e,t){let n="help";return E("[string|boolean] [string]",[e,t],arguments.length),a(this,xe)&&(this[mn](a(this,xe)),P(this,xe,null)),e===!1&&t===void 0?this:(P(this,xe,typeof e=="string"?e:n),this.boolean(a(this,xe)),this.describe(a(this,xe),t||a(this,F).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(E("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,Ut);return this.boolean(n),this.describe(n,t||a(this,F).deferY18nLookup("Show hidden options")),a(this,I).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return E("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.alias.bind(this),"alias",e,t),this}array(e){return E("<array|string>",[e],arguments.length),this[Ge]("array",e),this}boolean(e){return E("<array|string>",[e],arguments.length),this[Ge]("boolean",e),this}check(e,t){return E("<function> [boolean]",[e,t],arguments.length),this.middleware((n,r)=>Ve(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,F).fail(s.toString(),s):a(this,F).fail(a(this,N).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,F).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return E("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(E("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new Z("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new Z("coerce callback must be provided");return a(this,I).key[e]=!0,a(this,Se).addCoerceMiddleware((n,r)=>{let s;return Ve(()=>(s=r.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new Z(o.message)})},e),this}conflicts(e,t){return E("<string|object> [string|array]",[e,t],arguments.length),a(this,te).conflicts(e,t),this}config(e="config",t,n){return E("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=St(e,a(this,Je),this[it]()["deep-merge-config"]||!1,a(this,N)),a(this,I).configObjects=(a(this,I).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,F).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(r=>{a(this,I).config[r]=n||!0}),this)}completion(e,t,n){return E("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),P(this,we,e||a(this,we)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,we),t),n&&a(this,_e).registerFunction(n),this}command(e,t,n,r,s,o){return E("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,r,s,o],arguments.length),a(this,ie).addHandler(e,t,n,r,s,o),this}commands(e,t,n,r,s,o){return this.command(e,t,n,r,s,o)}commandDir(e,t){E("<string> [object]",[e,t],arguments.length);let n=a(this,Wt)||a(this,N).require;return a(this,ie).addDirectory(e,n,a(this,N).getCallerFile(),t),this}count(e){return E("<array|string>",[e],arguments.length),this[Ge]("count",e),this}default(e,t,n){return E("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(ln(e,a(this,N)),a(this,I).defaultDescription[e]=n),typeof t=="function"&&(ln(e,a(this,N)),a(this,I).defaultDescription[e]||(a(this,I).defaultDescription[e]=a(this,F).functionDescription(t)),t=t.call()),this[mt](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,r){return E("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,r],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),a(this,I).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(r=>{he(n,!0,a(this,N)),this.demandOption(r,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(he(n,!0,a(this,N)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(r=>{he(n,!0,a(this,N)),this.demandOption(r,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return E("<object|string|array> [string]",[e,t],arguments.length),this[mt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return E("<string> [string|boolean]",[e,t],arguments.length),a(this,I).deprecatedOptions[e]=t,this}describe(e,t){return E("<object|string|array> [string]",[e,t],arguments.length),this[An](e,!0),a(this,F).describe(e,t),this}detectLocale(e){return E("<boolean>",[e],arguments.length),P(this,Qe,e),this}env(e){return E("[string|boolean]",[e],arguments.length),e===!1?delete a(this,I).envPrefix:a(this,I).envPrefix=e||"",this}epilogue(e){return E("<string>",[e],arguments.length),a(this,F).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return E("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,F).example(e,t),this}exit(e,t){P(this,Oe,!0),P(this,qe,t),a(this,je)&&a(this,N).process.exit(e)}exitProcess(e=!0){return E("[boolean]",[e],arguments.length),P(this,je,e),this}fail(e){if(E("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Z("Invalid first argument. Expected function or boolean 'false'");return a(this,F).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return E("<array> [function]",[e,t],arguments.length),t?a(this,_e).getCompletion(e,t):new Promise((n,r)=>{a(this,_e).getCompletion(e,(s,o)=>{s?r(s):n(o)})})}getDemandedOptions(){return E([],0),a(this,I).demandedOptions}getDemandedCommands(){return E([],0),a(this,I).demandedCommands}getDeprecatedOptions(){return E([],0),a(this,I).deprecatedOptions}getDetectLocale(){return a(this,Qe)}getExitProcess(){return a(this,je)}getGroups(){return Object.assign({},a(this,$e),a(this,Xe))}getHelp(){if(P(this,Oe,!0),!a(this,F).hasCachedHelpMessage()){if(!this.parsed){let t=this[vt](a(this,We),void 0,void 0,0,!0);if(X(t))return t.then(()=>a(this,F).help())}let e=a(this,ie).runDefaultBuilderOn(this);if(X(e))return e.then(()=>a(this,F).help())}return Promise.resolve(a(this,F).help())}getOptions(){return a(this,I)}getStrict(){return a(this,et)}getStrictCommands(){return a(this,tt)}getStrictOptions(){return a(this,nt)}global(e,t){return E("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,I).local=a(this,I).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,I).local.indexOf(n)===-1&&a(this,I).local.push(n)}),this}group(e,t){E("<string|array> <string>",[e,t],arguments.length);let n=a(this,Xe)[t]||a(this,$e)[t];a(this,Xe)[t]&&delete a(this,Xe)[t];let r={};return a(this,$e)[t]=(n||[]).concat(e).filter(s=>r[s]?!1:r[s]=!0),this}hide(e){return E("<string>",[e],arguments.length),a(this,I).hiddenOptions.push(e),this}implies(e,t){return E("<string|object> [number|string|array]",[e,t],arguments.length),a(this,te).implies(e,t),this}locale(e){return E("[string]",[e],arguments.length),e?(P(this,Qe,!1),a(this,N).y18n.setLocale(e),this):(this[gn](),a(this,N).y18n.getLocale())}middleware(e,t,n){return a(this,Se).addMiddleware(e,!!t,n)}nargs(e,t){return E("<string|object|array> [number]",[e,t],arguments.length),this[mt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return E("<array|string>",[e],arguments.length),this[Ge]("normalize",e),this}number(e){return E("<array|string>",[e],arguments.length),this[Ge]("number",e),this}option(e,t){if(E("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),a(this,I).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(a(this,I).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){E("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[Ki](),typeof e>"u"&&(e=a(this,We)),typeof t=="object"&&(P(this,Ze,t),t=n),typeof t=="function"&&(P(this,Ae,t),t=!1),t||P(this,We,e),a(this,Ae)&&P(this,je,!1);let r=this[vt](e,!!t),s=this.parsed;return a(this,_e).setParsed(this.parsed),X(r)?r.then(o=>(a(this,Ae)&&a(this,Ae).call(this,a(this,qe),o,a(this,ce)),o)).catch(o=>{throw a(this,Ae)&&a(this,Ae)(o,this.parsed.argv,a(this,ce)),o}).finally(()=>{this[Cn](),this.parsed=s}):(a(this,Ae)&&a(this,Ae).call(this,a(this,qe),r,a(this,ce)),this[Cn](),this.parsed=s,r)}parseAsync(e,t,n){let r=this.parse(e,t,n);return X(r)?r:Promise.resolve(r)}parseSync(e,t,n){let r=this.parse(e,t,n);if(X(r))throw new Z(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(e){return E("<object>",[e],arguments.length),P(this,Gt,e),this}pkgConf(e,t){E("<string> [string]",[e,t],arguments.length);let n=null,r=this[yn](t||a(this,Je));return r[e]&&typeof r[e]=="object"&&(n=St(r[e],t||a(this,Je),this[it]()["deep-merge-config"]||!1,a(this,N)),a(this,I).configObjects=(a(this,I).configObjects||[]).concat(n)),this}positional(e,t){E("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=ze(t,(o,c)=>{let h=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(h=!1),h});let r=a(this,xt).fullCommands[a(this,xt).fullCommands.length-1],s=r?a(this,ie).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return ft(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,F).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return E("[boolean]",[e],arguments.length),P(this,Ht,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return E("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,I).narg[e]?this:(this[mt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return E("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,pt).log(a(this,_e).generateCompletionScript(e,t||a(this,we)||"completion")),this}showHelp(e){if(E("[string|function]",[e],arguments.length),P(this,Oe,!0),!a(this,F).hasCachedHelpMessage()){if(!this.parsed){let n=this[vt](a(this,We),void 0,void 0,0,!0);if(X(n))return n.then(()=>{a(this,F).showHelp(e)}),this}let t=a(this,ie).runDefaultBuilderOn(this);if(X(t))return t.then(()=>{a(this,F).showHelp(e)}),this}return a(this,F).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return E("[boolean|string] [string]",[e,t],arguments.length),a(this,F).showHelpOnFail(e,t),this}showVersion(e){return E("[string|function]",[e],arguments.length),a(this,F).showVersion(e),this}skipValidation(e){return E("<array|string>",[e],arguments.length),this[Ge]("skipValidation",e),this}strict(e){return E("[boolean]",[e],arguments.length),P(this,et,e!==!1),this}strictCommands(e){return E("[boolean]",[e],arguments.length),P(this,tt,e!==!1),this}strictOptions(e){return E("[boolean]",[e],arguments.length),P(this,nt,e!==!1),this}string(e){return E("<array|string>",[e],arguments.length),this[Ge]("string",e),this}terminalWidth(){return E([],0),a(this,N).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return E("<object>",[e],arguments.length),P(this,Qe,!1),a(this,N).y18n.updateLocale(e),this}usage(e,t,n,r){if(E("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,r],arguments.length),t!==void 0){if(he(e,null,a(this,N)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,r);throw new Z(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,F).usage(e),this}version(e,t,n){let r="version";if(E("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,De)&&(this[mn](a(this,De)),a(this,F).version(void 0),P(this,De,null)),arguments.length===0)n=this[Vi](),e=r;else if(arguments.length===1){if(e===!1)return this;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return P(this,De,typeof e=="string"?e:r),t=t||a(this,F).deferY18nLookup("Show version number"),a(this,F).version(n||void 0),this.boolean(a(this,De)),this.describe(a(this,De),t),this}wrap(e){return E("<number|null|undefined>",[e],arguments.length),a(this,F).wrap(e),this}[(ie=new WeakMap,Je=new WeakMap,xt=new WeakMap,_e=new WeakMap,we=new WeakMap,Ut=new WeakMap,qe=new WeakMap,Qe=new WeakMap,je=new WeakMap,qt=new WeakMap,Se=new WeakMap,$e=new WeakMap,Oe=new WeakMap,xe=new WeakMap,pt=new WeakMap,ce=new WeakMap,I=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,Ae=new WeakMap,Ze=new WeakMap,ht=new WeakMap,Xe=new WeakMap,We=new WeakMap,Ht=new WeakMap,N=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,F=new WeakMap,De=new WeakMap,te=new WeakMap,Hi)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Bi](){return{log:(...e)=>{this[Bt]()||console.log(...e),P(this,Oe,!0),a(this,ce).length&&P(this,ce,a(this,ce)+`
|
|
72
|
+
`),P(this,ce,a(this,ce)+e.join(" "))},error:(...e)=>{this[Bt]()||console.error(...e),P(this,Oe,!0),a(this,ce).length&&P(this,ce,a(this,ce)+`
|
|
73
|
+
`),P(this,ce,a(this,ce)+e.join(" "))}}}[mn](e){ft(a(this,I)).forEach(t=>{if((r=>r==="configObjects")(t))return;let n=a(this,I)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete a(this,F).getDescriptions()[e]}[Ki](){a(this,qt).push({options:a(this,I),configObjects:a(this,I).configObjects.slice(0),exitProcess:a(this,je),groups:a(this,$e),strict:a(this,et),strictCommands:a(this,tt),strictOptions:a(this,nt),completionCommand:a(this,we),output:a(this,ce),exitError:a(this,qe),hasOutput:a(this,Oe),parsed:this.parsed,parseFn:a(this,Ae),parseContext:a(this,Ze)}),a(this,F).freeze(),a(this,te).freeze(),a(this,ie).freeze(),a(this,Se).freeze()}[Yi](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,N).process.argv()[0])?t=a(this,N).process.argv().slice(1,2):t=a(this,N).process.argv().slice(0,1),e=t.map(n=>{let r=this[sr](a(this,Je),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<n.length?r:n}).join(" ").trim(),a(this,N).getEnv("_")&&a(this,N).getProcessArgvBin()===a(this,N).getEnv("_")&&(e=a(this,N).getEnv("_").replace(`${a(this,N).path.dirname(a(this,N).process.execPath())}/`,"")),e}[it](){return a(this,Gt)}[gn](){if(!a(this,Qe))return;let e=a(this,N).getEnv("LC_ALL")||a(this,N).getEnv("LC_MESSAGES")||a(this,N).getEnv("LANG")||a(this,N).getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Vi](){return this[yn]().version||"unknown"}[Ji](e){let t=e["--"]?e["--"]:e._;for(let n=0,r;(r=t[n])!==void 0;n++)a(this,N).Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(t[n]=Number(r));return e}[yn](e){let t=e||"*";if(a(this,ht)[t])return a(this,ht)[t];let n={};try{let r=e||a(this,N).mainFilename;!e&&a(this,N).path.extname(r)&&(r=a(this,N).path.dirname(r));let s=a(this,N).findUp(r,(o,c)=>{if(c.includes("package.json"))return"package.json"});he(s,void 0,a(this,N)),n=JSON.parse(a(this,N).readFileSync(s,"utf8"))}catch{}return a(this,ht)[t]=n||{},a(this,ht)[t]}[Ge](e,t){t=[].concat(t),t.forEach(n=>{n=this[On](n),a(this,I)[e].push(n)})}[mt](e,t,n,r){this[wn](e,t,n,r,(s,o,c)=>{a(this,I)[s][o]=c})}[bn](e,t,n,r){this[wn](e,t,n,r,(s,o,c)=>{a(this,I)[s][o]=(a(this,I)[s][o]||[]).concat(c)})}[wn](e,t,n,r,s){if(Array.isArray(n))n.forEach(o=>{e(o,r)});else if((o=>typeof o=="object")(n))for(let o of ft(n))e(o,n[o]);else s(t,this[On](n),r)}[On](e){return e==="__proto__"?"___proto___":e}[An](e,t){return this[mt](this[An].bind(this),"key",e,t),this}[Cn](){var e,t,n,r,s,o,c,h,y,m,u,g;let w=a(this,qt).pop();he(w,void 0,a(this,N));let O;e=this,t=this,n=this,r=this,s=this,o=this,c=this,h=this,y=this,m=this,u=this,g=this,{options:{set value(d){P(e,I,d)}}.value,configObjects:O,exitProcess:{set value(d){P(t,je,d)}}.value,groups:{set value(d){P(n,$e,d)}}.value,output:{set value(d){P(r,ce,d)}}.value,exitError:{set value(d){P(s,qe,d)}}.value,hasOutput:{set value(d){P(o,Oe,d)}}.value,parsed:this.parsed,strict:{set value(d){P(c,et,d)}}.value,strictCommands:{set value(d){P(h,tt,d)}}.value,strictOptions:{set value(d){P(y,nt,d)}}.value,completionCommand:{set value(d){P(m,we,d)}}.value,parseFn:{set value(d){P(u,Ae,d)}}.value,parseContext:{set value(d){P(g,Ze,d)}}.value}=w,a(this,I).configObjects=O,a(this,F).unfreeze(),a(this,te).unfreeze(),a(this,ie).unfreeze(),a(this,Se).unfreeze()}[Qi](e,t){return Ve(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Zi].bind(this),getContext:this[Xi].bind(this),getHasOutput:this[er].bind(this),getLoggerInstance:this[tr].bind(this),getParseContext:this[nr].bind(this),getParserConfiguration:this[it].bind(this),getUsageInstance:this[ir].bind(this),getValidationInstance:this[rr].bind(this),hasParseCallback:this[Bt].bind(this),postProcess:this[rt].bind(this),reset:this[_n].bind(this),runValidation:this[jn].bind(this),runYargsParserAndExecuteCommands:this[vt].bind(this),setHasOutput:this[or].bind(this)}}[Zi](){return a(this,ie)}[Xi](){return a(this,xt)}[er](){return a(this,Oe)}[tr](){return a(this,pt)}[nr](){return a(this,Ze)||{}}[ir](){return a(this,F)}[rr](){return a(this,te)}[Bt](){return!!a(this,Ae)}[rt](e,t,n,r){return n||X(e)||(t||(e=this[Hi](e)),(this[it]()["parse-positional-numbers"]||this[it]()["parse-positional-numbers"]===void 0)&&(e=this[Ji](e)),r&&(e=Ye(e,this,a(this,Se).getMiddleware(),!1))),e}[_n](e={}){P(this,I,a(this,I)||{});let t={};t.local=a(this,I).local?a(this,I).local:[],t.configObjects=a(this,I).configObjects?a(this,I).configObjects:[];let n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,Xe),Object.keys(a(this,$e)).reduce((o,c)=>{let h=a(this,$e)[c].filter(y=>!(y in n));return h.length>0&&(o[c]=h),o},{})),P(this,$e,{});let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(o=>{t[o]=(a(this,I)[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{t[o]=ze(a(this,I)[o],c=>!n[c])}),t.envPrefix=a(this,I).envPrefix,P(this,I,t),P(this,F,a(this,F)?a(this,F).reset(n):Ti(this,a(this,N))),P(this,te,a(this,te)?a(this,te).reset(n):Wi(this,a(this,F),a(this,N))),P(this,ie,a(this,ie)?a(this,ie).reset():Mi(a(this,F),a(this,te),a(this,Se),a(this,N))),a(this,_e)||P(this,_e,zi(this,a(this,F),a(this,ie),a(this,N))),a(this,Se).reset(),P(this,we,null),P(this,ce,""),P(this,qe,null),P(this,Oe,!1),this.parsed=!1,this}[sr](e,t){return a(this,N).path.relative(e,t)}[vt](e,t,n,r=0,s=!1){let o=!!n||s;e=e||a(this,We),a(this,I).__=a(this,N).y18n.__,a(this,I).configuration=this[it]();let c=!!a(this,I).configuration["populate--"],h=Object.assign({},a(this,I).configuration,{"populate--":!0}),y=a(this,N).Parser.detailed(e,Object.assign({},a(this,I),{configuration:{"parse-positional-numbers":!1,...h}})),m=Object.assign(y.argv,a(this,Ze)),u,g=y.aliases,w=!1,O=!1;Object.keys(m).forEach(d=>{d===a(this,xe)&&m[d]?w=!0:d===a(this,De)&&m[d]&&(O=!0)}),m.$0=this.$0,this.parsed=y,r===0&&a(this,F).clearCachedHelpMessage();try{if(this[gn](),t)return this[rt](m,c,!!n,!1);a(this,xe)&&~[a(this,xe)].concat(g[a(this,xe)]||[]).filter(G=>G.length>1).indexOf(""+m._[m._.length-1])&&(m._.pop(),w=!0);let d=a(this,ie).getCommands(),S=a(this,_e).completionKey in m,C=w||S||s;if(m._.length){if(d.length){let j;for(let G=r||0,z;m._[G]!==void 0;G++)if(z=String(m._[G]),~d.indexOf(z)&&z!==a(this,we)){let Ee=a(this,ie).runCommand(z,this,y,G+1,s,w||O||s);return this[rt](Ee,c,!!n,!1)}else if(!j&&z!==a(this,we)){j=z;break}!a(this,ie).hasDefaultCommand()&&a(this,Ht)&&j&&!C&&a(this,te).recommendCommands(j,d)}a(this,we)&&~m._.indexOf(a(this,we))&&!S&&(a(this,je)&&Ue(!0),this.showCompletionScript(),this.exit(0))}if(a(this,ie).hasDefaultCommand()&&!C){let j=a(this,ie).runCommand(null,this,y,0,s,w||O||s);return this[rt](j,c,!!n,!1)}if(S){a(this,je)&&Ue(!0),e=[].concat(e);let j=e.slice(e.indexOf(`--${a(this,_e).completionKey}`)+1);return a(this,_e).getCompletion(j,(G,z)=>{if(G)throw new Z(G.message);(z||[]).forEach(Ee=>{a(this,pt).log(Ee)}),this.exit(0)}),this[rt](m,!c,!!n,!1)}if(a(this,Oe)||(w?(a(this,je)&&Ue(!0),o=!0,this.showHelp("log"),this.exit(0)):O&&(a(this,je)&&Ue(!0),o=!0,a(this,F).showVersion("log"),this.exit(0))),!o&&a(this,I).skipValidation.length>0&&(o=Object.keys(m).some(j=>a(this,I).skipValidation.indexOf(j)>=0&&m[j]===!0)),!o){if(y.error)throw new Z(y.error.message);if(!S){let j=this[jn](g,{},y.error);n||(u=Ye(m,this,a(this,Se).getMiddleware(),!0)),u=this[Qi](j,u??m),X(u)&&!n&&(u=u.then(()=>Ye(m,this,a(this,Se).getMiddleware(),!1)))}}}catch(d){if(d instanceof Z)a(this,F).fail(d.message,d);else throw d}return this[rt](u??m,c,!!n,!0)}[jn](e,t,n,r){e={...e},t={...t};let s={...this.getDemandedOptions()};return o=>{if(n)throw new Z(n.message);a(this,te).nonOptionCount(o),a(this,te).requiredArguments(o,s);let c=!1;a(this,tt)&&(c=a(this,te).unknownCommands(o)),a(this,et)&&!c?a(this,te).unknownArguments(o,e,t,!!r):a(this,nt)&&a(this,te).unknownArguments(o,e,{},!1,!1),a(this,te).limitedChoices(o),a(this,te).implications(o),a(this,te).conflicting(o)}}[or](){P(this,Oe,!0)}};function Di(i){return!!i&&typeof i.getInternalMethods=="function"}var Ls=ar(cn),cr=Ls;var st=Pt(Xt(),1);import{spawnSync as En}from"node:child_process";import{existsSync as fe,mkdirSync as Pn,mkdtempSync as mr,readdirSync as gr,readFileSync as ue,realpathSync as lr,rmSync as yr,statSync as Ms,writeFileSync as ne}from"node:fs";import{createRequire as Ds}from"node:module";import{tmpdir as br}from"node:os";import{dirname as Et,join as U,relative as ve,resolve as Ns}from"node:path";import{fileURLToPath as Ts}from"node:url";var gt=new Set(["python","go","php","java","typescript","zod","mock","swr","tanstack-query","transformers","cli"]),dr=new Map([["tanstack-query-vue","vue"],["tanstack-query-svelte","svelte"],["tanstack-query-solid","solid"]]),ge="@redocly/client-generator",Fs="https://redocly.com/docs/cli/commands/eject-generator",xn="@redocly/openapi-core",fr="<!-- redocly-generators:begin \u2014 managed by `redocly eject-generator`; content between markers is refreshed on eject -->",vn="<!-- redocly-generators:end -->";function ks(){let i=Ts(new URL("./eject-assets/",import.meta.url));if(fe(U(i,"generators")))return i;let e=Ds(import.meta.url).resolve(ge),t=U(Et(e),"..","eject-assets");if(fe(U(t,"generators")))return t;throw new de(`
|
|
74
|
+
\u274C The ejectable generator sources are missing from ${ge}.
|
|
75
|
+
In a checkout of the CLI, build them first: npm run prepare -w ${ge}
|
|
76
|
+
`)}function ur(i,e){let t=U(process.cwd(),".claude","skills",i,"SKILL.md");return Pn(Et(t),{recursive:!0}),ne(t,ue(U(e,"skills",i,"SKILL.md"),"utf-8"),"utf-8"),ve(process.cwd(),t)}function Rn(i,e){let t=["# Ejected client generators","","These files are Redocly client generators you own; `redocly generate-client` runs them.","Their design and the authoring toolkit are agent skills \u2014 edit the skill first, then make","the code match, and never hand-edit generated client output:","","- `.claude/skills/client-generators/SKILL.md` \u2014 the API model, the helpers, the loop.",...e.map(h=>`- \`.claude/skills/${h}-generator/SKILL.md\` \u2014 the \`${h}\` generator's design.`)],n=`${fr}
|
|
77
77
|
|
|
78
78
|
${t.join(`
|
|
79
79
|
`)}
|
|
80
80
|
|
|
81
|
-
${
|
|
82
|
-
`,
|
|
83
|
-
`);return}
|
|
81
|
+
${vn}
|
|
82
|
+
`,r=U(i,"AGENTS.md");if(!fe(r)){ne(r,n,"utf-8");return}let s=ue(r,"utf-8"),o=s.indexOf(fr),c=s.indexOf(vn);if(o===-1||c===-1){k.warn(`eject-generator: ${r} exists without the managed markers \u2014 leaving it untouched.
|
|
83
|
+
`);return}ne(r,s.slice(0,o)+n.trimEnd()+s.slice(c+vn.length),"utf-8")}function In(i,e,t){let n=mr(U(br(),"redocly-eject-merge-")),r={ours:U(n,".merge-ours"),base:U(n,".merge-base"),theirs:U(n,".merge-theirs")};ne(r.ours,i,"utf-8"),ne(r.base,e,"utf-8"),ne(r.theirs,t,"utf-8");let s=En("git",["merge-file","-p","-L","yours","-L","ejected-from","-L","update",r.ours,r.base,r.theirs],{encoding:"utf-8"});if(yr(n,{recursive:!0,force:!0}),s.error||s.status===null)throw Q.eject_generator_outcome="merge-tool-missing",new de("\n\u274C `--update` needs `git` on PATH for the three-way merge. Alternative: eject to a temporary directory and diff by hand.\n");if(s.status>127)throw Q.eject_generator_outcome="merge-failed",new de(`
|
|
84
84
|
\u274C \`git merge-file\` could not merge the update (your copy is untouched): ${s.stderr.trim()}
|
|
85
|
-
`);return{merged:s.stdout,conflicts:s.status}}function
|
|
86
|
-
`),0;let{merged:o,conflicts:c}=
|
|
87
|
-
`,"utf-8"),s}function
|
|
85
|
+
`);return{merged:s.stdout,conflicts:s.status}}function wr(i){return/Ejected from @redocly\/client-generator@(\S+)/.exec(i)?.[1]}function Or(i,e){let t=mr(U(br(),"redocly-eject-base-")),n=new Map;try{if(En("npm",["pack",i,"--pack-destination",t],{encoding:"utf-8"}).status!==0)return n;let s=gr(t).find(o=>o.endsWith(".tgz"));if(s===void 0)return n;for(let o of e)En("tar",["-xzf",U(t,s),"-C",t,o],{encoding:"utf-8"}).status===0&&n.set(o,ue(U(t,o),"utf-8"));return n}finally{yr(t,{recursive:!0,force:!0})}}var pr=i=>`package/eject-assets/generators/${i}.mjs`,hr=(i,e)=>`package/eject-assets/generators/${i}/${e}`,yt=i=>`package/eject-assets/skills/${i}/SKILL.md`;function zs(i,e){let t=U(i,"generators",e);if(!(!fe(t)||!Ms(t).isDirectory()))return gr(t).filter(n=>n.endsWith(".ts")).sort()}function Kt(i,e,t){let n=U(process.cwd(),".claude","skills",i,"SKILL.md"),r=ue(U(e,"skills",i,"SKILL.md"),"utf-8");if(!fe(n))return Pn(Et(n),{recursive:!0}),ne(n,r,"utf-8"),0;let s=ue(n,"utf-8");if(s===r)return 0;if(t===void 0)return ne(`${n}.new`,r,"utf-8"),k.warn(`${ve(process.cwd(),n)} was edited and has no merge base \u2014 the new skill is beside it as SKILL.md.new.
|
|
86
|
+
`),0;let{merged:o,conflicts:c}=In(s,t,r);return ne(n,o,"utf-8"),c}function $n(i){return[...gt].filter(e=>fe(U(i,`${e}.mjs`))||fe(U(i,e,"index.ts")))}function Ln(i,e=!1){let t=U(process.cwd(),"package.json");if(!fe(t))return"no-package-json";let n=ue(t,"utf-8"),r=JSON.parse(n),s="present",o={};for(let[h,y]of Object.entries(i)){let m=r.devDependencies?.[h]!==void 0?r.devDependencies:r.dependencies?.[h]!==void 0?r.dependencies:void 0;m===void 0?(o[h]=`^${y}`,s="added"):e&&!(st.validRange(m[h])!==null&&st.satisfies(y,m[h]))&&(m[h]=`^${y}`,s==="present"&&(s="updated"))}if(s==="present")return"present";if(Object.keys(o).length>0){let h={...r.devDependencies,...o};r.devDependencies=Object.fromEntries(Object.entries(h).sort(([y],[m])=>y.localeCompare(m)))}let c=/^([ \t]+)"/m.exec(n)?.[1]??" ";return ne(t,`${JSON.stringify(r,null,c)}
|
|
87
|
+
`,"utf-8"),s}function Us(i,e,t,n,r){let s=qn(e),o=Ie(s)&&Ie(s.apis)?s.apis:{};if(Object.values(o).some(c=>Ie(c)&&Ie(c.client)))return!1;if(n===-1){if(/^client:/m.test(e))return!1;let c=e===""||e.endsWith(`
|
|
88
88
|
`)?"":`
|
|
89
|
-
`;return
|
|
89
|
+
`;return ne(i,`${e}${c}client:
|
|
90
90
|
generators:
|
|
91
|
-
- ${
|
|
92
|
-
`,"utf-8"),!0}return t.splice(n+1,0," generators:",` - ${
|
|
93
|
-
`),"utf-8"),!0}function
|
|
94
|
-
`),
|
|
95
|
-
`),"utf-8"),!0}if(!/^\s+generators:\s*$/.test(c[
|
|
96
|
-
`),"utf-8"),!0;
|
|
97
|
-
`),"utf-8"),!0}function
|
|
98
|
-
\u274C ${
|
|
91
|
+
- ${r}
|
|
92
|
+
`,"utf-8"),!0}return t.splice(n+1,0," generators:",` - ${r}`),ne(i,t.join(`
|
|
93
|
+
`),"utf-8"),!0}function qs(i,e,t){if(i===void 0||!fe(i))return!1;let n=ue(i,"utf-8"),r=w=>O=>O===w||O===`'${w}'`||O===`"${w}"`,s=r(e),o=r(t),c=n.split(`
|
|
94
|
+
`),h=c.findIndex(w=>/^client:\s*$/.test(w)),y=h===-1?-1:c.findIndex((w,O)=>O>h&&/^\s+generators:/.test(w));if(y!==-1&&c.slice(h+1,y).some(w=>/^\S/.test(w))&&(y=-1),y===-1)return Us(i,n,c,h,t);let m=c[y].match(/^(\s+generators:\s*\[)(.*)\]\s*$/);if(m!==null){let w=m[2].split(",").map(d=>d.trim()).filter(d=>d!=="");if(w.some(o))return!0;let O=w.findIndex(s);return O===-1?w.push(t):w[O]=t,c[y]=`${m[1]}${w.join(", ")}]`,ne(i,c.join(`
|
|
95
|
+
`),"utf-8"),!0}if(!/^\s+generators:\s*$/.test(c[y]))return!1;let u=y,g=`${c[y].match(/^\s+/)[0]} `;for(let w=y+1;w<c.length;w++){if(/^\s*(#|$)/.test(c[w]))continue;let O=c[w].match(/^(\s+)- (.*?)\s*$/);if(O===null)break;let d=O[2].match(/\s+#.*$/)?.[0]??"",S=d===""?O[2]:O[2].slice(0,-d.length);if(o(S))return!0;if(s(S))return c[w]=`${O[1]}- ${t}${d}`,ne(i,c.join(`
|
|
96
|
+
`),"utf-8"),!0;u=w,g=O[1]}return c.splice(u+1,0,`${g}- ${t}`),ne(i,c.join(`
|
|
97
|
+
`),"utf-8"),!0}function Ws({name:i,files:e,toolkitVersion:t,assetsDir:n,dir:r,targetDir:s}){let o=U(s,"index.ts"),c=ve(process.cwd(),o)||o;if(!fe(o)){Q.eject_generator_outcome="missing-target";let S=U(r,`${i}.mjs`);throw new de(fe(S)?`
|
|
98
|
+
\u274C ${ve(process.cwd(),S)} is a single-file eject from an older version; this version ejects a folder. Eject fresh: redocly eject-generator ${i} --force
|
|
99
99
|
`:`
|
|
100
100
|
\u274C Nothing to update: ${c} does not exist. Eject first.
|
|
101
|
-
`)}let
|
|
101
|
+
`)}let h=wr(ue(o,"utf-8"));h!==void 0&&st.valid(h)!==null&&(Q.eject_generator_from_version=h),Q.eject_generator_to_version=t;let y=h===t||h===void 0?new Map:Or(`${ge}@${h}`,[...e.map(S=>hr(i,S)),yt("client-generators"),yt(`${i}-generator`)]);if(h===void 0)throw Q.eject_generator_outcome="missing-base",new de(`
|
|
102
102
|
\u274C Could not read the version ${c} was ejected from (not recorded in its header), so there is no merge base.
|
|
103
103
|
Eject to a temporary directory and diff by hand, or re-eject with --force.
|
|
104
|
-
`);let
|
|
105
|
-
`);continue}let
|
|
106
|
-
`);let
|
|
107
|
-
`)):
|
|
108
|
-
`)}function
|
|
104
|
+
`);let m=0;for(let S of e){let C=ue(U(n,"generators",i,S),"utf-8"),j=U(s,S);if(!fe(j)){ne(j,C,"utf-8");continue}let G=ue(j,"utf-8");if(G===C)continue;let z=h===t?C:y.get(hr(i,S));if(z===void 0){ne(`${j}.new`,C,"utf-8"),k.warn(`${ve(process.cwd(),j)} has no merge base in ${ge}@${h} \u2014 the new file is beside it as ${S}.new.
|
|
105
|
+
`);continue}let Ee=In(G,z,C);ne(j,Ee.merged,"utf-8"),m+=Ee.conflicts}let u=S=>h===t?ue(U(n,"skills",S,"SKILL.md"),"utf-8"):y.get(yt(S)),g=Kt("client-generators",n,u("client-generators"))+Kt(`${i}-generator`,n,u(`${i}-generator`));Rn(r,$n(r));let w=Ln({[ge]:t},!0);(w==="updated"||w==="added")&&k.info(`Set ${ge} to ^${t} in package.json \u2014 run your installer.
|
|
106
|
+
`);let O=m+g;Q.eject_generator_outcome=O>0?"conflicts":"success";let d=ve(process.cwd(),s)||s;O>0?(Q.eject_generator_conflicts=O,k.warn(`Updated ${d} with ${O} conflict(s)${g>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
107
|
+
`)):k.info(`Updated ${d} cleanly.
|
|
108
|
+
`)}function Gs({name:i,asset:e,toolkitVersion:t,assetsDir:n,dir:r,target:s,printedTarget:o}){if(!fe(s))throw Q.eject_generator_outcome="missing-target",new de(`
|
|
109
109
|
\u274C Nothing to update: ${o} does not exist. Eject first.
|
|
110
|
-
`);let c=
|
|
111
|
-
\u274C Could not read the version this file was ejected from (${
|
|
112
|
-
The current generator is written to ${
|
|
113
|
-
`)}let{merged:
|
|
114
|
-
`);let
|
|
115
|
-
`);let
|
|
116
|
-
`)):
|
|
117
|
-
`)}var
|
|
110
|
+
`);let c=U(r,".pristine",`${i}.mjs`),h=ue(s,"utf-8"),y=wr(h);y!==void 0&&st.valid(y)!==null&&(Q.eject_generator_from_version=y),Q.eject_generator_to_version=t;let m=fe(c)||y===t||y===void 0?new Map:Or(`${ge}@${y}`,[pr(i),yt("client-generators"),yt(`${i}-generator`)]),u=fe(c)?ue(c,"utf-8"):y===t?e:m.get(pr(i));if(u===void 0){Q.eject_generator_outcome="missing-base";let j=`${s}.new`;throw ne(j,e,"utf-8"),new de(`
|
|
111
|
+
\u274C Could not read the version this file was ejected from (${y??"not recorded in its header"}), so there is no merge base.
|
|
112
|
+
The current generator is written to ${ve(process.cwd(),j)} \u2014 diff it against your copy and merge by hand.
|
|
113
|
+
`)}let{merged:g,conflicts:w}=In(h,u,e);ne(s,g,"utf-8"),fe(c)&&k.info(`Used ${ve(process.cwd(),c)} as the merge base. Later updates read the version from the file's header, so you can delete that .pristine directory.
|
|
114
|
+
`);let O=j=>y===t?ue(U(n,"skills",j,"SKILL.md"),"utf-8"):m.get(yt(j)),d=Kt("client-generators",n,O("client-generators"))+Kt(`${i}-generator`,n,O(`${i}-generator`));Rn(r,$n(r));let S=Ln({[ge]:t},!0);(S==="updated"||S==="added")&&k.info(`Set ${ge} to ^${t} in package.json \u2014 run your installer.
|
|
115
|
+
`);let C=w+d;Q.eject_generator_outcome=C>0?"conflicts":"success",C>0?(Q.eject_generator_conflicts=C,k.warn(`Updated ${o} with ${C} conflict(s)${d>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
116
|
+
`)):k.info(`Updated ${o} cleanly.
|
|
117
|
+
`)}var Ar=async({argv:i,config:e})=>{let t=i.generator??"";Q.eject_generator_action=i.update?"update":"eject",(gt.has(t)||dr.has(t))&&(Q.eject_generator_name=t),Q.eject_generator_outcome="unexpected-error";let n=dr.get(t);if(n!==void 0){Q.eject_generator_action="guidance",Q.eject_generator_outcome="success",k.info(`
|
|
118
118
|
The "${t}" generator is the "tanstack-query" generator with one argument changed.
|
|
119
119
|
Eject that one and set the framework in your copy's default export:
|
|
120
120
|
|
|
121
121
|
redocly eject-generator tanstack-query
|
|
122
122
|
# then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
|
|
123
|
-
`);return}if(!
|
|
124
|
-
\u274C Unknown generator "${t}". Ejectable generators: ${[...
|
|
125
|
-
`);let
|
|
126
|
-
\u274C ${
|
|
127
|
-
`);
|
|
128
|
-
`+(
|
|
129
|
-
`:
|
|
130
|
-
`:"")+(d?`It also imports ${
|
|
131
|
-
`:"")+(
|
|
123
|
+
`);return}if(!gt.has(t))throw Q.eject_generator_outcome="unknown-generator",new de(`
|
|
124
|
+
\u274C Unknown generator "${t}". Ejectable generators: ${[...gt].join(", ")}.
|
|
125
|
+
`);let r=ks(),s=zs(r,t),{GENERATOR_VERSION:o}=await import("./chunks/FRC2YJS4.js"),c=Ns(i.dir??"./generators"),h=s===void 0?U(c,`${t}.mjs`):U(c,t,"index.ts"),y=ve(process.cwd(),h)||h;if(i.update){if(s===void 0){let j=ue(U(r,"generators",`${t}.mjs`),"utf-8");Gs({name:t,asset:j,toolkitVersion:o,assetsDir:r,dir:c,target:h,printedTarget:y})}else Ws({name:t,files:s,toolkitVersion:o,assetsDir:r,dir:c,targetDir:U(c,t)});return}if(fe(h)&&!i.force)throw Q.eject_generator_outcome="already-exists",new de(`
|
|
126
|
+
\u274C ${y} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
127
|
+
`);Pn(Et(h),{recursive:!0});let m=s===void 0?[ue(U(r,"generators",`${t}.mjs`),"utf-8")]:s.map(j=>ue(U(r,"generators",t,j),"utf-8"));s===void 0?ne(h,m[0],"utf-8"):s.forEach((j,G)=>{ne(U(c,t,j),m[G],"utf-8")});let u=ur("client-generators",r),g=ur(`${t}-generator`,r);Rn(c,$n(c));let w=`./${ve(e.configPath===void 0?process.cwd():lr(Et(e.configPath)),lr(h)).split("\\").join("/")}`,O=Ln({[ge]:o}),d=m.some(j=>j.includes(`from "${xn}"`)||j.includes(`from '${xn}'`)),S=qs(e.configPath,t,w),C=s===void 0?y:ve(process.cwd(),U(c,t))+"/";k.info(`Ejected the "${t}" generator to ${C}.
|
|
128
|
+
`+(O==="added"?`Added ${ge} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
129
|
+
`:O==="no-package-json"?`The ejected file imports its toolkit from ${ge} \u2014 install it: npm install --save-dev ${ge}
|
|
130
|
+
`:"")+(d?`It also imports ${xn} (a dependency of the toolkit) \u2014 add it explicitly if your package manager does not hoist.
|
|
131
|
+
`:"")+(S?`Added it to client.generators in ${ve(process.cwd(),e.configPath)} \u2014 the path to your copy replaces the built-in name.
|
|
132
132
|
`:`Point your config at the ${s===void 0?"file":"entry file"} \u2014 the path to your copy replaces the built-in name:
|
|
133
133
|
|
|
134
134
|
client:
|
|
135
135
|
generators:
|
|
136
|
-
- ${
|
|
136
|
+
- ${w}
|
|
137
137
|
|
|
138
138
|
`)+(s===void 0?"":`Running TypeScript generators uses Node's type stripping \u2014 Node 22.18 or 23.6 and newer.
|
|
139
|
-
`)+`Your agent's skills: ${
|
|
140
|
-
|
|
141
|
-
Run it: redocly generate-client <api> --output <path>${
|
|
142
|
-
Edit ${
|
|
143
|
-
Reference: ${
|
|
144
|
-
`),
|
|
145
|
-
`)}
|
|
146
|
-
`),o===0&&
|
|
147
|
-
`),
|
|
148
|
-
`),!
|
|
149
|
-
`)}function
|
|
150
|
-
`);let o="";for(let c of(s?s[1]:"").split(" "))o&&o.length+c.length+1>t?(
|
|
151
|
-
`),o=c):o=o?`${o} ${c}`:c;
|
|
152
|
-
|
|
153
|
-
`)}
|
|
154
|
-
`)}function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
`):r.
|
|
158
|
-
`):
|
|
159
|
-
`)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
`)
|
|
163
|
-
`)
|
|
164
|
-
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async r=>{let{handleStats:e}=await import("./chunks/XVS7B4RZ.js");K(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/KLGUZBJO.js");K(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async r=>{let{handleScore:e}=await import("./chunks/7GADNOVY.js");K(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async r=>{let{handleSplit:e}=await import("./chunks/IQLQH23V.js");K(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleJoin:e}=await import("./chunks/2TG3DP4I.js");K(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/HP7UD4BA.js");K(e)(r)}).command("push [files...]","Push documents to the Redocly platform.",r=>r.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:ya},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/YF4FMOTE.js");K(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/OFIQ2EST.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");K(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async r=>{let{handleLint:e}=await import("./chunks/ZXOX7NF2.js");K(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:Vn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async r=>{let{handleBundle:e}=await import("./chunks/AZ5LIJEO.js");K(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),r=>{K()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/W7TN2XCW.js");K(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/U4MI7HDM.js");K(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/BIS2ZFGS.js");K(t)(e)}).command("pr","Work with the pull requests of a cloned project.",e=>e.command("create","Open a pull request in the Redocly platform for the current branch.",t=>t.options({title:{description:"Pull request title. Defaults to the subject of the last commit.",alias:["t"],type:"string"},body:{description:"Pull request body.",alias:["b"],type:"string"},"body-file":{description:"Read the body from a file. Use `-` to read from standard input.",alias:["F"],type:"string",conflicts:"body"},base:{description:"Branch to merge into. Defaults to the project's default branch.",alias:["B"],type:"string"},draft:{description:"Open the pull request as a draft.",alias:["d"],type:"boolean"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async t=>{let{handleProjectPrCreate:n}=await import("./chunks/JRVXIEVC.js");K(n)(t)}).command("status","Show the state, review, checks, and preview URL of the pull request for the current branch.",t=>t.options({config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async t=>{let{handleProjectPrStatus:n}=await import("./chunks/JRVXIEVC.js");K(n)(t)}).demandCommand(1,"Specify a pr subcommand: create or status.")).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/BPJTNQBC.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:He}))}).demandCommand(1,"Specify a project subcommand: clone or pr.")).command("preview","Preview Redocly project.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:Object.keys(Xn),hidden:!0,deprecated:"the preview reads the package from package.json, @redocly/framework by default."},plan:{type:"string",choices:Jn,default:"enterprise",description:"Plan whose features the preview enables: pro, scale or enterprise."},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:nt("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&z.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
165
|
-
`);let{previewProject:e}=await import("./chunks/P5T6BIKW.js");K(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},openapi:{describe:"Redoc configuration. Use dot notation, e.g. openapi.hideDownloadButtons"},asyncapi:{describe:"Redoc configuration. Use dot notation, e.g. asyncapi.jsonSamplesDepth"},graphql:{describe:"Redoc configuration. Use dot notation, e.g. graphql.showBuiltInScalars"},inlineBundle:{describe:"Embed the Redoc scripts into the output file instead of loading them from the Redocly CDN.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},theme:{hidden:!0},disableGoogleFont:{hidden:!0,type:"boolean"}}).check(e=>{if(e.theme!==void 0)throw new Error("The --theme.openapi option was removed. Pass Redoc options with --openapi instead: https://redocly.com/docs/cli/guides/migrate-to-v2#changes-in-the-build-docs-command");if(e.disableGoogleFont!==void 0)throw new Error("The --disableGoogleFont option was removed because the page no longer loads Google Fonts. Remove the option from your command.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/DWXDCKZ7.js");K(e)(r)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",r=>r.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleTranslations:e}=await import("./chunks/LKNL5LEV.js");K(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleEject:e}=await import("./chunks/LET2MPMU.js");K(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:ca},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:nt("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:nt("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:nt("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/AXGFQS75.js");K(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:nt("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:nt("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/CR5TYFBN.js");K(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async r=>{let{handleGenerateClient:e}=await import("./chunks/KJNBOXDI.js");K(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[..._t].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async r=>{K(oa)(r)}).command("skills","Install the Redocly CLI agent skills for AI coding agents.",r=>r.options({agent:{description:"Agents to install the skills for. Default: detected agents.",type:"array",string:!0,choices:fa},global:{description:"Install in your home folder instead of the current project.",type:"boolean",default:!1},list:{description:"List the bundled skills without installing them.",type:"boolean",default:!1}}),async r=>{K(da)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"openapi-version":{describe:"OpenAPI version of the generated description.",type:"string",choices:["3.1","3.2"],default:"3.2"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:nt("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async r=>{let{handleGenerateSpec:e}=await import("./chunks/JZATGVUO.js");K(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/NXREEI2S.js");K(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleScorecardClassic:e}=await import("./chunks/Z6GFQV2Y.js");K(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleDrift:e}=await import("./chunks/J2EPFEBO.js");K(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleProxy:e}=await import("./chunks/UVKUPD4U.js");K(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ma]).strict().argv;
|
|
139
|
+
`)+`Your agent's skills: ${g} (this generator's design) and ${u} (the toolkit).
|
|
140
|
+
|
|
141
|
+
Run it: redocly generate-client <api> --output <path>${S?"":` --generator ${w}`}
|
|
142
|
+
Edit ${C} and run that again to see your change.
|
|
143
|
+
Reference: ${Fs}
|
|
144
|
+
`),Q.eject_generator_outcome="success"};function _r(i){if(Array.isArray(i)){let e={};for(let t of i)if(t&&typeof t=="string"){let n=Cr(t);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!i||typeof i!="string"))return Cr(i)}function Cr(i){try{let e=JSON.parse(i);if(!Ie(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[t,n]of Object.entries(e)){if(!Ie(n))throw new Error(`mTLS config for domain "${t}" must be an object`);Mn(n,"clientCert",t,!0),Mn(n,"clientKey",t,!0),Mn(n,"caCert",t,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Mn(i,e,t,n){let r=i[e];if(!r){if(n)throw new Error(`${e} is required for domain "${t}"`);return}if(typeof r!="string")throw new Error(`${e} for domain "${t}" must be a string`)}import{existsSync as Yt,mkdirSync as Hs,readdirSync as Bs,readFileSync as Dn,writeFileSync as Ks}from"node:fs";import{homedir as Ys}from"node:os";import{join as le,relative as Vs}from"node:path";import{fileURLToPath as Js}from"node:url";var jr=le(".agents","skills"),Qs=["codex","cursor","copilot","gemini","opencode"],Ne=Ys(),Zs=process.env.CLAUDE_CONFIG_DIR||le(Ne,".claude"),Xs=process.env.XDG_CONFIG_HOME||le(Ne,".config"),Sr=[{name:"claude",projectDir:".claude",homeDir:Zs},{name:"windsurf",projectDir:".windsurf",homeDir:le(Ne,".codeium","windsurf")},{name:"kiro",projectDir:".kiro",homeDir:le(Ne,".kiro")},{name:"continue",projectDir:".continue",homeDir:le(Ne,".continue")},{name:"roo",projectDir:".roo",homeDir:le(Ne,".roo")},{name:"goose",projectDir:".goose",homeDir:le(Xs,"goose")},{name:"junie",projectDir:".junie",homeDir:le(Ne,".junie")},{name:"augment",projectDir:".augment",homeDir:le(Ne,".augment")}],xr=[...Qs,...Sr.map(i=>i.name)];async function vr({argv:i}){let e=no(),t=Bs(e);if(i.list){eo(e,t);return}let n=process.cwd(),r=i.global?Ne:n,s=[le(r,jr)];for(let c of Sr)to(c,i,n)&&(i.global?s.push(le(c.homeDir,"skills")):s.push(le(n,c.projectDir,"skills")));let o=0;for(let c of s)for(let h of t){let y=Dn(le(e,h,"SKILL.md"),"utf-8"),m=le(c,h,"SKILL.md"),u=i.global?m:Vs(n,m),g="created",w=dt;Yt(m)&&(Dn(m,"utf-8")===y?(g="unchanged",w=Gn):(g="updated",w=Rt)),g!=="unchanged"&&(Hs(le(c,h),{recursive:!0}),Ks(m,y,"utf-8"),o++),k.output(`${w(g.padEnd(10))}${u}
|
|
145
|
+
`)}k.output(`
|
|
146
|
+
`),o===0&&k.output(`All skills are up to date.
|
|
147
|
+
`),k.output(`Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, and other agents read ${jr}.
|
|
148
|
+
`),!i.agent&&s.length===1&&k.output(`To install for an agent with its own folder, such as Claude Code, run: redocly skills --agent claude
|
|
149
|
+
`)}function eo(i,e){let t=Math.min(process.stdout.columns||80,100)-4;for(let n of e){let s=Dn(le(i,n,"SKILL.md"),"utf-8").match(/^description: (.*)$/m);k.output(`${Ot(ye(n))}
|
|
150
|
+
`);let o="";for(let c of(s?s[1]:"").split(" "))o&&o.length+c.length+1>t?(k.output(` ${o}
|
|
151
|
+
`),o=c):o=o?`${o} ${c}`:c;k.output(` ${o}
|
|
152
|
+
|
|
153
|
+
`)}k.output(`To install the skills, run: ${Ot("redocly skills")}
|
|
154
|
+
`)}function to(i,e,t){return e.agent?e.agent.includes(i.name):Yt(i.homeDir)?!0:!e.global&&Yt(le(t,i.projectDir))}function no(){let i=[new URL("./skills/",import.meta.url),new URL("../../lib/skills/",import.meta.url)];for(let e of i){let t=Js(e);if(Yt(t))return t}throw new de("The bundled agent skills are missing. In a checkout of the CLI, run: npm run compile")}var Jt=Pt(Xt(),1);import{existsSync as io,mkdirSync as ro,writeFileSync as Pr,readFileSync as so,statSync as oo}from"node:fs";import{homedir as ao,tmpdir as Tn}from"node:os";import{dirname as co,join as Vt}from"node:path";import*as He from"node:process";var Rr=[`${ye("Redocly CLI")} comes with skills for AI coding agents:`,"",` ${ye("redocly-cli")} lint, bundle, build docs, test, and more`,` ${ye("redocly-lint-rules")} write lint rules and plugins`,` ${ye("recheck-lint")} lint the Markdown that the agent changed`,` ${ye("recheck-config")} set up recheck in redocly.yaml`,"",`Install them in your project: \`${ye("redocly skills")}\`.`,"Docs: https://redocly.com/docs/cli/commands/skills"],Ir=Zn(Rr.join(`
|
|
155
|
+
`)),Fn="redocly-cli-version",Nn=Vt(ao(),".redocly","announcement"),lo=1e3*60*60*12,$r=He.env.NODE_ENV==="test"||He.env.CI||!He.stderr.isTTY||!!He.env.LAMBDA_TASK_ROOT||He.env.REDOCLY_SUPPRESS_NOTIFICATIONS==="true"||He.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",Lr=()=>{if($r)return;let i=(0,Jt.valid)(Er(Vt(Tn(),Fn)));i&&po(Fe,i)?fo(i):Er(Nn)!==Ir&&uo()},Er=i=>{try{return so(i,"utf-8")}catch{return}},fo=i=>{k.info(At([`A new version of ${ye("Redocly CLI")} (${dt(i)}) is available.`,`Update now: \`${ye("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},uo=()=>{try{ro(co(Nn),{recursive:!0}),Pr(Nn,Ir)}catch{return}k.info(At(Rr))},po=(i,e)=>(0,Jt.compare)(i,e)<0,ho=async i=>{let e=`https://registry.npmjs.org/${i}/latest`;try{let{fetchWithTimeout:t}=await import("./chunks/QXBSAWH3.js");return(await(await t(e,{timeout:ri})).json()).version}catch{return}},Mr=()=>{!mo()||$r||ho(Xn).then(i=>{if(i){let e=Vt(Tn(),Fn);Pr(e,i)}}).catch(()=>{})},mo=()=>{try{let i=Vt(Tn(),Fn);if(!io(i))return!0;let e=new Date().getTime(),n=oo(i).mtime.getTime();return e-n>=lo}catch{return!1}};function Dr(i){if(!i||i==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return i}function Be(i,e=!1){return t=>{let n=Number(t);if(isNaN(n)||n<=0)throw new Error(`${i} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${i} must be a positive integer`);return n}}function Nr(i){return i?._?.[0]??""}async function Tr(i,e,t){let n;try{n=await Kn({configPath:i.config,customExtends:i.extends,plugins:t})}catch(o){throw new de(`Failed to load the configuration file:
|
|
156
|
+
|
|
157
|
+
- ${o.message}`)}if(i["lint-config"]==="off"||n.document===void 0)return n;let r=await Jn({config:n,severity:i["lint-config"]||"warn"}),s=Yn(r);if(Vn(r,{maxProblems:i["max-problems"],totals:s,version:e,command:"check-config"}),go(s,Nr(i)),s.errors>0)throw new It("Config check failed.");return n}function go(i,e){i.errors>0?k.error(`\u274C Your config has ${i.errors} ${Zt("error",i.errors)}.
|
|
158
|
+
`):i.warnings>0?k.warn(`\u26A0\uFE0F Your config has ${i.warnings} ${Zt("warning",i.warnings)}.
|
|
159
|
+
`):e==="check-config"&&k.info(dt(`\u2705 Your config is valid.
|
|
160
|
+
`))}function W(i,e={}){return async t=>{let n=performance.now(),r=2,s="unknown",o,c,h,y=new Set,m=new Set,u=new Set,g=({parsed:C,source:j})=>{if(s="unknown",o=void 0,c=void 0,j?.absoluteRef&&Wn(j.absoluteRef)){s="graphql";return}try{s=Bn(C)}catch{s="unsupported"}Ie(C)&&(o=C?.openapi?"openapi":C?.swagger?"swagger":C?.asyncapi?"asyncapi":C?.arazzo?"arazzo":C?.overlay?"overlay":void 0,o&&(c=C[o]),Hn(s)==="arazzo1"&&(di(C,y),ci(C,m),li(C,u)))},w=new Set,O=new Set,d=new Set,S=C=>{for(let j of C)j.ignored?d.add(j.ruleId):j.severity==="error"?w.add(j.ruleId):j.severity==="warn"&&O.add(j.ruleId)};try{if(t.config&&!zn(t.config))throw new de("Please provide a valid path to the configuration file.");h=await Tr(t,Fe,e.plugins),r=1,typeof i=="function"&&await i({argv:t,config:h,version:Fe,collectSpecData:g,collectResults:S}),r=0}catch(C){C instanceof It||(C instanceof de?k.error(C.message+`
|
|
161
|
+
|
|
162
|
+
`):(k.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
163
|
+
`),k.error(C instanceof Error?C.stack||C.message:String(C)),k.error(`
|
|
164
|
+
`)))}finally{if(oi(h)){let C=Math.round(performance.now()-n);await ai({config:h,argv:t,exit_code:r,execution_time:C,spec_version:s,spec_keyword:o,spec_full_version:c,respect_x_security_auth_types:[...y],respect_source_description_types:[...m],respect_criterion_object_types:[...u],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...O],lint_rules_with_ignored_problems:[...d],generate_client:ti,eject_generator:Q,bundle:si})}process.once("beforeExit",()=>{process.exit(r)})}}}Fr.config({path:kr.resolve(process.cwd(),"./.env")});Mr();cr(on(process.argv)).version(!1).option("version",{type:"boolean",description:"Show version number.",global:!1}).middleware(i=>{i.version&&i._.length===0&&(k.output(`${Fe}
|
|
165
|
+
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",i=>i.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async i=>{let{handleStats:e}=await import("./chunks/BL2KWYMY.js");W(e)(i)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",i=>i.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async i=>{let{handleInspectNodeTypes:e}=await import("./chunks/FJBULQ4P.js");W(e)(i)}).command("diff <base> <revision>","Compare two API descriptions and rate every change by the semver bump it requires [experimental].",i=>i.env("REDOCLY_CLI_DIFF").positional("base",{type:"string",demandOption:!0}).positional("revision",{type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown","html","github-actions","next-version"],default:"stylish"},output:{description:"Write the diff report to a file.",type:"string",alias:"o"},"fail-on":{description:"Exit with a non-zero code when changes of this impact or higher are found.",choices:[...Un,"none"],default:"major"},"check-version":{description:"Fail when info.version was not bumped to match the impact of the changes.",type:"boolean",default:!1},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"}}),async i=>{let{handleDiff:e}=await import("./chunks/QYBWIG5Y.js");W(e)(i)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",i=>i.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async i=>{let{handleScore:e}=await import("./chunks/EHMG7I34.js");W(e)(i)}).command("split [api]","Split an API description into a multi-file structure.",i=>i.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async i=>{let{handleSplit:e}=await import("./chunks/FLL7MTDS.js");W(e)(i)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",i=>i.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handleJoin:e}=await import("./chunks/A7XJ7Y3N.js");W(e)(i)}).command("push-status [pushId]",!1,i=>i.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handlePushStatus:e}=await import("./chunks/IFGXTL5P.js");W(e)(i)}).command("push [files...]","Push documents to the Redocly platform.",i=>i.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:Dr},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async i=>{let{handlePush:e}=await import("./chunks/6234PJEZ.js");W(e)(i)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",i=>i.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async i=>{let{handleRecheck:e}=await import("./chunks/KVXVR5Y4.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");W(e,{plugins:[t]})(i)}).command("lint [apis...]","Lint an API or Arazzo description.",i=>i.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async i=>{let{handleLint:e}=await import("./chunks/LTJXST6M.js");W(e)(i)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",i=>i.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:Qn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async i=>{let{handleBundle:e}=await import("./chunks/2DXUH2SS.js");W(e)(i)}).command("check-config","Lint the Redocly configuration file.",async i=>i.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),i=>{W()(i)}).command("login","Log in to Redocly.",async i=>i.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async i=>{let{handleLogin:e}=await import("./chunks/GHJGHHQP.js");W(e)(i)}).command("logout","Clear your stored credentials.",i=>i,async i=>{let{handleLogout:e}=await import("./chunks/HJ5KS42K.js");W(e)(i)}).command("project","[early access] Work with a Redocly-hosted project.",i=>i.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/BTLP7Z6A.js");W(t)(e)}).command("pr","Work with the pull requests of a cloned project.",e=>e.command("create","Open a pull request in the Redocly platform for the current branch.",t=>t.options({title:{description:"Pull request title. Defaults to the subject of the last commit.",alias:["t"],type:"string"},body:{description:"Pull request body.",alias:["b"],type:"string"},"body-file":{description:"Read the body from a file. Use `-` to read from standard input.",alias:["F"],type:"string",conflicts:"body"},base:{description:"Branch to merge into. Defaults to the project's default branch.",alias:["B"],type:"string"},draft:{description:"Open the pull request as a draft.",alias:["d"],type:"boolean"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async t=>{let{handleProjectPrCreate:n}=await import("./chunks/7HTKK26B.js");W(n)(t)}).command("status","Show the state, review, checks, and preview URL of the pull request for the current branch.",t=>t.options({config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async t=>{let{handleProjectPrStatus:n}=await import("./chunks/7HTKK26B.js");W(n)(t)}).demandCommand(1,"Specify a pr subcommand: create or status.")).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/42X6IAVM.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Fe}))}).demandCommand(1,"Specify a project subcommand: clone or pr.")).command("preview","Preview Redocly project.",i=>i.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:Object.keys(ni),hidden:!0,deprecated:"the preview reads the package from package.json, @redocly/framework by default."},plan:{type:"string",choices:ii,default:"enterprise",description:"Plan whose features the preview enables: pro, scale or enterprise."},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:Be("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{process.argv.some(t=>t.startsWith("--source-dir"))&&k.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
166
|
+
`);let{previewProject:e}=await import("./chunks/SPIFPTTE.js");W(e)(i)}).command("build-docs [api]","Produce API documentation as an HTML file",i=>i.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},openapi:{describe:"Redoc configuration. Use dot notation, e.g. openapi.hideDownloadButtons"},asyncapi:{describe:"Redoc configuration. Use dot notation, e.g. asyncapi.jsonSamplesDepth"},graphql:{describe:"Redoc configuration. Use dot notation, e.g. graphql.showBuiltInScalars"},inlineBundle:{describe:"Embed the Redoc scripts into the output file instead of loading them from the Redocly CDN.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},theme:{hidden:!0},disableGoogleFont:{hidden:!0,type:"boolean"}}).check(e=>{if(e.theme!==void 0)throw new Error("The --theme.openapi option was removed. Pass Redoc options with --openapi instead: https://redocly.com/docs/cli/guides/migrate-to-v2#changes-in-the-build-docs-command");if(e.disableGoogleFont!==void 0)throw new Error("The --disableGoogleFont option was removed because the page no longer loads Google Fonts. Remove the option from your command.");return!0}),async i=>{let{handlerBuildCommand:e}=await import("./chunks/DNDYWJHC.js");W(e)(i)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",i=>i.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handleTranslations:e}=await import("./chunks/L4HVZOFP.js");W(e)(i)}).command("eject <type> [path]","Helper function to eject project elements for customization.",i=>i.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handleEject:e}=await import("./chunks/UKVHQIBO.js");W(e)(i)}).command("respect [files...]","Run Arazzo tests.",i=>i.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:_r},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:Be("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:Be("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:Be("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async i=>{let{handleRespect:e}=await import("./chunks/BXMYSHQY.js");W(e)(i)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",i=>i.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:Be("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:Be("max-workflows",!0)}}),async i=>{let{handleGenerateArazzo:e}=await import("./chunks/FMMOQ6SE.js");W(e)(i)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",i=>i.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php, java \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async i=>{let{handleGenerateClient:e}=await import("./chunks/6XDKNFYM.js");W(e)(i)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",i=>i.positional("generator",{describe:`Built-in generator to eject (${[...gt].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async i=>{W(Ar)(i)}).command("skills","Install the Redocly CLI agent skills for AI coding agents.",i=>i.options({agent:{description:"Agents to install the skills for. Default: detected agents.",type:"array",string:!0,choices:xr},global:{description:"Install in your home folder instead of the current project.",type:"boolean",default:!1},list:{description:"List the bundled skills without installing them.",type:"boolean",default:!1}}),async i=>{W(vr)(i)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",i=>i.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"openapi-version":{describe:"OpenAPI version of the generated description.",type:"string",choices:["3.1","3.2"],default:"3.2"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:Be("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async i=>{let{handleGenerateSpec:e}=await import("./chunks/WKBXTA7Y.js");W(e)(i)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",i=>i.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async i=>{let{handleIntrospectMcp:e}=await import("./chunks/RL2EIWFM.js");W(e)(i)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",i=>i.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async i=>{let{handleScorecardClassic:e}=await import("./chunks/L5AG5NJZ.js");W(e)(i)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",i=>i.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handleDrift:e}=await import("./chunks/MO6NEDYO.js");W(e)(i)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",i=>i.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async i=>{let{handleProxy:e}=await import("./chunks/GMMFZFKJ.js");W(e)(i)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Lr]).strict().argv;
|
|
166
167
|
/*! Bundled license information:
|
|
167
168
|
|
|
168
169
|
yargs-parser/build/lib/string-utils.js:
|