@redocly/cli 2.53.2 → 2.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/lib/chunks/{T376AHHQ.js → 23QBFBKB.js} +1 -1
  3. package/lib/chunks/{IMWIJK4I.js → 2MBZI3W3.js} +2 -1
  4. package/lib/chunks/2TLIBL23.js +8 -0
  5. package/lib/chunks/{Q3LFOSXJ.js → 3BQA72CL.js} +1 -1
  6. package/lib/chunks/{FKRGYVXD.js → 3JLKV64R.js} +1 -1
  7. package/lib/chunks/3RDMQ5CQ.js +13 -0
  8. package/lib/chunks/{4BCUUE3J.js → 4563NK6K.js} +1 -1
  9. package/lib/chunks/{7GYVSRCX.js → 5U5KA4QB.js} +1 -1
  10. package/lib/chunks/7IULUVWX.js +13 -0
  11. package/lib/chunks/AHGQ4BNI.js +30 -0
  12. package/lib/chunks/ALXOGCUM.js +8 -0
  13. package/lib/chunks/AM6FT7EB.js +9 -0
  14. package/lib/chunks/{53VK4LV5.js → B2NEPS53.js} +485 -473
  15. package/lib/chunks/{HY6IF56V.js → BV3FDR6T.js} +1 -1
  16. package/lib/chunks/{LGWICMQK.js → C22B72S6.js} +1 -1
  17. package/lib/chunks/{6ER74AF4.js → CI4NGJ3I.js} +3 -3
  18. package/lib/chunks/{JA4LTWW3.js → CR75HYUP.js} +1 -1
  19. package/lib/chunks/{BVF3GEBD.js → DZ3BIL7B.js} +1 -1
  20. package/lib/chunks/{EFVXVP5M.js → ELMWD5XU.js} +1 -1
  21. package/lib/chunks/{NU76FSGR.js → EQF3XONE.js} +1 -1
  22. package/lib/chunks/{RGJTOYYC.js → EVZXABWY.js} +1 -1
  23. package/lib/chunks/{R2EWSE4Z.js → FFUSN7JK.js} +1 -1
  24. package/lib/chunks/FOLQQTQP.js +19 -0
  25. package/lib/chunks/{CXNOQVEB.js → FTDJMTRX.js} +1 -1
  26. package/lib/chunks/{HE2DJR6Y.js → FTTM5CU5.js} +1 -1
  27. package/lib/chunks/{BNWXU2OA.js → FUCJM4CG.js} +1 -1
  28. package/lib/chunks/{Z57CXIHX.js → G2C7YJ5D.js} +1 -1
  29. package/lib/chunks/{YLZS72LY.js → G6ES3GTP.js} +1 -1
  30. package/lib/chunks/{RD64AQAZ.js → GV5K7EMH.js} +1 -1
  31. package/lib/chunks/H4XURXR7.js +47 -0
  32. package/lib/chunks/{GM5FQCWY.js → IW2J6X26.js} +4 -4
  33. package/lib/chunks/{RI6WFA4F.js → KEF4233Y.js} +6 -6
  34. package/lib/chunks/{LUCPX66E.js → KIVK5WD5.js} +1 -1
  35. package/lib/chunks/{NPD4SXEI.js → L24E6ZRY.js} +4 -4
  36. package/lib/chunks/LLGJ3YMR.js +85 -0
  37. package/lib/chunks/{UZQGV3C7.js → MLHMLZ6D.js} +2 -2
  38. package/lib/chunks/QZBHV7SD.js +7 -0
  39. package/lib/chunks/{UWKKXZOE.js → RW2ESAIF.js} +80 -80
  40. package/lib/chunks/{QJ4W6N5P.js → RZ4WANMS.js} +1 -1
  41. package/lib/chunks/{3BIPHQGZ.js → SGZ5GYE3.js} +1 -1
  42. package/lib/chunks/{KQUR5LDF.js → SK6F5TET.js} +1 -1
  43. package/lib/chunks/{ZBW2UTL4.js → T5U6O5KC.js} +1 -1
  44. package/lib/chunks/TZMWTSOQ.js +7 -0
  45. package/lib/chunks/{WEAET3FR.js → UIQNT772.js} +1 -1
  46. package/lib/chunks/{DQLEE5LL.js → VFDSXLTV.js} +1 -1
  47. package/lib/chunks/VTKYS75A.js +13 -0
  48. package/lib/chunks/XRZ5NMQ5.js +13 -0
  49. package/lib/chunks/Y6E4JAM3.js +16 -0
  50. package/lib/chunks/{GJKYTFLY.js → YDSFHQXH.js} +3 -3
  51. package/lib/chunks/{I4EFNEXU.js → YZIILRDN.js} +1 -1
  52. package/lib/chunks/{BSAURQIG.js → ZBHEZTGU.js} +1 -1
  53. package/lib/chunks/ZBK7SJHM.js +7 -0
  54. package/lib/chunks/ZDQDZTQ7.js +7 -0
  55. package/lib/chunks/{FPOO3NKZ.js → ZLOWCBYN.js} +1 -1
  56. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  57. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  58. package/lib/eject-assets/generators/cli/index.ts +2 -2
  59. package/lib/eject-assets/generators/cli/render.ts +1 -1
  60. package/lib/eject-assets/generators/go/client.ts +1 -1
  61. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  62. package/lib/eject-assets/generators/go/index.ts +2 -2
  63. package/lib/eject-assets/generators/go/models.ts +1 -1
  64. package/lib/eject-assets/generators/go/naming.ts +1 -1
  65. package/lib/eject-assets/generators/go/operations.ts +1 -1
  66. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  67. package/lib/eject-assets/generators/go/types.ts +1 -1
  68. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  69. package/lib/eject-assets/generators/mock/index.ts +2 -2
  70. package/lib/eject-assets/generators/mock/render.ts +1 -1
  71. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  72. package/lib/eject-assets/generators/mock/values.ts +1 -1
  73. package/lib/eject-assets/generators/php/client.ts +1 -1
  74. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  75. package/lib/eject-assets/generators/php/index.ts +2 -2
  76. package/lib/eject-assets/generators/php/models.ts +1 -1
  77. package/lib/eject-assets/generators/php/naming.ts +1 -1
  78. package/lib/eject-assets/generators/php/operations.ts +1 -1
  79. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  80. package/lib/eject-assets/generators/php/types.ts +1 -1
  81. package/lib/eject-assets/generators/python/client.ts +1 -1
  82. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  83. package/lib/eject-assets/generators/python/index.ts +2 -2
  84. package/lib/eject-assets/generators/python/models.ts +1 -1
  85. package/lib/eject-assets/generators/python/naming.ts +1 -1
  86. package/lib/eject-assets/generators/python/operations.ts +1 -1
  87. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  88. package/lib/eject-assets/generators/python/types.ts +1 -1
  89. package/lib/eject-assets/generators/swr/index.ts +2 -2
  90. package/lib/eject-assets/generators/swr/render.ts +1 -1
  91. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  92. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  93. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  94. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  95. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  96. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  97. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  98. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  99. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  100. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  101. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  102. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  103. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  104. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  105. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  106. package/lib/eject-assets/generators/zod/index.ts +2 -2
  107. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  108. package/lib/index.js +157 -276
  109. package/package.json +1 -1
  110. package/lib/chunks/32XCOMOR.js +0 -7
  111. package/lib/chunks/6LHYZTIP.js +0 -48
  112. package/lib/chunks/KXHIHQWX.js +0 -13
  113. package/lib/chunks/OFAMJNQ6.js +0 -7
  114. package/lib/chunks/P26PQ2RU.js +0 -7
  115. package/lib/chunks/R6Q6FO6R.js +0 -14
  116. package/lib/chunks/RS5PUOTT.js +0 -18
  117. package/lib/chunks/SCWHIBJL.js +0 -22
  118. package/lib/chunks/SP5G6SN2.js +0 -7
  119. package/lib/chunks/T226COGJ.js +0 -19
  120. package/lib/chunks/WV7XOOFD.js +0 -7
@@ -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 zs,b as _e}from"./IMWIJK4I.js";import{B as ys,C as xs,J as Pp,K as Tp,P as lo,Q as po,U as dr,W as ge,c as we}from"./UWKKXZOE.js";import"./NEWT5A6S.js";import{a as Oe,c as ie,d as uo,e as pr}from"./RFWIIJFG.js";var Cl=ie((ub,Rl)=>{Rl.exports=El;El.sync=bh;var Pl=Oe("fs");function wh(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 Tl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:wh(t,r)}function El(e,t,r){Pl.stat(e,function(o,n){r(o,o?!1:Tl(n,e,t))})}function bh(e,t){return Tl(Pl.statSync(e),e,t)}});var Nl=ie((lb,Al)=>{Al.exports=Zl;Zl.sync=Sh;var Ol=Oe("fs");function Zl(e,t,r){Ol.stat(e,function(o,n){r(o,o?!1:Il(n,t))})}function Sh(e,t){return Il(Ol.statSync(e),t)}function Il(e,t){return e.isFile()&&kh(e,t)}function kh(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 Ml=ie((db,jl)=>{var pb=Oe("fs"),no;process.platform==="win32"||global.TESTING_WINDOWS?no=Cl():no=Nl();jl.exports=ss;ss.sync=$h;function ss(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){ss(e,t||{},function(s,i){s?n(s):o(i)})})}no(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function $h(e,t){try{return no.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hl=ie((fb,Vl)=>{var vt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dl=Oe("path"),Ph=vt?";":":",Ll=Ml(),Ul=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ql=(e,t)=>{let r=t.colon||Ph,o=e.match(/\//)||vt&&e.match(/\\/)?[""]:[...vt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=vt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vt?n.split(r):[""];return vt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},Fl=(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(Ul(e));let h=o[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,z=Dl.join(m,e),S=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+z:z;p(c(S,u,0))}),c=(u,p,d)=>new Promise((h,m)=>{if(d===n.length)return h(a(p+1));let z=n[d];Ll(u+z,{pathExt:s},(S,k)=>{if(!S&&k)if(t.all)i.push(u+z);else return h(u+z);return h(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Th=(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=Dl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let h=p+o[d];try{if(Ll.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Ul(e)};Vl.exports=Fl;Fl.sync=Th});var Bl=ie((mb,is)=>{"use strict";var Jl=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};is.exports=Jl;is.exports.default=Jl});var Xl=ie((hb,Kl)=>{"use strict";var Wl=Oe("path"),Eh=Hl(),Rh=Bl();function Gl(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=Eh.sync(e.command,{path:r[Rh({env:r})],pathExt:t?Wl.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=Wl.resolve(n?e.options.cwd:"",i)),i}function Ch(e){return Gl(e)||Gl(e,!0)}Kl.exports=Ch});var Yl=ie((gb,cs)=>{"use strict";var as=/([()\][%!^"`<>&|;, *?])/g;function Oh(e){return e=e.replace(as,"^$1"),e}function Zh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(as,"^$1"),t&&(e=e.replace(as,"^$1")),e}cs.exports.command=Oh;cs.exports.argument=Zh});var ep=ie((_b,Ql)=>{"use strict";Ql.exports=/^#!(.*)/});var rp=ie((yb,tp)=>{"use strict";var Ih=ep();tp.exports=(e="")=>{let t=e.match(Ih);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var np=ie((xb,op)=>{"use strict";var us=Oe("fs"),Ah=rp();function Nh(e){let r=Buffer.alloc(150),o;try{o=us.openSync(e,"r"),us.readSync(o,r,0,150,0),us.closeSync(o)}catch{}return Ah(r.toString())}op.exports=Nh});var cp=ie((zb,ap)=>{"use strict";var jh=Oe("path"),sp=Xl(),ip=Yl(),Mh=np(),Dh=process.platform==="win32",Lh=/\.(?:com|exe)$/i,Uh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qh(e){e.file=sp(e);let t=e.file&&Mh(e.file);return t?(e.args.unshift(e.file),e.command=t,sp(e)):e.file}function Fh(e){if(!Dh)return e;let t=qh(e),r=!Lh.test(t);if(e.options.forceShell||r){let o=Uh.test(t);e.command=jh.normalize(e.command),e.command=ip.command(e.command),e.args=e.args.map(s=>ip.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 Vh(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:Fh(o)}ap.exports=Vh});var pp=ie((vb,lp)=>{"use strict";var ls=process.platform==="win32";function ps(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 Hh(e,t){if(!ls)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=up(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function up(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawn"):null}function Jh(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawnSync"):null}lp.exports={hookChildProcess:Hh,verifyENOENT:up,verifyENOENTSync:Jh,notFoundError:ps}});var mp=ie((wb,wt)=>{"use strict";var dp=Oe("child_process"),ds=cp(),fs=pp();function fp(e,t,r){let o=ds(e,t,r),n=dp.spawn(o.command,o.args,o.options);return fs.hookChildProcess(n,o),n}function Bh(e,t,r){let o=ds(e,t,r),n=dp.spawnSync(o.command,o.args,o.options);return n.error=n.error||fs.verifyENOENTSync(n.status,o),n}wt.exports=fp;wt.exports.spawn=fp;wt.exports.sync=Bh;wt.exports._parse=ds;wt.exports._enoent=fs});var zp=ie(hs=>{"use strict";var _p=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Qh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,yp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,eg=/\\([\u000b\u0020-\u00ff])/g,tg=/([\\"])/g,xp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;hs.format=rg;hs.parse=og;function rg(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!xp.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],!yp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+sg(t[n])}return o}function og(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ng(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(!xp.test(o))throw new TypeError("invalid media type");var n=new ig(o.toLowerCase());if(r!==-1){var s,i,a;for(_p.lastIndex=r;i=_p.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(eg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ng(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 sg(e){var t=String(e);if(yp.test(t))return t;if(t.length>0&&!Qh.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(tg,"\\$1")+'"'}function ig(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as dg,mkdirSync as fg,readFileSync as mg,writeFileSync as hg}from"node:fs";import{dirname as gg}from"node:path";import{isDeepStrictEqual as St}from"node:util";function bt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])we(r)&&t.set(r.name,r);return t}function fr(e,t,r){let o=bt(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 Ep(e,t){let r=bt(t);return fr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:fr(o.arguments,n,["example"])}})}function fo(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=we(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=>we(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=fr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Ep(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=fr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Rp(e,t){let r=bt(e),o=bt(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)&&!St(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 vs(e,t){if(St(e,t))return[];let r=we(e["x-mcp"])?e["x-mcp"]:{},o=we(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Rp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return St(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),St(r.capabilities,o.capabilities)||n.push("capabilities changed"),St(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var ws,mo=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 h=p[d];h in a||(a[h]=u[h].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.")}},tt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ws=globalThis).__zod_globalConfig??(ws.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ae(e){return e&&Object.assign(rt,e),rt}var C={};uo(C,{BIGINT_FORMAT_RANGES:()=>$s,Class:()=>go,NUMBER_FORMAT_RANGES:()=>wo,aborted:()=>Ae,allowsEval:()=>xo,assert:()=>Ap,assertEqual:()=>Cp,assertIs:()=>Zp,assertNever:()=>Ip,assertNotEqual:()=>Op,assignProp:()=>Ze,base64ToUint8Array:()=>Ts,base64urlToUint8Array:()=>Yp,cached:()=>nt,captureStackTrace:()=>gr,cleanEnum:()=>Xp,cleanRegex:()=>Tt,clone:()=>de,cloneDef:()=>jp,createTransparentProxy:()=>Fp,defineLazy:()=>I,esc:()=>hr,escapeRegex:()=>Se,explicitlyAborted:()=>bo,extend:()=>Jp,finalizeIssue:()=>fe,floatSafeRemainder:()=>_o,getElementAtPath:()=>Mp,getEnumValues:()=>$t,getLengthableOrigin:()=>Et,getParsedType:()=>qp,getSizableOrigin:()=>Ps,hexToUint8Array:()=>ed,isObject:()=>Fe,isPlainObject:()=>Ie,issue:()=>st,joinValues:()=>mr,jsonStringifyReplacer:()=>ot,merge:()=>Wp,mergeDefs:()=>be,normalizeParams:()=>w,nullish:()=>Pt,numKeys:()=>Up,objectClone:()=>Np,omit:()=>Hp,optionalKeys:()=>vo,parsedType:()=>So,partial:()=>Gp,pick:()=>Vp,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>Dp,propertyKeyTypes:()=>zo,randomString:()=>Lp,required:()=>Kp,safeExtend:()=>Bp,shallowClone:()=>Ss,slugify:()=>yo,stringifyPrimitive:()=>_r,uint8ArrayToBase64:()=>Es,uint8ArrayToBase64url:()=>Qp,uint8ArrayToHex:()=>td,unwrapMessage:()=>kt});function Cp(e){return e}function Op(e){return e}function Zp(e){}function Ip(e){throw new Error("Unexpected value in exhaustive check")}function Ap(e){}function $t(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 mr(e,t="|"){return e.map(r=>_r(r)).join(t)}function ot(e,t){return typeof t=="bigint"?t.toString():t}function nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(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 bs=Symbol("evaluating");function I(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==bs)return o===void 0&&(o=bs,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Np(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 be(...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 be(e._zod.def)}function Mp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Dp(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 Lp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hr(e){return JSON.stringify(e)}function yo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var gr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xo=nt(()=>{if(rt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ie(e){if(Fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Fe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ss(e){return Ie(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var qp=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}`)}},zo=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function w(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 Fp(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 _r(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var wo={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]},$s={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vp(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=be(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 de(e,s)}function Hp(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=be(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 de(e,s)}function Jp(e,t){if(!Ie(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=be(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return de(e,n)}function Bp(e,t){if(!Ie(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return de(e,r)}function Wp(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=be(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 de(e,r)}function Gp(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=be(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 de(t,i)}function Kp(e,t,r){let o=be(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 de(t,o)}function Ae(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 bo(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 ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kt(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){let o=e.message?e.message:kt(e.inst?._zod.def?.error?.(e))??kt(t?.error?.(e))??kt(r.customError?.(e))??kt(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 Ps(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Et(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function So(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 st(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Xp(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ts(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 Es(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Yp(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ts(t+r)}function Qp(e){return Es(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ed(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 td(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var go=class{constructor(...t){}};var Rs=(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,ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yr=f("$ZodError",Rs),ko=f("$ZodError",Rs,{Parent:Error});function $o(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 Po(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 xr=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=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var zr=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=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var Rt=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??yr)(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},Ct=Rt(ko),Ot=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=>fe(i,n,ae())))}:{success:!0,data:s.value}},vr=Ot(ko),Cs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return xr(e)(t,r,n)};var Os=e=>(t,r,o)=>xr(e)(t,r,o);var Zs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)};var Is=e=>async(t,r,o)=>zr(e)(t,r,o);var As=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rt(e)(t,r,n)};var Ns=e=>(t,r,o)=>Rt(e)(t,r,o);var js=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Ms=e=>async(t,r,o)=>Ot(e)(t,r,o);var Ds=/^[cC][0-9a-z]{6,}$/,Ls=/^[0-9a-z]+$/,Us=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qs=/^[0-9a-vA-V]{20}$/,Fs=/^[A-Za-z0-9]{27}$/,Vs=/^[a-zA-Z0-9_-]{21}$/,Hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Js=/^([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})$/,To=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 Bs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var od="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ws(){return new RegExp(od,"u")}var Gs=/^(?:(?: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])$/,Ks=/^(([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 Xs=/^((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])$/,Ys=/^(([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])$/,Qs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/;var ei=/^https?$/,ti=/^\+[1-9]\d{6,14}$/,ri="(?:(?:\\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])))",oi=new RegExp(`^${ri}$`);function ni(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 si(e){return new RegExp(`^${ni(e)}$`)}function ii(e){let t=ni({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(`^${ri}T(?:${o})$`)}var ai=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ci=/^-?\d+n?$/,ui=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,li=/^(?:true|false)$/i,pi=/^null$/i;var di=/^[^A-Z]*$/,fi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mi={number:"number",bigint:"bigint",object:"date"},Co=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=mi[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})}}),Oo=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=mi[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})}}),hi=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):_o(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})}}),gi=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]=wo[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=ui)}),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 _i=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yi=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(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})}}),It=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=()=>{})}),zi=f("$ZodCheckRegex",(e,t)=>{It.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})}}),vi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=di),It.init(e,t)}),wi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fi),It.init(e,t)}),bi=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Se(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})}}),Si=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Se(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})}}),ki=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Se(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 $i=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var wr=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{C as ys,D as xs,K as Pp,L as Tp,Q as lo,R as po,V as dr,X as ge,c as we,na as _e,oa as zs}from"./RW2ESAIF.js";import"./NEWT5A6S.js";import{a as Oe,c as ie,d as uo,e as pr}from"./RFWIIJFG.js";var Cl=ie((ub,Rl)=>{Rl.exports=El;El.sync=bh;var Pl=Oe("fs");function wh(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 Tl(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:wh(t,r)}function El(e,t,r){Pl.stat(e,function(o,n){r(o,o?!1:Tl(n,e,t))})}function bh(e,t){return Tl(Pl.statSync(e),e,t)}});var Nl=ie((lb,Al)=>{Al.exports=Zl;Zl.sync=Sh;var Ol=Oe("fs");function Zl(e,t,r){Ol.stat(e,function(o,n){r(o,o?!1:Il(n,t))})}function Sh(e,t){return Il(Ol.statSync(e),t)}function Il(e,t){return e.isFile()&&kh(e,t)}function kh(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 Ml=ie((db,jl)=>{var pb=Oe("fs"),no;process.platform==="win32"||global.TESTING_WINDOWS?no=Cl():no=Nl();jl.exports=ss;ss.sync=$h;function ss(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){ss(e,t||{},function(s,i){s?n(s):o(i)})})}no(e,t||{},function(o,n){o&&(o.code==="EACCES"||t&&t.ignoreErrors)&&(o=null,n=!1),r(o,n)})}function $h(e,t){try{return no.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Hl=ie((fb,Vl)=>{var vt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dl=Oe("path"),Ph=vt?";":":",Ll=Ml(),Ul=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ql=(e,t)=>{let r=t.colon||Ph,o=e.match(/\//)||vt&&e.match(/\\/)?[""]:[...vt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=vt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=vt?n.split(r):[""];return vt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:o,pathExt:s,pathExtExe:n}},Fl=(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(Ul(e));let h=o[u],m=/^".*"$/.test(h)?h.slice(1,-1):h,z=Dl.join(m,e),S=!m&&/^\.[\\\/]/.test(e)?e.slice(0,2)+z:z;p(c(S,u,0))}),c=(u,p,d)=>new Promise((h,m)=>{if(d===n.length)return h(a(p+1));let z=n[d];Ll(u+z,{pathExt:s},(S,k)=>{if(!S&&k)if(t.all)i.push(u+z);else return h(u+z);return h(c(u,p,d+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Th=(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=Dl.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let d=0;d<o.length;d++){let h=p+o[d];try{if(Ll.sync(h,{pathExt:n}))if(t.all)s.push(h);else return h}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Ul(e)};Vl.exports=Fl;Fl.sync=Th});var Bl=ie((mb,is)=>{"use strict";var Jl=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};is.exports=Jl;is.exports.default=Jl});var Xl=ie((hb,Kl)=>{"use strict";var Wl=Oe("path"),Eh=Hl(),Rh=Bl();function Gl(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=Eh.sync(e.command,{path:r[Rh({env:r})],pathExt:t?Wl.delimiter:void 0})}catch{}finally{s&&process.chdir(o)}return i&&(i=Wl.resolve(n?e.options.cwd:"",i)),i}function Ch(e){return Gl(e)||Gl(e,!0)}Kl.exports=Ch});var Yl=ie((gb,cs)=>{"use strict";var as=/([()\][%!^"`<>&|;, *?])/g;function Oh(e){return e=e.replace(as,"^$1"),e}function Zh(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(as,"^$1"),t&&(e=e.replace(as,"^$1")),e}cs.exports.command=Oh;cs.exports.argument=Zh});var ep=ie((_b,Ql)=>{"use strict";Ql.exports=/^#!(.*)/});var rp=ie((yb,tp)=>{"use strict";var Ih=ep();tp.exports=(e="")=>{let t=e.match(Ih);if(!t)return null;let[r,o]=t[0].replace(/#! ?/,"").split(" "),n=r.split("/").pop();return n==="env"?o:o?`${n} ${o}`:n}});var np=ie((xb,op)=>{"use strict";var us=Oe("fs"),Ah=rp();function Nh(e){let r=Buffer.alloc(150),o;try{o=us.openSync(e,"r"),us.readSync(o,r,0,150,0),us.closeSync(o)}catch{}return Ah(r.toString())}op.exports=Nh});var cp=ie((zb,ap)=>{"use strict";var jh=Oe("path"),sp=Xl(),ip=Yl(),Mh=np(),Dh=process.platform==="win32",Lh=/\.(?:com|exe)$/i,Uh=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qh(e){e.file=sp(e);let t=e.file&&Mh(e.file);return t?(e.args.unshift(e.file),e.command=t,sp(e)):e.file}function Fh(e){if(!Dh)return e;let t=qh(e),r=!Lh.test(t);if(e.options.forceShell||r){let o=Uh.test(t);e.command=jh.normalize(e.command),e.command=ip.command(e.command),e.args=e.args.map(s=>ip.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 Vh(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:Fh(o)}ap.exports=Vh});var pp=ie((vb,lp)=>{"use strict";var ls=process.platform==="win32";function ps(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 Hh(e,t){if(!ls)return;let r=e.emit;e.emit=function(o,n){if(o==="exit"){let s=up(n,t);if(s)return r.call(e,"error",s)}return r.apply(e,arguments)}}function up(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawn"):null}function Jh(e,t){return ls&&e===1&&!t.file?ps(t.original,"spawnSync"):null}lp.exports={hookChildProcess:Hh,verifyENOENT:up,verifyENOENTSync:Jh,notFoundError:ps}});var mp=ie((wb,wt)=>{"use strict";var dp=Oe("child_process"),ds=cp(),fs=pp();function fp(e,t,r){let o=ds(e,t,r),n=dp.spawn(o.command,o.args,o.options);return fs.hookChildProcess(n,o),n}function Bh(e,t,r){let o=ds(e,t,r),n=dp.spawnSync(o.command,o.args,o.options);return n.error=n.error||fs.verifyENOENTSync(n.status,o),n}wt.exports=fp;wt.exports.spawn=fp;wt.exports.sync=Bh;wt.exports._parse=ds;wt.exports._enoent=fs});var zp=ie(hs=>{"use strict";var _p=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Qh=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,yp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,eg=/\\([\u000b\u0020-\u00ff])/g,tg=/([\\"])/g,xp=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;hs.format=rg;hs.parse=og;function rg(e){if(!e||typeof e!="object")throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!xp.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],!yp.test(n))throw new TypeError("invalid parameter name");o+="; "+n+"="+sg(t[n])}return o}function og(e){if(!e)throw new TypeError("argument string is required");var t=typeof e=="object"?ng(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(!xp.test(o))throw new TypeError("invalid media type");var n=new ig(o.toLowerCase());if(r!==-1){var s,i,a;for(_p.lastIndex=r;i=_p.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(eg,"$1"))),n.parameters[s]=a}if(r!==t.length)throw new TypeError("invalid parameter format")}return n}function ng(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 sg(e){var t=String(e);if(yp.test(t))return t;if(t.length>0&&!Qh.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(tg,"\\$1")+'"'}function ig(e){this.parameters=Object.create(null),this.type=e}});import{existsSync as dg,mkdirSync as fg,readFileSync as mg,writeFileSync as hg}from"node:fs";import{dirname as gg}from"node:path";import{isDeepStrictEqual as St}from"node:util";function bt(e){let t=new Map;for(let r of Array.isArray(e)?e:[])we(r)&&t.set(r.name,r);return t}function fr(e,t,r){let o=bt(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 Ep(e,t){let r=bt(t);return fr(e,t,["tags","security"]).map(o=>{if(!o.arguments)return o;let n=r.get(o.name)?.arguments;return{...o,arguments:fr(o.arguments,n,["example"])}})}function fo(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=we(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=>we(a)&&a.url===r)||i.push({url:r}),s.servers=i}return t.capabilities&&(s.capabilities=t.capabilities),t.capabilities?.tools?s.tools=fr(t.tools,n.tools,["tags","security"]):delete s.tools,t.capabilities?.prompts?s.prompts=Ep(t.prompts,n.prompts):delete s.prompts,t.capabilities?.resources?s.resources=fr(t.resources,n.resources,["tags","security"]):delete s.resources,o["x-mcp"]=s,o}function Rp(e,t){let r=bt(e),o=bt(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)&&!St(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 vs(e,t){if(St(e,t))return[];let r=we(e["x-mcp"])?e["x-mcp"]:{},o=we(t["x-mcp"])?t["x-mcp"]:{},n=[];for(let s of["tools","prompts","resources"]){let i=Rp(r[s],o[s]);i&&n.push(`${s} - ${i}`)}return St(r.protocolVersion,o.protocolVersion)||n.push(`protocolVersion - ${r.protocolVersion??"not set"} -> ${o.protocolVersion}`),St(r.capabilities,o.capabilities)||n.push("capabilities changed"),St(r.servers,o.servers)||n.push("servers - the MCP server URL is not listed"),n.length===0&&n.push("x-mcp changed"),n}var ws,mo=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 h=p[d];h in a||(a[h]=u[h].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.")}},tt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(ws=globalThis).__zod_globalConfig??(ws.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ae(e){return e&&Object.assign(rt,e),rt}var C={};uo(C,{BIGINT_FORMAT_RANGES:()=>$s,Class:()=>go,NUMBER_FORMAT_RANGES:()=>wo,aborted:()=>Ae,allowsEval:()=>xo,assert:()=>Ap,assertEqual:()=>Cp,assertIs:()=>Zp,assertNever:()=>Ip,assertNotEqual:()=>Op,assignProp:()=>Ze,base64ToUint8Array:()=>Ts,base64urlToUint8Array:()=>Yp,cached:()=>nt,captureStackTrace:()=>gr,cleanEnum:()=>Xp,cleanRegex:()=>Tt,clone:()=>de,cloneDef:()=>jp,createTransparentProxy:()=>Fp,defineLazy:()=>I,esc:()=>hr,escapeRegex:()=>Se,explicitlyAborted:()=>bo,extend:()=>Jp,finalizeIssue:()=>fe,floatSafeRemainder:()=>_o,getElementAtPath:()=>Mp,getEnumValues:()=>$t,getLengthableOrigin:()=>Et,getParsedType:()=>qp,getSizableOrigin:()=>Ps,hexToUint8Array:()=>ed,isObject:()=>Fe,isPlainObject:()=>Ie,issue:()=>st,joinValues:()=>mr,jsonStringifyReplacer:()=>ot,merge:()=>Wp,mergeDefs:()=>be,normalizeParams:()=>w,nullish:()=>Pt,numKeys:()=>Up,objectClone:()=>Np,omit:()=>Hp,optionalKeys:()=>vo,parsedType:()=>So,partial:()=>Gp,pick:()=>Vp,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>Dp,propertyKeyTypes:()=>zo,randomString:()=>Lp,required:()=>Kp,safeExtend:()=>Bp,shallowClone:()=>Ss,slugify:()=>yo,stringifyPrimitive:()=>_r,uint8ArrayToBase64:()=>Es,uint8ArrayToBase64url:()=>Qp,uint8ArrayToHex:()=>td,unwrapMessage:()=>kt});function Cp(e){return e}function Op(e){return e}function Zp(e){}function Ip(e){throw new Error("Unexpected value in exhaustive check")}function Ap(e){}function $t(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 mr(e,t="|"){return e.map(r=>_r(r)).join(t)}function ot(e,t){return typeof t=="bigint"?t.toString():t}function nt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Pt(e){return e==null}function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(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 bs=Symbol("evaluating");function I(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==bs)return o===void 0&&(o=bs,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Np(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 be(...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 be(e._zod.def)}function Mp(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function Dp(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 Lp(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function hr(e){return JSON.stringify(e)}function yo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var gr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var xo=nt(()=>{if(rt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ie(e){if(Fe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Fe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ss(e){return Ie(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Up(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var qp=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}`)}},zo=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Se(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function de(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function w(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 Fp(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 _r(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function vo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var wo={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]},$s={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vp(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=be(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 de(e,s)}function Hp(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=be(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 de(e,s)}function Jp(e,t){if(!Ie(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=be(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return de(e,n)}function Bp(e,t){if(!Ie(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=be(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Ze(this,"shape",o),o}});return de(e,r)}function Wp(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=be(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 de(e,r)}function Gp(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=be(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 de(t,i)}function Kp(e,t,r){let o=be(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 de(t,o)}function Ae(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 bo(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 ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function kt(e){return typeof e=="string"?e:e?.message}function fe(e,t,r){let o=e.message?e.message:kt(e.inst?._zod.def?.error?.(e))??kt(t?.error?.(e))??kt(r.customError?.(e))??kt(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 Ps(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Et(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function So(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 st(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function Xp(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Ts(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 Es(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Yp(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Ts(t+r)}function Qp(e){return Es(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ed(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 td(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var go=class{constructor(...t){}};var Rs=(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,ot,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},yr=f("$ZodError",Rs),ko=f("$ZodError",Rs,{Parent:Error});function $o(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 Po(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 xr=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=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var zr=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=>fe(c,s,ae())));throw gr(a,n?.callee),a}return i.value};var Rt=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??yr)(s.issues.map(i=>fe(i,n,ae())))}:{success:!0,data:s.value}},Ct=Rt(ko),Ot=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=>fe(i,n,ae())))}:{success:!0,data:s.value}},vr=Ot(ko),Cs=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return xr(e)(t,r,n)};var Os=e=>(t,r,o)=>xr(e)(t,r,o);var Zs=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return zr(e)(t,r,n)};var Is=e=>async(t,r,o)=>zr(e)(t,r,o);var As=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Rt(e)(t,r,n)};var Ns=e=>(t,r,o)=>Rt(e)(t,r,o);var js=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ot(e)(t,r,n)};var Ms=e=>async(t,r,o)=>Ot(e)(t,r,o);var Ds=/^[cC][0-9a-z]{6,}$/,Ls=/^[0-9a-z]+$/,Us=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qs=/^[0-9a-vA-V]{20}$/,Fs=/^[A-Za-z0-9]{27}$/,Vs=/^[a-zA-Z0-9_-]{21}$/,Hs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Js=/^([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})$/,To=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 Bs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var od="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ws(){return new RegExp(od,"u")}var Gs=/^(?:(?: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])$/,Ks=/^(([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 Xs=/^((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])$/,Ys=/^(([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])$/,Qs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Eo=/^[A-Za-z0-9_-]*$/;var ei=/^https?$/,ti=/^\+[1-9]\d{6,14}$/,ri="(?:(?:\\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])))",oi=new RegExp(`^${ri}$`);function ni(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 si(e){return new RegExp(`^${ni(e)}$`)}function ii(e){let t=ni({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(`^${ri}T(?:${o})$`)}var ai=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ci=/^-?\d+n?$/,ui=/^-?\d+$/,Ro=/^-?\d+(?:\.\d+)?$/,li=/^(?:true|false)$/i,pi=/^null$/i;var di=/^[^A-Z]*$/,fi=/^[^a-z]*$/;var Q=f("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mi={number:"number",bigint:"bigint",object:"date"},Co=f("$ZodCheckLessThan",(e,t)=>{Q.init(e,t);let r=mi[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})}}),Oo=f("$ZodCheckGreaterThan",(e,t)=>{Q.init(e,t);let r=mi[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})}}),hi=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):_o(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})}}),gi=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]=wo[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=ui)}),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 _i=f("$ZodCheckMaxLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(n);o.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),yi=f("$ZodCheckMinLength",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(n);o.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckLengthEquals",(e,t)=>{var r;Q.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Pt(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=Et(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})}}),It=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=()=>{})}),zi=f("$ZodCheckRegex",(e,t)=>{It.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})}}),vi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=di),It.init(e,t)}),wi=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fi),It.init(e,t)}),bi=f("$ZodCheckIncludes",(e,t)=>{Q.init(e,t);let r=Se(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})}}),Si=f("$ZodCheckStartsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`^${Se(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})}}),ki=f("$ZodCheckEndsWith",(e,t)=>{Q.init(e,t);let r=new RegExp(`.*${Se(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 $i=f("$ZodCheckOverwrite",(e,t)=>{Q.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var wr=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 Ti={major:4,minor:4,patch:3};var A=f("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ti;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=Ae(i),p;for(let d of a){if(d._zod.def.when){if(bo(i)||!d._zod.def.when(i))continue}else if(u)continue;let h=i.issues.length,m=d._zod.check(i);if(m instanceof Promise&&c?.async===!1)throw new ve;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,i.issues.length!==h&&(u||(u=Ae(i,h)))});else{if(i.issues.length===h)continue;u||(u=Ae(i,h))}}return p?p.then(()=>i):i},s=(i,a,c)=>{if(Ae(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)}}I(e,"~standard",()=>({validate:n=>{try{let s=Ct(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vr(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),kr=f("$ZodString",(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ai(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}}),D=f("$ZodStringFormat",(e,t)=>{It.init(e,t),kr.init(e,t)}),ji=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Js),D.init(e,t)}),Mi=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=To(o))}else t.pattern??(t.pattern=To());D.init(e,t)}),Di=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bs),D.init(e,t)}),Li=f("$ZodURL",(e,t)=>{D.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===ei.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})}}}),Ui=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ws()),D.init(e,t)}),qi=f("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Vs),D.init(e,t)}),Fi=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ds),D.init(e,t)}),Vi=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ls),D.init(e,t)}),Hi=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Us),D.init(e,t)}),Ji=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=qs),D.init(e,t)}),Bi=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Fs),D.init(e,t)}),Wi=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ii(t)),D.init(e,t)}),Gi=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=oi),D.init(e,t)}),Ki=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=si(t)),D.init(e,t)}),Xi=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hs),D.init(e,t)}),Yi=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Gs),D.init(e,t),e._zod.bag.format="ipv4"}),Qi=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ks),D.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 ea=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Xs),D.init(e,t)}),ta=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ys),D.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 ra(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var oa=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qs),D.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ra(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function id(e){if(!Eo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ra(r)}var na=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Eo),D.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{id(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),sa=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ti),D.init(e,t)});function ad(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 ia=f("$ZodJWT",(e,t)=>{D.init(e,t),e._zod.check=r=>{ad(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Io=f("$ZodNumber",(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ro,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}}),aa=f("$ZodNumberFormat",(e,t)=>{gi.init(e,t),Io.init(e,t)}),ca=f("$ZodBoolean",(e,t)=>{A.init(e,t),e._zod.pattern=li,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}}),ua=f("$ZodBigInt",(e,t)=>{A.init(e,t),e._zod.pattern=ci,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 la=f("$ZodNull",(e,t)=>{A.init(e,t),e._zod.pattern=pi,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}}),pa=f("$ZodAny",(e,t)=>{A.init(e,t),e._zod.parse=r=>r}),da=f("$ZodUnknown",(e,t)=>{A.init(e,t),e._zod.parse=r=>r}),fa=f("$ZodNever",(e,t)=>{A.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});var ma=f("$ZodDate",(e,t)=>{A.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 Ei(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}var ha=f("$ZodArray",(e,t)=>{A.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=>Ei(u,r,i))):Ei(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Sr(e,t,r,o,n,s){let i=r in o;if(e.issues.length){if(n&&s&&!i)return;t.issues.push(...ke(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 ga(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=vo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function _a(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 h in t){if(h==="__proto__"||a.has(h))continue;if(u==="never"){i.push(h);continue}let m=c.run({value:t[h],issues:[]},o);m instanceof Promise?e.push(m.then(z=>Sr(z,r,h,t,p,d))):Sr(m,r,h,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 cd=f("$ZodObject",(e,t)=>{if(A.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=nt(()=>ga(t));I(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=Fe,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 h of i.keys){let m=d[h],z=m._zod.optin==="optional",S=m._zod.optout==="optional",k=m._zod.run({value:u[h],issues:[]},c);k instanceof Promise?p.push(k.then(B=>Sr(B,a,h,u,z,S))):Sr(k,a,h,u,z,S)}return s?_a(p,u,a,c,o.value,e):p.length?Promise.all(p).then(()=>a):a}}),ya=f("$ZodObjectJIT",(e,t)=>{cd.init(e,t);let r=e._zod.parse,o=nt(()=>ga(t)),n=h=>{let m=new wr(["shape","payload","ctx"]),z=o.value,S=P=>{let R=hr(P);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};m.write("const input = payload.value;");let k=Object.create(null),B=0;for(let P of z.keys)k[P]=`key_${B++}`;m.write("const newResult = {};");for(let P of z.keys){let R=k[P],_=hr(P),x=h[P],E=x?._zod?.optin==="optional",W=x?._zod?.optout==="optional";m.write(`const ${R} = ${S(P)};`),E&&W?m.write(`
10
10
  if (${R}.issues.length) {
@@ -79,9 +79,9 @@ ${_s}`,d++;return}if(ul(_,x,W)){h=_.slice(_.charCodeAt(x+6)===Be?x+7:x+6,E)||voi
79
79
  ${x}`,d++;break;case"id":x.includes("\0")||(u=x);break;case"retry":/^\d+$/.test(x)?o(parseInt(x,10)):r(new Wt(`Invalid \`retry\` value: "${x}"`,{type:"invalid-retry",value:x,line:E}));break;default:r(new Wt(`Unknown field "${_.length>20?`${_.slice(0,20)}\u2026`:_}"`,{type:"unknown-field",field:_,value:x,line:E}));break}}function P(){d>0&&t({id:u,event:h,data:p}),u=void 0,p="",d=0,h=void 0}function R(_={}){if(_.consume&&i.length>0){let x=i.join("");B(x,0,x.length)}c=!0,u=void 0,p="",d=0,h=void 0,i.length=0,a=0,m=!1}return{feed:z,reset:R}}function cl(e,t,r){return r===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function ul(e,t,r){return r===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var eo=class extends Event{constructor(t,r){var o,n;super(t),this.code=(o=r?.code)!=null?o:void 0,this.message=(n=r?.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,r,o){return o(ll(this),r)}[Symbol.for("Deno.customInspect")](t,r){return t(ll(this),r)}};function Gm(e){let t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Un(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Un).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Un(e.cause)}`:e.message:`${e}`}function ll(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var dl=e=>{throw TypeError(e)},Gn=(e,t,r)=>t.has(e)||dl("Cannot "+r),T=(e,t,r)=>(Gn(e,t,"read from private field"),r?r.call(e):t.get(e)),X=(e,t,r)=>t.has(e)?dl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),V=(e,t,r,o)=>(Gn(e,t,"write to private field"),t.set(e,r),r),Te=(e,t,r)=>(Gn(e,t,"access private method"),r),ue,We,mt,Qr,to,Xt,_t,Yt,Ue,ht,yt,gt,Gt,ze,qn,Fn,Vn,pl,Hn,Jn,Kt,Bn,Wn,Ge=class extends EventTarget{constructor(t,r){var o,n;super(),X(this,ze),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,X(this,ue),X(this,We),X(this,mt),X(this,Qr),X(this,to),X(this,Xt),X(this,_t),X(this,Yt,null),X(this,Ue),X(this,ht),X(this,yt,null),X(this,gt,null),X(this,Gt,null),X(this,Fn,async s=>{var i;T(this,ht).reset();let{body:a,redirected:c,status:u,headers:p}=s;if(u===204){Te(this,ze,Kt).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?V(this,mt,new URL(s.url)):V(this,mt,void 0),u!==200){Te(this,ze,Kt).call(this,`Non-200 status code (${u})`,u);return}if(!(p.get("content-type")||"").startsWith("text/event-stream")){Te(this,ze,Kt).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(T(this,ue)===this.CLOSED)return;V(this,ue,this.OPEN);let d=new Event("open");if((i=T(this,Gt))==null||i.call(this,d),this.dispatchEvent(d),typeof a!="object"||!a||!("getReader"in a)){Te(this,ze,Kt).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}let h=new TextDecoder,m=a.getReader(),z=!0;do{let{done:S,value:k}=await m.read();k&&T(this,ht).feed(h.decode(k,{stream:!S})),S&&(z=!1,T(this,ht).reset(),Te(this,ze,Bn).call(this))}while(z)}),X(this,Vn,s=>{V(this,Ue,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Te(this,ze,Bn).call(this,Un(s))}),X(this,Hn,s=>{typeof s.id=="string"&&V(this,Yt,s.id);let i=new MessageEvent(s.event||"message",{data:s.data,origin:T(this,mt)?T(this,mt).origin:T(this,We).origin,lastEventId:s.id||""});T(this,gt)&&(!s.event||s.event==="message")&&T(this,gt).call(this,i),this.dispatchEvent(i)}),X(this,Jn,s=>{V(this,Xt,s)}),X(this,Wn,()=>{V(this,_t,void 0),T(this,ue)===this.CONNECTING&&Te(this,ze,qn).call(this)});try{if(t instanceof URL)V(this,We,t);else if(typeof t=="string")V(this,We,new URL(t,Km()));else throw new Error("Invalid URL")}catch{throw Gm("An invalid or illegal string was specified")}V(this,ht,Yr({onEvent:T(this,Hn),onRetry:T(this,Jn)})),V(this,ue,this.CONNECTING),V(this,Xt,3e3),V(this,to,(o=r?.fetch)!=null?o:globalThis.fetch),V(this,Qr,(n=r?.withCredentials)!=null?n:!1),Te(this,ze,qn).call(this)}get readyState(){return T(this,ue)}get url(){return T(this,We).href}get withCredentials(){return T(this,Qr)}get onerror(){return T(this,yt)}set onerror(t){V(this,yt,t)}get onmessage(){return T(this,gt)}set onmessage(t){V(this,gt,t)}get onopen(){return T(this,Gt)}set onopen(t){V(this,Gt,t)}addEventListener(t,r,o){let n=r;super.addEventListener(t,n,o)}removeEventListener(t,r,o){let n=r;super.removeEventListener(t,n,o)}close(){T(this,_t)&&clearTimeout(T(this,_t)),T(this,ue)!==this.CLOSED&&(T(this,Ue)&&T(this,Ue).abort(),V(this,ue,this.CLOSED),V(this,Ue,void 0))}};ue=new WeakMap,We=new WeakMap,mt=new WeakMap,Qr=new WeakMap,to=new WeakMap,Xt=new WeakMap,_t=new WeakMap,Yt=new WeakMap,Ue=new WeakMap,ht=new WeakMap,yt=new WeakMap,gt=new WeakMap,Gt=new WeakMap,ze=new WeakSet,qn=function(){V(this,ue,this.CONNECTING),V(this,Ue,new AbortController),T(this,to)(T(this,We),Te(this,ze,pl).call(this)).then(T(this,Fn)).catch(T(this,Vn))},Fn=new WeakMap,Vn=new WeakMap,pl=function(){var e;let t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...T(this,Yt)?{"Last-Event-ID":T(this,Yt)}:void 0},cache:"no-store",signal:(e=T(this,Ue))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Hn=new WeakMap,Jn=new WeakMap,Kt=function(e,t){var r;T(this,ue)!==this.CLOSED&&V(this,ue,this.CLOSED);let o=new eo("error",{code:t,message:e});(r=T(this,yt))==null||r.call(this,o),this.dispatchEvent(o)},Bn=function(e,t){var r;if(T(this,ue)===this.CLOSED)return;V(this,ue,this.CONNECTING);let o=new eo("error",{code:t,message:e});(r=T(this,yt))==null||r.call(this,o),this.dispatchEvent(o),V(this,_t,setTimeout(T(this,Wn),T(this,Xt)))},Wn=new WeakMap,Ge.CONNECTING=0,Ge.OPEN=1,Ge.CLOSED=2;function Km(){let e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function xt(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function ro(e=fetch,t){return t?async(r,o)=>{let n={...t,...o,headers:o?.headers?{...xt(t.headers),...xt(o.headers)}:t.headers};return e(r,n)}:e}var Kn;Kn=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(e=>e.webcrypto);async function Xm(e){return(await Kn).getRandomValues(new Uint8Array(e))}async function Ym(e){let t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r=Math.pow(2,8)-Math.pow(2,8)%t.length,o="";for(;o.length<e;){let n=await Xm(e-o.length);for(let s of n)s<r&&(o+=t[s%t.length])}return o}async function Qm(e){return await Ym(e)}async function eh(e){let t=await(await Kn).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Xn(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Qm(e),r=await eh(t);return{code_verifier:t,code_challenge:r}}var oe=vu().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Au.custom,message:"URL must be parseable",fatal:!0}),mo}).refine(e=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),ml=G({resource:l().url(),authorization_servers:g(oe).optional(),jwks_uri:l().url().optional(),scopes_supported:g(l()).optional(),bearer_methods_supported:g(l()).optional(),resource_signing_alg_values_supported:g(l()).optional(),resource_name:l().optional(),resource_documentation:l().optional(),resource_policy_uri:l().url().optional(),resource_tos_uri:l().url().optional(),tls_client_certificate_bound_access_tokens:j().optional(),authorization_details_types_supported:g(l()).optional(),dpop_signing_alg_values_supported:g(l()).optional(),dpop_bound_access_tokens_required:j().optional()}),Yn=G({issuer:l(),authorization_endpoint:oe,token_endpoint:oe,registration_endpoint:oe.optional(),scopes_supported:g(l()).optional(),response_types_supported:g(l()),response_modes_supported:g(l()).optional(),grant_types_supported:g(l()).optional(),token_endpoint_auth_methods_supported:g(l()).optional(),token_endpoint_auth_signing_alg_values_supported:g(l()).optional(),service_documentation:oe.optional(),revocation_endpoint:oe.optional(),revocation_endpoint_auth_methods_supported:g(l()).optional(),revocation_endpoint_auth_signing_alg_values_supported:g(l()).optional(),introspection_endpoint:l().optional(),introspection_endpoint_auth_methods_supported:g(l()).optional(),introspection_endpoint_auth_signing_alg_values_supported:g(l()).optional(),code_challenge_methods_supported:g(l()).optional(),client_id_metadata_document_supported:j().optional()}),th=G({issuer:l(),authorization_endpoint:oe,token_endpoint:oe,userinfo_endpoint:oe.optional(),jwks_uri:oe,registration_endpoint:oe.optional(),scopes_supported:g(l()).optional(),response_types_supported:g(l()),response_modes_supported:g(l()).optional(),grant_types_supported:g(l()).optional(),acr_values_supported:g(l()).optional(),subject_types_supported:g(l()),id_token_signing_alg_values_supported:g(l()),id_token_encryption_alg_values_supported:g(l()).optional(),id_token_encryption_enc_values_supported:g(l()).optional(),userinfo_signing_alg_values_supported:g(l()).optional(),userinfo_encryption_alg_values_supported:g(l()).optional(),userinfo_encryption_enc_values_supported:g(l()).optional(),request_object_signing_alg_values_supported:g(l()).optional(),request_object_encryption_alg_values_supported:g(l()).optional(),request_object_encryption_enc_values_supported:g(l()).optional(),token_endpoint_auth_methods_supported:g(l()).optional(),token_endpoint_auth_signing_alg_values_supported:g(l()).optional(),display_values_supported:g(l()).optional(),claim_types_supported:g(l()).optional(),claims_supported:g(l()).optional(),service_documentation:l().optional(),claims_locales_supported:g(l()).optional(),ui_locales_supported:g(l()).optional(),claims_parameter_supported:j().optional(),request_parameter_supported:j().optional(),request_uri_parameter_supported:j().optional(),require_request_uri_registration:j().optional(),op_policy_uri:oe.optional(),op_tos_uri:oe.optional(),client_id_metadata_document_supported:j().optional()}),hl=y({...th.shape,...Yn.pick({code_challenge_methods_supported:!0}).shape}),gl=y({access_token:l(),id_token:l().optional(),token_type:l(),expires_in:Ir.number().optional(),scope:l().optional(),refresh_token:l().optional()}).strip(),_l=y({error:l(),error_description:l().optional(),error_uri:l().optional()}),fl=oe.optional().or(v("").transform(()=>{})),rh=y({redirect_uris:g(oe),token_endpoint_auth_method:l().optional(),grant_types:g(l()).optional(),response_types:g(l()).optional(),client_name:l().optional(),client_uri:oe.optional(),logo_uri:fl,scope:l().optional(),contacts:g(l()).optional(),tos_uri:fl,policy_uri:l().optional(),jwks_uri:oe.optional(),jwks:Su().optional(),software_id:l().optional(),software_version:l().optional(),software_statement:l().optional()}).strip(),oh=y({client_id:l(),client_secret:l().optional(),client_id_issued_at:Z().optional(),client_secret_expires_at:Z().optional()}).strip(),yl=rh.merge(oh),Jw=y({error:l(),error_description:l().optional()}).strip(),Bw=y({token:l(),token_type_hint:l().optional()}).strip();function xl(e){let t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function zl({requestedResource:e,configuredResource:t}){let r=typeof e=="string"?new URL(e):new URL(e.href),o=typeof t=="string"?new URL(t):new URL(t.href);if(r.origin!==o.origin||r.pathname.length<o.pathname.length)return!1;let n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",s=o.pathname.endsWith("/")?o.pathname:o.pathname+"/";return n.startsWith(s)}var J=class extends Error{constructor(t,r){super(t),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}},Qt=class extends J{};Qt.errorCode="invalid_request";var Ke=class extends J{};Ke.errorCode="invalid_client";var Xe=class extends J{};Xe.errorCode="invalid_grant";var Ye=class extends J{};Ye.errorCode="unauthorized_client";var er=class extends J{};er.errorCode="unsupported_grant_type";var tr=class extends J{};tr.errorCode="invalid_scope";var rr=class extends J{};rr.errorCode="access_denied";var Ee=class extends J{};Ee.errorCode="server_error";var or=class extends J{};or.errorCode="temporarily_unavailable";var nr=class extends J{};nr.errorCode="unsupported_response_type";var sr=class extends J{};sr.errorCode="unsupported_token_type";var ir=class extends J{};ir.errorCode="invalid_token";var ar=class extends J{};ar.errorCode="method_not_allowed";var cr=class extends J{};cr.errorCode="too_many_requests";var Qe=class extends J{};Qe.errorCode="invalid_client_metadata";var ur=class extends J{};ur.errorCode="insufficient_scope";var lr=class extends J{};lr.errorCode="invalid_target";var vl={[Qt.errorCode]:Qt,[Ke.errorCode]:Ke,[Xe.errorCode]:Xe,[Ye.errorCode]:Ye,[er.errorCode]:er,[tr.errorCode]:tr,[rr.errorCode]:rr,[Ee.errorCode]:Ee,[or.errorCode]:or,[nr.errorCode]:nr,[sr.errorCode]:sr,[ir.errorCode]:ir,[ar.errorCode]:ar,[cr.errorCode]:cr,[Qe.errorCode]:Qe,[ur.errorCode]:ur,[lr.errorCode]:lr};var se=class extends Error{constructor(t){super(t??"Unauthorized")}};function nh(e){return["client_secret_basic","client_secret_post","none"].includes(e)}var Qn="code",es="S256";function sh(e,t){let r=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&nh(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?r?"client_secret_basic":"none":r&&t.includes("client_secret_basic")?"client_secret_basic":r&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":r?"client_secret_post":"none"}function ih(e,t,r,o){let{client_id:n,client_secret:s}=t;switch(e){case"client_secret_basic":ah(n,s,r);return;case"client_secret_post":ch(n,s,o);return;case"none":uh(n,o);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function ah(e,t,r){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");let o=btoa(`${e}:${t}`);r.set("Authorization",`Basic ${o}`)}function ch(e,t,r){r.set("client_id",e),t&&r.set("client_secret",t)}function uh(e,t){t.set("client_id",e)}async function bl(e){let t=e instanceof Response?e.status:void 0,r=e instanceof Response?await e.text():e;try{let o=_l.parse(JSON.parse(r)),{error:n,error_description:s,error_uri:i}=o,a=vl[n]||Ee;return new a(s||"",i)}catch(o){let n=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${o}. Raw body: ${r}`;return new Ee(n)}}async function Re(e,t){try{return await ts(e,t)}catch(r){if(r instanceof Ke||r instanceof Ye)return await e.invalidateCredentials?.("all"),await ts(e,t);if(r instanceof Xe)return await e.invalidateCredentials?.("tokens"),await ts(e,t);throw r}}async function ts(e,{serverUrl:t,authorizationCode:r,scope:o,resourceMetadataUrl:n,fetchFn:s}){let i=await e.discoveryState?.(),a,c,u,p=n;if(!p&&i?.resourceMetadataUrl&&(p=new URL(i.resourceMetadataUrl)),i?.authorizationServerUrl){if(c=i.authorizationServerUrl,a=i.resourceMetadata,u=i.authorizationServerMetadata??await kl(c,{fetchFn:s}),!a)try{a=await Sl(t,{resourceMetadataUrl:p},s)}catch{}(u!==i.authorizationServerMetadata||a!==i.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:p?.toString(),resourceMetadata:a,authorizationServerMetadata:u})}else{let P=await gh(t,{resourceMetadataUrl:p,fetchFn:s});c=P.authorizationServerUrl,u=P.authorizationServerMetadata,a=P.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:p?.toString(),resourceMetadata:a,authorizationServerMetadata:u})}let d=await ph(t,e,a),h=o||a?.scopes_supported?.join(" ")||e.clientMetadata.scope,m=await Promise.resolve(e.clientInformation());if(!m){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");let P=u?.client_id_metadata_document_supported===!0,R=e.clientMetadataUrl;if(R&&!lh(R))throw new Qe(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(P&&R)m={client_id:R},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let x=await vh(c,{metadata:u,clientMetadata:e.clientMetadata,scope:h,fetchFn:s});await e.saveClientInformation(x),m=x}}let z=!e.redirectUrl;if(r!==void 0||z){let P=await zh(e,c,{metadata:u,resource:d,authorizationCode:r,fetchFn:s});return await e.saveTokens(P),"AUTHORIZED"}let S=await e.tokens();if(S?.refresh_token)try{let P=await xh(c,{metadata:u,clientInformation:m,refreshToken:S.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:s});return await e.saveTokens(P),"AUTHORIZED"}catch(P){if(!(!(P instanceof J)||P instanceof Ee))throw P}let k=e.state?await e.state():void 0,{authorizationUrl:B,codeVerifier:O}=await _h(c,{metadata:u,clientInformation:m,state:k,redirectUrl:e.redirectUrl,scope:h,resource:d});return await e.saveCodeVerifier(O),await e.redirectToAuthorization(B),"REDIRECT"}function lh(e){if(!e)return!1;try{let t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function ph(e,t,r){let o=xl(e);if(t.validateResourceURL)return await t.validateResourceURL(o,r?.resource);if(r){if(!zl({requestedResource:o,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${o} (or origin)`);return new URL(r.resource)}}function zt(e){let t=e.headers.get("WWW-Authenticate");if(!t)return{};let[r,o]=t.split(" ");if(r.toLowerCase()!=="bearer"||!o)return{};let n=rs(e,"resource_metadata")||void 0,s;if(n)try{s=new URL(n)}catch{}let i=rs(e,"scope")||void 0,a=rs(e,"error")||void 0;return{resourceMetadataUrl:s,scope:i,error:a}}function rs(e,t){let r=e.headers.get("WWW-Authenticate");if(!r)return null;let o=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),n=r.match(o);return n?n[1]||n[2]:null}async function Sl(e,t,r=fetch){let o=await mh(e,"oauth-protected-resource",r,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!o||o.status===404)throw await o?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!o.ok)throw await o.body?.cancel(),new Error(`HTTP ${o.status} trying to load well-known OAuth protected resource metadata.`);return ml.parse(await o.json())}async function os(e,t,r=fetch){try{return await r(e,{headers:t})}catch(o){if(o instanceof TypeError)return t?os(e,void 0,r):void 0;throw o}}function dh(e,t="",r={}){return t.endsWith("/")&&(t=t.slice(0,-1)),r.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function wl(e,t,r=fetch){return await os(e,{"MCP-Protocol-Version":t},r)}function fh(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function mh(e,t,r,o){let n=new URL(e),s=o?.protocolVersion??pt,i;if(o?.metadataUrl)i=new URL(o.metadataUrl);else{let c=dh(t,n.pathname);i=new URL(c,o?.metadataServerUrl??n),i.search=n.search}let a=await wl(i,s,r);if(!o?.metadataUrl&&fh(a,n.pathname)){let c=new URL(`/.well-known/${t}`,n);a=await wl(c,s,r)}return a}function hh(e){let t=typeof e=="string"?new URL(e):e,r=t.pathname!=="/",o=[];if(!r)return o.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),o.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),o;let n=t.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),o.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,t.origin),type:"oauth"}),o.push({url:new URL(`/.well-known/openid-configuration${n}`,t.origin),type:"oidc"}),o.push({url:new URL(`${n}/.well-known/openid-configuration`,t.origin),type:"oidc"}),o}async function kl(e,{fetchFn:t=fetch,protocolVersion:r=pt}={}){let o={"MCP-Protocol-Version":r,Accept:"application/json"},n=hh(e);for(let{url:s,type:i}of n){let a=await os(s,o,t);if(a){if(!a.ok){if(await a.body?.cancel(),a.status>=400&&a.status<500)continue;throw new Error(`HTTP ${a.status} trying to load ${i==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return i==="oauth"?Yn.parse(await a.json()):hl.parse(await a.json())}}}async function gh(e,t){let r,o;try{r=await Sl(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(o=r.authorization_servers[0])}catch{}o||(o=String(new URL("/",e)));let n=await kl(o,{fetchFn:t?.fetchFn});return{authorizationServerUrl:o,authorizationServerMetadata:n,resourceMetadata:r}}async function _h(e,{metadata:t,clientInformation:r,redirectUrl:o,scope:n,state:s,resource:i}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Qn))throw new Error(`Incompatible auth server: does not support response type ${Qn}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(es))throw new Error(`Incompatible auth server: does not support code challenge method ${es}`)}else a=new URL("/authorize",e);let c=await Xn(),u=c.code_verifier,p=c.code_challenge;return a.searchParams.set("response_type",Qn),a.searchParams.set("client_id",r.client_id),a.searchParams.set("code_challenge",p),a.searchParams.set("code_challenge_method",es),a.searchParams.set("redirect_uri",String(o)),s&&a.searchParams.set("state",s),n&&a.searchParams.set("scope",n),n?.includes("offline_access")&&a.searchParams.append("prompt","consent"),i&&a.searchParams.set("resource",i.href),{authorizationUrl:a,codeVerifier:u}}function yh(e,t,r){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(r)})}async function $l(e,{metadata:t,tokenRequestParams:r,clientInformation:o,addClientAuthentication:n,resource:s,fetchFn:i}){let a=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),n)await n(c,r,a,t);else if(o){let p=t?.token_endpoint_auth_methods_supported??[],d=sh(o,p);ih(d,o,c,r)}let u=await(i??fetch)(a,{method:"POST",headers:c,body:r});if(!u.ok)throw await bl(u);return gl.parse(await u.json())}async function xh(e,{metadata:t,clientInformation:r,refreshToken:o,resource:n,addClientAuthentication:s,fetchFn:i}){let a=new URLSearchParams({grant_type:"refresh_token",refresh_token:o}),c=await $l(e,{metadata:t,tokenRequestParams:a,clientInformation:r,addClientAuthentication:s,resource:n,fetchFn:i});return{refresh_token:o,...c}}async function zh(e,t,{metadata:r,resource:o,authorizationCode:n,fetchFn:s}={}){let i=e.clientMetadata.scope,a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(i)),!a){if(!n)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let u=await e.codeVerifier();a=yh(n,u,e.redirectUrl)}let c=await e.clientInformation();return $l(t,{metadata:r,tokenRequestParams:a,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:o,fetchFn:s})}async function vh(e,{metadata:t,clientMetadata:r,scope:o,fetchFn:n}){let s;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(t.registration_endpoint)}else s=new URL("/register",e);let i=await(n??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...o!==void 0?{scope:o}:{}})});if(!i.ok)throw await bl(i);return yl.parse(await i.json())}var ns=class extends Error{constructor(t,r,o){super(`SSE error: ${r}`),this.code=t,this.event=o}},oo=class{constructor(t,r){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=ro(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new se("No auth provider");let t;try{t=await Re(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new se;return await this._startOrAuth()}async _commonHeaders(){let t={};if(this._authProvider){let o=await this._authProvider.tokens();o&&(t.Authorization=`Bearer ${o.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=xt(this._requestInit?.headers);return new Headers({...t,...r})}_startOrAuth(){let t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,o)=>{this._eventSource=new Ge(this._url.href,{...this._eventSourceInit,fetch:async(n,s)=>{let i=await this._commonHeaders();i.set("Accept","text/event-stream");let a=await t(n,{...s,headers:i});if(a.status===401&&a.headers.has("www-authenticate")){let{resourceMetadataUrl:c,scope:u}=zt(a);this._resourceMetadataUrl=c,this._scope=u}return a}}),this._abortController=new AbortController,this._eventSource.onerror=n=>{if(n.code===401&&this._authProvider){this._authThenStart().then(r,o);return}let s=new ns(n.code,n.message,n);o(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",n=>{let s=n;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(i){o(i),this.onerror?.(i),this.close();return}r()}),this._eventSource.onmessage=n=>{let s=n,i;try{i=De.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(i)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new se("No auth provider");if(await Re(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new se("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let o={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(t),signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._endpoint,o);if(!n.ok){let s=await n.text().catch(()=>null);if(n.status===401&&this._authProvider){let{resourceMetadataUrl:i,scope:a}=zt(n);if(this._resourceMetadataUrl=i,this._scope=a,await Re(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new se;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${n.status}): ${s}`)}await n.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(t){this._protocolVersion=t}};var gp=pr(mp(),1);import ms from"node:process";import{PassThrough as Kh}from"node:stream";var Wh=10*1024*1024,so=class{constructor(t){this._maxBufferSize=t?.maxBufferSize??Wh}append(t){if((this._buffer?.length??0)+t.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
80
80
  `);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),Gh(r)}clear(){this._buffer=void 0}};function Gh(e){return De.parse(JSON.parse(e))}function hp(e){return JSON.stringify(e)+`
81
81
  `}var Xh=ms.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Yh(){let e={};for(let t of Xh){let r=ms.env[t];r!==void 0&&(r.startsWith("()")||(e[t]=r))}return e}var io=class{constructor(t){this._stderrStream=null,this._serverParams=t,this._readBuffer=new so({maxBufferSize:t.maxBufferSize}),(t.stderr==="pipe"||t.stderr==="overlapped")&&(this._stderrStream=new Kh)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,r)=>{this._process=(0,gp.default)(this._serverParams.command,this._serverParams.args??[],{env:{...Yh(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:ms.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",o=>{r(o),this.onerror?.(o)}),this._process.on("spawn",()=>{t()}),this._process.on("close",o=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",o=>{this.onerror?.(o)}),this._process.stdout?.on("data",o=>{try{this._readBuffer.append(o),this.processReadBuffer()}catch(n){this.onerror?.(n),this.close().catch(()=>{})}}),this._process.stdout?.on("error",o=>{this.onerror?.(o)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){if(this._process){let t=this._process;this._process=void 0;let r=new Promise(o=>{t.once("close",()=>{o()})});try{t.stdin?.end()}catch{}if(await Promise.race([r,new Promise(o=>setTimeout(o,2e3).unref())]),t.exitCode===null){try{t.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(o=>setTimeout(o,2e3).unref())])}if(t.exitCode===null)try{t.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(t){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let o=hp(t);this._process.stdin.write(o)?r():this._process.stdin.once("drain",r)})}};var vp=pr(zp(),1);function wp(e){if(e)try{return vp.default.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();return t===""||e.slice(t.length).includes(",")?void 0:t}}var ao=class extends TransformStream{constructor({onError:t,onRetry:r,onComment:o,maxBufferSize:n}={}){let s;super({start(i){s=Yr({onEvent:a=>{i.enqueue(a)},onError(a){typeof t=="function"&&t(a),(t==="terminate"||a.type==="max-buffer-size-exceeded")&&i.error(a)},onRetry:r,onComment:o,maxBufferSize:n})},transform(i){s.feed(i)}})}};var ag={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},qe=class extends Error{constructor(t,r){super(`Streamable HTTP error: ${r}`),this.code=t}},co=class{constructor(t,r){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=ro(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??ag}async _authThenStart(){if(!this._authProvider)throw new se("No auth provider");let t;try{t=await Re(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(t!=="AUTHORIZED")throw new se;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let t={};if(this._authProvider){let o=await this._authProvider.tokens();o&&(t.Authorization=`Bearer ${o.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);let r=xt(this._requestInit?.headers);return new Headers({...t,...r})}async _startOrAuthSse(t){let{resumptionToken:r}=t;try{let o=await this._commonHeaders();o.set("Accept","text/event-stream"),r&&o.set("last-event-id",r);let n=await(this._fetch??fetch)(this._url,{method:"GET",headers:o,signal:this._abortController?.signal});if(!n.ok){if(await n.body?.cancel(),n.status===401&&this._authProvider)return await this._authThenStart();if(n.status===405)return;throw new qe(n.status,`Failed to open SSE stream: ${n.statusText}`)}this._handleSseStream(n.body,t,!0)}catch(o){throw this.onerror?.(o),o}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,o=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(o,t),n)}_scheduleReconnection(t,r=0){let o=this._reconnectionOptions.maxRetries;if(r>=o){this.onerror?.(new Error(`Maximum reconnection attempts (${o}) exceeded.`));return}let n=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(t,r+1)})},n)}_handleSseStream(t,r,o){if(!t)return;let{onresumptiontoken:n,replayMessageId:s}=r,i,a=!1,c=!1;(async()=>{try{let p=t.pipeThrough(new TextDecoderStream).pipeThrough(new ao({onRetry:m=>{this._serverRetryMs=m}})).getReader();for(;;){let{value:m,done:z}=await p.read();if(z)break;if(m.id&&(i=m.id,a=!0,n?.(m.id)),!!m.data&&(!m.event||m.event==="message"))try{let S=De.parse(JSON.parse(m.data));Ve(S)&&(c=!0,s!==void 0&&(S.id=s)),this.onmessage?.(S)}catch(S){this.onerror?.(S)}}(o||a)&&!c&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:i,onresumptiontoken:n,replayMessageId:s},0)}catch(p){if(this.onerror?.(new Error(`SSE stream disconnected: ${p}`)),(o||a)&&!c&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:i,onresumptiontoken:n,replayMessageId:s},0)}catch(m){this.onerror?.(new Error(`Failed to reconnect: ${m instanceof Error?m.message:String(m)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new se("No auth provider");if(await Re(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new se("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,r){try{let{resumptionToken:o,onresumptiontoken:n}=r||{};if(o){this._startOrAuthSse({resumptionToken:o,replayMessageId:Lt(t)?t.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let i={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(t),signal:this._abortController?.signal},a=await(this._fetch??fetch)(this._url,i),c=a.headers.get("mcp-session-id");if(c&&(this._sessionId=c),!a.ok){let m=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new qe(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:z,scope:S}=zt(a);if(this._resourceMetadataUrl=z,this._scope=S,await Re(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new se;return this._hasCompletedAuthFlow=!0,this.send(t)}if(a.status===403&&this._authProvider){let{resourceMetadataUrl:z,scope:S,error:k}=zt(a);if(k==="insufficient_scope"){let B=a.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===B)throw new qe(403,"Server returned 403 after trying upscoping");if(S&&(this._scope=S),z&&(this._resourceMetadataUrl=z),this._lastUpscopingHeader=B??void 0,await Re(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new se;return this.send(t)}}throw new qe(a.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,a.status===202){await a.body?.cancel(),Ju(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let p=(Array.isArray(t)?t:[t]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,d=a.headers.get("content-type"),h=wp(d);if(p)if(h==="text/event-stream")this._handleSseStream(a.body,{onresumptiontoken:n},!1);else if(h==="application/json"){let m=await a.json(),z=Array.isArray(m)?m.map(S=>De.parse(S)):[De.parse(m)];for(let S of z)this.onmessage?.(S)}else throw await a.body?.cancel(),new qe(-1,`Unexpected content type: ${d}`);else await a.body?.cancel()}catch(o){throw this.onerror?.(o),o}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let t=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,r);if(await o.body?.cancel(),!o.ok&&o.status!==405)throw new qe(o.status,`Failed to terminate session: ${o.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,r){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:r?.onresumptiontoken})}};async function gs(e){let t=[],r;do{let o=await e(r);t.push(...o.items),r=o.nextCursor}while(r);return t}function cg(e){let t,r=e.setProtocolVersion?.bind(e);return e.setProtocolVersion=o=>{t=o,r?.(o)},()=>t}function ug(){let e={};for(let[t,r]of Object.entries(process.env))r!==void 0&&(e[t]=r);return e}function lg(e){return e.kind==="http"?e.url.href:`"${[e.command,...e.args].join(" ")}"`}async function pg(e,t){let r=e.kind==="stdio"?[()=>new io({command:e.command,args:e.args,env:ug()})]:[()=>new co(e.url,{requestInit:{headers:e.headers}}),()=>new oo(e.url,{requestInit:{headers:e.headers}})],o;for(let[n,s]of r.entries()){n>0&&ge.info(dr(` Retrying with the legacy HTTP+SSE transport...
82
- `));let i=s(),a=cg(i),c=new Xr({name:"redocly-cli",version:t});try{return await c.connect(i),{mcpClient:c,getProtocolVersion:a}}catch(u){o??=u,await c.close().catch(()=>{})}}_e(`Failed to connect to the MCP server at ${lg(e)}: ${o instanceof Error?o.message:String(o)}`)}async function bp(e,t){let{mcpClient:r,getProtocolVersion:o}=await pg(e,t);try{let n=r.getServerCapabilities(),s=n?.tools?await gs(async c=>{let u=await r.listTools({cursor:c});return{items:u.tools,nextCursor:u.nextCursor}}):[],i=n?.prompts?await gs(async c=>{let u=await r.listPrompts({cursor:c});return{items:u.prompts,nextCursor:u.nextCursor}}):[],a=n?.resources?await gs(async c=>{let u=await r.listResources({cursor:c});return{items:u.resources,nextCursor:u.nextCursor}}):[];return{protocolVersion:o(),capabilities:n,serverInfo:r.getServerVersion(),instructions:r.getInstructions(),tools:s,prompts:i,resources:a}}finally{await r.close()}}function _g(e=[]){let t={};for(let r of e){let o=r.indexOf(":");o===-1&&_e(`Invalid header "${r}". Use the "Name: value" format.`);let n=r.slice(0,o).trim(),s=r.slice(o+1).trim();(!n||!s)&&_e(`Invalid header "${r}". Use the "Name: value" format.`),t[n]=s}return t}function yg(e){let t=[],r="",o,n=!1;for(let s of e)o?s===o?o=void 0:r+=s:s==='"'||s==="'"?(o=s,n=!0):/\s/.test(s)?(n||r)&&(t.push(r),r="",n=!1):r+=s;return o&&_e(`Unclosed ${o} quote in --command.`),(n||r)&&t.push(r),t}function xg(e){if(e.command){let[r,...o]=yg(e.command);return r||_e("The --command option cannot be empty."),{kind:"stdio",command:r,args:o}}let t;try{t=new URL(e["server-url"]??"")}catch{_e(`Invalid MCP server URL: ${e["server-url"]}.`)}return{kind:"http",url:t,headers:_g(e.header)}}async function tS({argv:e,version:t}){let r=xg(e),o=e.output;ge.info(dr(`
82
+ `));let i=s(),a=cg(i),c=new Xr({name:"redocly-cli",version:t});try{return await c.connect(i),{mcpClient:c,getProtocolVersion:a}}catch(u){o??=u,await c.close().catch(()=>{})}}throw new _e(`Failed to connect to the MCP server at ${lg(e)}: ${o instanceof Error?o.message:String(o)}`)}async function bp(e,t){let{mcpClient:r,getProtocolVersion:o}=await pg(e,t);try{let n=r.getServerCapabilities(),s=n?.tools?await gs(async c=>{let u=await r.listTools({cursor:c});return{items:u.tools,nextCursor:u.nextCursor}}):[],i=n?.prompts?await gs(async c=>{let u=await r.listPrompts({cursor:c});return{items:u.prompts,nextCursor:u.nextCursor}}):[],a=n?.resources?await gs(async c=>{let u=await r.listResources({cursor:c});return{items:u.resources,nextCursor:u.nextCursor}}):[];return{protocolVersion:o(),capabilities:n,serverInfo:r.getServerVersion(),instructions:r.getInstructions(),tools:s,prompts:i,resources:a}}finally{await r.close()}}function _g(e=[]){let t={};for(let r of e){let o=r.indexOf(":");if(o===-1)throw new _e(`Invalid header "${r}". Use the "Name: value" format.`);let n=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!n||!s)throw new _e(`Invalid header "${r}". Use the "Name: value" format.`);t[n]=s}return t}function yg(e){let t=[],r="",o,n=!1;for(let s of e)o?s===o?o=void 0:r+=s:s==='"'||s==="'"?(o=s,n=!0):/\s/.test(s)?(n||r)&&(t.push(r),r="",n=!1):r+=s;if(o)throw new _e(`Unclosed ${o} quote in --command.`);return(n||r)&&t.push(r),t}function xg(e){if(e.command){let[r,...o]=yg(e.command);if(!r)throw new _e("The --command option cannot be empty.");return{kind:"stdio",command:r,args:o}}let t;try{t=new URL(e["server-url"]??"")}catch{throw new _e(`Invalid MCP server URL: ${e["server-url"]}.`)}return{kind:"http",url:t,headers:_g(e.header)}}async function Qb({argv:e,version:t}){let r=xg(e),o=e.output;ge.info(dr(`
83
83
  Connecting to the MCP server at ${r.kind==="http"?r.url.href:e.command}...
84
- `));let n=await bp(r,t),s=!dg(o),i;if(!s){let p;try{p=ys(mg(o,"utf-8"))}catch(d){_e(`Failed to parse ${o}: ${d instanceof Error?d.message:String(d)}`)}we(p)||_e(`Expected ${o} to contain an OpenAPI description object.`),i=p}let a=r.kind==="http"?e["server-url"]:void 0;if(e.check){i||_e(`Cannot check ${o} - the file does not exist. Run the command without --check to create it.`);let p=fo(structuredClone(i),n,a),d=vs(i,p);if(d.length===0){ge.info(`
84
+ `));let n=await bp(r,t),s=!dg(o),i;if(!s){let p;try{p=ys(mg(o,"utf-8"))}catch(d){throw new _e(`Failed to parse ${o}: ${d instanceof Error?d.message:String(d)}`)}if(!we(p))throw new _e(`Expected ${o} to contain an OpenAPI description object.`);i=p}let a=r.kind==="http"?e["server-url"]:void 0;if(e.check){if(!i)throw new _e(`Cannot check ${o} - the file does not exist. Run the command without --check to create it.`);let p=fo(structuredClone(i),n,a),d=vs(i,p);if(d.length===0){ge.info(`
85
85
  `+po(`${lo(o)} is up to date with the MCP server.`)+`
86
86
  `);return}ge.error(`
87
87
  ${o} is out of date with the MCP server:
@@ -93,7 +93,7 @@ Run the command without --check to update it.
93
93
  `),ge.info(`
94
94
  `+po(`${s?"Created":"Updated"} ${lo(o)} with the MCP server capabilities in the x-mcp extension.`)+`
95
95
  `),s&&ge.warn(`The info section of ${o} is scaffolded - review and complete it.
96
- `)}export{tS as handleIntrospectMcp};
96
+ `)}export{Qb as handleIntrospectMcp};
97
97
  /*! Bundled license information:
98
98
 
99
99
  content-type/index.js:
@@ -4,12 +4,12 @@ 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 T,b as O,c as A,d as E}from"./T376AHHQ.js";import{c as m,k as C,r as $}from"./BNWXU2OA.js";import{a as R,b as y}from"./IMWIJK4I.js";import{a as q}from"./BXI4SF2U.js";import{W as u,c as H}from"./UWKKXZOE.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as V}from"node:fs";import{appendFile as N,mkdir as j,rm as _,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
8
- `,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await _(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await N(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await j(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
7
+ import{a as T,b as O,c as A,d as E}from"./23QBFBKB.js";import{c as m,k as C,r as $}from"./FUCJM4CG.js";import{a as q}from"./BXI4SF2U.js";import{X as u,c as H,na as y,oa as R}from"./RW2ESAIF.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as N}from"node:fs";import{appendFile as V,mkdir as _,rm as j,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
8
+ `,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await j(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await V(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await _(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
9
9
  "log": {
10
10
  "version": "1.2",
11
11
  "creator": ${n},
12
- "entries": [`);let o=0;if(V(this.entriesPath)){let s=G({input:F(this.entriesPath,{encoding:"utf8"}),crlfDelay:1/0});for await(let i of s)i.trim()&&(await r(`${o===0?`
12
+ "entries": [`);let o=0;if(N(this.entriesPath)){let s=G({input:F(this.entriesPath,{encoding:"utf8"}),crlfDelay:1/0});for await(let i of s)i.trim()&&(await r(`${o===0?`
13
13
  `:`,
14
14
  `} ${i}`),o+=1)}await r(o===0?`]
15
15
  }
@@ -18,14 +18,14 @@ import{a as T,b as O,c as A,d as E}from"./T376AHHQ.js";import{c as m,k as C,r as
18
18
  ]
19
19
  }
20
20
  }
21
- `)}finally{await new Promise((n,o)=>{t.on("error",o),t.end(()=>n())})}}};var I=z(q(),1);import{createServer as Q,STATUS_CODES as J}from"node:http";var Y=["GET","HEAD","POST","PUT","DELETE","OPTIONS","TRACE","PATCH"];function K(e){let t=(e??"GET").toUpperCase();return Y.find(r=>r===t)}var b=new Set(["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade"]);function X(e){return new Promise((t,r)=>{let n=[];e.on("data",o=>n.push(o)),e.on("end",()=>t(Buffer.concat(n))),e.on("error",r)})}function Z(e){let t={};for(let[r,n]of Object.entries(e.headers)){if(n===void 0)continue;let o=r.toLowerCase();b.has(o)||o==="host"||o==="content-length"||o!=="accept-encoding"&&(t[r]=Array.isArray(n)?n.join(", "):n)}return t}function ee(e){let t={};for(let[r,n]of Object.entries(e))n===void 0||b.has(r.toLowerCase())||(t[r]=n);return t}function te(e){let t=[];for(let r=0;r<e.length-1;r+=2)t.push({name:e[r],value:e[r+1]});return t}function re(e){let t=[];for(let[r,n]of Object.entries(e))if(n!==void 0){if(Array.isArray(n)){for(let o of n)t.push({name:r,value:o});continue}t.push({name:r,value:n})}return t}function ne(e){let t=[];for(let[r,n]of e.searchParams.entries())t.push({name:r,value:n});return t}function oe(e){if(!e)return[];let t=[];for(let r of e.split(";")){let n=r.indexOf("=");if(n===-1)continue;let o=r.slice(0,n).trim(),s=r.slice(n+1).trim();o&&t.push({name:o,value:s})}return t}function ie(e){if(!e||C(e))return!0;let t=e.split(";")[0]?.trim().toLowerCase()??"";return t.startsWith("text/")||t==="application/xml"||t==="application/x-www-form-urlencoded"||t.endsWith("+xml")}function D(e,t){return e.length===0?{size:0}:ie(t)?{text:e.toString("utf8"),size:e.length}:{text:e.toString("base64"),encoding:"base64",size:e.length}}function se(e,t){if(e.length===0)return;let r=D(e,t);return{mimeType:t??"application/octet-stream",text:r.text??"",...r.encoding?{encoding:r.encoding}:{}}}function M(e){let t=new URL(e.target),r=0,n=()=>r++,o=Q((s,i)=>{de(s,i,t,e,n)});return new Promise((s,i)=>{o.once("error",i),o.listen(e.port,e.host,()=>{o.removeListener("error",i);let d=o.address(),f=H(d)?d.port:e.port;s({url:`http://${e.host}:${f}`,close:()=>new Promise((a,h)=>{o.close(c=>c?h(c):a())})})})})}function ae(e,t){let r=new URL(e,t),n=t.pathname.endsWith("/")?t.pathname.slice(0,-1):t.pathname,o=r.pathname,s=o===n||o.startsWith(`${n}/`),i=new URL(t.toString());return i.pathname=n&&!s?`${n}${o}`:o,i.search=r.search,i}async function de(e,t,r,n,o){let s=new Date,i=K(e.method);if(!i){t.writeHead(501,{"content-type":"text/plain"}),t.end(`Unsupported HTTP method: ${e.method}`);return}let d=ae(e.url??"/",r),f=null;try{let a=await X(e),h=i!=="GET"&&i!=="HEAD"&&a.length>0,c=await(0,I.request)(d,{method:i,headers:Z(e),body:h?a:void 0}),g=Buffer.from(await c.body.arrayBuffer());t.writeHead(c.statusCode,ee(c.headers)),t.end(g);let P=Date.now()-s.getTime();f=ce({index:o(),method:i,forwardUrl:d,req:e,requestBody:a,statusCode:c.statusCode,responseHeaders:c.headers,responseBody:g,startedAt:s,elapsedMs:P})}catch(a){n.onError(a),t.writableEnded||(t.headersSent||t.writeHead(502,{"content-type":"text/plain"}),t.end(`Proxy error: ${a.message}`));return}if(f)try{await n.onExchange(f)}catch(a){n.onError(a)}}function ce(e){let t=x(e.req.headers["content-type"]),r=x(e.responseHeaders["content-type"]),n=$({method:e.method,url:e.forwardUrl.toString(),requestHeaders:e.req.headers,requestBody:e.requestBody,requestContentType:t,responseStatus:e.statusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,responseContentType:r,startedAt:e.startedAt.toISOString()},e.index,"(proxy)");if(!n)return null;let o=D(e.responseBody,r),s={startedDateTime:e.startedAt.toISOString(),time:e.elapsedMs,request:{method:e.method,url:e.forwardUrl.toString(),httpVersion:`HTTP/${e.req.httpVersion}`,cookies:oe(x(e.req.headers.cookie)),headers:te(e.req.rawHeaders),queryString:ne(e.forwardUrl),postData:se(e.requestBody,t),headersSize:-1,bodySize:e.requestBody.length},response:{status:e.statusCode,statusText:J[e.statusCode]??"",httpVersion:"HTTP/1.1",cookies:[],headers:re(e.responseHeaders),content:{size:o.size,mimeType:r??"application/octet-stream",...o.text!==void 0?{text:o.text}:{},...o.encoding?{encoding:o.encoding}:{}},redirectURL:x(e.responseHeaders.location)??"",headersSize:-1,bodySize:e.responseBody.length},cache:{},timings:{send:0,wait:e.elapsedMs,receive:0}};return{exchange:n,harEntry:s}}function x(e){return Array.isArray(e)?e[0]:e}var ue=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function fe(e){return e==="error"?"\u2716":e==="warning"?"\u25B2":"\u25CF"}function pe(e){let t=e.status!==void 0?` (${e.status})`:"",r=e.operationId?` ${e.operationId}`:"";return`${fe(e.severity)} ${e.severity.toUpperCase()} ${e.method} ${e.path}${t}${r} \u2192 [${e.ruleId}] ${e.message}`}function he(){return new Promise(e=>{process.once("SIGINT",()=>e()),process.once("SIGTERM",()=>e())})}async function be({argv:e,config:t,version:r}){let n=/^[a-z][a-z0-9+.-]*:\/\//i.test(e.target)?e.target:`http://${e.target}`,o;try{o=new URL(n)}catch{return y(`Invalid --target URL: ${e.target}`)}let s=m(e.har),i=new w(s,r),d=null;if(e.api){let p=m(e.api),l=await A(p,t);if(l.loadedOperations===0)return y(`No OpenAPI operations were loaded from: ${p}`);d=O.create({openApiIndex:l,matchMode:e["match-mode"],ignoreCookies:e["ignore-cookies"],ignoreHeaders:e["ignore-headers"]?E(e["ignore-headers"]):void 0,previewFindingsLimit:e["max-findings"],activeRules:e.rules?E(e.rules):void 0})}let f=Promise.resolve(),a;try{a=await M({target:o.toString(),port:e.port,host:e.host,onExchange:({exchange:p,harEntry:l})=>{let v=f.then(async()=>{try{await i.add(l)}catch(S){u.error(`Failed to write HAR entry, skipping validation for this exchange: ${S.message}
21
+ `)}finally{await new Promise((n,o)=>{t.on("error",o),t.end(()=>n())})}}};var I=z(q(),1);import{createServer as Q,STATUS_CODES as J}from"node:http";var Y=["GET","HEAD","POST","PUT","DELETE","OPTIONS","TRACE","PATCH"];function K(e){let t=(e??"GET").toUpperCase();return Y.find(r=>r===t)}var b=new Set(["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade"]);function X(e){return new Promise((t,r)=>{let n=[];e.on("data",o=>n.push(o)),e.on("end",()=>t(Buffer.concat(n))),e.on("error",r)})}function Z(e){let t={};for(let[r,n]of Object.entries(e.headers)){if(n===void 0)continue;let o=r.toLowerCase();b.has(o)||o==="host"||o==="content-length"||o!=="accept-encoding"&&(t[r]=Array.isArray(n)?n.join(", "):n)}return t}function ee(e){let t={};for(let[r,n]of Object.entries(e))n===void 0||b.has(r.toLowerCase())||(t[r]=n);return t}function te(e){let t=[];for(let r=0;r<e.length-1;r+=2)t.push({name:e[r],value:e[r+1]});return t}function re(e){let t=[];for(let[r,n]of Object.entries(e))if(n!==void 0){if(Array.isArray(n)){for(let o of n)t.push({name:r,value:o});continue}t.push({name:r,value:n})}return t}function ne(e){let t=[];for(let[r,n]of e.searchParams.entries())t.push({name:r,value:n});return t}function oe(e){if(!e)return[];let t=[];for(let r of e.split(";")){let n=r.indexOf("=");if(n===-1)continue;let o=r.slice(0,n).trim(),s=r.slice(n+1).trim();o&&t.push({name:o,value:s})}return t}function ie(e){if(!e||C(e))return!0;let t=e.split(";")[0]?.trim().toLowerCase()??"";return t.startsWith("text/")||t==="application/xml"||t==="application/x-www-form-urlencoded"||t.endsWith("+xml")}function D(e,t){return e.length===0?{size:0}:ie(t)?{text:e.toString("utf8"),size:e.length}:{text:e.toString("base64"),encoding:"base64",size:e.length}}function se(e,t){if(e.length===0)return;let r=D(e,t);return{mimeType:t??"application/octet-stream",text:r.text??"",...r.encoding?{encoding:r.encoding}:{}}}function M(e){let t=new URL(e.target),r=0,n=()=>r++,o=Q((s,i)=>{de(s,i,t,e,n)});return new Promise((s,i)=>{o.once("error",i),o.listen(e.port,e.host,()=>{o.removeListener("error",i);let d=o.address(),f=H(d)?d.port:e.port;s({url:`http://${e.host}:${f}`,close:()=>new Promise((a,h)=>{o.close(c=>c?h(c):a())})})})})}function ae(e,t){let r=new URL(e,t),n=t.pathname.endsWith("/")?t.pathname.slice(0,-1):t.pathname,o=r.pathname,s=o===n||o.startsWith(`${n}/`),i=new URL(t.toString());return i.pathname=n&&!s?`${n}${o}`:o,i.search=r.search,i}async function de(e,t,r,n,o){let s=new Date,i=K(e.method);if(!i){t.writeHead(501,{"content-type":"text/plain"}),t.end(`Unsupported HTTP method: ${e.method}`);return}let d=ae(e.url??"/",r),f=null;try{let a=await X(e),h=i!=="GET"&&i!=="HEAD"&&a.length>0,c=await(0,I.request)(d,{method:i,headers:Z(e),body:h?a:void 0}),l=Buffer.from(await c.body.arrayBuffer());t.writeHead(c.statusCode,ee(c.headers)),t.end(l);let P=Date.now()-s.getTime();f=ce({index:o(),method:i,forwardUrl:d,req:e,requestBody:a,statusCode:c.statusCode,responseHeaders:c.headers,responseBody:l,startedAt:s,elapsedMs:P})}catch(a){n.onError(a),t.writableEnded||(t.headersSent||t.writeHead(502,{"content-type":"text/plain"}),t.end(`Proxy error: ${a.message}`));return}if(f)try{await n.onExchange(f)}catch(a){n.onError(a)}}function ce(e){let t=x(e.req.headers["content-type"]),r=x(e.responseHeaders["content-type"]),n=$({method:e.method,url:e.forwardUrl.toString(),requestHeaders:e.req.headers,requestBody:e.requestBody,requestContentType:t,responseStatus:e.statusCode,responseHeaders:e.responseHeaders,responseBody:e.responseBody,responseContentType:r,startedAt:e.startedAt.toISOString()},e.index,"(proxy)");if(!n)return null;let o=D(e.responseBody,r),s={startedDateTime:e.startedAt.toISOString(),time:e.elapsedMs,request:{method:e.method,url:e.forwardUrl.toString(),httpVersion:`HTTP/${e.req.httpVersion}`,cookies:oe(x(e.req.headers.cookie)),headers:te(e.req.rawHeaders),queryString:ne(e.forwardUrl),postData:se(e.requestBody,t),headersSize:-1,bodySize:e.requestBody.length},response:{status:e.statusCode,statusText:J[e.statusCode]??"",httpVersion:"HTTP/1.1",cookies:[],headers:re(e.responseHeaders),content:{size:o.size,mimeType:r??"application/octet-stream",...o.text!==void 0?{text:o.text}:{},...o.encoding?{encoding:o.encoding}:{}},redirectURL:x(e.responseHeaders.location)??"",headersSize:-1,bodySize:e.responseBody.length},cache:{},timings:{send:0,wait:e.elapsedMs,receive:0}};return{exchange:n,harEntry:s}}function x(e){return Array.isArray(e)?e[0]:e}var ue=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function fe(e){return e==="error"?"\u2716":e==="warning"?"\u25B2":"\u25CF"}function pe(e){let t=e.status!==void 0?` (${e.status})`:"",r=e.operationId?` ${e.operationId}`:"";return`${fe(e.severity)} ${e.severity.toUpperCase()} ${e.method} ${e.path}${t}${r} \u2192 [${e.ruleId}] ${e.message}`}function he(){return new Promise(e=>{process.once("SIGINT",()=>e()),process.once("SIGTERM",()=>e())})}async function Ie({argv:e,config:t,version:r}){let n=/^[a-z][a-z0-9+.-]*:\/\//i.test(e.target)?e.target:`http://${e.target}`,o;try{o=new URL(n)}catch{throw new y(`Invalid --target URL: ${e.target}`)}let s=m(e.har),i=new w(s,r),d=null;if(e.api){let p=m(e.api),g=await A(p,t);if(g.loadedOperations===0)throw new y(`No OpenAPI operations were loaded from: ${p}`);d=O.create({openApiIndex:g,matchMode:e["match-mode"],ignoreCookies:e["ignore-cookies"],ignoreHeaders:e["ignore-headers"]?E(e["ignore-headers"]):void 0,previewFindingsLimit:e["max-findings"],activeRules:e.rules?E(e.rules):void 0})}let f=Promise.resolve(),a;try{a=await M({target:o.toString(),port:e.port,host:e.host,onExchange:({exchange:p,harEntry:g})=>{let v=f.then(async()=>{try{await i.add(g)}catch(S){u.error(`Failed to write HAR entry, skipping validation for this exchange: ${S.message}
22
22
  `);return}if(!d)return;let L=await d.process(p);for(let S of L)u.info(`${pe(S)}
23
23
  `)});return f=v.catch(()=>{}),v},onError:p=>{u.error(`Proxy request failed: ${p.message}
24
- `)}})}catch(p){return y(`Failed to start proxy server: ${p.message}`)}if(u.info(`Proxy listening on ${a.url} \u2192 forwarding to ${o.toString()}
24
+ `)}})}catch(p){throw new y(`Failed to start proxy server: ${p.message}`)}if(u.info(`Proxy listening on ${a.url} \u2192 forwarding to ${o.toString()}
25
25
  `),u.info(`Recording traffic to ${s}
26
26
  `),d&&u.info(`Validating live traffic against ${m(e.api)}
27
27
  `),u.info(`Press Ctrl+C to stop.
28
28
  `),await he(),u.info(`
29
29
  Shutting down proxy\u2026
30
30
  `),await a.close(),await f,await i.finalize(),u.info(`Captured ${i.entryCount} exchange(s) to ${s}
31
- `),!d)return;let{runId:h,summary:c,findings:g}=d.finalize(),P={runId:h,summary:c,findings:g,meta:{specSource:m(e.api),trafficPath:s,format:"har",matchMode:e["match-mode"]}},U=T(P,{format:e["report-format"],color:ue&&e["report-format"]==="pretty",maxFindings:e["max-findings"]});if(u.output(U),c.findingsBySeverity.error>0)throw new R("Drift detected.")}export{be as handleProxy};
31
+ `),!d)return;let{runId:h,summary:c,findings:l}=d.finalize(),P={runId:h,summary:c,findings:l,meta:{specSource:m(e.api),trafficPath:s,format:"har",matchMode:e["match-mode"]}},U=T(P,{format:e["report-format"],color:ue&&e["report-format"]==="pretty",maxFindings:e["max-findings"]});if(u.output(U),c.findingsBySeverity.error>0)throw new R("Drift detected.")}export{Ie as handleProxy};
@@ -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
- var e={name:"@redocly/cli",version:"2.53.2",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@modelcontextprotocol/sdk":"^1.30.0","@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.5","@redocly/client-generator":"0.4.11","@redocly/openapi-core":"2.53.2","@redocly/respect-core":"2.53.2","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9","https-proxy-agent":"^7.0.5",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.4",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:s,name:c,engines:i}=e,n=e.devDependencies.redoc,p="sha384-w447zOpYfw/1Tv/5AK9NfHTlQIqE3RVR6KY62jCyy9zNDgO64cMwGGP1Fj0zJVf5";export{s as a,c as b,i as c,n as d,p as e};
7
+ var e={name:"@redocly/cli",version:"2.54.0",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@modelcontextprotocol/sdk":"^1.30.0","@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.5","@redocly/client-generator":"0.4.13","@redocly/openapi-core":"2.54.0","@redocly/respect-core":"2.54.0","@redocly/reunite-integration":"2.54.0","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.4",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:i,name:c,engines:s}=e,n=e.devDependencies.redoc,p="sha384-w447zOpYfw/1Tv/5AK9NfHTlQIqE3RVR6KY62jCyy9zNDgO64cMwGGP1Fj0zJVf5";export{i as a,c as b,s as c,n as d,p as e};