@redocly/cli 2.59.0 → 2.60.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.
Files changed (126) hide show
  1. package/lib/chunks/{RSJYGTUN.js → 2F2YM4RD.js} +1 -1
  2. package/lib/chunks/{GYVNLXXF.js → 3MPID4OC.js} +1 -1
  3. package/lib/chunks/{V2MDYOAB.js → 4HEJ6GQB.js} +2 -2
  4. package/lib/chunks/{J56XVM43.js → 4WAQNM63.js} +2 -2
  5. package/lib/chunks/{YYL4GJWR.js → 4XDEFJCF.js} +1 -1
  6. package/lib/chunks/{IOYEFQOG.js → 52MW7SRF.js} +1 -1
  7. package/lib/chunks/{F2MGZZWG.js → 72ZX5WSN.js} +1 -1
  8. package/lib/chunks/{NFJLKOC3.js → 7C244K4X.js} +1 -1
  9. package/lib/chunks/{7YRZIM5N.js → 7ED6ZTTH.js} +1 -1
  10. package/lib/chunks/{IT53FBW3.js → ACVFQG4D.js} +1 -1
  11. package/lib/chunks/{PHV3T4WH.js → AP2GA7RS.js} +2 -2
  12. package/lib/chunks/{J3SQBSQT.js → B5GZ7KU2.js} +1 -1
  13. package/lib/chunks/{B7HK2FMY.js → BHUCIWQF.js} +1 -1
  14. package/lib/chunks/{DBWAOHZO.js → BZBFESBB.js} +1 -1
  15. package/lib/chunks/{MO5BUSRI.js → CAJM6OL3.js} +1 -1
  16. package/lib/chunks/{E2UY7KGT.js → CEPC3LL4.js} +1 -1
  17. package/lib/chunks/{QTOB5ERW.js → CKZ35ARL.js} +1 -1
  18. package/lib/chunks/DAAOXDSB.js +11 -0
  19. package/lib/chunks/{MBJ2NZOC.js → DJWI7SF7.js} +1 -1
  20. package/lib/chunks/{ZLNFQUIK.js → DJXBNZCO.js} +1 -1
  21. package/lib/chunks/{RTZAVLXW.js → DTMC35L3.js} +1 -1
  22. package/lib/chunks/{AX7QT4NM.js → EXCIOEBN.js} +1 -1
  23. package/lib/chunks/{AF5IHTRV.js → G4ZIYGF5.js} +1 -1
  24. package/lib/chunks/{O553F5PN.js → GC26XZYZ.js} +1 -1
  25. package/lib/chunks/{6IOZ5LPA.js → GD6WKI2C.js} +1 -1
  26. package/lib/chunks/{BEYYSLHN.js → GHPOEF7A.js} +1 -1
  27. package/lib/chunks/{42YAZTOS.js → GYKYFMW3.js} +1 -1
  28. package/lib/chunks/{DAQRGYND.js → HFGKPU2P.js} +1 -1
  29. package/lib/chunks/{BYWCQTSQ.js → HNKSHJLU.js} +1 -1
  30. package/lib/chunks/{P6JG7GU7.js → HQUG6XPO.js} +1 -1
  31. package/lib/chunks/{WK3QKCKY.js → HSHAARAO.js} +1 -1
  32. package/lib/chunks/{CUJVZNF3.js → HVO5F4MP.js} +1 -1
  33. package/lib/chunks/{RS64EP6M.js → HZZP3BZQ.js} +1 -1
  34. package/lib/chunks/{OFVQSSQQ.js → IAN3UOJT.js} +1 -1
  35. package/lib/chunks/{ECKYES2X.js → IJ43XWPG.js} +1 -1
  36. package/lib/chunks/{6367YNHA.js → J4NCFMOR.js} +1 -1
  37. package/lib/chunks/{BRJNFWLD.js → LF35KJ5M.js} +1 -1
  38. package/lib/chunks/{AVEIZUZG.js → MCJLOALK.js} +1 -1
  39. package/lib/chunks/{NSLUCFIM.js → MJYI42E6.js} +1 -1
  40. package/lib/chunks/{7QMY27YR.js → N4AA4DRD.js} +1 -1
  41. package/lib/chunks/{CSBPXWYJ.js → NADFEIIN.js} +1 -1
  42. package/lib/chunks/{J2APNZBG.js → O4RAFGZA.js} +1 -1
  43. package/lib/chunks/{UESEVDDS.js → O5WCU6SC.js} +1 -1
  44. package/lib/chunks/{US7OHDWQ.js → OKTLNLO3.js} +1 -1
  45. package/lib/chunks/{7FNYMCIP.js → PGZIUA7J.js} +1 -1
  46. package/lib/chunks/{KSTWCX27.js → PKYNMOKV.js} +1 -1
  47. package/lib/chunks/{NBRDOUIR.js → Q526MFO3.js} +1 -1
  48. package/lib/chunks/{OIPFI3RD.js → QGUZ4KFX.js} +1 -1
  49. package/lib/chunks/{G5TC4ZEC.js → RDMFHSDB.js} +1 -1
  50. package/lib/chunks/S27TE7KZ.js +8 -0
  51. package/lib/chunks/{7W4L5LRS.js → S46ENZHC.js} +1 -1
  52. package/lib/chunks/{UQSXY6X3.js → S5G22GL5.js} +1 -1
  53. package/lib/chunks/{QB6J3FNI.js → SDNESV5E.js} +1 -1
  54. package/lib/chunks/{FG62OWSV.js → SL6UQOKE.js} +1 -1
  55. package/lib/chunks/{PRAHH3RT.js → SNR3DAVL.js} +1 -1
  56. package/lib/chunks/{OIISHIPF.js → SXOXAG7R.js} +2 -2
  57. package/lib/chunks/{LHKSVCO3.js → UPHYYNN3.js} +3 -3
  58. package/lib/chunks/{NSK5BX5M.js → UXSV2J6V.js} +1 -1
  59. package/lib/chunks/{PCJ3RO4V.js → V46KUEYR.js} +1 -1
  60. package/lib/chunks/VCV3FKMW.js +7 -0
  61. package/lib/chunks/{GEYI6VH2.js → W3K4YAMS.js} +1 -1
  62. package/lib/chunks/{NC5GB4G5.js → W7VT3BOM.js} +1 -1
  63. package/lib/chunks/WFIIXHF3.js +9 -0
  64. package/lib/chunks/{NEOAISVJ.js → XHDOW23C.js} +1 -1
  65. package/lib/chunks/{IDDPOAAO.js → XQA4EEZA.js} +1 -1
  66. package/lib/chunks/{TJGR5OHF.js → XZKUPNLZ.js} +1 -1
  67. package/lib/chunks/{AVVEOYYF.js → YNPWONFN.js} +1 -1
  68. package/lib/chunks/{TPR5SEOT.js → ZJAFKITR.js} +1 -1
  69. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  70. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  71. package/lib/eject-assets/generators/cli/index.ts +2 -2
  72. package/lib/eject-assets/generators/cli/render.ts +1 -1
  73. package/lib/eject-assets/generators/go/client.ts +1 -1
  74. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  75. package/lib/eject-assets/generators/go/index.ts +2 -2
  76. package/lib/eject-assets/generators/go/models.ts +1 -1
  77. package/lib/eject-assets/generators/go/naming.ts +1 -1
  78. package/lib/eject-assets/generators/go/operations.ts +1 -1
  79. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  80. package/lib/eject-assets/generators/go/types.ts +1 -1
  81. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  82. package/lib/eject-assets/generators/mock/index.ts +2 -2
  83. package/lib/eject-assets/generators/mock/render.ts +1 -1
  84. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  85. package/lib/eject-assets/generators/mock/values.ts +1 -1
  86. package/lib/eject-assets/generators/php/client.ts +1 -1
  87. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  88. package/lib/eject-assets/generators/php/index.ts +2 -2
  89. package/lib/eject-assets/generators/php/models.ts +1 -1
  90. package/lib/eject-assets/generators/php/naming.ts +1 -1
  91. package/lib/eject-assets/generators/php/operations.ts +1 -1
  92. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  93. package/lib/eject-assets/generators/php/types.ts +1 -1
  94. package/lib/eject-assets/generators/python/client.ts +1 -1
  95. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  96. package/lib/eject-assets/generators/python/index.ts +2 -2
  97. package/lib/eject-assets/generators/python/models.ts +1 -1
  98. package/lib/eject-assets/generators/python/naming.ts +1 -1
  99. package/lib/eject-assets/generators/python/operations.ts +1 -1
  100. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  101. package/lib/eject-assets/generators/python/types.ts +1 -1
  102. package/lib/eject-assets/generators/swr/index.ts +2 -2
  103. package/lib/eject-assets/generators/swr/render.ts +1 -1
  104. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  105. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  106. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  107. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  108. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  109. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  110. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  111. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  112. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  113. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  114. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  115. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  116. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  117. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  118. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  119. package/lib/eject-assets/generators/zod/index.ts +2 -2
  120. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  121. package/lib/index.js +6 -5
  122. package/package.json +1 -1
  123. package/lib/chunks/2ZE577MX.js +0 -11
  124. package/lib/chunks/6CJDOMNR.js +0 -8
  125. package/lib/chunks/QEM3YVSB.js +0 -7
  126. package/lib/chunks/YSCPIS6C.js +0 -9
package/lib/index.js CHANGED
@@ -5,7 +5,7 @@ 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 Pa,b as ri,c as ni}from"./chunks/GHSNC2OX.js";import{a as Jn,f as te}from"./chunks/U5DIFWGH.js";import{c as Qn}from"./chunks/4PTNG4EI.js";import{a as ei}from"./chunks/6CJDOMNR.js";import{a as ii}from"./chunks/G5TC4ZEC.js";import{a as Zn}from"./chunks/NSLUCFIM.js";import{a as La}from"./chunks/LRUXN6H5.js";import{a as ti,c as Yt,d as $r,e as si,g as oi}from"./chunks/TZMWTSOQ.js";import{a as Fe,b as Kn,c as Xn}from"./chunks/OIPFI3RD.js";import{N as Gn,Q as kn,_ as Ht,a as zn,c as we,ca as jr,ga as X,ha as Vt,ia as Wn,l as vr,ma as Oe,na as Bt,qa as Hn,t as Un,ta as Vn,ua as Bn,za as Yn}from"./chunks/PHV3T4WH.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as z,e as Pt}from"./chunks/RFWIIJFG.js";var wt=z((pd,ai)=>{"use strict";var Na="2.0.0",Ta=Number.MAX_SAFE_INTEGER||9007199254740991,Da=16,qa=250,Ma=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ai.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Da,MAX_SAFE_BUILD_LENGTH:qa,MAX_SAFE_INTEGER:Ta,RELEASE_TYPES:Ma,SEMVER_SPEC_VERSION:Na,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Lt=z((hd,ci)=>{"use strict";var Fa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};ci.exports=Fa});var Ot=z((Ge,li)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ir,MAX_SAFE_BUILD_LENGTH:za,MAX_LENGTH:Ua}=wt(),Ga=Lt();Ge=li.exports={};var ka=Ge.re=[],Wa=Ge.safeRe=[],C=Ge.src=[],Ha=Ge.safeSrc=[],x=Ge.t={},Va=0,Pr="[a-zA-Z0-9-]",Ba=[["\\s",1],["\\d",Ua],[Pr,za]],Ya=r=>{for(let[e,t]of Ba)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Ya(e),i=Va++;Ga(r,i,e),x[r]=i,C[i]=e,Ha[i]=n,ka[i]=new RegExp(e,t?"g":void 0),Wa[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Pr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Pr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ir}})(?:\\.(\\d{1,${Ir}}))?(?:\\.(\\d{1,${Ir}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Kt=z((md,ui)=>{"use strict";var Ka=Object.freeze({loose:!0}),Xa=Object.freeze({}),Ja=r=>r?typeof r!="object"?Ka:r:Xa;ui.exports=Ja});var Lr=z((gd,pi)=>{"use strict";var fi=/^[0-9]+$/,di=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=fi.test(r),n=fi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},Qa=(r,e)=>di(e,r);pi.exports={compareIdentifiers:di,rcompareIdentifiers:Qa}});var me=z((yd,mi)=>{"use strict";var Xt=Lt(),{MAX_LENGTH:hi,MAX_SAFE_INTEGER:Jt}=wt(),{safeRe:Qt,t:Zt}=Ot(),Za=Kt(),{compareIdentifiers:Nr}=Lr(),ec=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(Nr(r[n],t[n])!==0)return!1;return!0},Tr=class r{constructor(e,t){if(t=Za(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>hi)throw new TypeError(`version is longer than ${hi} characters`);Xt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Qt[Zt.LOOSE]:Qt[Zt.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>Jt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jt||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<Jt)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(Xt("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(Xt("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 Nr(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(Xt("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 Nr(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?Qt[Zt.PRERELEASELOOSE]:Qt[Zt.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]),ec(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}};mi.exports=Tr});var Qe=z((bd,yi)=>{"use strict";var gi=me(),tc=(r,e,t=!1)=>{if(r instanceof gi)return r;try{return new gi(r,e)}catch(n){if(!t)return null;throw n}};yi.exports=tc});var Ei=z((Ed,bi)=>{"use strict";var rc=Qe(),nc=(r,e)=>{let t=rc(r,e);return t?t.version:null};bi.exports=nc});var Oi=z((wd,wi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};wi.exports=sc});var Si=z((Od,_i)=>{"use strict";var Ai=me(),oc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ai(r instanceof Ai?r.version:r,t).inc(e,n,i).version}catch{return null}};_i.exports=oc});var Ri=z((Ad,xi)=>{"use strict";var Ci=Qe(),ac=(r,e)=>{let t=Ci(r,null,!0),n=Ci(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"};xi.exports=ac});var ji=z((_d,vi)=>{"use strict";var cc=me(),lc=(r,e)=>new cc(r,e).major;vi.exports=lc});var Ii=z((Sd,$i)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).minor;$i.exports=fc});var Li=z((Cd,Pi)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).patch;Pi.exports=pc});var Ti=z((xd,Ni)=>{"use strict";var hc=Qe(),mc=(r,e)=>{let t=hc(r,e);return t&&t.prerelease.length?t.prerelease:null};Ni.exports=mc});var Ie=z((Rd,qi)=>{"use strict";var Di=me(),gc=(r,e,t)=>new Di(r,t).compare(new Di(e,t));qi.exports=gc});var Fi=z((vd,Mi)=>{"use strict";var yc=Ie(),bc=(r,e,t)=>yc(e,r,t);Mi.exports=bc});var Ui=z((jd,zi)=>{"use strict";var Ec=Ie(),wc=(r,e)=>Ec(r,e,!0);zi.exports=wc});var er=z(($d,ki)=>{"use strict";var Gi=me(),Oc=(r,e,t)=>{let n=new Gi(r,t),i=new Gi(e,t);return n.compare(i)||n.compareBuild(i)};ki.exports=Oc});var Hi=z((Id,Wi)=>{"use strict";var Ac=er(),_c=(r,e)=>r.sort((t,n)=>Ac(t,n,e));Wi.exports=_c});var Bi=z((Pd,Vi)=>{"use strict";var Sc=er(),Cc=(r,e)=>r.sort((t,n)=>Sc(n,t,e));Vi.exports=Cc});var Nt=z((Ld,Yi)=>{"use strict";var xc=Ie(),Rc=(r,e,t)=>xc(r,e,t)>0;Yi.exports=Rc});var tr=z((Nd,Ki)=>{"use strict";var vc=Ie(),jc=(r,e,t)=>vc(r,e,t)<0;Ki.exports=jc});var Dr=z((Td,Xi)=>{"use strict";var $c=Ie(),Ic=(r,e,t)=>$c(r,e,t)===0;Xi.exports=Ic});var qr=z((Dd,Ji)=>{"use strict";var Pc=Ie(),Lc=(r,e,t)=>Pc(r,e,t)!==0;Ji.exports=Lc});var rr=z((qd,Qi)=>{"use strict";var Nc=Ie(),Tc=(r,e,t)=>Nc(r,e,t)>=0;Qi.exports=Tc});var nr=z((Md,Zi)=>{"use strict";var Dc=Ie(),qc=(r,e,t)=>Dc(r,e,t)<=0;Zi.exports=qc});var Mr=z((Fd,es)=>{"use strict";var Mc=Dr(),Fc=qr(),zc=Nt(),Uc=rr(),Gc=tr(),kc=nr(),Wc=(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 Mc(r,t,n);case"!=":return Fc(r,t,n);case">":return zc(r,t,n);case">=":return Uc(r,t,n);case"<":return Gc(r,t,n);case"<=":return kc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};es.exports=Wc});var rs=z((zd,ts)=>{"use strict";var Hc=me(),Vc=Qe(),{safeRe:ir,t:sr}=Ot(),Bc=(r,e)=>{if(r instanceof Hc)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?ir[sr.COERCEFULL]:ir[sr.COERCE]);else{let u=e.includePrerelease?ir[sr.COERCERTLFULL]:ir[sr.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 Vc(`${n}.${i}.${s}${o}${c}`,e)};ts.exports=Bc});var is=z((Ud,ns)=>{"use strict";var Yc=Qe(),Kc=wt(),Xc=me(),Jc=(r,e,t)=>{if(!Kc.RELEASE_TYPES.includes(e))return null;let n=Qc(r,t);return n&&Zc(n,e)},Qc=(r,e)=>{let t=r instanceof Xc?r.version:r;return Yc(t,e)},Zc=(r,e)=>{if(el(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()},el=r=>r.startsWith("pre");ns.exports=Jc});var os=z((Gd,ss)=>{"use strict";var Fr=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}};ss.exports=Fr});var Pe=z((kd,us)=>{"use strict";var tl=/\s+/g,zr=class r{constructor(e,t){if(t=nl(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(tl," "),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=>!cs(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&&dl(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(fl,"");let n=((this.options.includePrerelease&&ll)|(this.options.loose&&ul))+":"+e,i=as.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,_l(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],ol),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],al),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],cl),re("caret trim",e);let c=e.split(" ").map(l=>pl(l,this.options)).join(" ").split(/\s+/).map(l=>Al(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Ur(l,this.options));for(let l of p){if(cs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return as.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ls(n,t)&&e.set.some(i=>ls(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 il(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Sl(this.set[t],e,this.options))return!0;return!1}};us.exports=zr;var rl=os(),as=new rl,nl=Kt(),Ur=Tt(),re=Lt(),il=me(),{safeRe:Ae,src:sl,t:ge,comparatorTrimReplace:ol,tildeTrimReplace:al,caretTrimReplace:cl}=Ot(),{FLAG_INCLUDE_PRERELEASE:ll,FLAG_LOOSE:ul}=wt(),fl=new RegExp(sl[ge.BUILD],"g"),cs=r=>r.value==="<0.0.0-0",dl=r=>r.value==="",ls=(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},pl=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=yl(r,e),re("caret",r),r=ml(r,e),re("tildes",r),r=El(r,e),re("xrange",r),r=Ol(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",hl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),ml=(r,e)=>r.trim().split(/\s+/).map(t=>gl(t,e)).join(" "),gl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.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})},yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.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})},El=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>wl(t,e)).join(" ")),wl=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),hl(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})},Ol=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Al=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),_l=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()),Sl=(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 Tt=z((Wd,gs)=>{"use strict";var Dt=Symbol("SemVer ANY"),Wr=class r{static get ANY(){return Dt}constructor(e,t){if(t=fs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),kr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Dt?this.value="":this.value=this.operator+this.semver.version,kr("comp",this)}parse(e){let t=this.options.loose?ds[ps.COMPARATORLOOSE]:ds[ps.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 hs(n[2],this.options.loose):this.semver=Dt}toString(){return this.value}test(e){if(kr("Comparator.test",e,this.options.loose),this.semver===Dt||e===Dt)return!0;if(typeof e=="string")try{e=new hs(e,this.options)}catch{return!1}return Gr(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 ms(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ms(this.value,t).test(e.semver):(t=fs(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("=")||Gr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Gr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};gs.exports=Wr;var fs=Kt(),{safeRe:ds,t:ps}=Ot(),Gr=Mr(),kr=Lt(),hs=me(),ms=Pe()});var qt=z((Hd,ys)=>{"use strict";var Cl=Pe(),xl=(r,e,t)=>{try{e=new Cl(e,t)}catch{return!1}return e.test(r)};ys.exports=xl});var Es=z((Vd,bs)=>{"use strict";var Rl=Pe(),vl=(r,e)=>new Rl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));bs.exports=vl});var Os=z((Bd,ws)=>{"use strict";var jl=me(),$l=Pe(),Il=(r,e,t)=>{let n=null,i=null,s=null;try{s=new $l(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new jl(n,t))}),n};ws.exports=Il});var _s=z((Yd,As)=>{"use strict";var Pl=me(),Ll=Pe(),Nl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Ll(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Pl(n,t))}),n};As.exports=Nl});var xs=z((Kd,Cs)=>{"use strict";var Hr=me(),Tl=Pe(),Ss=Nt(),Dl=(r,e)=>{r=new Tl(r,e);let t=new Hr("0.0.0");if(r.test(t)||(t=new Hr("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 Hr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ss(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Ss(t,s))&&(t=s)}return t&&r.test(t)?t:null};Cs.exports=Dl});var vs=z((Xd,Rs)=>{"use strict";var ql=Pe(),Ml=(r,e)=>{try{return new ql(r,e).range||"*"}catch{return null}};Rs.exports=Ml});var or=z((Jd,Ps)=>{"use strict";var Fl=me(),Is=Tt(),{ANY:zl}=Is,Ul=Pe(),Gl=qt(),js=Nt(),$s=tr(),kl=nr(),Wl=rr(),Hl=(r,e,t,n)=>{r=new Fl(r,n),e=new Ul(e,n);let i,s,o,c,u;switch(t){case">":i=js,s=kl,o=$s,c=">",u=">=";break;case"<":i=$s,s=Wl,o=js,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gl(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(g=>{g.semver===zl&&(g=new Is(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),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};Ps.exports=Hl});var Ns=z((Qd,Ls)=>{"use strict";var Vl=or(),Bl=(r,e,t)=>Vl(r,e,">",t);Ls.exports=Bl});var Ds=z((Zd,Ts)=>{"use strict";var Yl=or(),Kl=(r,e,t)=>Yl(r,e,"<",t);Ts.exports=Kl});var Fs=z((ep,Ms)=>{"use strict";var qs=Pe(),Xl=(r,e,t)=>(r=new qs(r,t),e=new qs(e,t),r.intersects(e,t));Ms.exports=Xl});var Us=z((tp,zs)=>{"use strict";var Jl=qt(),Ql=Ie();zs.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>Ql(h,l,t));for(let h of o)Jl(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 Bs=z((rp,Vs)=>{"use strict";var Gs=Pe(),Yr=Tt(),{ANY:Vr}=Yr,Br=qt(),Kr=Ie(),Zl=(r,e,t={})=>{if(r===e)return!0;r=new Gs(r,t),e=new Gs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=tu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},eu=[new Yr(">=0.0.0-0")],ks=[new Yr(">=0.0.0")],tu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Vr){if(e.length===1&&e[0].semver===Vr)return!0;t.includePrerelease?r=eu:r=ks}if(e.length===1&&e[0].semver===Vr){if(t.includePrerelease)return!0;e=ks}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Ws(i,g,t):g.operator==="<"||g.operator==="<="?s=Hs(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Kr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Br(g,String(i),t)||s&&!Br(g,String(s),t))return null;for(let w of e)if(!Br(g,String(w),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 g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Ws(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Hs(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Ws=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Hs=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Vs.exports=Zl});var ar=z((np,Xs)=>{"use strict";var Xr=Ot(),Ys=wt(),ru=me(),Ks=Lr(),nu=Qe(),iu=Ei(),su=Oi(),ou=Si(),au=Ri(),cu=ji(),lu=Ii(),uu=Li(),fu=Ti(),du=Ie(),pu=Fi(),hu=Ui(),mu=er(),gu=Hi(),yu=Bi(),bu=Nt(),Eu=tr(),wu=Dr(),Ou=qr(),Au=rr(),_u=nr(),Su=Mr(),Cu=rs(),xu=is(),Ru=Tt(),vu=Pe(),ju=qt(),$u=Es(),Iu=Os(),Pu=_s(),Lu=xs(),Nu=vs(),Tu=or(),Du=Ns(),qu=Ds(),Mu=Fs(),Fu=Us(),zu=Bs();Xs.exports={parse:nu,valid:iu,clean:su,inc:ou,diff:au,major:cu,minor:lu,patch:uu,prerelease:fu,compare:du,rcompare:pu,compareLoose:hu,compareBuild:mu,sort:gu,rsort:yu,gt:bu,lt:Eu,eq:wu,neq:Ou,gte:Au,lte:_u,cmp:Su,coerce:Cu,truncate:xu,Comparator:Ru,Range:vu,satisfies:ju,toComparators:$u,maxSatisfying:Iu,minSatisfying:Pu,minVersion:Lu,validRange:Nu,outside:Tu,gtr:Du,ltr:qu,intersects:Mu,simplifyRange:Fu,subset:zu,SemVer:ru,re:Xr.re,src:Xr.src,tokens:Xr.t,SEMVER_SPEC_VERSION:Ys.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ys.RELEASE_TYPES,compareIdentifiers:Ks.compareIdentifiers,rcompareIdentifiers:Ks.rcompareIdentifiers}});var Js=Pt(ar(),1);import*as Jr from"node:process";try{let r=Xn?.node;typeof r=="string"&&!Js.satisfies(Jr.version,r)&&X.warn(`
8
+ import{a as Pa,b as ri,c as ni}from"./chunks/GHSNC2OX.js";import{a as Jn,f as te}from"./chunks/U5DIFWGH.js";import{c as Qn}from"./chunks/4PTNG4EI.js";import{a as ei}from"./chunks/S27TE7KZ.js";import{a as ii}from"./chunks/RDMFHSDB.js";import{a as Zn}from"./chunks/MJYI42E6.js";import{a as La}from"./chunks/LRUXN6H5.js";import{a as ti,c as Yt,d as $r,e as si,g as oi}from"./chunks/TZMWTSOQ.js";import{a as Fe,b as Kn,c as Xn}from"./chunks/QGUZ4KFX.js";import{Ba as Yn,O as Gn,R as kn,a as zn,aa as Ht,c as we,ea as jr,ia as X,ja as Vt,ka as Wn,l as vr,oa as Oe,pa as Bt,sa as Hn,u as Un,va as Vn,wa as Bn}from"./chunks/AP2GA7RS.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as z,e as Pt}from"./chunks/RFWIIJFG.js";var wt=z((pd,ai)=>{"use strict";var Na="2.0.0",Ta=Number.MAX_SAFE_INTEGER||9007199254740991,Da=16,qa=250,Ma=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ai.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Da,MAX_SAFE_BUILD_LENGTH:qa,MAX_SAFE_INTEGER:Ta,RELEASE_TYPES:Ma,SEMVER_SPEC_VERSION:Na,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Lt=z((hd,ci)=>{"use strict";var Fa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};ci.exports=Fa});var Ot=z((Ge,li)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ir,MAX_SAFE_BUILD_LENGTH:za,MAX_LENGTH:Ua}=wt(),Ga=Lt();Ge=li.exports={};var ka=Ge.re=[],Wa=Ge.safeRe=[],C=Ge.src=[],Ha=Ge.safeSrc=[],x=Ge.t={},Va=0,Pr="[a-zA-Z0-9-]",Ba=[["\\s",1],["\\d",Ua],[Pr,za]],Ya=r=>{for(let[e,t]of Ba)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Ya(e),i=Va++;Ga(r,i,e),x[r]=i,C[i]=e,Ha[i]=n,ka[i]=new RegExp(e,t?"g":void 0),Wa[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Pr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Pr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ir}})(?:\\.(\\d{1,${Ir}}))?(?:\\.(\\d{1,${Ir}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Kt=z((md,ui)=>{"use strict";var Ka=Object.freeze({loose:!0}),Xa=Object.freeze({}),Ja=r=>r?typeof r!="object"?Ka:r:Xa;ui.exports=Ja});var Lr=z((gd,pi)=>{"use strict";var fi=/^[0-9]+$/,di=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=fi.test(r),n=fi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},Qa=(r,e)=>di(e,r);pi.exports={compareIdentifiers:di,rcompareIdentifiers:Qa}});var me=z((yd,mi)=>{"use strict";var Xt=Lt(),{MAX_LENGTH:hi,MAX_SAFE_INTEGER:Jt}=wt(),{safeRe:Qt,t:Zt}=Ot(),Za=Kt(),{compareIdentifiers:Nr}=Lr(),ec=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(Nr(r[n],t[n])!==0)return!1;return!0},Tr=class r{constructor(e,t){if(t=Za(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>hi)throw new TypeError(`version is longer than ${hi} characters`);Xt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Qt[Zt.LOOSE]:Qt[Zt.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>Jt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jt||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<Jt)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(Xt("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(Xt("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 Nr(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(Xt("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 Nr(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?Qt[Zt.PRERELEASELOOSE]:Qt[Zt.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]),ec(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}};mi.exports=Tr});var Qe=z((bd,yi)=>{"use strict";var gi=me(),tc=(r,e,t=!1)=>{if(r instanceof gi)return r;try{return new gi(r,e)}catch(n){if(!t)return null;throw n}};yi.exports=tc});var Ei=z((Ed,bi)=>{"use strict";var rc=Qe(),nc=(r,e)=>{let t=rc(r,e);return t?t.version:null};bi.exports=nc});var Oi=z((wd,wi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};wi.exports=sc});var Si=z((Od,_i)=>{"use strict";var Ai=me(),oc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ai(r instanceof Ai?r.version:r,t).inc(e,n,i).version}catch{return null}};_i.exports=oc});var Ri=z((Ad,xi)=>{"use strict";var Ci=Qe(),ac=(r,e)=>{let t=Ci(r,null,!0),n=Ci(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"};xi.exports=ac});var ji=z((_d,vi)=>{"use strict";var cc=me(),lc=(r,e)=>new cc(r,e).major;vi.exports=lc});var Ii=z((Sd,$i)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).minor;$i.exports=fc});var Li=z((Cd,Pi)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).patch;Pi.exports=pc});var Ti=z((xd,Ni)=>{"use strict";var hc=Qe(),mc=(r,e)=>{let t=hc(r,e);return t&&t.prerelease.length?t.prerelease:null};Ni.exports=mc});var Ie=z((Rd,qi)=>{"use strict";var Di=me(),gc=(r,e,t)=>new Di(r,t).compare(new Di(e,t));qi.exports=gc});var Fi=z((vd,Mi)=>{"use strict";var yc=Ie(),bc=(r,e,t)=>yc(e,r,t);Mi.exports=bc});var Ui=z((jd,zi)=>{"use strict";var Ec=Ie(),wc=(r,e)=>Ec(r,e,!0);zi.exports=wc});var er=z(($d,ki)=>{"use strict";var Gi=me(),Oc=(r,e,t)=>{let n=new Gi(r,t),i=new Gi(e,t);return n.compare(i)||n.compareBuild(i)};ki.exports=Oc});var Hi=z((Id,Wi)=>{"use strict";var Ac=er(),_c=(r,e)=>r.sort((t,n)=>Ac(t,n,e));Wi.exports=_c});var Bi=z((Pd,Vi)=>{"use strict";var Sc=er(),Cc=(r,e)=>r.sort((t,n)=>Sc(n,t,e));Vi.exports=Cc});var Nt=z((Ld,Yi)=>{"use strict";var xc=Ie(),Rc=(r,e,t)=>xc(r,e,t)>0;Yi.exports=Rc});var tr=z((Nd,Ki)=>{"use strict";var vc=Ie(),jc=(r,e,t)=>vc(r,e,t)<0;Ki.exports=jc});var Dr=z((Td,Xi)=>{"use strict";var $c=Ie(),Ic=(r,e,t)=>$c(r,e,t)===0;Xi.exports=Ic});var qr=z((Dd,Ji)=>{"use strict";var Pc=Ie(),Lc=(r,e,t)=>Pc(r,e,t)!==0;Ji.exports=Lc});var rr=z((qd,Qi)=>{"use strict";var Nc=Ie(),Tc=(r,e,t)=>Nc(r,e,t)>=0;Qi.exports=Tc});var nr=z((Md,Zi)=>{"use strict";var Dc=Ie(),qc=(r,e,t)=>Dc(r,e,t)<=0;Zi.exports=qc});var Mr=z((Fd,es)=>{"use strict";var Mc=Dr(),Fc=qr(),zc=Nt(),Uc=rr(),Gc=tr(),kc=nr(),Wc=(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 Mc(r,t,n);case"!=":return Fc(r,t,n);case">":return zc(r,t,n);case">=":return Uc(r,t,n);case"<":return Gc(r,t,n);case"<=":return kc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};es.exports=Wc});var rs=z((zd,ts)=>{"use strict";var Hc=me(),Vc=Qe(),{safeRe:ir,t:sr}=Ot(),Bc=(r,e)=>{if(r instanceof Hc)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?ir[sr.COERCEFULL]:ir[sr.COERCE]);else{let u=e.includePrerelease?ir[sr.COERCERTLFULL]:ir[sr.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 Vc(`${n}.${i}.${s}${o}${c}`,e)};ts.exports=Bc});var is=z((Ud,ns)=>{"use strict";var Yc=Qe(),Kc=wt(),Xc=me(),Jc=(r,e,t)=>{if(!Kc.RELEASE_TYPES.includes(e))return null;let n=Qc(r,t);return n&&Zc(n,e)},Qc=(r,e)=>{let t=r instanceof Xc?r.version:r;return Yc(t,e)},Zc=(r,e)=>{if(el(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()},el=r=>r.startsWith("pre");ns.exports=Jc});var os=z((Gd,ss)=>{"use strict";var Fr=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}};ss.exports=Fr});var Pe=z((kd,us)=>{"use strict";var tl=/\s+/g,zr=class r{constructor(e,t){if(t=nl(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(tl," "),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=>!cs(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&&dl(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(fl,"");let n=((this.options.includePrerelease&&ll)|(this.options.loose&&ul))+":"+e,i=as.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,_l(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],ol),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],al),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],cl),re("caret trim",e);let c=e.split(" ").map(l=>pl(l,this.options)).join(" ").split(/\s+/).map(l=>Al(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Ur(l,this.options));for(let l of p){if(cs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return as.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ls(n,t)&&e.set.some(i=>ls(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 il(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Sl(this.set[t],e,this.options))return!0;return!1}};us.exports=zr;var rl=os(),as=new rl,nl=Kt(),Ur=Tt(),re=Lt(),il=me(),{safeRe:Ae,src:sl,t:ge,comparatorTrimReplace:ol,tildeTrimReplace:al,caretTrimReplace:cl}=Ot(),{FLAG_INCLUDE_PRERELEASE:ll,FLAG_LOOSE:ul}=wt(),fl=new RegExp(sl[ge.BUILD],"g"),cs=r=>r.value==="<0.0.0-0",dl=r=>r.value==="",ls=(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},pl=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=yl(r,e),re("caret",r),r=ml(r,e),re("tildes",r),r=El(r,e),re("xrange",r),r=Ol(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",hl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),ml=(r,e)=>r.trim().split(/\s+/).map(t=>gl(t,e)).join(" "),gl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.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})},yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.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})},El=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>wl(t,e)).join(" ")),wl=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),hl(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})},Ol=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Al=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),_l=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()),Sl=(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 Tt=z((Wd,gs)=>{"use strict";var Dt=Symbol("SemVer ANY"),Wr=class r{static get ANY(){return Dt}constructor(e,t){if(t=fs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),kr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Dt?this.value="":this.value=this.operator+this.semver.version,kr("comp",this)}parse(e){let t=this.options.loose?ds[ps.COMPARATORLOOSE]:ds[ps.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 hs(n[2],this.options.loose):this.semver=Dt}toString(){return this.value}test(e){if(kr("Comparator.test",e,this.options.loose),this.semver===Dt||e===Dt)return!0;if(typeof e=="string")try{e=new hs(e,this.options)}catch{return!1}return Gr(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 ms(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ms(this.value,t).test(e.semver):(t=fs(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("=")||Gr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Gr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};gs.exports=Wr;var fs=Kt(),{safeRe:ds,t:ps}=Ot(),Gr=Mr(),kr=Lt(),hs=me(),ms=Pe()});var qt=z((Hd,ys)=>{"use strict";var Cl=Pe(),xl=(r,e,t)=>{try{e=new Cl(e,t)}catch{return!1}return e.test(r)};ys.exports=xl});var Es=z((Vd,bs)=>{"use strict";var Rl=Pe(),vl=(r,e)=>new Rl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));bs.exports=vl});var Os=z((Bd,ws)=>{"use strict";var jl=me(),$l=Pe(),Il=(r,e,t)=>{let n=null,i=null,s=null;try{s=new $l(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new jl(n,t))}),n};ws.exports=Il});var _s=z((Yd,As)=>{"use strict";var Pl=me(),Ll=Pe(),Nl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Ll(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Pl(n,t))}),n};As.exports=Nl});var xs=z((Kd,Cs)=>{"use strict";var Hr=me(),Tl=Pe(),Ss=Nt(),Dl=(r,e)=>{r=new Tl(r,e);let t=new Hr("0.0.0");if(r.test(t)||(t=new Hr("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 Hr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ss(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Ss(t,s))&&(t=s)}return t&&r.test(t)?t:null};Cs.exports=Dl});var vs=z((Xd,Rs)=>{"use strict";var ql=Pe(),Ml=(r,e)=>{try{return new ql(r,e).range||"*"}catch{return null}};Rs.exports=Ml});var or=z((Jd,Ps)=>{"use strict";var Fl=me(),Is=Tt(),{ANY:zl}=Is,Ul=Pe(),Gl=qt(),js=Nt(),$s=tr(),kl=nr(),Wl=rr(),Hl=(r,e,t,n)=>{r=new Fl(r,n),e=new Ul(e,n);let i,s,o,c,u;switch(t){case">":i=js,s=kl,o=$s,c=">",u=">=";break;case"<":i=$s,s=Wl,o=js,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gl(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(g=>{g.semver===zl&&(g=new Is(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),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};Ps.exports=Hl});var Ns=z((Qd,Ls)=>{"use strict";var Vl=or(),Bl=(r,e,t)=>Vl(r,e,">",t);Ls.exports=Bl});var Ds=z((Zd,Ts)=>{"use strict";var Yl=or(),Kl=(r,e,t)=>Yl(r,e,"<",t);Ts.exports=Kl});var Fs=z((ep,Ms)=>{"use strict";var qs=Pe(),Xl=(r,e,t)=>(r=new qs(r,t),e=new qs(e,t),r.intersects(e,t));Ms.exports=Xl});var Us=z((tp,zs)=>{"use strict";var Jl=qt(),Ql=Ie();zs.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>Ql(h,l,t));for(let h of o)Jl(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 Bs=z((rp,Vs)=>{"use strict";var Gs=Pe(),Yr=Tt(),{ANY:Vr}=Yr,Br=qt(),Kr=Ie(),Zl=(r,e,t={})=>{if(r===e)return!0;r=new Gs(r,t),e=new Gs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=tu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},eu=[new Yr(">=0.0.0-0")],ks=[new Yr(">=0.0.0")],tu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Vr){if(e.length===1&&e[0].semver===Vr)return!0;t.includePrerelease?r=eu:r=ks}if(e.length===1&&e[0].semver===Vr){if(t.includePrerelease)return!0;e=ks}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Ws(i,g,t):g.operator==="<"||g.operator==="<="?s=Hs(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Kr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Br(g,String(i),t)||s&&!Br(g,String(s),t))return null;for(let w of e)if(!Br(g,String(w),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 g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Ws(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Hs(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Ws=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Hs=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Vs.exports=Zl});var ar=z((np,Xs)=>{"use strict";var Xr=Ot(),Ys=wt(),ru=me(),Ks=Lr(),nu=Qe(),iu=Ei(),su=Oi(),ou=Si(),au=Ri(),cu=ji(),lu=Ii(),uu=Li(),fu=Ti(),du=Ie(),pu=Fi(),hu=Ui(),mu=er(),gu=Hi(),yu=Bi(),bu=Nt(),Eu=tr(),wu=Dr(),Ou=qr(),Au=rr(),_u=nr(),Su=Mr(),Cu=rs(),xu=is(),Ru=Tt(),vu=Pe(),ju=qt(),$u=Es(),Iu=Os(),Pu=_s(),Lu=xs(),Nu=vs(),Tu=or(),Du=Ns(),qu=Ds(),Mu=Fs(),Fu=Us(),zu=Bs();Xs.exports={parse:nu,valid:iu,clean:su,inc:ou,diff:au,major:cu,minor:lu,patch:uu,prerelease:fu,compare:du,rcompare:pu,compareLoose:hu,compareBuild:mu,sort:gu,rsort:yu,gt:bu,lt:Eu,eq:wu,neq:Ou,gte:Au,lte:_u,cmp:Su,coerce:Cu,truncate:xu,Comparator:Ru,Range:vu,satisfies:ju,toComparators:$u,maxSatisfying:Iu,minSatisfying:Pu,minVersion:Lu,validRange:Nu,outside:Tu,gtr:Du,ltr:qu,intersects:Mu,simplifyRange:Fu,subset:zu,SemVer:ru,re:Xr.re,src:Xr.src,tokens:Xr.t,SEMVER_SPEC_VERSION:Ys.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ys.RELEASE_TYPES,compareIdentifiers:Ks.compareIdentifiers,rcompareIdentifiers:Ks.rcompareIdentifiers}});var Js=Pt(ar(),1);import*as Jr from"node:process";try{let r=Xn?.node;typeof r=="string"&&!Js.satisfies(Jr.version,r)&&X.warn(`
9
9
  \u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Jr.version}"
10
10
 
11
11
  `)}catch{}var $a=Pt(Pa(),1);import*as Ia from"node:path";import{notStrictEqual as ff,strictEqual as df}from"assert";var Uu={right:Vu,center:Bu},Gu=0,cr=1,ku=2,lr=3,Qr=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(`
@@ -122,7 +122,7 @@ Eject that one and set the framework in your copy's default export:
122
122
  # then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
123
123
  `);return}if(!Rt.has(t))throw te.eject_generator_outcome="unknown-generator",new Oe(`
124
124
  \u274C Unknown generator "${t}". Ejectable generators: ${[...Rt].join(", ")}.
125
- `);let i=zf(),s=Uf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/US7OHDWQ.js"),c=qf(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Me(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Hf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Wf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
125
+ `);let i=zf(),s=Uf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/OKTLNLO3.js"),c=qf(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Me(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Hf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Wf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
126
126
  \u274C ${p} already exists. Use --update to merge the newer version in, or --force to overwrite.
127
127
  `);Rn(kt(u),{recursive:!0});let h=s===void 0?[be(H(i,"generators",`${t}.mjs`),"utf-8")]:s.map(A=>be(H(i,"generators",t,A),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((A,G)=>{ae(H(c,t,A),h[G],"utf-8")});let l=ea("client-generators",i),b=ea(`${t}-generator`,i);vn(c,$n(c));let g=`./${Me(e.configPath===void 0?process.cwd():Jo(kt(e.configPath)),Jo(u)).split("\\").join("/")}`,w=In({[Ce]:o}),d=h.some(A=>A.includes(`from "${Sn}"`)||A.includes(`from '${Sn}'`)),S=kf(e.configPath,t,g),N=s===void 0?p:Me(process.cwd(),H(c,t))+"/";X.info(`Ejected the "${t}" generator to ${N}.
128
128
  `+(w==="added"?`Added ${Ce} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
@@ -146,12 +146,13 @@ Reference: ${Ff}
146
146
  - ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await Yn({config:n,severity:r["lint-config"]||"warn"}),s=Vn(i);if(Bn(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),td(s,ya(r)),s.errors>0)throw new Bt("Config check failed.");return n}function td(r,e){r.errors>0?X.error(`\u274C Your config has ${r.errors} ${vr("error",r.errors)}.
147
147
  `):r.warnings>0?X.warn(`\u26A0\uFE0F Your config has ${r.warnings} ${vr("warning",r.warnings)}.
148
148
  `):e==="check-config"&&X.info(Ht(`\u2705 Your config is valid.
149
- `))}import{execSync as rd}from"node:child_process";import*as $t from"node:fs";import{existsSync as nd,writeFileSync as id,readFileSync as Oa}from"node:fs";import*as Aa from"node:os";import{tmpdir as _a}from"node:os";import{dirname as wa,join as xr}from"node:path";async function Ea(r=Yt){try{return await Sr(ti,{timeout:r}),!0}catch{return!1}}var Cr="***";async function Sa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Ea(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/MO5BUSRI.js"),Ye=new W(Fe),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=dd();V||(V=`ann_${oi()}`,fd(V));let We=Vt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...cd(G,process.argv.slice(2)),node_version:process.version,npm_version:ud(),version:Fe,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=si.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Aa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/WK3QKCKY.js");L.send(_)}catch{}}function Ca(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function xa(r,e){for(let t of r.workflows??[]){jt(t.successActions,e),jt(t.failureActions,e);for(let n of t.steps??[])Ra(n.successCriteria,e),jt(n.onSuccess,e),jt(n.onFailure,e)}jt(Object.values(r.components?.successActions??{}),e),jt(Object.values(r.components?.failureActions??{}),e)}function jt(r,e){for(let t of r??[])Ra(t.criteria,e)}function Ra(r,e){for(let t of r??[]){let n=sd(t);n&&e.add(n)}}function sd(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function va(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function od(r){return $t.existsSync(r)&&$t.statSync(r).isFile()}function ad(r){return $t.existsSync(r)&&$t.statSync(r).isDirectory()}function Dn(r){return r&&(Un(r)?r.split("://")[0]+"://url":od(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ad(r)?"folder":r)}function qn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function ja(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=Cr:we(i)?t[n]=ja(i,e):t[n]=i;return t}function Mn(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Mn(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&Mn(i,e,t);return t}function cd(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=Cr,n=qn(n,o,Cr);else if(typeof o=="string"){let c=Dn(o);i[s]=c,n=qn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Dn);for(let c of o){let u=Dn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=Mn(o,t);for(let u of c)n=qn(n,u,Cr);i[s]=ja(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var ld=process.platform==="win32"?xr(wa(process.execPath),"node_modules","npm","package.json"):xr(wa(process.execPath),"..","lib","node_modules","npm","package.json");function ud(){try{return JSON.parse(Oa(ld,"utf8")).version}catch{}try{return rd("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var fd=r=>{if(!(process.env.CI||!r))try{let t=xr(_a(),$r);id(t,r)}catch{}},dd=()=>{if(!process.env.CI)try{let e=xr(_a(),$r);return nd(e)?Oa(e).toString().trim():void 0}catch{return}};function Q(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&kn(G.absoluteRef)){o="graphql";return}try{o=Wn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Vt(o)==="arazzo1"&&(va(A,h),Ca(A,l),xa(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!zn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await ba(t,Fe,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Fe,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Bt||(A instanceof Oe?X.error(A.message+`
149
+ `))}import{execSync as rd}from"node:child_process";import*as $t from"node:fs";import{existsSync as nd,writeFileSync as id,readFileSync as Oa}from"node:fs";import*as Aa from"node:os";import{tmpdir as _a}from"node:os";import{dirname as wa,join as xr}from"node:path";async function Ea(r=Yt){try{return await Sr(ti,{timeout:r}),!0}catch{return!1}}var Cr="***";async function Sa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Ea(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/CAJM6OL3.js"),Ye=new W(Fe),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=dd();V||(V=`ann_${oi()}`,fd(V));let We=Vt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...cd(G,process.argv.slice(2)),node_version:process.version,npm_version:ud(),version:Fe,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=si.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Aa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/HSHAARAO.js");L.send(_)}catch{}}function Ca(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function xa(r,e){for(let t of r.workflows??[]){jt(t.successActions,e),jt(t.failureActions,e);for(let n of t.steps??[])Ra(n.successCriteria,e),jt(n.onSuccess,e),jt(n.onFailure,e)}jt(Object.values(r.components?.successActions??{}),e),jt(Object.values(r.components?.failureActions??{}),e)}function jt(r,e){for(let t of r??[])Ra(t.criteria,e)}function Ra(r,e){for(let t of r??[]){let n=sd(t);n&&e.add(n)}}function sd(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function va(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function od(r){return $t.existsSync(r)&&$t.statSync(r).isFile()}function ad(r){return $t.existsSync(r)&&$t.statSync(r).isDirectory()}function Dn(r){return r&&(Un(r)?r.split("://")[0]+"://url":od(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ad(r)?"folder":r)}function qn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function ja(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=Cr:we(i)?t[n]=ja(i,e):t[n]=i;return t}function Mn(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Mn(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&Mn(i,e,t);return t}function cd(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=Cr,n=qn(n,o,Cr);else if(typeof o=="string"){let c=Dn(o);i[s]=c,n=qn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Dn);for(let c of o){let u=Dn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=Mn(o,t);for(let u of c)n=qn(n,u,Cr);i[s]=ja(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var ld=process.platform==="win32"?xr(wa(process.execPath),"node_modules","npm","package.json"):xr(wa(process.execPath),"..","lib","node_modules","npm","package.json");function ud(){try{return JSON.parse(Oa(ld,"utf8")).version}catch{}try{return rd("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var fd=r=>{if(!(process.env.CI||!r))try{let t=xr(_a(),$r);id(t,r)}catch{}},dd=()=>{if(!process.env.CI)try{let e=xr(_a(),$r);return nd(e)?Oa(e).toString().trim():void 0}catch{return}};function Q(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&kn(G.absoluteRef)){o="graphql";return}try{o=Wn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Vt(o)==="arazzo1"&&(va(A,h),Ca(A,l),xa(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!zn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await ba(t,Fe,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Fe,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Bt||(A instanceof Oe?X.error(A.message+`
150
150
 
151
151
  `):(X.error(`An unexpected error occurred. This is likely a bug that should be reported.
152
152
  `),X.error(A instanceof Error?A.stack||A.message:String(A)),X.error(`
153
- `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let A=Math.round(performance.now()-n);await Sa({config:p,argv:t,exit_code:i,execution_time:A,spec_version:o,spec_keyword:c,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:Jn,eject_generator:te,bundle:ii})}process.once("beforeExit",()=>{process.exit(i)})}}}$a.config({path:Ia.resolve(process.cwd(),"./.env")});ma();Xo(nn(process.argv)).version("version","Show version number.",Fe).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/GYVNLXXF.js");Q(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/E2UY7KGT.js");Q(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/YSCPIS6C.js");Q(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:"_"},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/2ZE577MX.js");Q(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/OFVQSSQQ.js");Q(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/UQSXY6X3.js");Q(e)(r)}).command("push [files...]","Push documents to Reunite.",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:ga},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/RS64EP6M.js");Q(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/42YAZTOS.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");Q(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/MBJ2NZOC.js");Q(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:Zn},"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/RSJYGTUN.js");Q(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=>{Q()(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/RTZAVLXW.js");Q(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/6IOZ5LPA.js");Q(e)(r)}).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:Qn,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"))&&X.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
154
- `);let{previewProject:e}=await import("./chunks/7YRZIM5N.js");Q(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"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},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"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/P6JG7GU7.js");Q(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/YYL4GJWR.js");Q(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/J2APNZBG.js");Q(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:fa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("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/V2MDYOAB.js");Q(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:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/OIISHIPF.js");Q(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/LHKSVCO3.js");Q(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 (${[...Rt].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=>{Q(la)(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"},"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:st("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/AVVEOYYF.js");Q(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/7FNYMCIP.js");Q(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/NFJLKOC3.js");Q(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/QB6J3FNI.js");Q(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/CUJVZNF3.js");Q(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ha]).strict().argv;
153
+ `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let A=Math.round(performance.now()-n);await Sa({config:p,argv:t,exit_code:i,execution_time:A,spec_version:o,spec_keyword:c,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:Jn,eject_generator:te,bundle:ii})}process.once("beforeExit",()=>{process.exit(i)})}}}$a.config({path:Ia.resolve(process.cwd(),"./.env")});ma();Xo(nn(process.argv)).version(!1).option("version",{type:"boolean",description:"Show version number.",global:!1}).middleware(r=>{r.version&&r._.length===0&&(X.output(`${Fe}
154
+ `),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/3MPID4OC.js");Q(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/CEPC3LL4.js");Q(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/WFIIXHF3.js");Q(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/DAAOXDSB.js");Q(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/IAN3UOJT.js");Q(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/S5G22GL5.js");Q(e)(r)}).command("push [files...]","Push documents to Reunite.",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:ga},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/HZZP3BZQ.js");Q(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/GYKYFMW3.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");Q(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/DJWI7SF7.js");Q(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:Zn},"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/2F2YM4RD.js");Q(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=>{Q()(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/DTMC35L3.js");Q(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/GD6WKI2C.js");Q(e)(r)}).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:Qn,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"))&&X.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
155
+ `);let{previewProject:e}=await import("./chunks/7ED6ZTTH.js");Q(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"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},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"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/HQUG6XPO.js");Q(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/4XDEFJCF.js");Q(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/O4RAFGZA.js");Q(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:fa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("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/4HEJ6GQB.js");Q(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:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/SXOXAG7R.js");Q(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/UPHYYNN3.js");Q(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 (${[...Rt].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=>{Q(la)(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"},"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:st("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/YNPWONFN.js");Q(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/PGZIUA7J.js");Q(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/7C244K4X.js");Q(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/SDNESV5E.js");Q(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/HVO5F4MP.js");Q(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ha]).strict().argv;
155
156
  /*! Bundled license information:
156
157
 
157
158
  yargs-parser/build/lib/string-utils.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/cli",
3
- "version": "2.59.0",
3
+ "version": "2.60.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,11 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{a as F,b as ae,c as me,d as pe,e as K}from"./QEM3YVSB.js";import{a as ce,b as fe}from"./64G5RPLP.js";import{f as oe,g as x,h as ie,i as se,l as T,m as h,n as re}from"./NSLUCFIM.js";import{R as Z,Z as ee,_ as te,aa as u,b as U,c as I,d as O,ga as N,h as L,ia as ne,ma as b,o as d,r as S}from"./PHV3T4WH.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import*as Me from"node:fs";import{performance as We}from"perf_hooks";import*as ve from"node:fs";import*as G from"node:path";import*as le from"node:path";function A(e,t,n={}){pe(e,i=>{if(S(i)&&K(i.$ref))o(i,"$ref");else if(I(i.discriminator)&&I(i.discriminator.mapping)){let{mapping:s}=i.discriminator;for(let m of Object.keys(s)){let a=s[m];typeof a=="string"&&K(a)&&o(i.discriminator.mapping,m)}}});function o(i,s){let m=i[s].split("/"),a=m.pop(),p=m[2],r=n[p];if(!r||!r[a])return;let c=d(le.relative(t,r[a].filename));c.startsWith(".")||(c="./"+c),i[s]=c}}import*as Q from"node:path";import*as ye from"node:path";function E(e,t,n){return ye.join(e,t)+`.${n}`}var he=["schemas","messages","securitySchemes","parameters","correlationIds","messageTraits","operationTraits","serverBindings","channelBindings","operationBindings","messageBindings"];var Ae=["schemas","messages","securitySchemes","servers","serverVariables","parameters","replies","replyAddresses","correlationIds","messageTraits","operationTraits","tags","externalDocs","serverBindings","channelBindings","operationBindings","messageBindings"];function Y(e,t){return(t==="async2"?he:Ae).filter(o=>o in e)}function de({asyncapi:e,asyncapiDir:t,componentsFiles:n,ext:o,specVersion:i}){let s=e.components;if(!s)return;let m=Q.join(t,F),a=Y(s,i);for(let p of a){let r=Q.join(m,p);for(let c of Object.keys(s[p]||{})){let y=E(r,c,o),f=[];p==="schemas"&&(f=(s[p]?.[c]?.allOf||[]).map(({$ref:l})=>l).filter(L)),n[p]=n[p]||{},n[p][c]={inherits:f,filename:y}}}}import*as ue from"node:fs";import*as w from"node:path";import*as M from"node:path";function g(e,t,n){let o=M.resolve(e),i=M.resolve(t);if(i!==o&&!i.startsWith(o+M.sep))throw new b(`Refusing to write "${n}" outside the output directory.`)}import*as P from"node:fs";import*as ge from"node:path";function v(e,t,n){if(!P.existsSync(e)||!P.statSync(e).isDirectory())return;let o=P.readdirSync(e);for(let i of o){let s=ge.join(e,i);P.statSync(s).isDirectory()?v(s,t,n):t(s,e,n)}}function $(e,t,n){if(!Z(e))return;let o=T(e);A(o,t,n),h(o,e)}function Ce({channels:e,asyncapiDir:t,outDir:n,componentsFiles:o,pathSeparator:i,ext:s}){let m={};if(!e)return m;ue.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${w.join(n,x(a,i))}.${s}`,r=e[a];S(r)||(g(t,p,a),m[a]=p,A(r,w.dirname(p),o),h(r,p),e[a]={$ref:d(w.relative(t,p))},v(n,$,o))}return m}import*as De from"node:fs";import*as R from"node:path";import*as Oe from"node:fs";function j(e){return e!=="securitySchemes"}function V(e,t){j(t)&&Oe.mkdirSync(e,{recursive:!0})}import*as Se from"node:fs";function H(e,t){return Se.existsSync(e)&&!U(T(e),t)}import*as Ne from"node:path";function k(e,t,n){if(!(!I(e)&&!Array.isArray(e))){if(Array.isArray(e)){for(let o of e)k(o,t,n);return}for(let o of Object.keys(e)){let i=e[o];if(o==="$ref"&&typeof i=="string"&&i.startsWith("#/channels/")){let s=i.slice(11),m=s.indexOf("/"),a=m===-1?s:s.slice(0,m),p=m===-1?"":s.slice(m),r=n[a];if(r){let c=d(Ne.relative(t,r));e[o]=p?`${c}#${p}`:c}}else k(i,t,n)}}}function Fe(e,t){let n=e.components;n&&(O(n[t])&&delete n[t],O(n)&&delete e.components)}function xe({asyncapi:e,asyncapiDir:t,componentsFiles:n,channelsFiles:o,ext:i,specVersion:s}){let m=e.components;if(m){let r=function(c){let y=R.join(a,c);V(y,c);for(let f of Object.keys(m?.[c]||{})){let l=E(y,f,i);g(t,l,f);let C=m?.[c]?.[f];A(C,R.dirname(l),n),k(C,R.dirname(l),o),H(l,C)?N.warn(`warning: conflict for ${f} - file already exists with different content: ${u(l)} ... Skip.
8
- `):h(C,l),delete m?.[c]?.[f]}Fe(e,c)},a=R.join(t,F);De.mkdirSync(a,{recursive:!0}),Y(m,s).forEach(r)}}import*as Ee from"node:fs";import*as _ from"node:path";function Pe({operations:e,asyncapiDir:t,outDir:n,componentsFiles:o,channelsFiles:i,pathSeparator:s,ext:m}){if(e){Ee.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${_.join(n,x(a,s))}.${m}`,r=e[a];S(r)||(g(t,p,a),A(r,_.dirname(p),o),k(r,_.dirname(p),i),h(r,p),e[a]={$ref:d(_.relative(t,p))},v(n,$,o))}}}function _e({asyncapi:e,asyncapiDir:t,pathSeparator:n,ext:o,specVersion:i}){ve.mkdirSync(t,{recursive:!0});let s={};de({asyncapi:e,asyncapiDir:t,componentsFiles:s,ext:o,specVersion:i});let m=e.channels,a=m?Ce({channels:m,asyncapiDir:t,outDir:G.join(t,ae),componentsFiles:s,pathSeparator:n,ext:o}):{};xe({asyncapi:e,asyncapiDir:t,componentsFiles:s,channelsFiles:a,ext:o,specVersion:i}),i==="async3"&&e.operations&&Pe({operations:e.operations,asyncapiDir:t,outDir:G.join(t,me),componentsFiles:s,channelsFiles:a,pathSeparator:n,ext:o}),A(e,t,s),h(e,G.join(t,`asyncapi.${o}`))}import*as Be from"node:fs";import*as J from"node:path";import*as ke from"node:fs";import*as B from"node:path";import*as q from"node:path";function be(e){return q.basename(e,q.extname(e))}function Te(e){return e?fe.filter(t=>j(t)&&Object.keys(e).includes(t)):[]}function $e(e,t,n,o,i){let s=[];n==="schemas"&&(s=(e?.[n]?.[o]?.allOf||[]).map(({$ref:m})=>m).filter(L)),t[n]=t[n]||{},t[n][o]={inherits:s,filename:i}}import*as X from"node:path";function we(e,t,n,o){if(!e.discriminator)return;let i=`#/${F}/schemas/${t}`,s={};for(let[r,{inherits:c,filename:y}]of Object.entries(o))if(c.indexOf(i)>-1){let f=d(X.relative(X.dirname(n),y));s[r]=f.startsWith(".")?f:"./"+f}if(O(s))return;let m=e.properties[e.discriminator.propertyName],a=m&&m.enum,p=e.discriminator.mapping=e.discriminator.mapping||{};for(let r of Object.keys(s))a&&!a.includes(r)||(p[r]&&p[r]!==s[r]&&N.warn(`warning: explicit mapping overlaps with local mapping entry ${ee(r)} at ${u(n)}. Please check it.`),p[r]=s[r])}function je(e,t){e.components&&O(e.components[t])&&delete e.components[t],O(e.components)&&delete e.components}function Re(e,t,n,o){let{components:i}=e;if(i){let a=function(r){let c=B.join(s,r);for(let y of Object.keys(i?.[r]||{})){let f=E(c,y,o);g(t,f,y),$e(i,n,r,y,f)}},p=function(r){let c=B.join(s,r);V(c,r);for(let y of Object.keys(i?.[r]||{})){let f=E(c,y,o),l=i?.[r]?.[y];A(l,B.dirname(f),n),we(l,be(f),f,n.schemas||{}),H(f,l)?N.warn(`warning: conflict for ${y} - file already exists with different content: ${u(f)} ... Skip.
9
- `):h(l,f),j(r)&&delete e.components?.[r]?.[y]}je(e,r)},s=B.join(t,F);ke.mkdirSync(s,{recursive:!0});let m=Te(i);m.forEach(a),m.forEach(p)}}import*as W from"node:fs";import*as D from"node:path";function z(e,t,n,o,i,s="",m){if(e){W.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let p=`${D.join(n,x(a,i))}.${m}`,r=e[a];if(!S(r)){g(t,p,a);for(let c of ce){let y=r[c],f=y?.["x-code-samples"]||y?.["x-codeSamples"];if(!(!f||!Array.isArray(f)))for(let l of f){if(l.source&&l.source.$ref)continue;let C=D.join(t,"code_samples",ie(l.lang),s+x(a,i),c+se(l.lang));g(t,C,l.lang),W.mkdirSync(D.dirname(C),{recursive:!0}),W.writeFileSync(C,l.source),l.source={$ref:d(D.relative(n,C))}}}h(r,p),e[a]={$ref:d(D.relative(t,p))},v(n,$,o)}}}}function Ie(e,t,n,o){Be.mkdirSync(t,{recursive:!0});let i={};Re(e,t,i,o),z(e.paths,t,J.join(t,"paths"),i,n,void 0,o);let s=e.webhooks||e["x-webhooks"];z(s,t,J.join(t,"webhooks"),i,n,"webhook_",o),A(e,t,i),h(e,J.join(t,`openapi.${o}`))}async function Vn({argv:e,collectSpecData:t}){let n=We.now(),{api:o,outDir:i,separator:s}=e,m=re(o);if(!Me.existsSync(o))throw new b(`File ${u(o)} does not exist.`);let a=T(o);t?.({parsed:a});let p=ne(a);switch(p){case"async2":case"async3":_e({asyncapi:a,asyncapiDir:i,pathSeparator:s,ext:m,specVersion:p});break;case"oas3_0":case"oas3_1":case"oas3_2":Ie(a,i,s,m);break;case"oas2":throw new b("OpenAPI 2 is not supported by this command.");default:throw new b("File does not conform to the OpenAPI or AsyncAPI Specification. Version is not specified.")}N.info(`\u{1FA93} Document: ${u(o)} ${te("is successfully split")}
10
- and all related files are saved to the directory: ${u(i)}
11
- `),oe("split",n,o)}export{Vn as handleSplit,z as iteratePathItems};
@@ -1,8 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{u as o}from"./NSLUCFIM.js";import{$ as t}from"./PHV3T4WH.js";var r=" ",a=" ";function g(i){let p=Math.max(...i.map(n=>o(n).length)),e=p+a.length*2,c=r+t("\u2551"+" ".repeat(e)+"\u2551");return["",r+t("\u2554"+"\u2550".repeat(e)+"\u2557"),c,...i.map(n=>{let h=" ".repeat(p-o(n).length);return`${r}${t("\u2551")}${a}${n}${h}${a}${t("\u2551")}`}),c,r+t("\u255A"+"\u2550".repeat(e)+"\u255D"),"",""].join(`
8
- `)}export{g as a};
@@ -1,7 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{c as r}from"./PHV3T4WH.js";var s="components";var p="channels",i="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function a(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,e as d,a as e};
@@ -1,9 +0,0 @@
1
- import { createRequire as __createRequire } from 'node:module';
2
- import { fileURLToPath as __fileURLToPath } from 'node:url';
3
- import { dirname as __pathDirname } from 'node:path';
4
- const require = __createRequire(import.meta.url);
5
- var __filename = __fileURLToPath(import.meta.url);
6
- var __dirname = __pathDirname(__filename);
7
- import{b as xe,f as Pe}from"./NSLUCFIM.js";import{$ as j,T as le,U as he,X as b,Z as fe,_ as de,ba as ye,c as L,ca as U,da as A,f as ie,ga as k,ha as Se,ia as ge,ja as Q,ka as K,ma as Ce,pa as be,q as ae,r as pe,s as ce,u as me,v as ue}from"./PHV3T4WH.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{performance as mt}from"perf_hooks";var D={thresholds:{maxParamsGood:5,maxDepthGood:4,maxPolymorphismGood:2,maxDependencyDepthGood:3,maxAmbiguousGood:0,maxOperationsForDiscoverability:1e3},weights:{parameterSimplicity:.1,schemaSimplicity:.1,documentationQuality:.18,constraintClarity:.12,exampleCoverage:.18,errorClarity:.12,dependencyClarity:.1,identifierClarity:.05,polymorphismClarity:.05,anyOfPenaltyMultiplier:2,discoverabilityWeight:.1},hotspotLimit:10},Oe=new Set(["id","name","type","value","data","key","status","state","code","result","item","object","resource","entity","input","output","payload","body","content","info"]);function B(e){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),t=Math.floor(r.length/2);return r.length%2!==0?r[t]:(r[t-1]+r[t])/2}function He(e,r,t=D){let{thresholds:o,weights:n}=t,s=x(1-e.parameterCount/(o.maxParamsGood*2)),a=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth)/(o.maxDepthGood*2),c=De(e,n.anyOfPenaltyMultiplier)/(o.maxPolymorphismGood*3),h=x(1-a-c),u=(e.operationDescriptionPresent?1:0)+e.paramsWithDescription+e.schemaPropertiesWithDescription,f=1+e.parameterCount+e.totalSchemaProperties,$=f>0?x(u/f):1,O=e.totalSchemaProperties>0?x(e.constraintCount/e.totalSchemaProperties):1,y=(e.requestExamplePresent?1:0)+(e.responseExamplePresent?1:0),g=(e.requestBodyPresent?1:0)+1,M=x(y/g),T=e.totalErrorResponses>0?x(e.structuredErrorResponseCount/e.totalErrorResponses):1,I=x(1-r/(o.maxDependencyDepthGood*2)),l=x(1-e.ambiguousIdentifierCount/Math.max(o.maxAmbiguousGood+3,1)),m=De(e,n.anyOfPenaltyMultiplier),d=m===0?1:e.hasDiscriminator?x(1-m/(o.maxPolymorphismGood*4)):x(1-m/(o.maxPolymorphismGood*2));return{parameterSimplicity:s,schemaSimplicity:h,documentationQuality:$,constraintClarity:O,exampleCoverage:M,errorClarity:T,dependencyClarity:I,identifierClarity:l,polymorphismClarity:d}}function ze(e,r=D){let t=r.weights,o=e.parameterSimplicity*t.parameterSimplicity+e.schemaSimplicity*t.schemaSimplicity+e.documentationQuality*t.documentationQuality+e.constraintClarity*t.constraintClarity+e.exampleCoverage*t.exampleCoverage+e.errorClarity*t.errorClarity+e.dependencyClarity*t.dependencyClarity+e.identifierClarity*t.identifierClarity+e.polymorphismClarity*t.polymorphismClarity;return $e(x(o)*100)}function Re(e,r,t=D){let o=new Map;for(let[n,s]of e.operations){let i=r.get(n)??0,a=He(s,i,t);o.set(n,{agentReadiness:ze(a,t),subscores:a})}return o}function Me(e,r=D){return x(1-e/r.thresholds.maxOperationsForDiscoverability)}function ve(e,r,t=D){if(e.size===0)return{agentReadiness:100};let o=[];for(let i of e.values())o.push(i.agentReadiness);let n=t.weights.discoverabilityWeight,s=r*100;return{agentReadiness:$e(B(o)*(1-n)+s*n)}}function J(e,r,t){return e-r+r*t}function De(e,r){return J(e.polymorphismCount,e.anyOfCount,r)}function x(e){return Math.max(0,Math.min(1,e))}function Ee(e){let r=e.size||1,t={parameterSimplicity:0,schemaSimplicity:0,documentationQuality:0,constraintClarity:0,exampleCoverage:0,errorClarity:0,dependencyClarity:0,identifierClarity:0,polymorphismClarity:0};for(let o of e.values())t.parameterSimplicity+=o.subscores.parameterSimplicity,t.schemaSimplicity+=o.subscores.schemaSimplicity,t.documentationQuality+=o.subscores.documentationQuality,t.constraintClarity+=o.subscores.constraintClarity,t.exampleCoverage+=o.subscores.exampleCoverage,t.errorClarity+=o.subscores.errorClarity,t.dependencyClarity+=o.subscores.dependencyClarity,t.identifierClarity+=o.subscores.identifierClarity,t.polymorphismClarity+=o.subscores.polymorphismClarity;return t.parameterSimplicity/=r,t.schemaSimplicity/=r,t.documentationQuality/=r,t.constraintClarity/=r,t.exampleCoverage/=r,t.errorClarity/=r,t.dependencyClarity/=r,t.identifierClarity/=r,t.polymorphismClarity/=r,t}function $e(e){return Math.round(e*10)/10}function we(e,r,t){let o=Math.max(1,e);return r/o+t/o}function Qe(e,r){return r.totalSchemaProperties>e.totalSchemaProperties?!0:r.totalSchemaProperties<e.totalSchemaProperties?!1:we(r.totalSchemaProperties,r.schemaPropertiesWithDescription,r.constraintCount)>we(e.totalSchemaProperties,e.schemaPropertiesWithDescription,e.constraintCount)}var Ke=["enum","const","format","pattern","minimum","maximum","minLength","maxLength","minItems","maxItems","minProperties","maxProperties","multipleOf","exclusiveMinimum","exclusiveMaximum","uniqueItems"];function Y(){return{depth:-1,maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[],debugEntries:null,pendingRef:null}}function Ie(e){Object.assign(e,Y())}function Le(e){return{ref:{enter(r){typeof r?.$ref=="string"&&(e.refsUsed.push(r.$ref),e.pendingRef=r.$ref)}},Schema:{enter(r,t){e.depth++,e.maxDepth=Math.max(e.maxDepth,e.depth);let o=0;for(let i of Ke)r[i]!==void 0&&(e.constraintCount++,o++);r.discriminator?.propertyName&&(e.hasDiscriminator=!0);let n={};for(let i of["oneOf","anyOf","allOf"]){let a=r[i];Array.isArray(a)&&(e.polymorphismCount+=a.length,i==="anyOf"&&(e.anyOfCount+=a.length),n[i]=a.length)}let s=[];if(L(r.properties)){let i=Object.entries(r.properties);e.totalSchemaProperties+=i.length;for(let[a,c]of i){s.push(a);let h=c&&"$ref"in c&&c.$ref?t.resolve(c)?.node??c:c;h?.description&&e.schemaPropertiesWithDescription++,(h?.example!==void 0||h?.examples)&&(e.hasPropertyExamples=!0),h?.readOnly||e.writableTopLevelFields++}}e.debugEntries!==null&&e.debugEntries.push({ref:e.pendingRef,depth:e.depth,propertyNames:s,polymorphism:Object.keys(n).length>0?n:{},constraintCount:o}),e.pendingRef=null},leave(){e.depth--}}}}function qe(e,r,t){return{operations:new Map,currentPath:"",pathLevelParams:[],current:null,walkSchema:e,anyOfPenaltyMultiplier:r,debugOperationId:t,debugLogs:[]}}function Je(e,r,t){return{path:e,method:r,operationId:t.operationId,operationDescriptionPresent:!!t.description,parameterCount:0,requiredParameterCount:0,paramsWithDescription:0,ambiguousIdentifierCount:0,maxRequestSchemaDepth:0,maxResponseSchemaDepth:0,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,topLevelWritableFieldCount:0,requestBodyPresent:!1,requestExamplePresent:!1,responseExamplePresent:!1,structuredErrorResponseCount:0,totalErrorResponses:0,inRequestBody:!1,inResponse:!1,currentResponseCode:"",errorStructuredCounted:!1,maxEffectivePolymorphism:-1,refsUsed:new Set}}function Ye(e){let{inRequestBody:r,inResponse:t,currentResponseCode:o,errorStructuredCounted:n,maxEffectivePolymorphism:s,...i}=e;return i}function We(e){return{RequestBody:{enter(){e.current&&(e.current.requestBodyPresent=!0,e.current.inRequestBody=!0)},leave(){e.current&&(e.current.inRequestBody=!1)}},Response:{enter(r,t){let o=e.current;if(!o)return;let n=String(t.key);o.inResponse=!0,o.currentResponseCode=n,o.errorStructuredCounted=!1,Te(n)&&(o.totalErrorResponses++,!r.content&&r.description&&(o.structuredErrorResponseCount++,o.errorStructuredCounted=!0))},leave(){e.current&&(e.current.inResponse=!1)}},MediaType:{enter(r){let t=e.current;if(t&&(Ze(r)&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inResponse&&Te(t.currentResponseCode)&&!t.errorStructuredCounted&&(t.structuredErrorResponseCount++,t.errorStructuredCounted=!0),r.schema)){let o=!!e.debugOperationId&&(t.operationId===e.debugOperationId||`${t.method.toUpperCase()} ${t.path}`===e.debugOperationId),n=e.walkSchema(r.schema,o);Qe(t,n)&&(t.totalSchemaProperties=n.totalSchemaProperties,t.schemaPropertiesWithDescription=n.schemaPropertiesWithDescription,t.constraintCount=n.constraintCount);let s=J(n.polymorphismCount,n.anyOfCount,e.anyOfPenaltyMultiplier);s>t.maxEffectivePolymorphism&&(t.maxEffectivePolymorphism=s,t.polymorphismCount=n.polymorphismCount,t.anyOfCount=n.anyOfCount),n.hasDiscriminator&&(t.hasDiscriminator=!0);for(let i of n.refsUsed)t.refsUsed.add(i);if(n.hasPropertyExamples&&(t.inRequestBody&&(t.requestExamplePresent=!0),t.inResponse&&(t.responseExamplePresent=!0)),t.inRequestBody&&(t.maxRequestSchemaDepth=Math.max(t.maxRequestSchemaDepth,n.maxDepth),t.topLevelWritableFieldCount=Math.max(t.topLevelWritableFieldCount,n.writableTopLevelFields)),t.inResponse&&(t.maxResponseSchemaDepth=Math.max(t.maxResponseSchemaDepth,n.maxDepth)),o&&n.debugEntries){let i=t.inRequestBody?"REQUEST BODY":`RESPONSE ${t.currentResponseCode}`;e.debugLogs.push({context:i,entries:n.debugEntries,totalProperties:n.totalSchemaProperties,totalPolymorphism:n.polymorphismCount,totalConstraints:n.constraintCount,maxDepth:n.maxDepth})}}}},Paths:{PathItem:{enter(r,t){e.currentPath=String(t.key),e.pathLevelParams=r.parameters??[]},Operation:{enter(r,t){let o=String(t.key),n=Je(e.currentPath,o,r);e.current=n;let s=Xe(e.pathLevelParams,r.parameters??[],t.resolve);for(let i of s.values())n.parameterCount++,i.required&&n.requiredParameterCount++,i.description&&n.paramsWithDescription++,et(i)&&n.ambiguousIdentifierCount++},leave(r){let t=e.current;if(!t)return;let o=r.operationId??`${t.method.toUpperCase()} ${t.path}`;e.operations.set(o,Ye(t)),e.current=null}}}}}}function Ue(e){return{operationCount:e.operations.size,operations:e.operations}}function Ae(e,r){return r(e).node}function Xe(e,r,t){let o=new Map;for(let n of e){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}for(let n of r){let s=Ae(n,t);s?.name&&s.in&&o.set(`${s.in}:${s.name}`,s)}return o}function Ze(e){return e.example!==void 0||ie(e.examples)}function et(e){if(e.description)return!1;let r=(e.name??"").toLowerCase();return Oe.has(r)}function Te(e){if(e==="default"||/^4xx$/i.test(e)||/^5xx$/i.test(e))return!0;let r=parseInt(e,10);return r>=400&&r<600}function tt(e,r){if(!r.startsWith("#/"))return;let t=e;for(let o of r.slice(2).split("/"))t=t?.[ce(o)];return t}function ke({document:e,types:r,resolvedRefMap:t,ctx:o,debugOperationId:n,scoringConstants:s}){let i=s?.weights.anyOfPenaltyMultiplier??D.weights.anyOfPenaltyMultiplier,a=Y(),c=Le(a),h=Q([{severity:"warn",ruleId:"score-schema",visitor:c}],r),u=(l,m)=>{Ie(a),m&&(a.debugEntries=[]),K({document:{...e,parsed:l},rootType:r.Schema,normalizedVisitors:h,resolvedRefMap:t,ctx:o});let{depth:d,pendingRef:w,debugEntries:_,...N}=a;return{...N,refsUsed:[...a.refsUsed],debugEntries:m?a.debugEntries??void 0:void 0}},f=new Map,$=new WeakSet,O={maxDepth:0,polymorphismCount:0,anyOfCount:0,hasDiscriminator:!1,totalSchemaProperties:0,schemaPropertiesWithDescription:0,constraintCount:0,hasPropertyExamples:!1,writableTopLevelFields:0,refsUsed:[]};function y(l,m){return{maxDepth:Math.max(l.maxDepth,m.maxDepth),polymorphismCount:l.polymorphismCount+m.polymorphismCount,anyOfCount:l.anyOfCount+m.anyOfCount,hasDiscriminator:l.hasDiscriminator||m.hasDiscriminator,totalSchemaProperties:l.totalSchemaProperties+m.totalSchemaProperties,schemaPropertiesWithDescription:l.schemaPropertiesWithDescription+m.schemaPropertiesWithDescription,constraintCount:l.constraintCount+m.constraintCount,hasPropertyExamples:l.hasPropertyExamples||m.hasPropertyExamples,writableTopLevelFields:l.writableTopLevelFields+m.writableTopLevelFields,refsUsed:[...l.refsUsed,...m.refsUsed],debugEntries:l.debugEntries||m.debugEntries?[...l.debugEntries??[],...m.debugEntries??[]]:void 0}}let g=(l,m=!1)=>{let d=l,w=pe(l)?l.$ref:void 0;if(w){if(!m){let S=f.get(w);if(S)return S}d=tt(e.parsed,w)??l}if(L(d)&&$.has(d))return{...O};L(d)&&$.add(d);let _=d?.oneOf,N=d?.anyOf,Z=Array.isArray(_)&&_.length>1,ee=Array.isArray(N)&&N.length>1,G=Z||ee,te=Array.isArray(d?.allOf)&&d.allOf.length>0,V=d?.discriminator,q=!G&&L(V?.mapping)?Object.values(V.mapping).filter(S=>typeof S=="string"&&me(S)).map(S=>({$ref:S})):null,re=Array.isArray(q)&&q.length>0,C;if(G||te||re){let S={...d},F=null,oe=P=>{F=F?y(F,P):P},ne=(P,v)=>{let E=g(v[0],m);for(let z=1;z<v.length;z++){let se=g(v[z],m);se.totalSchemaProperties>E.totalSchemaProperties&&(E=se)}return{...E,polymorphismCount:E.polymorphismCount+v.length,anyOfCount:E.anyOfCount+(P==="anyOf"?v.length:0),hasDiscriminator:E.hasDiscriminator||!!V}};G&&delete S.discriminator,Z&&(delete S.oneOf,oe(ne("oneOf",_))),ee&&(delete S.anyOf,oe(ne("anyOf",N)));let H=null;if(re){delete S.discriminator;let P=g(q[0],m);for(let v=1;v<q.length;v++){let E=g(q[v],m);E.totalSchemaProperties>P.totalSchemaProperties&&(P=E)}H={...P,polymorphismCount:P.polymorphismCount+q.length,hasDiscriminator:!0}}let W=null;if(te){delete S.allOf,W={...O};for(let P of d.allOf)W=y(W,g(P,m));W.polymorphismCount+=d.allOf.length}C=u(S,m),W&&(C=y(C,W)),F&&(C=y(C,F)),H&&(C=y(C,H)),w&&(C={...C,refsUsed:[w,...C.refsUsed]})}else C=u(l,m);return L(d)&&$.delete(d),w&&!m&&f.set(w,C),C},M=qe(g,i,n),T=We(M),I=Q([{severity:"warn",ruleId:"score",visitor:T}],r);return K({document:e,rootType:r.Root,normalizedVisitors:I,resolvedRefMap:t,ctx:o}),{metrics:Ue(M),debugLogs:M.debugLogs}}function Ne(e){let r=new Map;for(let[n,s]of e)for(let i of s.refsUsed){let a=r.get(i);a||(a=new Set,r.set(i,a)),a.add(n)}let t=new Map;for(let n of e.keys())t.set(n,new Set);for(let n of r.values()){if(n.size<2)continue;let s=Array.from(n);for(let i=0;i<s.length;i++)for(let a=i+1;a<s.length;a++)t.get(s[i]).add(s[a]),t.get(s[a]).add(s[i])}let o=new Map;for(let n of e.keys()){let s=rt(n,t);o.set(n,s)}return o}function rt(e,r){let t=new Set([e]),o=[e],n=0;for(;o.length>0;){let s=[];for(let i of o)for(let a of r.get(i)??[])t.has(a)||(t.add(a),s.push(a));s.length>0&&n++,o=s}return n}function Fe(e){let r={agentReadiness:e.agentReadiness,discoverability:Math.round(e.discoverability*100),subscores:e.subscores,rawMetrics:{operationCount:e.rawMetrics.operationCount,operations:Object.fromEntries(Array.from(e.rawMetrics.operations.entries()).map(([t,o])=>{let{refsUsed:n,...s}=o;return[t,s]}))},operationScores:Object.fromEntries(e.operationScores),dependencyDepths:Object.fromEntries(e.dependencyDepths),hotspots:e.hotspots};k.output(JSON.stringify(r,null,2))}function je(e,r=!1){ot(e),nt(e),it(e),r&&at(e),pt(e)}function _e(e){return e>=80?de:e>=50?j:fe}function Be(e){return _e(e)(b(e.toFixed(1)))}function p(e){k.output(e+`
8
- `)}function ot(e){p(""),p(b(A(" Scores"))),p(""),p(` Agent Readiness: ${Be(e.agentReadiness)}/100`),p("")}function nt(e){p(b(A(" Subscores"))),p("");let r=e.subscores;R("Parameter Simplicity",r.parameterSimplicity),R("Schema Simplicity",r.schemaSimplicity),R("Documentation Quality",r.documentationQuality),R("Constraint Clarity",r.constraintClarity),R("Example Coverage",r.exampleCoverage),R("Error Clarity",r.errorClarity),R("Dependency Clarity",r.dependencyClarity),R("Identifier Clarity",r.identifierClarity),R("Polymorphism Clarity",r.polymorphismClarity),R("Discoverability",e.discoverability),p("")}function R(e,r){let t=Math.round(r*100),o=st(r);p(` ${e.padEnd(24)} ${o} ${_e(t)(t+"%")}`)}function st(e){let t=Math.round(e*20);return U("["+"\u2588".repeat(t)+"\u2591".repeat(20-t)+"]")}function it(e){if(p(b(A(" Raw Metrics Summary"))),p(""),p(` Total operations: ${e.rawMetrics.operationCount}`),e.rawMetrics.operationCount===0){p("");return}let r=[],t=[],o=[],n=[],s=0,i=0,a=0;for(let u of e.rawMetrics.operations.values())r.push(u.parameterCount),t.push(Math.max(u.maxRequestSchemaDepth,u.maxResponseSchemaDepth)),o.push(u.polymorphismCount),n.push(u.totalSchemaProperties),u.requestExamplePresent&&s++,u.responseExamplePresent&&i++,u.operationDescriptionPresent&&a++;let c=e.rawMetrics.operationCount;function h(u,f){let O=(f.reduce((T,I)=>T+I,0)/c).toFixed(1),y=B(f).toFixed(1),g=Math.min(...f),M=Math.max(...f);p(` ${u.padEnd(26)} avg ${O.padStart(6)} median ${y.padStart(6)} min ${String(g).padStart(5)} max ${String(M).padStart(5)}`)}h("Parameters/operation:",r),h("Schema depth:",t),h("Polymorphism/operation:",o),h("Properties/operation:",n),p(` Operations with request examples: ${s}/${c} (${X(s,c)})`),p(` Operations with response examples: ${i}/${c} (${X(i,c)})`),p(` Operations with description: ${a}/${c} (${X(a,c)})`),p("")}function X(e,r){return r>0?`${Math.round(e/r*100)}%`:"N/A"}function at(e){p(b(A(" Per-Operation Metrics"))),p("");let r=" "+"Operation".padEnd(50)+"Props".padStart(7)+"Poly".padStart(7)+"Depth".padStart(7)+"Params".padStart(8)+"Constr".padStart(8);p(U(r)),p(U(" "+"\u2500".repeat(r.length-2)));let t=[...e.rawMetrics.operations.entries()].sort(([,o],[,n])=>n.totalSchemaProperties-o.totalSchemaProperties);for(let[,o]of t){let n=(o.operationId??`${o.method.toUpperCase()} ${o.path}`).slice(0,48),s=Math.max(o.maxRequestSchemaDepth,o.maxResponseSchemaDepth),i=" "+n.padEnd(50)+String(o.totalSchemaProperties).padStart(7)+String(o.polymorphismCount).padStart(7)+String(s).padStart(7)+String(o.parameterCount).padStart(8)+String(o.constraintCount).padStart(8);p(i)}p("")}function Ge(e,r){if(p(""),p(b(A(` Debug: ${e} schema breakdown`))),p(""),r.length===0){p(j(` No schemas found for operation "${e}".`)),p(j(' Make sure the value matches an operationId or "METHOD /path" exactly.')),p("");return}for(let t of r){p(b(U(` ${t.context}`))),p(U(" "+"\u2500".repeat(70)));let o=new Map;for(let s of t.entries){let i=s.ref??`(inline depth ${s.depth})`,a=o.get(i);if(a){a.count++,a.totalProps+=s.propertyNames.length;for(let c of s.propertyNames)a.propNames.includes(c)||a.propNames.push(c)}else o.set(i,{count:1,totalProps:s.propertyNames.length,propNames:[...s.propertyNames]})}for(let s of t.entries){let i=s.ref??"(inline)",a=" ".repeat(Math.min(s.depth,6)),c=s.propertyNames.length,h=` ${a}${i}`;c>0&&(h+=` (${c} properties)`);let u=[];if(s.polymorphism.oneOf&&u.push(`oneOf:${s.polymorphism.oneOf}`),s.polymorphism.anyOf&&u.push(`anyOf:${s.polymorphism.anyOf}`),s.polymorphism.allOf&&u.push(`allOf:${s.polymorphism.allOf}`),u.length>0&&(h+=` [${u.join(", ")}]`),s.constraintCount>0&&(h+=` {${s.constraintCount} constraints}`),p(h),c>0&&c<=20)p(` ${a} properties: ${s.propertyNames.join(", ")}`);else if(c>20){let f=s.propertyNames.slice(0,15).join(", ");p(` ${a} properties: ${f}, ... +${c-15} more`)}}p(""),p(` Totals: ${t.totalProperties} properties, ${t.totalPolymorphism} polymorphism items, ${t.totalConstraints} constraints, max depth ${t.maxDepth}`);let n=[...o.entries()].filter(([,s])=>s.totalProps>0).sort(([,s],[,i])=>i.totalProps-s.totalProps).slice(0,10);if(n.length>0){p(""),p(b(" Top schemas by property count:"));for(let[s,i]of n)p(` ${s}: ${i.totalProps} properties`)}p("")}}function pt(e){if(e.hotspots.length===0){p(b(A(" No hotspot operations found."))),p("");return}p(b(A(` Top ${e.hotspots.length} Hotspot Operations`))),p("");for(let r of e.hotspots){let t=r.operationId?`${r.method.toUpperCase()} ${r.path} (${r.operationId})`:`${r.method.toUpperCase()} ${r.path}`;p(b(` ${t}`)),p(` Agent Readiness: ${Be(r.agentReadinessScore)}`);for(let o of r.reasons)p(j(` - ${o}`));p("")}}function Ve(e,r,t,o=D){let n=[];for(let[s,i]of r){let a=e.operations.get(s);if(!a)continue;let c=ct(a,t.get(s)??0,o);c.length!==0&&n.push({path:a.path,method:a.method,operationId:a.operationId,agentReadinessScore:i.agentReadiness,reasons:c})}return n.sort((s,i)=>s.reasons.length!==i.reasons.length?i.reasons.length-s.reasons.length:s.agentReadinessScore-i.agentReadinessScore),n.slice(0,o.hotspotLimit)}function ct(e,r,t){let{thresholds:o}=t,n=[];e.parameterCount>o.maxParamsGood&&n.push(`High parameter count (${e.parameterCount})`);let s=Math.max(e.maxRequestSchemaDepth,e.maxResponseSchemaDepth);s>o.maxDepthGood&&n.push(`Deep schema nesting (depth ${s})`),e.anyOfCount>0&&!e.hasDiscriminator?n.push(`Polymorphism (anyOf) without discriminator (${e.anyOfCount} anyOf)`):e.polymorphismCount>o.maxPolymorphismGood&&n.push(`High polymorphism count (${e.polymorphismCount})`);let i=e.requestBodyPresent&&!e.requestExamplePresent,a=!e.responseExamplePresent;return i&&a?n.push("Missing request and response examples"):i?n.push("Missing request body examples"):a&&n.push("Missing response examples"),e.totalErrorResponses>0&&e.structuredErrorResponseCount===0&&n.push("No structured error responses (4xx/5xx)"),e.operationDescriptionPresent||n.push("Missing operation description"),e.parameterCount>0&&e.paramsWithDescription===0&&n.push("No parameter descriptions"),r>o.maxDependencyDepthGood&&n.push(`High dependency depth (${r})`),e.ambiguousIdentifierCount>o.maxAmbiguousGood&&n.push(`Ambiguous identifiers (${e.ambiguousIdentifierCount})`),n}async function Vt({argv:e,config:r,collectSpecData:t}){let[{path:o}]=await xe(e.api?[e.api]:[],r),n=new le(r.resolve),{bundle:s}=await be({config:r,ref:o});t?.(s);let i=ge(s.parsed);if(Se(i)!=="oas3")throw new Ce(`The score command currently supports only OpenAPI 3.x. Detected: ${i}`);let a=mt.now(),c=ae(r.extendTypes(ue(i),i),r),h=await he({rootDocument:s,rootType:c.Root,externalRefResolver:n}),u=e["debug-operation-id"],{metrics:f,debugLogs:$}=ke({document:s,types:c,resolvedRefMap:h,ctx:{problems:[],specVersion:i,config:r,visitorsData:{}},debugOperationId:u}),O=Ne(f.operations),y=Re(f,O),g=Me(f.operationCount),{agentReadiness:M}=ve(y,g),T=Ve(f,y,O),I={agentReadiness:M,discoverability:g,subscores:Ee(y),rawMetrics:f,hotspots:T,operationScores:y,dependencyDepths:O};ut(I,o,a,e.format,!!e["operation-details"],u?{operationId:u,logs:$}:void 0)}function ut(e,r,t,o,n,s){k.info(`Document: ${ye(r)} score:
9
- `),o==="json"?Fe(e):je(e,n),s&&Ge(s.operationId,s.logs),Pe("score",t,r)}export{Vt as handleScore};