@redocly/cli 2.65.1 → 2.66.1

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 (137) hide show
  1. package/README.md +5 -1
  2. package/THIRD_PARTY_NOTICES +1 -1
  3. package/lib/chunks/{3JAAMD2R.js → 36DQZK3T.js} +1 -1
  4. package/lib/chunks/{LLF5CY3L.js → 46YO7ZAG.js} +8 -8
  5. package/lib/chunks/{VAWGDT2W.js → 4ABWBH3W.js} +1 -1
  6. package/lib/chunks/{LVTNHX3K.js → 5EHUKG3I.js} +1 -1
  7. package/lib/chunks/{TNOMHRE3.js → 6JHVGOS4.js} +1 -1
  8. package/lib/chunks/{PFDVXHFS.js → 6KF4UNVM.js} +1 -1
  9. package/lib/chunks/{5UVEGDN5.js → 7NPQH3V7.js} +1 -1
  10. package/lib/chunks/{QLVSL5ZF.js → AONBK2JI.js} +1 -1
  11. package/lib/chunks/{SDI3BFVE.js → ARBQ5CUR.js} +1 -1
  12. package/lib/chunks/{OAZXHMUB.js → AZPQQ3GI.js} +1 -1
  13. package/lib/chunks/{K7YR4ZCE.js → B4Z2Z4FS.js} +1 -1
  14. package/lib/chunks/{GPHT4S2M.js → CK2FG2DD.js} +1 -1
  15. package/lib/chunks/{GY5LIRXF.js → CVCE3TMJ.js} +1 -1
  16. package/lib/chunks/{4JADC334.js → DRSH6QBU.js} +1 -1
  17. package/lib/chunks/ERBLCNSR.js +9 -0
  18. package/lib/chunks/{N7DGFIVS.js → F7K3O6UM.js} +1 -1
  19. package/lib/chunks/{Z4H5FLK2.js → FHDBQIEB.js} +1 -1
  20. package/lib/chunks/{PDRYPWBF.js → FOXOWXSK.js} +1 -1
  21. package/lib/chunks/{Y3UYQPDY.js → FP63LRP5.js} +1 -1
  22. package/lib/chunks/{7HX75VPL.js → FXCLUZIF.js} +1 -1
  23. package/lib/chunks/{YMEXZJK4.js → GG6HRP6Y.js} +1 -1
  24. package/lib/chunks/{W7XDH65E.js → GLUPJCQU.js} +1 -1
  25. package/lib/chunks/HHCU6T2V.js +7 -0
  26. package/lib/chunks/{ZHVZ22LO.js → HXPCC4OG.js} +1 -1
  27. package/lib/chunks/{AHV2L4AT.js → IAAYM25M.js} +1 -1
  28. package/lib/chunks/{6IEALFNR.js → IVWO724G.js} +1 -1
  29. package/lib/chunks/{RC2SP4YD.js → JFWECYV5.js} +1 -1
  30. package/lib/chunks/{GJJKLLSJ.js → JGSM4NRA.js} +1 -1
  31. package/lib/chunks/{TWAEUQN5.js → JZPKVDJA.js} +1 -1
  32. package/lib/chunks/{WJHTYCZL.js → JZV7OYQZ.js} +1 -1
  33. package/lib/chunks/{YUBO3M45.js → K4IZRPJV.js} +77 -77
  34. package/lib/chunks/{PDOJBUHH.js → KOEA2NZG.js} +2 -2
  35. package/lib/chunks/{76L5Y4E5.js → KTZA5BVG.js} +1 -1
  36. package/lib/chunks/{6O4EZZCB.js → L3SH4LDY.js} +1 -1
  37. package/lib/chunks/{QRGB7OHQ.js → LIDTATJI.js} +1 -1
  38. package/lib/chunks/{NCJ56PXB.js → LJTGHAPA.js} +1 -1
  39. package/lib/chunks/{PTPIZYEL.js → LR6VKQFM.js} +2 -2
  40. package/lib/chunks/{M6USEZHV.js → LSFJCPZH.js} +1 -1
  41. package/lib/chunks/{6OKAMFUS.js → M37DUXGN.js} +1 -1
  42. package/lib/chunks/{QET7LMPQ.js → M3VAMERP.js} +1 -1
  43. package/lib/chunks/{5LDTRSKM.js → MSJZTIMR.js} +3 -3
  44. package/lib/chunks/{EGRWOCUZ.js → NFCO7FU3.js} +1 -1
  45. package/lib/chunks/{XLPP6YHU.js → NHOPECWM.js} +1 -1
  46. package/lib/chunks/{F6CK2H55.js → NT6J6VMM.js} +1 -1
  47. package/lib/chunks/{YWLFGM2W.js → NUBOB7QM.js} +2 -2
  48. package/lib/chunks/{L7EAVWQA.js → OMDMN4SS.js} +1 -1
  49. package/lib/chunks/{GMPZCENU.js → ON2YZD5C.js} +1 -1
  50. package/lib/chunks/{LMOHVXBG.js → OYDBXGWA.js} +1 -1
  51. package/lib/chunks/{25STMLZM.js → PGX27JIK.js} +1 -1
  52. package/lib/chunks/{XVSKACRN.js → POIQ4MUQ.js} +1 -1
  53. package/lib/chunks/{Z3O5AH5W.js → PYSE2LAG.js} +1 -1
  54. package/lib/chunks/QMIJ4HMG.js +20 -0
  55. package/lib/chunks/{Q3SW35UY.js → R5MSEDNK.js} +1 -1
  56. package/lib/chunks/{FTJ2GLND.js → RALPAYEE.js} +1 -1
  57. package/lib/chunks/{BM3HLVGR.js → RO4A6LSK.js} +1 -1
  58. package/lib/chunks/{4ZSE2QKC.js → ROLEKKAB.js} +1 -1
  59. package/lib/chunks/{2AC4OXSZ.js → SDGM5YBT.js} +1 -1
  60. package/lib/chunks/{XGUY3CME.js → STYLK3WI.js} +1 -1
  61. package/lib/chunks/{XLDZKMWY.js → T23ZPTN4.js} +1 -1
  62. package/lib/chunks/{DLTGH5OY.js → TLDUEX6A.js} +1 -1
  63. package/lib/chunks/{VMZQPXC5.js → TOBKCE6P.js} +1 -1
  64. package/lib/chunks/{M3F2P6PS.js → TPBJSMIK.js} +1 -1
  65. package/lib/chunks/{7XEJIRRE.js → U7SJFXVW.js} +1 -1
  66. package/lib/chunks/{2IWPVA32.js → UJN4HIWM.js} +4 -4
  67. package/lib/chunks/{Q4UXM33T.js → ULKOLYWY.js} +1 -1
  68. package/lib/chunks/{AVRP5K2W.js → USAJ5FBD.js} +1 -1
  69. package/lib/chunks/{2Y42T65U.js → UYF7BOSD.js} +1 -1
  70. package/lib/chunks/{HTZ66OYY.js → VAPT4FUS.js} +1 -1
  71. package/lib/chunks/VOLUJUI5.js +7 -0
  72. package/lib/chunks/{YW65CIDB.js → WFZEGGBA.js} +1 -1
  73. package/lib/chunks/{KTG4J5LM.js → YCJL4ZHF.js} +1 -1
  74. package/lib/chunks/{5LKBZN75.js → YY44N7JX.js} +1 -1
  75. package/lib/chunks/{UFQAPCO4.js → ZSK75GT2.js} +1 -1
  76. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  77. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  78. package/lib/eject-assets/generators/cli/index.ts +2 -2
  79. package/lib/eject-assets/generators/cli/render.ts +1 -1
  80. package/lib/eject-assets/generators/go/client.ts +1 -1
  81. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  82. package/lib/eject-assets/generators/go/index.ts +2 -2
  83. package/lib/eject-assets/generators/go/models.ts +1 -1
  84. package/lib/eject-assets/generators/go/naming.ts +1 -1
  85. package/lib/eject-assets/generators/go/operations.ts +1 -1
  86. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  87. package/lib/eject-assets/generators/go/types.ts +1 -1
  88. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  89. package/lib/eject-assets/generators/mock/index.ts +2 -2
  90. package/lib/eject-assets/generators/mock/render.ts +1 -1
  91. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  92. package/lib/eject-assets/generators/mock/values.ts +1 -1
  93. package/lib/eject-assets/generators/php/client.ts +1 -1
  94. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  95. package/lib/eject-assets/generators/php/index.ts +2 -2
  96. package/lib/eject-assets/generators/php/models.ts +4 -4
  97. package/lib/eject-assets/generators/php/naming.ts +1 -1
  98. package/lib/eject-assets/generators/php/operations.ts +1 -1
  99. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  100. package/lib/eject-assets/generators/php/types.ts +1 -1
  101. package/lib/eject-assets/generators/python/client.ts +1 -1
  102. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  103. package/lib/eject-assets/generators/python/index.ts +2 -2
  104. package/lib/eject-assets/generators/python/models.ts +44 -19
  105. package/lib/eject-assets/generators/python/naming.ts +1 -1
  106. package/lib/eject-assets/generators/python/operations.ts +1 -1
  107. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  108. package/lib/eject-assets/generators/python/types.ts +1 -1
  109. package/lib/eject-assets/generators/swr/index.ts +2 -2
  110. package/lib/eject-assets/generators/swr/render.ts +1 -1
  111. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  112. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  113. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  114. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  115. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  116. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  117. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  118. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  119. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  120. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  121. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  122. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  123. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  124. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  125. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  126. package/lib/eject-assets/generators/zod/index.ts +2 -2
  127. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  128. package/lib/eject-assets/skills/php-generator/SKILL.md +3 -1
  129. package/lib/eject-assets/skills/python-generator/SKILL.md +2 -1
  130. package/lib/index.js +80 -70
  131. package/lib/skills/recheck-config/SKILL.md +116 -0
  132. package/lib/skills/recheck-lint/SKILL.md +73 -0
  133. package/lib/skills/redocly-cli/SKILL.md +214 -0
  134. package/lib/skills/redocly-lint-rules/SKILL.md +554 -0
  135. package/package.json +1 -1
  136. package/lib/chunks/GHSNC2OX.js +0 -9
  137. package/lib/chunks/SCSGALAM.js +0 -20
package/README.md CHANGED
@@ -60,9 +60,13 @@ Redocly CLI ships [agent skills](./.claude/skills) that teach AI coding assistan
60
60
  Install them into your project:
61
61
 
62
62
  ```sh
63
- npx skills add https://redocly.com
63
+ redocly skills
64
64
  ```
65
65
 
66
+ The command detects Claude Code, Codex, Cursor, GitHub Copilot, and other agents.
67
+ It installs only the skills for Redocly CLI.
68
+ To install every skill that Redocly publishes, use `npx skills add https://redocly.com`.
69
+
66
70
  - `redocly-cli` — day-to-day usage: lint, bundle, decorate, build docs, test, and generate a client.
67
71
  - `redocly-lint-rules` — turn a check written in plain language into a built-in rule, a configurable rule, or a custom plugin.
68
72
  It also covers migrating rules from other linters, such as Spectral.
@@ -664,7 +664,7 @@ Packages:
664
664
  @redocly/ajv@8.18.3 — Copyright (c) 2015-2021 Evgeny Poberezkin
665
665
  @redocly/cli-otel@0.3.7 — Copyright 2025 Redocly Inc, all rights reserved.
666
666
  @redocly/config@0.22.0 — Copyright 2024 Redocly Inc.
667
- @redocly/config@0.66.0 — Copyright 2024 Redocly Inc.
667
+ @redocly/config@0.67.0 — Copyright 2024 Redocly Inc.
668
668
  @redocly/openapi-core@1.34.20
669
669
  agent-base@7.1.4 — Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
670
670
  ajv-formats@3.0.1 — Copyright (c) 2020 Evgeny Poberezkin
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as A}from"./EGRWOCUZ.js";import{a as F,b as O,c as k,d as g}from"./VMZQPXC5.js";import{c as d,d as M}from"./25STMLZM.js";import{$ as C,Z as y,aa as R,ba as $,ea as S,ia as s,oa as l,pa as b}from"./YUBO3M45.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(e,o){let t=[["operations",e.totals.operations],["parameters",e.totals.parameters],["schema properties",e.totals.properties],["response codes",e.totals.responses]],r=Math.max(...t.map(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
7
+ import{a as A}from"./NFCO7FU3.js";import{a as F,b as O,c as k,d as g}from"./TOBKCE6P.js";import{c as d,d as M}from"./PGX27JIK.js";import{$ as C,Z as y,aa as R,ba as $,ea as S,ia as s,oa as l,pa as b}from"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(e,o){let t=[["operations",e.totals.operations],["parameters",e.totals.parameters],["schema properties",e.totals.properties],["response codes",e.totals.responses]],r=Math.max(...t.map(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
8
8
  `)}
9
9
  `}function T(e,o){let t={version:1,meta:{...o,exchanges:e.exchanges},totals:e.totals,operations:e.operations};return`${JSON.stringify(t,null,2)}
10
10
  `}async function P(e){let o=await M(e.trafficPath);if(o.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=O.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity,coverage:e.coverage}),r=0,n=0;for(let a of o){let i=await A(a,e.format);if(!i){s.warn(`Skipping traffic file with unrecognized format: ${a}
@@ -4,31 +4,31 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{$ as P,O as D,P as h,Q as O,U as C,aa as j,ba as S,ca as f,d as E,e as A,f as $,ga as b,ia as o,l,oa as a,u}from"./YUBO3M45.js";var y=["json","yaml","yml"];import*as i from"node:fs";import{basename as T,dirname as d,extname as g,join as N,resolve as m,relative as R}from"node:path";import*as p from"node:process";import{performance as F}from"perf_hooks";async function te(e,n){let r=!A(e)&&$(n.resolvedConfig.apis)?G(n):await W(e,n),c=r.filter(({path:s})=>!z(s));if(A(c)){for(let{path:s}of c)o.warn(`
8
- ${q(s)} ${P(`does not exist or is invalid.
7
+ import{$ as S,O as D,P as h,Q as O,U as C,aa as j,ba as P,ca as f,d as E,e as x,f as $,ga as b,ia as o,l,oa as a,u}from"./K4IZRPJV.js";var y=["json","yaml","yml"];import*as i from"node:fs";import{basename as k,dirname as d,extname as g,join as T,resolve as m,relative as R}from"node:path";import*as c from"node:process";import{performance as F}from"perf_hooks";async function te(e,n){let r=!x(e)&&$(n.resolvedConfig.apis)?G(n):await W(e,n),p=r.filter(({path:s})=>!z(s));if(x(p)){for(let{path:s}of p)o.warn(`
8
+ ${q(s)} ${S(`does not exist or is invalid.
9
9
 
10
- `)}`);throw new a("Please provide a valid path.")}if(r.length===0)throw new a("No APIs were provided. Specify an API via the command argument or define one in your config.");return r}function w(e){return e.configPath?d(e.configPath):p.cwd()}function z(e){if(!e.trim())throw new a("Path cannot be empty.");return i.existsSync(e)||u(e)?e:void 0}function G(e){return Object.entries(e.resolvedConfig.apis||{}).map(([n,{root:t,output:r}])=>({path:u(t)?t:m(w(e),t),alias:n,output:r&&m(w(e),r)}))}function k(e,n){let t=w(e),r=e.resolvedConfig.apis?.[n];return r?{path:u(r.root)?r.root:m(t,r.root),alias:n,output:r.output&&m(t,r.output)}:{path:n,alias:Object.entries(e.resolvedConfig.apis||{}).find(([c,s])=>m(t,s.root)===m(n))?.[0]??void 0}}async function W(e,n){let{hasMagic:t,glob:r}=await import("./SJHPKWSD.js");return(await Promise.all(e.map(async c=>t(c)&&!u(c)?(await r(c,{cwd:w(n)})).map(I=>k(n,I)):k(n,c)))).flat()}function L(e){return p.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(F.now()-e)}ms`}function oe(e,n,t){let r=L(n);o.info(b(`
10
+ `)}`);throw new a("Please provide a valid path.")}if(r.length===0)throw new a("No APIs were provided. Specify an API via the command argument or define one in your config.");return r}function w(e){return e.configPath?d(e.configPath):c.cwd()}function z(e){if(!e.trim())throw new a("Path cannot be empty.");return i.existsSync(e)||u(e)?e:void 0}function G(e){return Object.entries(e.resolvedConfig.apis||{}).map(([n,{root:t,output:r}])=>({path:u(t)?t:m(w(e),t),alias:n,output:r&&m(w(e),r)}))}function N(e,n){let t=w(e),r=e.resolvedConfig.apis?.[n];return r?{path:u(r.root)?r.root:m(t,r.root),alias:n,output:r.output&&m(t,r.output)}:{path:n,alias:Object.entries(e.resolvedConfig.apis||{}).find(([p,s])=>m(t,s.root)===m(n))?.[0]??void 0}}async function W(e,n){let{hasMagic:t,glob:r}=await import("./SJHPKWSD.js");return(await Promise.all(e.map(async p=>t(p)&&!u(p)?(await r(p,{cwd:w(n)})).map(I=>N(n,I)):N(n,p)))).flat()}function L(e){return c.env.NODE_ENV==="test"?"<test>ms":`${Math.ceil(F.now()-e)}ms`}function oe(e,n,t){let r=L(n);o.info(b(`
11
11
  ${t}: ${e} processed in ${r}
12
12
 
13
- `))}function se(e,n){return e==="/"?n:e.replaceAll("~1","/").replaceAll("~0","~").replace(/^\//,"").replaceAll("/",n)}function ie(e){return e.replace(/#/g,"_sharp").replace(/\//,"_").replace(/\s/g,"")}function ae(e){return{php:".php","c#":".cs",shell:".sh",curl:".sh",bash:".sh",javascript:".js",js:".js",python:".py",c:".c","c++":".cpp",coffeescript:".litcoffee",dart:".dart",elixir:".ex",go:".go",groovy:".groovy",java:".java",kotlin:".kt","objective-c":".m",perl:".pl",powershell:".ps1",ruby:".rb",rust:".rs",scala:".sc",swift:".swift",typescript:".ts",tsx:".tsx","visual basic":".vb","c/al":".al"}[e.toLowerCase()]??""}var x=class e extends Error{constructor(t){super(t.message);this.originalError=t;Object.setPrototypeOf(this,e.prototype)}originalError};function ce(e,n,t){if(n==="json")try{return JSON.stringify(e,null,2)}catch(r){throw r.message.indexOf("circular")>-1?new x(r):r}else return h(e,{noRefs:!t,lineWidth:-1})}function pe(e,n){i.mkdirSync(d(e),{recursive:!0}),i.writeFileSync(e,n)}function le(e){return D(i.readFileSync(e,"utf-8"),{filename:e})}function ue(e,n,t){if(_(n)==="json"){Y(e,n);return}V(e,n,t)}function V(e,n,t=!1){let r=h(e,{noRefs:t});if(p.env.NODE_ENV==="test"){o.info(r);return}i.mkdirSync(d(n),{recursive:!0}),i.writeFileSync(n,r)}function Y(e,n){let t=JSON.stringify(e,null,2);if(p.env.NODE_ENV==="test"){o.info(t);return}i.mkdirSync(d(n),{recursive:!0}),i.writeFileSync(n,t)}function _(e){let n=e.split(".").pop();return y.includes(n)?n:(o.warn(`Unsupported file extension: ${n}. Using yaml.
13
+ `))}function se(e,n){return e==="/"?n:e.replaceAll("~1","/").replaceAll("~0","~").replace(/^\//,"").replaceAll("/",n)}function ie(e){return e.replace(/#/g,"_sharp").replace(/\//,"_").replace(/\s/g,"")}function ae(e){return{php:".php","c#":".cs",shell:".sh",curl:".sh",bash:".sh",javascript:".js",js:".js",python:".py",c:".c","c++":".cpp",coffeescript:".litcoffee",dart:".dart",elixir:".ex",go:".go",groovy:".groovy",java:".java",kotlin:".kt","objective-c":".m",perl:".pl",powershell:".ps1",ruby:".rb",rust:".rs",scala:".sc",swift:".swift",typescript:".ts",tsx:".tsx","visual basic":".vb","c/al":".al"}[e.toLowerCase()]??""}var A=class e extends Error{constructor(t){super(t.message);this.originalError=t;Object.setPrototypeOf(this,e.prototype)}originalError};function pe(e,n,t){if(n==="json")try{return JSON.stringify(e,null,2)}catch(r){throw r.message.indexOf("circular")>-1?new A(r):r}else return h(e,{noRefs:!t,lineWidth:-1})}function ce(e,n){i.mkdirSync(d(e),{recursive:!0}),i.writeFileSync(e,n)}function le(e){return D(i.readFileSync(e,"utf-8"),{filename:e})}function ue(e,n,t){if(_(n)==="json"){Y(e,n);return}V(e,n,t)}function V(e,n,t=!1){let r=h(e,{noRefs:t});if(c.env.NODE_ENV==="test"){o.info(r);return}i.mkdirSync(d(n),{recursive:!0}),i.writeFileSync(n,r)}function Y(e,n){let t=JSON.stringify(e,null,2);if(c.env.NODE_ENV==="test"){o.info(t);return}i.mkdirSync(d(n),{recursive:!0}),i.writeFileSync(n,t)}function _(e){let n=e.split(".").pop();return y.includes(n)?n:(o.warn(`Unsupported file extension: ${n}. Using yaml.
14
14
  `),"yaml")}function fe(e,n){switch(e.constructor){case a:throw e;case C:throw new a(`Failed to resolve API description at ${n}:
15
15
 
16
16
  - ${e.message}`);case O:throw new a(`Failed to parse API description at ${n}:
17
17
 
18
- - ${e.message}`);case x:throw new a(`Detected circular reference which can't be converted to JSON.
18
+ - ${e.message}`);case A:throw new a(`Detected circular reference which can't be converted to JSON.
19
19
  Try to use ${f("yaml")} output or remove ${f("--dereferenced")}.`);case SyntaxError:throw new a(`Syntax error: ${e.message} ${e.stack?.split(`
20
20
 
21
21
  `)?.[0]}`);default:throw new a(`Something went wrong when processing ${n}:
22
22
 
23
- - ${e.message}`)}}function me(e,n){let t=e.ignored?S(`${e.ignored} ${l("problem is",e.ignored)} explicitly ignored.
23
+ - ${e.message}`)}}function me(e,n){let t=e.ignored?P(`${e.ignored} ${l("problem is",e.ignored)} explicitly ignored.
24
24
 
25
25
  `):"";e.errors>0?o.error(`\u274C Validation failed with ${e.errors} ${l("error",e.errors)}${e.warnings>0?` and ${e.warnings} ${l("warning",e.warnings)}`:""}.
26
26
  ${t}`):e.warnings>0?(o.info(j(`Woohoo! Your API ${l("description is",n)} valid. \u{1F389}
27
27
  `)),o.warn(`You have ${e.warnings} ${l("warning",e.warnings)}.
28
28
  ${t}`)):o.info(j(`Woohoo! Your API ${l("description is",n)} valid. \u{1F389}
29
29
  ${t}`)),e.errors>0&&o.info(b("run `redocly lint --generate-ignore-file` to add all problems to the ignore file.\n")),o.info(`
30
- `)}function ge({entrypoint:e,output:n,argvOutput:t,ext:r,entries:c}){let s=n||t;if(!s)return{ext:r||"yaml"};if(c>1&&t){if(r=r||g(e).substring(1),!y.includes(r))throw new Error(`Invalid file extension: ${r}.`);s=N(t,T(e,g(e)))+"."+r}else{if(r=r||g(s).substring(1)||g(e).substring(1),!y.includes(r))throw new Error(`Invalid file extension: ${r}.`);s=N(d(s),T(s,g(s)))+"."+r}return{outputFile:s,ext:r}}function de(e){let{preprocessors:n,rules:t,decorators:r}=e.getUnusedRules();t.length&&o.warn(`[WARNING] Unused rules found in ${f(e.configPath||"")}: ${t.join(", ")}.
30
+ `)}function ge({entrypoint:e,output:n,argvOutput:t,ext:r,entries:p}){let s=n||t;if(!s)return{ext:r||"yaml"};if(p>1&&t){if(r=r||g(e).substring(1),!y.includes(r))throw new Error(`Invalid file extension: ${r}.`);s=T(t,k(e,g(e)))+"."+r}else{if(r=r||g(s).substring(1)||g(e).substring(1),!y.includes(r))throw new Error(`Invalid file extension: ${r}.`);s=T(d(s),k(s,g(s)))+"."+r}return{outputFile:s,ext:r}}function de(e){let{preprocessors:n,rules:t,decorators:r}=e.getUnusedRules();t.length&&o.warn(`[WARNING] Unused rules found in ${f(e.configPath||"")}: ${t.join(", ")}.
31
31
  `),n.length&&o.warn(`[WARNING] Unused preprocessors found in ${f(e.configPath||"")}: ${n.join(", ")}.
32
32
  `),r.length&&o.warn(`[WARNING] Unused decorators found in ${f(e.configPath||"")}: ${r.join(", ")}.
33
33
  `),(t.length||n.length)&&o.warn(`Check the spelling and verify the added plugin prefix.
34
- `)}function B(e){return e.asyncapi?.startsWith("2")}var U=["swagger","info","host","basePath","schemes","consumes","produces","security","tags","externalDocs","paths","definitions","parameters","responses","securityDefinitions"],K=["openapi","info","jsonSchemaDialect","servers","security","tags","externalDocs","paths","webhooks","x-webhooks","components"],J=["asyncapi","id","info","externalDocs","tags","defaultContentType","servers","channels","components"],M=["asyncapi","info","defaultContentType","servers","channels","operations","components"];function ye(e){return"asyncapi"in e?B(e)?v(e,J):v(e,M):"swagger"in e?v(e,U):v(e,K)}function v(e,n){let t={};for(let r of n)e.hasOwnProperty(r)&&(t[r]=e[r]);return Object.assign(t,e)}function ve(e){let n={...e.oas2,...e.oas3_0,...e.oas3_1,...e.oas3_2,...e.async2,...e.async3,...e.arazzo1,...e.overlay1,...e.openrpc1,...e.graphql};if(E(n))throw new a("\u26A0\uFE0F No rules were configured. Learn how to configure rules: https://redocly.com/docs/cli/rules/")}function we(e){return e.replace(/\x1b\[\d+m/g,"")}function q(e){return u(e)?e:R(p.cwd(),e)}export{y as a,te as b,w as c,k as d,L as e,oe as f,se as g,ie as h,ae as i,ce as j,pe as k,le as l,ue as m,_ as n,fe as o,me as p,ge as q,de as r,ye as s,ve as t,we as u,q as v};
34
+ `)}function B(e){return e.asyncapi?.startsWith("2")}var U=["swagger","info","host","basePath","schemes","consumes","produces","security","tags","externalDocs","paths","definitions","parameters","responses","securityDefinitions"],K=["openapi","info","jsonSchemaDialect","servers","security","tags","externalDocs","paths","webhooks","x-webhooks","components"],J=["asyncapi","id","info","externalDocs","tags","defaultContentType","servers","channels","components"],M=["asyncapi","info","defaultContentType","servers","channels","operations","components"];function ye(e){return"asyncapi"in e?B(e)?v(e,J):v(e,M):"swagger"in e?v(e,U):v(e,K)}function v(e,n){let t={};for(let r of n)e.hasOwnProperty(r)&&(t[r]=e[r]);return Object.assign(t,e)}function ve(e){let n={...e.oas2,...e.oas3_0,...e.oas3_1,...e.oas3_2,...e.async2,...e.async3,...e.arazzo1,...e.overlay1,...e.openrpc1,...e.graphql};if(E(n))throw new a("\u26A0\uFE0F No rules were configured. Learn how to configure rules: https://redocly.com/docs/cli/rules/")}function we(e){return e.replace(/\x1b\[\d+m/g,"")}function q(e){return u(e)?e:R(c.cwd(),e)}export{y as a,te as b,w as c,N as d,L as e,oe as f,se as g,ie as h,ae as i,pe as j,ce as k,le as l,ue as m,_ as n,fe as o,me as p,ge as q,de as r,ye as s,ve as t,we as u,q as v};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as p}from"./HBUZKWXC.js";import{a as i,b as s}from"./4PTNG4EI.js";import{ia as t}from"./YUBO3M45.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as g}from"node:child_process";import{existsSync as l,readFileSync as P}from"node:fs";import w from"node:path";var S=async({argv:r})=>{let{plan:e,port:a}=r,n=r["project-dir"],o=r.product||h(n);if(!j(o))throw t.info(`Invalid product ${o}.`),new Error("Project preview launch failed.");let c=s[o],d=i[o];t.info(`
7
+ import{c as p}from"./HBUZKWXC.js";import{a as i,b as s}from"./4PTNG4EI.js";import{ia as t}from"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as g}from"node:child_process";import{existsSync as l,readFileSync as P}from"node:fs";import w from"node:path";var S=async({argv:r})=>{let{plan:e,port:a}=r,n=r["project-dir"],o=r.product||h(n);if(!j(o))throw t.info(`Invalid product ${o}.`),new Error("Project preview launch failed.");let c=s[o],d=i[o];t.info(`
8
8
  Launching preview of ${c} ${e} using NPX.
9
9
 
10
10
  `);let{npxExecutableName:m,shell:f}=p();g(m,["-y",d,"preview",`--plan=${e}`,`--port=${a||4e3}`],{stdio:"inherit",cwd:n,shell:f}).on("error",u=>{throw t.info(`Project preview launch failed: ${u.message}`),new Error("Project preview launch failed.")})},j=r=>r?!!s[r]:!1,h=r=>{let e=w.join(process.cwd(),r,"package.json");if(l(e))try{let n=JSON.parse(P(e,"utf-8")).dependencies||{};for(let[o,c]of Object.entries(i))if(n[c])return t.info(`
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as xe,f as Pe}from"./LLF5CY3L.js";import{$ as fe,V as le,W as he,Z as b,aa as de,ba as j,c as L,da as ye,ea as U,f as ie,fa as A,ia as k,ja as Se,ka as ge,la as Q,ma as K,oa as Ce,q as ae,r as pe,ra as be,s as ce,v as me,w as ue}from"./YUBO3M45.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+`
7
+ import{b as xe,f as Pe}from"./46YO7ZAG.js";import{$ as fe,V as le,W as he,Z as b,aa as de,ba as j,c as L,da as ye,ea as U,f as ie,fa as A,ia as k,ja as Se,ka as ge,la as Q,ma as K,oa as Ce,q as ae,r as pe,ra as be,s as ce,v as me,w as ue}from"./K4IZRPJV.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
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
9
  `),o==="json"?Fe(e):je(e,n),s&&Ge(s.operationId,s.logs),Pe("score",t,r)}export{Vt as handleScore};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as P,b as y,c as $}from"./N7DGFIVS.js";import{ia as h,za as x}from"./YUBO3M45.js";function N(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function O(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as T}from"node:child_process";import{mkdtemp as v}from"node:fs/promises";import{tmpdir as R}from"node:os";import S from"node:path";var I=3e5,a=class extends Error{},C;function L(){return C??=v(S.join(R(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await L();return new Promise((s,u)=>{let i=T(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},I);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new a(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${I/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function A(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function b(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
7
+ import{a as P,b as y,c as $}from"./F7K3O6UM.js";import{ia as h,za as x}from"./K4IZRPJV.js";function N(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function O(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as T}from"node:child_process";import{mkdtemp as v}from"node:fs/promises";import{tmpdir as R}from"node:os";import S from"node:path";var I=3e5,a=class extends Error{},C;function L(){return C??=v(S.join(R(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await L();return new Promise((s,u)=>{let i=T(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},I);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new a(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${I/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function A(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function b(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
8
8
 
9
9
  ${t.user}`,{stdout:r,stderr:o,code:s}=await w("codex",e,n);if(s!==0)throw new Error(`codex CLI exited with code ${s}: ${o.trim()||r.trim()}`);if(!r.trim())throw new Error("codex CLI returned no output.");return{text:r}}async function _(t){let e=["-p","--output-format","text","--trust"];t.model&&e.push("--model",t.model);let n=`${t.system}
10
10
 
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{u as o}from"./LLF5CY3L.js";import{ba as t}from"./YUBO3M45.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(`
7
+ import{u as o}from"./46YO7ZAG.js";import{ba as t}from"./K4IZRPJV.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
8
  `)}export{g as a};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as r}from"./YUBO3M45.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="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 S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
7
+ import{c as r}from"./K4IZRPJV.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="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 S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{d as L}from"./HAOBCQWB.js";import{b as $,c as w,d as M,f as D,g as q,h as B,i as _,j as F,k as U}from"./6OKAMFUS.js";import{h as T,j as E}from"./Z3O5AH5W.js";import{a as f,c as b,d as N,e as I,g as v}from"./PTPIZYEL.js";import{d as k,f as C,h as P,i as j,m as A}from"./LD5MEXEL.js";import{join as x}from"node:path";var d="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function S(e){return e.filter(t=>t.length>0).join(`
7
+ import{d as L}from"./HAOBCQWB.js";import{b as $,c as w,d as M,f as D,g as q,h as B,i as _,j as F,k as U}from"./M37DUXGN.js";import{h as T,j as E}from"./PYSE2LAG.js";import{a as f,c as b,d as N,e as I,g as v}from"./LR6VKQFM.js";import{d as k,f as C,h as P,i as j,m as A}from"./LD5MEXEL.js";import{join as x}from"node:path";var d="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function S(e){return e.filter(t=>t.length>0).join(`
8
8
 
9
9
  `)+`
10
10
  `}function O(e){let t=["/**",` * ${j(`${e.title} (v${e.version})`)}`];if(e.description)for(let n of A(j(e.description)))t.push(` * ${n}`.replace(/ +$/,""));return t.push(" */"),t.join(`
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./UFQAPCO4.js";import"./Z3O5AH5W.js";import"./PTPIZYEL.js";import"./WZXA5XPB.js";import"./YUBO3M45.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as zodGenerator};
7
+ import{a}from"./ZSK75GT2.js";import"./PYSE2LAG.js";import"./LR6VKQFM.js";import"./WZXA5XPB.js";import"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as zodGenerator};
@@ -4,6 +4,6 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a}from"./6OKAMFUS.js";import{ia as p}from"./YUBO3M45.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
7
+ import{a}from"./M37DUXGN.js";import{ia as p}from"./K4IZRPJV.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
8
8
  `);let i=new Set(t.schemas.map(e=>e.name)),o=n.filter(e=>e.sse===void 0&&m(e,i));return o.length>0&&p.warn(`generate-client: ${r} skipped ${o.length} operation(s) whose variables type name collides with a schema \u2014 rename the schema or the operation: ${o.map(e=>e.name).join(", ")}.
9
9
  `),n.filter(e=>e.sse===void 0&&!m(e,i))}function m(t,r){let n=a(t);return n.hasInputs&&r.has(n.variablesTypeName)}function x(t){return t.method==="get"||t.method==="head"}function u(t){return a(t).hasInputs}function f(t){return a(t).variablesTypeName}function $(t,r,n){let s=[];return a(t).hasInputs?s.push(r):n&&s.push("{}"),n&&s.push("{ ...init, envelope: undefined }"),`${t.name}(${s.join(", ")})`}function v(t,r,n){let s=t.map(e=>e.name).sort(),i=t.filter(u).map(f).sort();return n&&i.push("RequestOptions"),`import { ${[...s,...i.map(e=>`type ${e}`)].join(", ")} } from ${JSON.stringify(r)};`}export{g as a,x as b,u as c,f as d,$ as e,v as f};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{O as ks,P as $s,X as Np,Y as jp,ba as ho,c as Se,ca as go,ga as hr,ia as _e,oa as ye,pa as Ps}from"./YUBO3M45.js";import"./NEWT5A6S.js";import{a as Oe,c as ae,d as mo,e as mr}from"./RFWIIJFG.js";var ql=ae((kb,Ul)=>{Ul.exports=Ll;Ll.sync=Mh;var Ml=Oe("fs");function jh(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var n=r[o].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Dl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:jh(t,r)}function Ll(e,t,r){Ml.stat(e,function(o,n){r(o,o?!1:Dl(n,e,t))})}function Mh(e,t){return Dl(Ml.statSync(e),e,t)}});var Wl=ae(($b,Jl)=>{Jl.exports=Vl;Vl.sync=Dh;var Fl=Oe("fs");function Vl(e,t,r){Fl.stat(e,function(o,n){r(o,o?!1:Hl(n,t))})}function Dh(e,t){return Hl(Fl.statSync(e),t)}function Hl(e,t){return e.isFile()&&Lh(e,t)}function Lh(e,t){var r=e.mode,o=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),p=a|c,d=r&u||r&c&&n===i||r&a&&o===s||r&p&&s===0;return d}});var Gl=ae((Tb,Bl)=>{var Pb=Oe("fs"),co;process.platform==="win32"||global.TESTING_WINDOWS?co=ql():co=Wl();Bl.exports=ls;ls.sync=Uh;function ls(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,n){ls(e,t||{},function(s,i){s?n(s):o(i)})})}co(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function Uh(e,t){try{return co.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var rp=ae((Rb,tp)=>{var St=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kl=Oe("path"),qh=St?";":":",Xl=Gl(),Yl=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ql=(e,t)=>{let r=t.colon||qh,o=e.match(/\//)||St&&e.match(/\\/)?[""]:[...St?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=St?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=St?n.split(r):[""];return St&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},ep=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:n,pathExtExe:s}=Ql(e,t),i=[],a=u=>new Promise((p,d)=>{if(u===o.length)return t.all&&i.length?p(i):d(Yl(e));let m=o[u],h=/^".*"$/.test(m)?m.slice(1,-1):m,_=Kl.join(h,e),w=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+_:_;p(c(w,u,0))}),c=(u,p,d)=>new Promise((m,h)=>{if(d===n.length)return m(a(p+1));let _=n[d];Xl(u+_,{pathExt:s},(w,v)=>{if(!w&&v)if(t.all)i.push(u+_);else return m(u+_);return m(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Fh=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:o,pathExtExe:n}=Ql(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Kl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let m=p+o[d];try{if(Xl.sync(m,{pathExt:n}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Yl(e)};tp.exports=ep;ep.sync=Fh});var np=ae((Eb,ps)=>{"use strict";var op=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};ps.exports=op;ps.exports.default=op});var cp=ae((Cb,ap)=>{"use strict";var sp=Oe("path"),Vh=rp(),Hh=np();function ip(e,t){let r=e.options.env||process.env,o=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Vh.sync(e.command,{path:r[Hh({env:r})],pathExt:t?sp.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=sp.resolve(n?e.options.cwd:"",i)),i}function Jh(e){return ip(e)||ip(e,!0)}ap.exports=Jh});var up=ae((Ib,fs)=>{"use strict";var ds=/([()\][%!^"`<>&|;, *?])/g;function Wh(e){return e=e.replace(ds,"^$1"),e}function Bh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ds,"^$1"),t&&(e=e.replace(ds,"^$1")),e}fs.exports.command=Wh;fs.exports.argument=Bh});var pp=ae((Ob,lp)=>{"use strict";lp.exports=/^#!(.*)/});var fp=ae((Zb,dp)=>{"use strict";var Gh=pp();dp.exports=(e="")=>{let t=e.match(Gh);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var hp=ae((Ab,mp)=>{"use strict";var ms=Oe("fs"),Kh=fp();function Xh(e){let r=Buffer.alloc(150),o;try{o=ms.openSync(e,"r"),ms.readSync(o,r,0,150,0),ms.closeSync(o)}catch{}return Kh(r.toString())}mp.exports=Xh});var xp=ae((Nb,yp)=>{"use strict";var Yh=Oe("path"),gp=cp(),_p=up(),Qh=hp(),eg=process.platform==="win32",tg=/\.(?:com|exe)$/i,rg=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function og(e){e.file=gp(e);let t=e.file&&Qh(e.file);return t?(e.args.unshift(e.file),e.command=t,gp(e)):e.file}function ng(e){if(!eg)return e;let t=og(e),r=!tg.test(t);if(e.options.forceShell||r){let o=rg.test(t);e.command=Yh.normalize(e.command),e.command=_p.command(e.command),e.args=e.args.map(s=>_p.argument(s,o));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function sg(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let o={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?o:ng(o)}yp.exports=sg});var vp=ae((jb,wp)=>{"use strict";var hs=process.platform==="win32";function gs(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function ig(e,t){if(!hs)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=zp(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function zp(e,t){return hs&&e===1&&!t.file?gs(t.original,"spawn"):null}function ag(e,t){return hs&&e===1&&!t.file?gs(t.original,"spawnSync"):null}wp.exports={hookChildProcess:ig,verifyENOENT:zp,verifyENOENTSync:ag,notFoundError:gs}});var kp=ae((Mb,kt)=>{"use strict";var bp=Oe("child_process"),_s=xp(),ys=vp();function Sp(e,t,r){let o=_s(e,t,r),n=bp.spawn(o.command,o.args,o.options);return ys.hookChildProcess(n,o),n}function cg(e,t,r){let o=_s(e,t,r),n=bp.spawnSync(o.command,o.args,o.options);return n.error=n.error||ys.verifyENOENTSync(n.status,o),n}kt.exports=Sp;kt.exports.spawn=Sp;kt.exports.sync=cg;kt.exports._parse=_s;kt.exports._enoent=ys});var Cp=ae(zs=>{"use strict";var Tp=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,mg=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Rp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,hg=/\\([\u000b\u0020-\u00ff])/g,gg=/([\\"])/g,Ep=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;zs.format=_g;zs.parse=yg;function _g(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Ep.test(r))throw new TypeError("invalid type");var o=r;if(t&&typeof t=="object")for(var n,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(n=s[i],!Rp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+zg(t[n])}return o}function yg(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?xg(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),o=r!==-1?t.slice(0,r).trim():t.trim();if(!Ep.test(o))throw new TypeError("invalid media type");var n=new wg(o.toLowerCase());if(r!==-1){var s,i,a;for(Tp.lastIndex=r;i=Tp.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(hg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function xg(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function zg(e){var t=String(e);if(Rp.test(t))return t;if(t.length>0&&!mg.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(gg,"\\$1")+'"'}function wg(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Pg,mkdirSync as Tg,readFileSync as Rg,writeFileSync as Eg}from"node:fs";import{dirname as Cg}from"node:path";import{isDeepStrictEqual as Pt}from"node:util";function $t(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Se(r)&&t.set(r.name,r);return t}function gr(e,t,r){let o=$t(t);return e.map(n=>{let s=o.get(n.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...n,...i}})}function Mp(e,t){let r=$t(t);return gr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:gr(o.arguments,n,["example"])}})}function _o(e,t,r){let o=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},n=Se(o["x-mcp"])?o["x-mcp"]:{},s={...n};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Se(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=gr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Mp(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=gr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Dp(e,t){let r=$t(e),o=$t(t),n=[...o.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!o.has(c)),i=[...o.keys()].filter(c=>r.has(c)&&!Pt(r.get(c),o.get(c))),a=[];return n.length>0&&a.push(`added: ${n.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function Ts(e,t){if(Pt(e,t))return[];let r=Se(e["x-mcp"])?e["x-mcp"]:{},o=Se(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Dp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return Pt(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),Pt(r.capabilities,o.capabilities)||n.push("capabilities changed"),Pt(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var Rs,yo=Object.freeze({status:"aborted"});function f(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let m=p[d];m in a||(a[m]=u[m].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},rt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Rs=globalThis).__zod_globalConfig??(Rs.__zod_globalConfig={});var ot=globalThis.__zod_globalConfig;function ce(e){return e&&Object.assign(ot,e),ot}var E={};mo(E,{BIGINT_FORMAT_RANGES:()=>Os,Class:()=>zo,NUMBER_FORMAT_RANGES:()=>$o,aborted:()=>Ne,allowsEval:()=>bo,assert:()=>Vp,assertEqual:()=>Lp,assertIs:()=>qp,assertNever:()=>Fp,assertNotEqual:()=>Up,assignProp:()=>Ze,base64ToUint8Array:()=>As,base64urlToUint8Array:()=>ad,cached:()=>st,captureStackTrace:()=>xr,cleanEnum:()=>id,cleanRegex:()=>Ct,clone:()=>fe,cloneDef:()=>Jp,createTransparentProxy:()=>Yp,defineLazy:()=>Z,esc:()=>yr,escapeRegex:()=>$e,explicitlyAborted:()=>Po,extend:()=>td,finalizeIssue:()=>me,floatSafeRemainder:()=>wo,getElementAtPath:()=>Wp,getEnumValues:()=>Rt,getLengthableOrigin:()=>It,getParsedType:()=>Xp,getSizableOrigin:()=>Zs,hexToUint8Array:()=>ud,isObject:()=>Ve,isPlainObject:()=>Ae,issue:()=>it,joinValues:()=>_r,jsonStringifyReplacer:()=>nt,merge:()=>od,mergeDefs:()=>ke,normalizeParams:()=>S,nullish:()=>Et,numKeys:()=>Kp,objectClone:()=>Hp,omit:()=>ed,optionalKeys:()=>ko,parsedType:()=>To,partial:()=>nd,pick:()=>Qp,prefixIssues:()=>Pe,primitiveTypes:()=>Is,promiseAllObject:()=>Bp,propertyKeyTypes:()=>So,randomString:()=>Gp,required:()=>sd,safeExtend:()=>rd,shallowClone:()=>Cs,slugify:()=>vo,stringifyPrimitive:()=>zr,uint8ArrayToBase64:()=>Ns,uint8ArrayToBase64url:()=>cd,uint8ArrayToHex:()=>ld,unwrapMessage:()=>Tt});function Lp(e){return e}function Up(e){return e}function qp(e){}function Fp(e){throw new Error("Unexpected value in exhaustive check")}function Vp(e){}function Rt(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function _r(e,t="|"){return e.map(r=>zr(r)).join(t)}function nt(e,t){return typeof t=="bigint"?t.toString():t}function st(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Et(e){return e==null}function Ct(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wo(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Es=Symbol("evaluating");function Z(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Es)return o===void 0&&(o=Es,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Hp(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ze(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ke(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Jp(e){return ke(e._zod.def)}function Wp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Bp(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function Gp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function yr(e){return JSON.stringify(e)}function vo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var bo=st(()=>{if(ot.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ae(e){if(Ve(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ve(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Cs(e){return Ae(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Kp(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Xp=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},So=new Set(["string","number","symbol"]),Is=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Yp(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function zr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ko(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var $o={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Os={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=ke(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return Ze(this,"shape",i),i},checks:[]});return fe(e,s)}function ed(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=ke(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ze(this,"shape",i),i},checks:[]});return fe(e,s)}function td(e,t){if(!Ae(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=ke(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return fe(e,n)}function rd(e,t){if(!Ae(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ke(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return fe(e,r)}function od(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ke(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fe(e,r)}function nd(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=ke(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Ze(this,"shape",c),c},checks:[]});return fe(t,i)}function sd(e,t,r){let o=ke(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Ze(this,"shape",s),s}});return fe(t,o)}function Ne(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Po(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Pe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Tt(e){return typeof e=="string"?e:e?.message}function me(e,t,r){let o=e.message?e.message:Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function Zs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function It(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function To(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function it(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function id(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function As(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Ns(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ad(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return As(t+r)}function cd(e){return Ns(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ud(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function ld(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var zo=class{constructor(...t){}};var js=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,nt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wr=f("$ZodError",js),Ro=f("$ZodError",js,{Parent:Error});function Eo(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Co(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let p=a[u];u===a.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}}};return o(e),r}var vr=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ve;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>me(c,s,ce())));throw xr(a,n?.callee),a}return i.value};var br=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>me(c,s,ce())));throw xr(a,n?.callee),a}return i.value};var Ot=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new ve;return s.issues.length?{success:!1,error:new(e??wr)(s.issues.map(i=>me(i,n,ce())))}:{success:!0,data:s.value}},Zt=Ot(Ro),At=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>me(i,n,ce())))}:{success:!0,data:s.value}},Sr=At(Ro),Ms=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)};var Ds=e=>(t,r,o)=>vr(e)(t,r,o);var Ls=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return br(e)(t,r,n)};var Us=e=>async(t,r,o)=>br(e)(t,r,o);var qs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Fs=e=>(t,r,o)=>Ot(e)(t,r,o);var Vs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return At(e)(t,r,n)};var Hs=e=>async(t,r,o)=>At(e)(t,r,o);var Js=/^[cC][0-9a-z]{6,}$/,Ws=/^[0-9a-z]+$/,Bs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Gs=/^[0-9a-vA-V]{20}$/,Ks=/^[A-Za-z0-9]{27}$/,Xs=/^[a-zA-Z0-9_-]{21}$/,Ys=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Qs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Io=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var ei=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var dd="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ti(){return new RegExp(dd,"u")}var ri=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var ni=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,si=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ii=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oo=/^[A-Za-z0-9_-]*$/;var ai=/^https?$/,ci=/^\+[1-9]\d{6,14}$/,ui="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",li=new RegExp(`^${ui}$`);function pi(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function di(e){return new RegExp(`^${pi(e)}$`)}function fi(e){let t=pi({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ui}T(?:${o})$`)}var mi=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},hi=/^-?\d+n?$/,gi=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,_i=/^(?:true|false)$/i,yi=/^null$/i;var xi=/^[^A-Z]*$/,zi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wi={number:"number",bigint:"bigint",object:"date"},Ao=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=wi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),No=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=wi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vi=f("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wo(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),bi=f("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=$o[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=gi)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Si=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=It(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=It(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$i=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=It(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),jt=f("$ZodCheckStringFormat",(e,t)=>{var r,o;Q.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Pi=f("$ZodCheckRegex",(e,t)=>{jt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ti=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xi),jt.init(e,t)}),Ri=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zi),jt.init(e,t)}),Ei=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=$e(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ci=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${$e(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Ii=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${$e(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Oi=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var kr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
7
+ import{O as ks,P as $s,X as Np,Y as jp,ba as ho,c as Se,ca as go,ga as hr,ia as _e,oa as ye,pa as Ps}from"./K4IZRPJV.js";import"./NEWT5A6S.js";import{a as Oe,c as ae,d as mo,e as mr}from"./RFWIIJFG.js";var ql=ae((kb,Ul)=>{Ul.exports=Ll;Ll.sync=Mh;var Ml=Oe("fs");function jh(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o<r.length;o++){var n=r[o].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}function Dl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:jh(t,r)}function Ll(e,t,r){Ml.stat(e,function(o,n){r(o,o?!1:Dl(n,e,t))})}function Mh(e,t){return Dl(Ml.statSync(e),e,t)}});var Wl=ae(($b,Jl)=>{Jl.exports=Vl;Vl.sync=Dh;var Fl=Oe("fs");function Vl(e,t,r){Fl.stat(e,function(o,n){r(o,o?!1:Hl(n,t))})}function Dh(e,t){return Hl(Fl.statSync(e),t)}function Hl(e,t){return e.isFile()&&Lh(e,t)}function Lh(e,t){var r=e.mode,o=e.uid,n=e.gid,s=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),p=a|c,d=r&u||r&c&&n===i||r&a&&o===s||r&p&&s===0;return d}});var Gl=ae((Tb,Bl)=>{var Pb=Oe("fs"),co;process.platform==="win32"||global.TESTING_WINDOWS?co=ql():co=Wl();Bl.exports=ls;ls.sync=Uh;function ls(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,n){ls(e,t||{},function(s,i){s?n(s):o(i)})})}co(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function Uh(e,t){try{return co.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var rp=ae((Rb,tp)=>{var St=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Kl=Oe("path"),qh=St?";":":",Xl=Gl(),Yl=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ql=(e,t)=>{let r=t.colon||qh,o=e.match(/\//)||St&&e.match(/\\/)?[""]:[...St?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=St?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=St?n.split(r):[""];return St&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},ep=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:n,pathExtExe:s}=Ql(e,t),i=[],a=u=>new Promise((p,d)=>{if(u===o.length)return t.all&&i.length?p(i):d(Yl(e));let m=o[u],h=/^".*"$/.test(m)?m.slice(1,-1):m,_=Kl.join(h,e),w=!h&&/^\.[\\\/]/.test(e)?e.slice(0,2)+_:_;p(c(w,u,0))}),c=(u,p,d)=>new Promise((m,h)=>{if(d===n.length)return m(a(p+1));let _=n[d];Xl(u+_,{pathExt:s},(w,v)=>{if(!w&&v)if(t.all)i.push(u+_);else return m(u+_);return m(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Fh=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:o,pathExtExe:n}=Ql(e,t),s=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Kl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let m=p+o[d];try{if(Xl.sync(m,{pathExt:n}))if(t.all)s.push(m);else return m}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Yl(e)};tp.exports=ep;ep.sync=Fh});var np=ae((Eb,ps)=>{"use strict";var op=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};ps.exports=op;ps.exports.default=op});var cp=ae((Cb,ap)=>{"use strict";var sp=Oe("path"),Vh=rp(),Hh=np();function ip(e,t){let r=e.options.env||process.env,o=process.cwd(),n=e.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let i;try{i=Vh.sync(e.command,{path:r[Hh({env:r})],pathExt:t?sp.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=sp.resolve(n?e.options.cwd:"",i)),i}function Jh(e){return ip(e)||ip(e,!0)}ap.exports=Jh});var up=ae((Ib,fs)=>{"use strict";var ds=/([()\][%!^"`<>&|;, *?])/g;function Wh(e){return e=e.replace(ds,"^$1"),e}function Bh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ds,"^$1"),t&&(e=e.replace(ds,"^$1")),e}fs.exports.command=Wh;fs.exports.argument=Bh});var pp=ae((Ob,lp)=>{"use strict";lp.exports=/^#!(.*)/});var fp=ae((Zb,dp)=>{"use strict";var Gh=pp();dp.exports=(e="")=>{let t=e.match(Gh);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var hp=ae((Ab,mp)=>{"use strict";var ms=Oe("fs"),Kh=fp();function Xh(e){let r=Buffer.alloc(150),o;try{o=ms.openSync(e,"r"),ms.readSync(o,r,0,150,0),ms.closeSync(o)}catch{}return Kh(r.toString())}mp.exports=Xh});var xp=ae((Nb,yp)=>{"use strict";var Yh=Oe("path"),gp=cp(),_p=up(),Qh=hp(),eg=process.platform==="win32",tg=/\.(?:com|exe)$/i,rg=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function og(e){e.file=gp(e);let t=e.file&&Qh(e.file);return t?(e.args.unshift(e.file),e.command=t,gp(e)):e.file}function ng(e){if(!eg)return e;let t=og(e),r=!tg.test(t);if(e.options.forceShell||r){let o=rg.test(t);e.command=Yh.normalize(e.command),e.command=_p.command(e.command),e.args=e.args.map(s=>_p.argument(s,o));let n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function sg(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let o={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?o:ng(o)}yp.exports=sg});var vp=ae((jb,wp)=>{"use strict";var hs=process.platform==="win32";function gs(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function ig(e,t){if(!hs)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=zp(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function zp(e,t){return hs&&e===1&&!t.file?gs(t.original,"spawn"):null}function ag(e,t){return hs&&e===1&&!t.file?gs(t.original,"spawnSync"):null}wp.exports={hookChildProcess:ig,verifyENOENT:zp,verifyENOENTSync:ag,notFoundError:gs}});var kp=ae((Mb,kt)=>{"use strict";var bp=Oe("child_process"),_s=xp(),ys=vp();function Sp(e,t,r){let o=_s(e,t,r),n=bp.spawn(o.command,o.args,o.options);return ys.hookChildProcess(n,o),n}function cg(e,t,r){let o=_s(e,t,r),n=bp.spawnSync(o.command,o.args,o.options);return n.error=n.error||ys.verifyENOENTSync(n.status,o),n}kt.exports=Sp;kt.exports.spawn=Sp;kt.exports.sync=cg;kt.exports._parse=_s;kt.exports._enoent=ys});var Cp=ae(zs=>{"use strict";var Tp=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,mg=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Rp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,hg=/\\([\u000b\u0020-\u00ff])/g,gg=/([\\"])/g,Ep=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;zs.format=_g;zs.parse=yg;function _g(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!Ep.test(r))throw new TypeError("invalid type");var o=r;if(t&&typeof t=="object")for(var n,s=Object.keys(t).sort(),i=0;i<s.length;i++){if(n=s[i],!Rp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+zg(t[n])}return o}function yg(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?xg(e):e;if(typeof t!="string")throw new TypeError("argument string is required to be a string");var r=t.indexOf(";"),o=r!==-1?t.slice(0,r).trim():t.trim();if(!Ep.test(o))throw new TypeError("invalid media type");var n=new wg(o.toLowerCase());if(r!==-1){var s,i,a;for(Tp.lastIndex=r;i=Tp.exec(t);){if(i.index!==r)throw new TypeError("invalid parameter format");r+=i[0].length,s=i[1].toLowerCase(),a=i[2],a.charCodeAt(0)===34&&(a=a.slice(1,-1),a.indexOf("\\")!==-1&&(a=a.replace(hg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function xg(e){var t;if(typeof e.getHeader=="function"?t=e.getHeader("content-type"):typeof e.headers=="object"&&(t=e.headers&&e.headers["content-type"]),typeof t!="string")throw new TypeError("content-type header is missing from object");return t}function zg(e){var t=String(e);if(Rp.test(t))return t;if(t.length>0&&!mg.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(gg,"\\$1")+'"'}function wg(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as Pg,mkdirSync as Tg,readFileSync as Rg,writeFileSync as Eg}from"node:fs";import{dirname as Cg}from"node:path";import{isDeepStrictEqual as Pt}from"node:util";function $t(e){let t=new Map;for(let r of Array.isArray(e)?e:[])Se(r)&&t.set(r.name,r);return t}function gr(e,t,r){let o=$t(t);return e.map(n=>{let s=o.get(n.name),i={};for(let a of r)s&&s[a]!==void 0&&(i[a]=s[a]);return{...n,...i}})}function Mp(e,t){let r=$t(t);return gr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:gr(o.arguments,n,["example"])}})}function _o(e,t,r){let o=e??{openapi:"3.1.0",info:{title:t.serverInfo?.title||t.serverInfo?.name||"MCP API",...t.instructions?{description:t.instructions}:{},version:t.serverInfo?.version||"1.0.0"},paths:{}},n=Se(o["x-mcp"])?o["x-mcp"]:{},s={...n};if(t.protocolVersion&&(s.protocolVersion=t.protocolVersion),r){let i=Array.isArray(s.servers)?s.servers:[];i.some(a=>Se(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=gr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Mp(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=gr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Dp(e,t){let r=$t(e),o=$t(t),n=[...o.keys()].filter(c=>!r.has(c)),s=[...r.keys()].filter(c=>!o.has(c)),i=[...o.keys()].filter(c=>r.has(c)&&!Pt(r.get(c),o.get(c))),a=[];return n.length>0&&a.push(`added: ${n.join(", ")}`),s.length>0&&a.push(`removed: ${s.join(", ")}`),i.length>0&&a.push(`changed: ${i.join(", ")}`),a.length>0?a.join("; "):void 0}function Ts(e,t){if(Pt(e,t))return[];let r=Se(e["x-mcp"])?e["x-mcp"]:{},o=Se(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Dp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return Pt(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),Pt(r.capabilities,o.capabilities)||n.push("capabilities changed"),Pt(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var Rs,yo=Object.freeze({status:"aborted"});function f(e,t,r){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=i.prototype,p=Object.keys(u);for(let d=0;d<p.length;d++){let m=p[d];m in a||(a[m]=u[m].bind(a))}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let u=r?.Parent?new s:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let p of u._zod.deferred)p();return u}return Object.defineProperty(i,"init",{value:o}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}var ve=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},rt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Rs=globalThis).__zod_globalConfig??(Rs.__zod_globalConfig={});var ot=globalThis.__zod_globalConfig;function ce(e){return e&&Object.assign(ot,e),ot}var E={};mo(E,{BIGINT_FORMAT_RANGES:()=>Os,Class:()=>zo,NUMBER_FORMAT_RANGES:()=>$o,aborted:()=>Ne,allowsEval:()=>bo,assert:()=>Vp,assertEqual:()=>Lp,assertIs:()=>qp,assertNever:()=>Fp,assertNotEqual:()=>Up,assignProp:()=>Ze,base64ToUint8Array:()=>As,base64urlToUint8Array:()=>ad,cached:()=>st,captureStackTrace:()=>xr,cleanEnum:()=>id,cleanRegex:()=>Ct,clone:()=>fe,cloneDef:()=>Jp,createTransparentProxy:()=>Yp,defineLazy:()=>Z,esc:()=>yr,escapeRegex:()=>$e,explicitlyAborted:()=>Po,extend:()=>td,finalizeIssue:()=>me,floatSafeRemainder:()=>wo,getElementAtPath:()=>Wp,getEnumValues:()=>Rt,getLengthableOrigin:()=>It,getParsedType:()=>Xp,getSizableOrigin:()=>Zs,hexToUint8Array:()=>ud,isObject:()=>Ve,isPlainObject:()=>Ae,issue:()=>it,joinValues:()=>_r,jsonStringifyReplacer:()=>nt,merge:()=>od,mergeDefs:()=>ke,normalizeParams:()=>S,nullish:()=>Et,numKeys:()=>Kp,objectClone:()=>Hp,omit:()=>ed,optionalKeys:()=>ko,parsedType:()=>To,partial:()=>nd,pick:()=>Qp,prefixIssues:()=>Pe,primitiveTypes:()=>Is,promiseAllObject:()=>Bp,propertyKeyTypes:()=>So,randomString:()=>Gp,required:()=>sd,safeExtend:()=>rd,shallowClone:()=>Cs,slugify:()=>vo,stringifyPrimitive:()=>zr,uint8ArrayToBase64:()=>Ns,uint8ArrayToBase64url:()=>cd,uint8ArrayToHex:()=>ld,unwrapMessage:()=>Tt});function Lp(e){return e}function Up(e){return e}function qp(e){}function Fp(e){throw new Error("Unexpected value in exhaustive check")}function Vp(e){}function Rt(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function _r(e,t="|"){return e.map(r=>zr(r)).join(t)}function nt(e,t){return typeof t=="bigint"?t.toString():t}function st(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Et(e){return e==null}function Ct(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wo(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var Es=Symbol("evaluating");function Z(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Es)return o===void 0&&(o=Es,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Hp(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ze(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ke(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function Jp(e){return ke(e._zod.def)}function Wp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Bp(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let s=0;s<t.length;s++)n[t[s]]=o[s];return n})}function Gp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function yr(e){return JSON.stringify(e)}function vo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var xr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var bo=st(()=>{if(ot.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ae(e){if(Ve(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ve(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Cs(e){return Ae(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Kp(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var Xp=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},So=new Set(["string","number","symbol"]),Is=new Set(["string","number","bigint","boolean","symbol","undefined"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fe(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Yp(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,s){return t??(t=e()),Reflect.set(t,o,n,s)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function zr(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function ko(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var $o={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Os={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qp(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=ke(e._zod.def,{get shape(){let i={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return Ze(this,"shape",i),i},checks:[]});return fe(e,s)}function ed(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=ke(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ze(this,"shape",i),i},checks:[]});return fe(e,s)}function td(e,t){if(!Ae(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=ke(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return fe(e,n)}function rd(e,t){if(!Ae(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=ke(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return fe(e,r)}function od(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ke(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fe(e,r)}function nd(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=ke(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return Ze(this,"shape",c),c},checks:[]});return fe(t,i)}function sd(e,t,r){let o=ke(t._zod.def,{get shape(){let n=t._zod.def.shape,s={...n};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:n[i]}))}else for(let i in n)s[i]=new e({type:"nonoptional",innerType:n[i]});return Ze(this,"shape",s),s}});return fe(t,o)}function Ne(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Po(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Pe(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Tt(e){return typeof e=="string"?e:e?.message}function me(e,t,r){let o=e.message?e.message:Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input",{inst:n,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=i),a}function Zs(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function It(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function To(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function it(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function id(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function As(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Ns(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ad(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return As(t+r)}function cd(e){return Ns(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ud(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function ld(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var zo=class{constructor(...t){}};var js=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,nt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wr=f("$ZodError",js),Ro=f("$ZodError",js,{Parent:Error});function Eo(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function Co(e,t=r=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;for(;u<a.length;){let p=a[u];u===a.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(t(i))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}}};return o(e),r}var vr=e=>(t,r,o,n)=>{let s=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new ve;if(i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>me(c,s,ce())));throw xr(a,n?.callee),a}return i.value};var br=e=>async(t,r,o,n)=>{let s=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(n?.Err??e)(i.issues.map(c=>me(c,s,ce())));throw xr(a,n?.callee),a}return i.value};var Ot=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new ve;return s.issues.length?{success:!1,error:new(e??wr)(s.issues.map(i=>me(i,n,ce())))}:{success:!0,data:s.value}},Zt=Ot(Ro),At=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>me(i,n,ce())))}:{success:!0,data:s.value}},Sr=At(Ro),Ms=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return vr(e)(t,r,n)};var Ds=e=>(t,r,o)=>vr(e)(t,r,o);var Ls=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return br(e)(t,r,n)};var Us=e=>async(t,r,o)=>br(e)(t,r,o);var qs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Fs=e=>(t,r,o)=>Ot(e)(t,r,o);var Vs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return At(e)(t,r,n)};var Hs=e=>async(t,r,o)=>At(e)(t,r,o);var Js=/^[cC][0-9a-z]{6,}$/,Ws=/^[0-9a-z]+$/,Bs=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Gs=/^[0-9a-vA-V]{20}$/,Ks=/^[A-Za-z0-9]{27}$/,Xs=/^[a-zA-Z0-9_-]{21}$/,Ys=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Qs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Io=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var ei=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var dd="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ti(){return new RegExp(dd,"u")}var ri=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,oi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var ni=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,si=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ii=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Oo=/^[A-Za-z0-9_-]*$/;var ai=/^https?$/,ci=/^\+[1-9]\d{6,14}$/,ui="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",li=new RegExp(`^${ui}$`);function pi(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function di(e){return new RegExp(`^${pi(e)}$`)}function fi(e){let t=pi({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ui}T(?:${o})$`)}var mi=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},hi=/^-?\d+n?$/,gi=/^-?\d+$/,Zo=/^-?\d+(?:\.\d+)?$/,_i=/^(?:true|false)$/i,yi=/^null$/i;var xi=/^[^A-Z]*$/,zi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),wi={number:"number",bigint:"bigint",object:"date"},Ao=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=wi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),No=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=wi[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vi=f("$ZodCheckMultipleOf",(e,t)=>{Q.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):wo(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),bi=f("$ZodCheckNumberFormat",(e,t)=>{Q.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=$o[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=s,r&&(a.pattern=gi)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Si=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let i=It(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),ki=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let i=It(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$i=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Et(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,s=n.length;if(s===t.length)return;let i=It(n),a=s>t.length;o.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),jt=f("$ZodCheckStringFormat",(e,t)=>{var r,o;Q.init(e,t),e._zod.onattach.push(n=>{let s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Pi=f("$ZodCheckRegex",(e,t)=>{jt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ti=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xi),jt.init(e,t)}),Ri=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=zi),jt.init(e,t)}),Ei=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=$e(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ci=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${$e(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Ii=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${$e(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Oi=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var kr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
8
8
  `).filter(i=>i),n=Math.min(...o.map(i=>i.length-i.trimStart().length)),s=o.map(i=>i.slice(n)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,n.join(`
9
9
  `))}};var Ai={major:4,minor:4,patch:3};var N=f("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ai;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let s of n._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,a,c)=>{let u=Ne(i),p;for(let d of a){if(d._zod.def.when){if(Po(i)||!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new ve;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,i.issues.length!==m&&(u||(u=Ne(i,m)))});else{if(i.issues.length===m)continue;u||(u=Ne(i,m))}}return p?p.then(()=>i):i},s=(i,a,c)=>{if(Ne(i))return i.aborted=!0,i;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new ve;return u.then(p=>e._zod.parse(p,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){let u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(p=>s(p,i,a)):s(u,i,a)}let c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new ve;return c.then(u=>n(u,o,a))}return n(c,o,a)}}Z(e,"~standard",()=>({validate:n=>{try{let s=Zt(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Sr(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Tr=f("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mi(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),U=f("$ZodStringFormat",(e,t)=>{jt.init(e,t),Tr.init(e,t)}),Vi=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qs),U.init(e,t)}),Hi=f("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Io(o))}else t.pattern??(t.pattern=Io());U.init(e,t)}),Ji=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ei),U.init(e,t)}),Wi=f("$ZodURL",(e,t)=>{U.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===ai.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Bi=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ti()),U.init(e,t)}),Gi=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xs),U.init(e,t)}),Ki=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Js),U.init(e,t)}),Xi=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ws),U.init(e,t)}),Yi=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Bs),U.init(e,t)}),Qi=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Gs),U.init(e,t)}),ea=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ks),U.init(e,t)}),ta=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=fi(t)),U.init(e,t)}),ra=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=li),U.init(e,t)}),oa=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=di(t)),U.init(e,t)}),na=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ys),U.init(e,t)}),sa=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ri),U.init(e,t),e._zod.bag.format="ipv4"}),ia=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oi),U.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}});var aa=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ni),U.init(e,t)}),ca=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=si),U.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,s]=o;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ua(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var la=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ii),U.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ua(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function hd(e){if(!Oo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ua(r)}var pa=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Oo),U.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{hd(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),da=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ci),U.init(e,t)});function gd(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var fa=f("$ZodJWT",(e,t)=>{U.init(e,t),e._zod.check=r=>{gd(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Mo=f("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??Zo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),ma=f("$ZodNumberFormat",(e,t)=>{bi.init(e,t),Mo.init(e,t)}),ha=f("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=_i,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),ga=f("$ZodBigInt",(e,t)=>{N.init(e,t),e._zod.pattern=hi,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var _a=f("$ZodNull",(e,t)=>{N.init(e,t),e._zod.pattern=yi,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),ya=f("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),xa=f("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=r=>r}),za=f("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var wa=f("$ZodDate",(e,t)=>{N.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Ni(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}var va=f("$ZodArray",(e,t)=>{N.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let s=[];for(let i=0;i<n.length;i++){let a=n[i],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?s.push(c.then(u=>Ni(u,r,i))):Ni(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Pr(e,t,r,o,n,s){let i=r in o;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...Pe(r,e.issues))}if(!i&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function ba(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=ko(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Sa(e,t,r,o,n,s){let i=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,p=c.optin==="optional",d=c.optout==="optional";for(let m in t){if(m==="__proto__"||a.has(m))continue;if(u==="never"){i.push(m);continue}let h=c.run({value:t[m],issues:[]},o);h instanceof Promise?e.push(h.then(_=>Pr(_,r,m,t,p,d))):Pr(h,r,m,t,p,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}var _d=f("$ZodObject",(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=st(()=>ba(t));Z(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let p=a[u]._zod;if(p.values){c[u]??(c[u]=new Set);for(let d of p.values)c[u].add(d)}}return c});let n=Ve,s=t.catchall,i;e._zod.parse=(a,c)=>{i??(i=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let p=[],d=i.shape;for(let m of i.keys){let h=d[m],_=h._zod.optin==="optional",w=h._zod.optout==="optional",v=h._zod.run({value:u[m],issues:[]},c);v instanceof Promise?p.push(v.then(L=>Pr(L,a,m,u,_,w))):Pr(v,a,m,u,_,w)}return s?Sa(p,u,a,c,o.value,e):p.length?Promise.all(p).then(()=>a):a}}),ka=f("$ZodObjectJIT",(e,t)=>{_d.init(e,t);let r=e._zod.parse,o=st(()=>ba(t)),n=m=>{let h=new kr(["shape","payload","ctx"]),_=o.value,w=A=>{let I=yr(A);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};h.write("const input = payload.value;");let v=Object.create(null),L=0;for(let A of _.keys)v[A]=`key_${L++}`;h.write("const newResult = {};");for(let A of _.keys){let I=v[A],g=yr(A),z=m[A],T=z?._zod?.optin==="optional",W=z?._zod?.optout==="optional";h.write(`const ${I} = ${w(A)};`),T&&W?h.write(`
10
10
  if (${I}.issues.length) {
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a,b,c,d,e}from"./XLPP6YHU.js";import"./N7DGFIVS.js";import"./FTJ2GLND.js";import"./LLF5CY3L.js";import"./GKXY6U4S.js";import"./YUBO3M45.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSlugDeprecation,e as printSunsetWarning};
7
+ import{a,b,c,d,e}from"./NHOPECWM.js";import"./F7K3O6UM.js";import"./RALPAYEE.js";import"./GKXY6U4S.js";import"./46YO7ZAG.js";import"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{a as DeploymentError,b as handlePushStatus,c as handleReuniteError,d as printSlugDeprecation,e as printSunsetWarning};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{b as a,c as b,d as c}from"./XGUY3CME.js";import"./HAOBCQWB.js";import"./OAZXHMUB.js";import"./6OKAMFUS.js";import"./Z3O5AH5W.js";import"./PTPIZYEL.js";import"./WZXA5XPB.js";import"./YUBO3M45.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
7
+ import{b as a,c as b,d as c}from"./STYLK3WI.js";import"./HAOBCQWB.js";import"./AZPQQ3GI.js";import"./M37DUXGN.js";import"./PYSE2LAG.js";import"./LR6VKQFM.js";import"./WZXA5XPB.js";import"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
@@ -4,7 +4,7 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{a as c}from"./KTG4J5LM.js";import{h as s,l as a}from"./FTJ2GLND.js";import"./GKXY6U4S.js";import{aa as t,ia as e,oa as i}from"./YUBO3M45.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
7
+ import{a as c}from"./YCJL4ZHF.js";import{h as s,l as a}from"./RALPAYEE.js";import"./GKXY6U4S.js";import{aa as t,ia as e,oa as i}from"./K4IZRPJV.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function y({argv:r,config:l,version:d}){let o=s(l,r.residency);try{let n=new a(d);r.verbose&&(e.info(`OAuth client initialized.
8
8
  `),e.info(`Local credentials file path: ${n.credentialsFilePath}
9
9
  `)),await n.login(o,c),e.output(t(`\u2705 Logged in
10
10
 
@@ -0,0 +1,9 @@
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 p,c as y}from"./RFWIIJFG.js";var _=y((U,b)=>{b.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var S=y((F,u)=>{var g=p("fs"),h=p("path"),V=p("os"),w=p("crypto"),I=_(),E=I.version,O=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function T(e){let r={},n=e.toString();n=n.replace(/\r\n?/mg,`
8
+ `);let s;for(;(s=O.exec(n))!=null;){let i=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
9
+ `),t=t.replace(/\\r/g,"\r")),r[i]=t}return r}function A(e){let r=N(e),n=c.configDotenv({path:r});if(!n.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=D(e).split(","),i=s.length,t;for(let o=0;o<i;o++)try{let a=s[o].trim(),l=j(n,a);t=c.decrypt(l.ciphertext,l.key);break}catch(a){if(o+1>=i)throw a}return c.parse(t)}function k(e){console.log(`[dotenv@${E}][INFO] ${e}`)}function $(e){console.log(`[dotenv@${E}][WARN] ${e}`)}function v(e){console.log(`[dotenv@${E}][DEBUG] ${e}`)}function D(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function j(e,r){let n;try{n=new URL(r)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let s=n.password;if(!s){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=n.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let t=`DOTENV_VAULT_${i.toUpperCase()}`,o=e.parsed[t];if(!o){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:o,key:s}}function N(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let n of e.path)g.existsSync(n)&&(r=n.endsWith(".vault")?n:`${n}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=h.resolve(process.cwd(),".env.vault");return g.existsSync(r)?r:null}function m(e){return e[0]==="~"?h.join(V.homedir(),e.slice(1)):e}function x(e){k("Loading env from encrypted .env.vault");let r=c._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),c.populate(n,r,e),{parsed:r}}function K(e){let r=h.resolve(process.cwd(),".env"),n="utf8",s=!!(e&&e.debug);e&&e.encoding?n=e.encoding:s&&v("No encoding is specified. UTF-8 is used by default");let i=[r];if(e&&e.path)if(!Array.isArray(e.path))i=[m(e.path)];else{i=[];for(let l of e.path)i.push(m(l))}let t,o={};for(let l of i)try{let f=c.parse(g.readFileSync(l,{encoding:n}));c.populate(o,f,e)}catch(f){s&&v(`Failed to load ${l} ${f.message}`),t=f}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),c.populate(a,o,e),t?{parsed:o,error:t}:{parsed:o}}function Y(e){if(D(e).length===0)return c.configDotenv(e);let r=N(e);return r?c._configVault(e):($(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),c.configDotenv(e))}function L(e,r){let n=Buffer.from(r.slice(-64),"hex"),s=Buffer.from(e,"base64"),i=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=w.createDecipheriv("aes-256-gcm",n,i);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let a=o instanceof RangeError,l=o.message==="Invalid key length",f=o.message==="Unsupported state or unable to authenticate data";if(a||l){let d=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw d.code="INVALID_DOTENV_KEY",d}else if(f){let d=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw d.code="DECRYPTION_FAILED",d}else throw o}}function R(e,r,n={}){let s=!!(n&&n.debug),i=!!(n&&n.override);if(typeof r!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(r))Object.prototype.hasOwnProperty.call(e,t)?(i===!0&&(e[t]=r[t]),s&&v(i===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=r[t]}var c={configDotenv:K,_configVault:x,_parseVault:A,config:Y,decrypt:L,parse:T,populate:R};u.exports.configDotenv=c.configDotenv;u.exports._configVault=c._configVault;u.exports._parseVault=c._parseVault;u.exports.config=c.config;u.exports.decrypt=c.decrypt;u.exports.parse=c.parse;u.exports.populate=c.populate;u.exports=c});export{S as a};
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{ia as t}from"./YUBO3M45.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
7
+ import{ia as t}from"./K4IZRPJV.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
8
8
  `);return}this.intervalId===null&&(this.intervalId=setInterval(()=>{this.showFrame()},100))}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,t.info("\r")),this.message=""}};function h(i){i.stop(),e.stderr.isTTY&&t.info("\x1B[2K")}function m(i,r){let[s]=r.inFlight;if(!s)return;let a=r.inFlight.size>1?` (+${r.inFlight.size-1} more)`:"";i.start(`[${r.position}/${r.total}] ${r.action} ${s}${a}`)}export{n as a,h as b,m as c};