xmcp 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/client.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,()=>(()=>{"use strict";var e={8330(e){e.exports={version:"1.13.
|
|
2
|
+
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,()=>(()=>{"use strict";var e={8330(e){e.exports={version:"1.13.2"}}},n={};function t(o){var r=n[o];if(void 0!==r)return r.exports;var s=n[o]={exports:{}};return e[o](s,s.exports,t),s.exports}return t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n,o)=>{var r=(n,o)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,[o]:n[r]})};r(n,"get"),r(o,"value")},t.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{let e,n=require("module"),o=require("path");var r=t.n(o);let s=require("child_process"),i=require("fs");var l=t.n(i);let c=t(8330).version,a="https://xmcp.dev/docs/getting-started/upgrading",p="22.12.0",d="^4.0.0",u=["dependencies","devDependencies"],m=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".mts",".cts"]),f=new Set(["node_modules","dist",".xmcp",".git"]);function h(e){let n=e.match(/(\d+)(?:\.(\d+|x|\*))?(?:\.(\d+|x|\*))?/);if(!n)return null;let t=e=>e&&/^\d+$/.test(e)?Number(e):0;return[Number(n[1]),t(n[2]),t(n[3])]}function g(e,n){for(let t=0;t<3;t++)if(e[t]!==n[t])return e[t]-n[t];return 0}function x(e){return/^(workspace|catalog|link|file|portal|git|github|npm):/.test(e)}function v(e,n){if(x(e))return!1;let t=h(e);return null!==t&&0>g(t,n)}let y=[["bun.lock","bun"],["bun.lockb","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];function j(e){try{return JSON.parse(l().readFileSync(r().join(e,"package.json"),"utf8"))}catch{return null}}function k(e){for(let[n,t]of y)if(l().existsSync(r().join(e,n)))return t;let n=j(e)?.packageManager,t="string"==typeof n?n.split("@")[0]:"";return["npm","pnpm","yarn","bun"].includes(t)?t:null}let w=`Usage: npx xmcp@latest upgrade [options]
|
|
3
3
|
|
|
4
4
|
Upgrades the xmcp project in the current folder to xmcp ${c}.
|
|
5
5
|
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var e,t,r={6507(e,t,r){"use strict";let o=r(5317),i=r(8388),a=r(442);function n(e,t,r){let n=i(e,t,r),s=o.spawn(n.command,n.args,n.options);return a.hookChildProcess(s,n),s}e.exports=n,e.exports.spawn=n,e.exports.sync=function(e,t,r){let n=i(e,t,r),s=o.spawnSync(n.command,n.args,n.options);return s.error=s.error||a.verifyENOENTSync(s.status,n),s},e.exports._parse=i,e.exports._enoent=a},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let i=e.emit;e.emit=function(t,a){if("exit"===t){let t=o(a,r);if(t)return i.call(e,"error",t)}return i.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),i=r(3803),a=r(2077),n=r(1880),s="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!s)return e;let r=(e.file=i(e),(t=e.file&&n(e.file))?(e.args.unshift(e.file),e.command=t,i(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,t));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),i=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return i(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),i=r(1905),a=r(9695);function n(e,t){let r,n=e.options.env||process.env,s=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=i.sync(e.command,{path:n[a({env:n})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return n(e)||n(e,!0)}},9344(e,t,r){var o;function i(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){i(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=i,i.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),t)};var o=r(9896);function i(e,t,r){o.stat(e,function(e,o){r(e,!e&&a(o,t))})}function a(e,t){var r,o,i,a,n,s,l,c,u;return e.isFile()&&(r=e,o=t,i=r.mode,a=r.uid,n=r.gid,s=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),i&parseInt("001",8)||i&u&&n===l||i&c&&a===s||i&(c|u)&&0===s)}},8541(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),e,t)};var o=r(9896);function i(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var i=0;i<o.length;i++){var a=o[i].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a)return!0}return!1}function a(e,t,r){o.stat(e,function(o,a){r(o,!o&&i(a,e,t))})}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},600(e,t,r){"use strict";let o=r(7257);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),a=r.split("/").pop();return"env"===a?i:i?`${a} ${i}`:a}},7257(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=r(6928),a=o?";":":",n=r(9344),s=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||a,i=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=o?n.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:a,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((a,n)=>{if(r===o.length)return t.all&&u.length?a(u):n(s(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(c,e);a(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((i,s)=>{if(o===a.length)return i(d(r+1));let l=a[o];n(e+l,{pathExt:c},(a,n)=>{if(!a&&n)if(!t.all)return i(e+l);else u.push(e+l);return i(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:a}=l(e,t=t||{}),c=[];for(let s=0;s<r.length;s++){let l=r[s],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(n.sync(r,{pathExt:a}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw s(e)}},5317(e){"use strict";e.exports=require("child_process")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},6928(e){"use strict";e.exports=require("path")},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.13.0"}')}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,i),a.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var a=Object.create(null);i.r(a);var n={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{n[e]=()=>r[e]});return n.default=()=>r,i.d(a,n),a},i.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};for(var n in(()=>{"use strict";let e,t,r,o,n,s,l,c,u,d,p,h,f,m,y,g,v,_,b,S;i.r(a),i.d(a,{createClient:()=>he,withClient:()=>ht});var w,$,R,P,k,x,E,O,T=Object.create,C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyNames,N=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty,q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),A=(e,t,r)=>(r=null!=e?T(N(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,i=I(t),a=0,n=i.length;a<n;a++)o=i[a],z.call(e,o)||void 0===o||C(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=j(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?r:C(r,"default",{value:e,enumerable:!0}),e));let M=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),L=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),U=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),D=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function V(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function F(e,t="|"){return e.map(e=>ed(e)).join(t)}function H(e,t){return"bigint"==typeof t?t.toString():t}class Z{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function J(e){return new Z(e)}function B(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let K=Symbol("evaluating");function G(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function W(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function X(e){return W(e._zod.def)??e._zod.def.shape}function Y(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return G(this,t,e),e},enumerable:!0,configurable:!0})}function Q(e,t,r){t in e?G(e,t,r):e[t]=r}function ee(e,t,r,o){let i=X(t);for(let a of r){let r=Object.getOwnPropertyDescriptor(i,a);r.enumerable&&(r.get?Y(e,a,()=>{let e=t._zod.def.shape[a];return o?o(e,a):e}):Q(e,a,o?o(r.value,a):r.value))}}function et(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let er="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eo(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ei=J(()=>{if(eM.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function ea(e){if(!1===eo(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eo(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function en(e){return ea(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let es=new Set(["string","number","symbol"]);function el(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ec(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eu(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ed(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let ep={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ef(e,t){let r=X(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function em(e,t){let r={};ee(r,e,Reflect.ownKeys(X(e)));var o=r,i=t;for(let e of Reflect.ownKeys(i)){let t=Object.getOwnPropertyDescriptor(i,e);t.enumerable&&(t.get?Y(o,e,()=>i[e]):Q(o,e,t.value))}return r}function ey(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(ef(t,r)):void 0,n={};return ee(n,t,Reflect.ownKeys(X(t)),e&&((t,r)=>a&&!a.has(r)?t:new e({type:"optional",innerType:t}))),ec(t,et(t._zod.def,{shape:n,checks:[]}))}function eg(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ev(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e_(e){return"string"==typeof e?e:e?.message}function eb(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eS(e,t,r){var o;for(let i=t;i<e.length;i++)(o=e[i]).schema??(o.schema=r)}function ew(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:e_(e.inst?._zod.def?.error?.(e))??e_(i?.(e))??e_(t?.error?.(e))??e_(r.customError?.(e))??e_(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=a,t?.reportInput&&(n.input=e.input),n}let e$=/[\uD800-\uDBFF]/;function eR(e){let t=e.length;if(!e$.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eP(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ek(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function ex(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eE(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return ex(this,r,o(this))},set(e){ex(this,r,e)}})}return t}let eO=!1,eT={configurable:!0,get(){eO=!0}};function eC(t,r,o){let i=Object.getPrototypeOf(t._zod);if(r in i&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,eT);let e=eO;eO=!1;try{let t=o(this);return eO?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eO=eO||e,t}catch(t){throw delete this[r],eO=eO||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let ej=Object.freeze({status:"aborted"}),eI={value:void 0,enumerable:!1},eN="captureStackTrace"in Error?Error:null;function ez(e,t,r,o){function i(e){this.def=e,this.constr=c,this.traits=new Set}i.prototype={};let a=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{eI.value=new i(n);try{Object.defineProperty(o,"_zod",eI)}finally{eI.value=void 0}}if(o._zod.traits.add(e),t(o,n),a){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let n=i??e;if(!a.has(n)){a.add(n);var s=n,l=r;for(let e in l){let t=Object.getOwnPropertyDescriptor(l,e);t.get?Object.defineProperty(s,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:ex(this,t,r.bind(this))},set(e){ex(this,t,e)}})}(s,e,t.value)}}}let u=c.prototype;for(let e in u)Object.prototype.hasOwnProperty.call(u,e)&&(e in o||(o[e]=u[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=eN;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return eN=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class eq extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eA extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(x=globalThis).__zod_globalConfig??(x.__zod_globalConfig={});let eM=globalThis.__zod_globalConfig;function eL(e){return e&&Object.assign(eM,e),eM}class eU extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eD="~memo",eV=[];function eF(e){return null!==e&&"object"==typeof e}function eH(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let eZ=new WeakMap,eJ=[],eB={alloc(e,r,o){let i=t;if(!i)return o;t=void 0;let a={value:o,issues:null};return i.set(r.value,a),eJ.push(a),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,i;let a;if("backward"!==r.direction&&(o=r,i=e.value,void 0!==(a=o[eD]?.backEdges)&&eF(i)&&a.has(i)))throw new eU;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,i,a,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var i,a;let n=eZ.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let i=e(t,r,o);i>s&&(s=i)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=W(u);c(t?((t,i)=>{let a=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(i&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>a&&(a=l)}return a})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let i=u._cachedInner??(o?t._zod.innerType:void 0);c(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(a=s)&&eZ.set(i,2===a),a}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!eF(d))return r(l,c);let p=c[eD];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[eD]=p),i===c)u=a;else{var h,f;let t;h=p,f=e,(t=h.buckets.get(f))||(t=new WeakMap,h.buckets.set(f,t)),u=t,i=c,a=u}let m=u.get(d);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...eH(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;t=u;let y=eJ.length,g=r(l,c);t=void 0;let v=eJ.length>y?eJ.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?eH(e.issues):eV),e)):(v&&(v.issues=g.issues.length?eH(g.issues):eV),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},eK=/^[cC][0-9a-z]{6,}$/,eG=/^[0-9a-z]+$/,eW=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eX=/^[0-9a-vA-V]{20}$/,eY=/^[A-Za-z0-9]{27}$/,eQ=/^[a-zA-Z0-9_-]{21}$/,e0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e1=/^([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})$/,e2=e=>e?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)$/,e9=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e4=/^(?:(?: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])$/,e3=/^(([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}|:))$/,e5=/^((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])$/,e6=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,e8=/^https?$/,e7=/^\+[1-9]\d{6,14}$/,te="(?:(?:\\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])))",tt=(w=te,RegExp(`^${w}$`));function tr(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let to=/^[\s\S]{0,}$/,ti=/^-?\d+$/,ta=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,ts=/^null$/i,tl=/^[^A-Z]*$/,tc=/^[^a-z]*$/,tu=ez("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),td=e=>{let t=e.value;return null!=t&&void 0!==t.length},tp={number:"number",bigint:"bigint",object:"date"},th=ez("$ZodCheckLessThan",(e,t)=>{tu.init(e,t);let r=tp[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tp[typeof o.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tf=ez("$ZodCheckGreaterThan",(e,t)=>{tu.init(e,t);let r=tp[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tp[typeof o.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tm=ez("$ZodCheckMultipleOf",(e,t)=>{tu.init(e,t),e._zod.check=r=>{var o;let i,a,n;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(a=Math.round(i=(o=r.value)/t.value),n=4*Number.EPSILON*Math.max(Math.abs(i),1),Math.abs(i-a)<n?0:i-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ty=ez("$ZodCheckNumberFormat",(e,t)=>{tu.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[i,a]=ep[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<i&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),tg=ez("$ZodCheckMaxLength",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length;if(("string"==typeof o&&i>t.maximum?eR(o):i)<=t.maximum)return;let a=eP(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tv=ez("$ZodCheckMinLength",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length;if(("string"==typeof o&&i>=t.minimum&&i<2*t.minimum?eR(o):i)>=t.minimum)return;let a=eP(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),t_=ez("$ZodCheckLengthEquals",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length,a="string"==typeof o&&i>=t.length&&i<=2*t.length?eR(o):i;if(a===t.length)return;let n=eP(o),s=a>t.length;r.issues.push({origin:n,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tb=ez("$ZodCheckStringFormat",(e,t)=>{var r,o;tu.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tS=ez("$ZodCheckRegex",(e,t)=>{tb.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})}}),tw=ez("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tl),tb.init(e,t)}),t$=ez("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tc),tb.init(e,t)}),tR=ez("$ZodCheckIncludes",(e,t)=>{tu.init(e,t);let r=el(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tP=ez("$ZodCheckStartsWith",(e,t)=>{tu.init(e,t);let r=RegExp(`^${el(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tk=ez("$ZodCheckEndsWith",(e,t)=>{tu.init(e,t);let r=RegExp(`.*${el(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tx=ez("$ZodCheckOverwrite",(e,t)=>{tu.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tE{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
1
|
+
(()=>{var e,t,r={6507(e,t,r){"use strict";let o=r(5317),i=r(8388),a=r(442);function n(e,t,r){let n=i(e,t,r),s=o.spawn(n.command,n.args,n.options);return a.hookChildProcess(s,n),s}e.exports=n,e.exports.spawn=n,e.exports.sync=function(e,t,r){let n=i(e,t,r),s=o.spawnSync(n.command,n.args,n.options);return s.error=s.error||a.verifyENOENTSync(s.status,n),s},e.exports._parse=i,e.exports._enoent=a},442(e){"use strict";let t="win32"===process.platform;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;let i=e.emit;e.emit=function(t,a){if("exit"===t){let t=o(a,r);if(t)return i.call(e,"error",t)}return i.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},8388(e,t,r){"use strict";let o=r(6928),i=r(3803),a=r(2077),n=r(1880),s="win32"===process.platform,l=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);let u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){let t;if(!s)return e;let r=(e.file=i(e),(t=e.file&&n(e.file))?(e.args.unshift(e.file),e.command=t,i(e)):e.file),u=!l.test(r);if(e.options.forceShell||u){let t=c.test(r);e.command=o.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,t));let i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},2077(e){"use strict";let t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=(e=`${e}`).replace(/(?=(\\+?)?)\1"/g,'$1$1\\"')).replace(/(?=(\\+?)?)\1$/,"$1$1"),e=(e=`"${e}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},1880(e,t,r){"use strict";let o=r(9896),i=r(600);e.exports=function(e){let t,r=Buffer.alloc(150);try{t=o.openSync(e,"r"),o.readSync(t,r,0,150,0),o.closeSync(t)}catch(e){}return i(r.toString())}},3803(e,t,r){"use strict";let o=r(6928),i=r(1905),a=r(9695);function n(e,t){let r,n=e.options.env||process.env,s=process.cwd(),l=null!=e.options.cwd,c=l&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}try{r=i.sync(e.command,{path:n[a({env:n})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return r&&(r=o.resolve(l?e.options.cwd:"",r)),r}e.exports=function(e){return n(e)||n(e,!0)}},9344(e,t,r){var o;function i(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw TypeError("callback not provided");return new Promise(function(r,o){i(e,t||{},function(e,t){e?o(e):r(t)})})}o(e,t||{},function(e,o){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,o=!1),r(e,o)})}r(9896),o="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=i,i.sync=function(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709(e,t,r){e.exports=i,i.sync=function(e,t){return a(o.statSync(e),t)};var o=r(9896);function i(e,t,r){o.stat(e,function(e,o){r(e,!e&&a(o,t))})}function a(e,t){var r,o,i,a,n,s,l,c,u;return e.isFile()&&(r=e,o=t,i=r.mode,a=r.uid,n=r.gid,s=void 0!==o.uid?o.uid:process.getuid&&process.getuid(),l=void 0!==o.gid?o.gid:process.getgid&&process.getgid(),c=parseInt("100",8),u=parseInt("010",8),i&parseInt("001",8)||i&u&&n===l||i&c&&a===s||i&(c|u)&&0===s)}},8541(e,t,r){e.exports=a,a.sync=function(e,t){return i(o.statSync(e),e,t)};var o=r(9896);function i(e,t,r){if(!e.isSymbolicLink()&&!e.isFile())return!1;var o=void 0!==r.pathExt?r.pathExt:process.env.PATHEXT;if(!o||-1!==(o=o.split(";")).indexOf(""))return!0;for(var i=0;i<o.length;i++){var a=o[i].toLowerCase();if(a&&t.substr(-a.length).toLowerCase()===a)return!0}return!1}function a(e,t,r){o.stat(e,function(o,a){r(o,!o&&i(a,e,t))})}},9695(e){"use strict";let t=(e={})=>{let t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};e.exports=t,e.exports.default=t},600(e,t,r){"use strict";let o=r(7257);e.exports=(e="")=>{let t=e.match(o);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,"").split(" "),a=r.split("/").pop();return"env"===a?i:i?`${a} ${i}`:a}},7257(e){"use strict";e.exports=/^#!(.*)/},1905(e,t,r){let o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=r(6928),a=o?";":":",n=r(9344),s=e=>Object.assign(Error(`not found: ${e}`),{code:"ENOENT"}),l=(e,t)=>{let r=t.colon||a,i=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],n=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=o?n.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==s[0]&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},c=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});let{pathEnv:o,pathExt:a,pathExtExe:c}=l(e,t),u=[],d=r=>new Promise((a,n)=>{if(r===o.length)return t.all&&u.length?a(u):n(s(e));let l=o[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(c,e);a(p(!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,r,0))}),p=(e,r,o)=>new Promise((i,s)=>{if(o===a.length)return i(d(r+1));let l=a[o];n(e+l,{pathExt:c},(a,n)=>{if(!a&&n)if(!t.all)return i(e+l);else u.push(e+l);return i(p(e,r,o+1))})});return r?d(0).then(e=>r(null,e),r):d(0)};e.exports=c,c.sync=(e,t)=>{let{pathEnv:r,pathExt:o,pathExtExe:a}=l(e,t=t||{}),c=[];for(let s=0;s<r.length;s++){let l=r[s],u=/^".*"$/.test(l)?l.slice(1,-1):l,d=i.join(u,e),p=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<o.length;e++){let r=p+o[e];try{if(n.sync(r,{pathExt:a}))if(!t.all)return r;else c.push(r)}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw s(e)}},5317(e){"use strict";e.exports=require("child_process")},9896(e){"use strict";e.exports=require("fs")},7598(e){"use strict";e.exports=require("node:crypto")},6928(e){"use strict";e.exports=require("path")},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.13.2"}')}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,i),a.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var a=Object.create(null);i.r(a);var n={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{n[e]=()=>r[e]});return n.default=()=>r,i.d(a,n),a},i.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};for(var n in(()=>{"use strict";let e,t,r,o,n,s,l,c,u,d,p,h,f,m,y,g,v,_,b,S;i.r(a),i.d(a,{createClient:()=>he,withClient:()=>ht});var w,$,R,P,k,x,E,O,T=Object.create,C=Object.defineProperty,j=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyNames,N=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty,q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),A=(e,t,r)=>(r=null!=e?T(N(e)):{},((e,t,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,i=I(t),a=0,n=i.length;a<n;a++)o=i[a],z.call(e,o)||void 0===o||C(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(r=j(t,o))||r.enumerable});return e})(!t&&e&&e.__esModule?r:C(r,"default",{value:e,enumerable:!0}),e));let M=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),L=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),U=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),D=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function V(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function F(e,t="|"){return e.map(e=>ed(e)).join(t)}function H(e,t){return"bigint"==typeof t?t.toString():t}class Z{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function J(e){return new Z(e)}function B(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let K=Symbol("evaluating");function G(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function W(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function X(e){return W(e._zod.def)??e._zod.def.shape}function Y(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return G(this,t,e),e},enumerable:!0,configurable:!0})}function Q(e,t,r){t in e?G(e,t,r):e[t]=r}function ee(e,t,r,o){let i=X(t);for(let a of r){let r=Object.getOwnPropertyDescriptor(i,a);r.enumerable&&(r.get?Y(e,a,()=>{let e=t._zod.def.shape[a];return o?o(e,a):e}):Q(e,a,o?o(r.value,a):r.value))}}function et(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let er="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eo(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ei=J(()=>{if(eM.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function ea(e){if(!1===eo(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eo(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function en(e){return ea(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let es=new Set(["string","number","symbol"]);function el(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ec(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function eu(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function ed(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let ep={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ef(e,t){let r=X(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function em(e,t){let r={};ee(r,e,Reflect.ownKeys(X(e)));var o=r,i=t;for(let e of Reflect.ownKeys(i)){let t=Object.getOwnPropertyDescriptor(i,e);t.enumerable&&(t.get?Y(o,e,()=>i[e]):Q(o,e,t.value))}return r}function ey(e,t,r,o="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(ef(t,r)):void 0,n={};return ee(n,t,Reflect.ownKeys(X(t)),e&&((t,r)=>a&&!a.has(r)?t:new e({type:"optional",innerType:t}))),ec(t,et(t._zod.def,{shape:n,checks:[]}))}function eg(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function ev(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function e_(e){return"string"==typeof e?e:e?.message}function eb(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eS(e,t,r){var o;for(let i=t;i<e.length;i++)(o=e[i]).schema??(o.schema=r)}function ew(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:e_(e.inst?._zod.def?.error?.(e))??e_(i?.(e))??e_(t?.error?.(e))??e_(r.customError?.(e))??e_(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=a,t?.reportInput&&(n.input=e.input),n}let e$=/[\uD800-\uDBFF]/;function eR(e){let t=e.length;if(!e$.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eP(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ek(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function ex(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eE(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return ex(this,r,o(this))},set(e){ex(this,r,e)}})}return t}let eO=!1,eT={configurable:!0,get(){eO=!0}};function eC(t,r,o){let i=Object.getPrototypeOf(t._zod);if(r in i&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,eT);let e=eO;eO=!1;try{let t=o(this);return eO?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eO=eO||e,t}catch(t){throw delete this[r],eO=eO||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let ej=Object.freeze({status:"aborted"}),eI={value:void 0,enumerable:!1},eN="captureStackTrace"in Error?Error:null;function ez(e,t,r,o){function i(e){this.def=e,this.constr=c,this.traits=new Set}i.prototype={};let a=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{eI.value=new i(n);try{Object.defineProperty(o,"_zod",eI)}finally{eI.value=void 0}}if(o._zod.traits.add(e),t(o,n),a){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let n=i??e;if(!a.has(n)){a.add(n);var s=n,l=r;for(let e in l){let t=Object.getOwnPropertyDescriptor(l,e);t.get?Object.defineProperty(s,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:ex(this,t,r.bind(this))},set(e){ex(this,t,e)}})}(s,e,t.value)}}}let u=c.prototype;for(let e in u)Object.prototype.hasOwnProperty.call(u,e)&&(e in o||(o[e]=u[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=eN;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return eN=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class eq extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eA extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(x=globalThis).__zod_globalConfig??(x.__zod_globalConfig={});let eM=globalThis.__zod_globalConfig;function eL(e){return e&&Object.assign(eM,e),eM}class eU extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eD="~memo",eV=[];function eF(e){return null!==e&&"object"==typeof e}function eH(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let eZ=new WeakMap,eJ=[],eB={alloc(e,r,o){let i=t;if(!i)return o;t=void 0;let a={value:o,issues:null};return i.set(r.value,a),eJ.push(a),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,i;let a;if("backward"!==r.direction&&(o=r,i=e.value,void 0!==(a=o[eD]?.backEdges)&&eF(i)&&a.has(i)))throw new eU;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,i,a,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var i,a;let n=eZ.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let i=e(t,r,o);i>s&&(s=i)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=W(u);c(t?((t,i)=>{let a=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(i&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>a&&(a=l)}return a})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let i=u._cachedInner??(o?t._zod.innerType:void 0);c(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(a=s)&&eZ.set(i,2===a),a}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!eF(d))return r(l,c);let p=c[eD];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[eD]=p),i===c)u=a;else{var h,f;let t;h=p,f=e,(t=h.buckets.get(f))||(t=new WeakMap,h.buckets.set(f,t)),u=t,i=c,a=u}let m=u.get(d);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...eH(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;t=u;let y=eJ.length,g=r(l,c);t=void 0;let v=eJ.length>y?eJ.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?eH(e.issues):eV),e)):(v&&(v.issues=g.issues.length?eH(g.issues):eV),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},eK=/^[cC][0-9a-z]{6,}$/,eG=/^[0-9a-z]+$/,eW=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eX=/^[0-9a-vA-V]{20}$/,eY=/^[A-Za-z0-9]{27}$/,eQ=/^[a-zA-Z0-9_-]{21}$/,e0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,e1=/^([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})$/,e2=e=>e?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)$/,e9=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,e4=/^(?:(?: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])$/,e3=/^(([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}|:))$/,e5=/^((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])$/,e6=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,e8=/^https?$/,e7=/^\+[1-9]\d{6,14}$/,te="(?:(?:\\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])))",tt=(w=te,RegExp(`^${w}$`));function tr(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let to=/^[\s\S]{0,}$/,ti=/^-?\d+$/,ta=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,ts=/^null$/i,tl=/^[^A-Z]*$/,tc=/^[^a-z]*$/,tu=ez("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),td=e=>{let t=e.value;return null!=t&&void 0!==t.length},tp={number:"number",bigint:"bigint",object:"date"},th=ez("$ZodCheckLessThan",(e,t)=>{tu.init(e,t);let r=tp[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tp[typeof o.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tf=ez("$ZodCheckGreaterThan",(e,t)=>{tu.init(e,t);let r=tp[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tp[typeof o.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tm=ez("$ZodCheckMultipleOf",(e,t)=>{tu.init(e,t),e._zod.check=r=>{var o;let i,a,n;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(a=Math.round(i=(o=r.value)/t.value),n=4*Number.EPSILON*Math.max(Math.abs(i),1),Math.abs(i-a)<n?0:i-a))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ty=ez("$ZodCheckNumberFormat",(e,t)=>{tu.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[i,a]=ep[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<i&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),tg=ez("$ZodCheckMaxLength",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length;if(("string"==typeof o&&i>t.maximum?eR(o):i)<=t.maximum)return;let a=eP(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tv=ez("$ZodCheckMinLength",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length;if(("string"==typeof o&&i>=t.minimum&&i<2*t.minimum?eR(o):i)>=t.minimum)return;let a=eP(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),t_=ez("$ZodCheckLengthEquals",(e,t)=>{var r;tu.init(e,t),(r=e._zod.def).when??(r.when=td),e._zod.check=r=>{let o=r.value,i=o.length,a="string"==typeof o&&i>=t.length&&i<=2*t.length?eR(o):i;if(a===t.length)return;let n=eP(o),s=a>t.length;r.issues.push({origin:n,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tb=ez("$ZodCheckStringFormat",(e,t)=>{var r,o;tu.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tS=ez("$ZodCheckRegex",(e,t)=>{tb.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})}}),tw=ez("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tl),tb.init(e,t)}),t$=ez("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tc),tb.init(e,t)}),tR=ez("$ZodCheckIncludes",(e,t)=>{tu.init(e,t);let r=el(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tP=ez("$ZodCheckStartsWith",(e,t)=>{tu.init(e,t);let r=RegExp(`^${el(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tk=ez("$ZodCheckEndsWith",(e,t)=>{tu.init(e,t);let r=RegExp(`.*${el(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tx=ez("$ZodCheckOverwrite",(e,t)=>{tu.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tE{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
2
|
${t.join("\n")}
|
|
3
3
|
};`)(...Object.values(this.closed))}}let tO={major:4,minor:6,patch:7},tT=ez("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tO;let o=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let t of i)for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,o)=>{let i;if(t.memo)return t;let a=eg(t);for(let n of r){if(n._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(t)||!n._zod.def.when(t))continue}else if(a)continue;let r=t.issues.length,s=n._zod.check(t);if(s instanceof Promise&&o?.async===!1)throw new eq;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eS(t.issues,r,e),a||(a=eg(t,r)))});else{if(t.issues.length===r)continue;eS(t.issues,r,e),a||(a=eg(t,r))}}return i?i.then(()=>t):t},r=(r,o,a)=>{if(eg(r))return r.aborted=!0,r;let n=t(o,i,a);if(n instanceof Promise){if(!1===a.async)throw new eq;return n.then(t=>e._zod.parse(t,a))}return e._zod.parse(n,a)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if("backward"===a.direction){let t=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,o,a)):r(t,o,a)}let n=e._zod.parse(o,a);if(n instanceof Promise){if(!1===a.async)throw new eq;return n.then(e=>t(e,i,a))}return t(n,i,a)}}},{get"~standard"(){var e;return e=this,ex(e,"~standard",tj(this),!1)},set"~standard"(e){ex(this,"~standard",e)}}),tC=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ew(e,t,eL()))}:{value:e.value};function tj(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return tC(o,r)}catch(e){}return async function(e,t){let r={async:!0};return tC(await e._zod.run({value:t,issues:[]},r),r)}(e,t)},vendor:"zod",version:1}}let tI=ez("$ZodString",(e,t)=>{tT.init(e,t),e._zod.pattern=t.pattern??to,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tN=ez("$ZodStringFormat",(e,t)=>{tb.init(e,t),tI.init(e,t)}),tz=ez("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=e1),tN.init(e,t)}),tq=ez("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=e2(e))}else t.pattern??(t.pattern=e2());tN.init(e,t)}),tA=ez("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=e9),tN.init(e,t)});function tM(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let tL=/[\t\n\r]/g;function tU(e){return e.replace(tL,"")}let tD=ez("$ZodURL",(e,t)=>{tN.init(e,t),e._zod.check=r=>{try{var o,i,a,n,s,l;let c=r.value.trim(),u=(o=c,i=t,"normalize"in i||"hostname"in i||"protocol"in i?function(e,t){if(!t.normalize&&t.protocol?.source===e8.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,i):tM(o)||2);if(1===u)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===u)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===u){r.value=tU(c);return}t.hostname&&(a=u,(n=t.hostname).lastIndex=0,!n.test(a.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&&(s=u,(l=t.protocol).lastIndex=0,!l.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?u.href:tU(c);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),tV=ez("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),tN.init(e,t)}),tF=ez("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eQ:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),tN.init(e,t)}),tH=ez("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eK),tN.init(e,t)}),tZ=ez("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eG),tN.init(e,t)}),tJ=ez("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eW),tN.init(e,t)}),tB=ez("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eX),tN.init(e,t)}),tK=ez("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eY),tN.init(e,t)}),tG=ez("$ZodISODateTime",(e,t)=>{var r;let o,i,a;t.pattern??(o=["Z"],(r=t).offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),i=`${tr({precision:r.precision,seconds:!0})}(?:${o.join("|")})`,a=r.local?`${i}|${tr({precision:r.precision})}`:i,t.pattern=RegExp(`^${te}T(?:${a})$`)),tN.init(e,t)}),tW=ez("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tt),tN.init(e,t)}),tX=ez("$ZodISOTime",(e,t)=>{var r;t.pattern??(r=t,t.pattern=RegExp(`^${tr(r)}$`)),tN.init(e,t)}),tY=ez("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=e0),tN.init(e,t)}),tQ=ez("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=e4),tN.init(e,t)}),t0=/^[0-9a-fA-F:.]+$/;function t1(e){return!!t0.test(e)&&tM(`http://[${e}]`)}let t2=ez("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=e3),tN.init(e,t),e._zod.check=r=>{t1(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),t9=ez("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=e5),tN.init(e,t)}),t4=ez("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=e6),tN.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,o]=t;if(!o)return!1;let i=Number(o);return`${i}`===o&&!(i<0)&&!(i>128)&&t1(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function t3(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let t5=/^[0-9a-zA-Z+/]*={0,2}$/,t6=ez("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=t5),tN.init(e,t),e._zod.check=r=>{t3(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),t8=/^[A-Za-z0-9_-]*$/,t7=ez("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=t8),tN.init(e,t),e._zod.check=r=>{!function(e){if(!t8.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return t3(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),re=ez("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e7),tN.init(e,t)}),rt=ez("$ZodJWT",(e,t)=>{tN.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let i=JSON.parse(atob(o));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),rr=ez("$ZodNumber",(e,t)=>{tT.init(e,t),e._zod.pattern=ta,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),r}}),ro=ez("$ZodNumberFormat",(e,t)=>{ty.init(e,t),rr.init(e,t)}),ri=ez("$ZodBoolean",(e,t)=>{tT.init(e,t),e._zod.pattern=tn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),ra=ez("$ZodNull",(e,t)=>{tT.init(e,t),e._zod.pattern=ts,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),rn=ez("$ZodAny",(e,t)=>{tT.init(e,t),e._zod.parse=e=>e}),rs=ez("$ZodUnknown",(e,t)=>{tT.init(e,t),e._zod.parse=e=>e}),rl=ez("$ZodNever",(e,t)=>{tT.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rc=e=>Array.isArray(e)?e.length:-1;function ru(e,t,r){e.issues.length&&t.issues.push(...ev(r,e.issues)),t.value[r]=e.value}let rd=ez("$ZodArray",(e,t)=>{tT.init(e,t);let r=eM.memoizer;r?.attach(e),e._zod.parse=(o,i)=>{let a=o.value;if(!Array.isArray(a))return o.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),o;o.value=r?r.alloc(e,o,Array(a.length),i):Array(a.length);let n=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let r=a[e],l=t.element._zod.run({value:r,issues:[]},i);if(l instanceof Promise)n.push(l.then(t=>ru(t,o,e)));else if(ru(l,o,e),s&&0!==l.issues.length&&eg(l))break}return n.length?Promise.all(n).then(()=>o):o},function(e,t){let r=eb(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(r,a)=>{let n=t(r.value);if(n>o&&!a?.skipChecks&&a?.direction!=="backward"){for(let[t,o]of eb(e._zod.def.checks))if(n>t&&o._zod.def.when(r)){let t=r.issues.length;return o._zod.check(r),r.issues[t].continue=!1,eS(r.issues,t,e),r}}return i(r,a)}}(e,rc)});function rp(e,t,r,o,i,a){let n=r in o,s="optional"===a;if(n||!s||"optional"!==i){if(e.issues.length){if(void 0!==i&&s&&!n)return;t.issues.push(...ev(r,e.issues))}if(!n&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(n||"defaulted"===i&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let rh=[];function rf(e){var t;let r=Object.keys(e.shape),o=Object.getOwnPropertySymbols(e.shape),i=o.length?o:rh,a=i.length?[...r,...i]:r;for(let t of a)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let n=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:a,symbolKeys:i,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function rm(e,t,r,o,i,a,n){let s=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,d=c.optin,p=c.optout,h=0;for(let i in t){if(n&&r.issues.length!==h){if(eg(r,h))break;h=r.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===u&&s.push(i);continue}if("never"===u){s.push(i);continue}let a=c.run({value:t[i],issues:[]},o);a instanceof Promise?e.push(a.then(e=>rp(e,r,i,t,d,p))):rp(a,r,i,t,d,p)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let ry=ez("$ZodObject",(e,t)=>{let r;tT.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape"),i=o?.get?o.get.raw:t.shape??{};if(i){let e=()=>{let r={...i};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let a=J(()=>rf(t));eC(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let o=t[e]._zod;if(o.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||G(r,e,new Set),o.values))r[e].add(t);void 0!==o.optin&&r[e].add(void 0)}}return r});let n=t.catchall,s=eM.memoizer;s?.attach(e),e._zod.parse=(t,o)=>{r??(r=a.value);let i=t.value;if(!eo(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=s?s.alloc(e,t,{},o):{};let l=[],c=r.shape,u=o?.abortEarly,d=t.issues.length;for(let e of r.allKeys){if(u&&t.issues.length!==d){if(eg(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let r=c[e],a=r._zod.optin,n=r._zod.optout,s=r._zod.run({value:i[e],issues:[]},o);s instanceof Promise?l.push(s.then(r=>rp(r,t,e,i,a,n))):rp(s,t,e,i,a,n)}return n?rm(l,i,t,o,a.value,e,!0===u):l.length?Promise.all(l).then(()=>t):t}}),rg=ez("$ZodObjectJIT",(e,t)=>{let r,o;ry.init(e,t);let i=e._zod.parse,a=J(()=>rf(t)),n=eM.memoizer,s=!eM.jitless,l=s&&ei.value,c=t.catchall;e._zod.parse=(u,d)=>{o??(o=a.value);let p=u.value;return eo(p)?s&&l&&d?.async===!1&&!0!==d.jitless?(r||(r=(t=>{let r=a.value,o=r.symbolKeys,i=new tE(["payload","ctx"],{shape:t,inst:e,memo:n,syms:o}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
4
4
|
let ${e}_ab = false;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`,u);if(-1===t&&(t=o),o<4096)(-1===(e=r.indexOf("#",u))||e>t)&&(e=t);else for(e=u;e<t&&35!==r.charCodeAt(e);)e++;let i=u,n=e;for(;i<n&&f(r.charCodeAt(i));)i++;for(;n>i&&f(r.charCodeAt(n-1));)n--;let s=r.charCodeAt(i);if((y=r.slice(i,n)).includes("\u2028")||y.includes("\u2029")?y=y.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"):n-i>=2&&(39===s||34===s||96===s)&&r.charCodeAt(n-1)===s&&(y=r.slice(i+1,n-1)),a=e,e<t)for(;a<o&&!h(r.charCodeAt(a));)a++}34===m&&(g||d<a)&&-1!==y.indexOf("\\")&&(y=y.replace(/\\n/g,`
|
|
4
4
|
`).replace(/\\r/g,"\r")),t[l]=y}return t}(e):function(e){let t,r={},o=e.toString();for(o=o.replace(/\r\n?/mg,`
|
|
5
5
|
`);null!=(t=d.exec(o));){let e=t[1],o=t[2]||"",a=(o=o.trim())[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),'"'===a&&(o=(o=o.replace(/\\n/g,`
|
|
6
|
-
`)).replace(/\\r/g,"\r")),r[e]=o}return r}(e)},populate:function(e,t,r={}){let o=c(r&&r.debug),a=c(r&&r.override),i={};if(null===e||"object"!=typeof e||null===t||"object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r],i[r]=t[r]),o&&m(!0===a?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):(e[r]=t[r],i[r]=t[r]);return i}};t.exports.configDotenv=g.configDotenv,t.exports.config=g.config,t.exports.parse=g.parse,t.exports.populate=g.populate,t.exports=g})();e.exports=i,e.exports.config=i.config,e.exports.configDotenv=i.configDotenv,e.exports.parse=i.parse,e.exports.populate=i.populate},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.13.0"}')}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,a),i.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var i=Object.create(null);a.r(i);var n={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{n[e]=()=>r[e]});return n.default=()=>r,a.d(i,n),i},a.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};for(var n in(()=>{"use strict";let e,t,r,o,n,s,l,c,u,d,p,f,h,m,y,g,v,_,b,S,$,w,E,R;a.r(i),a.d(i,{HOST_CONTEXT_CHANGED_METHOD:()=>yi,INITIALIZED_METHOD:()=>m8,INITIALIZE_METHOD:()=>m6,LOG_MESSAGE_METHOD:()=>yo,MCP_APPS_PROTOCOL_VERSION:()=>m4,OPEN_LINK_METHOD:()=>ye,REQUEST_DISPLAY_MODE_METHOD:()=>m7,RESOURCES_READ_METHOD:()=>ya,SIZE_CHANGED_METHOD:()=>yn,UI_MESSAGE_METHOD:()=>yr,UPDATE_MODEL_CONTEXT_METHOD:()=>yt,UrlElicitationRequiredError:()=>l7,acceptedContent:()=>c_,apiKeyAuthMiddleware:()=>V,audio:()=>Y,callSTDIOClientTool:()=>m9,completable:()=>di,createContext:()=>Z,createHTTPClient:()=>m0,createMcpHostBridge:()=>yc,createRequestStateCodec:()=>dl,createSTDIOClient:()=>m1,disconnectSTDIOClient:()=>m3,embeddedResource:()=>Q,extractToolNamesFromRequest:()=>m5,getRequestContext:()=>er,headersToRecord:()=>mW,image:()=>X,inputRequired:()=>cv,inputResponse:()=>cb,isEnvHeader:()=>mZ,isInputRequiredResult:()=>ci,jwtAuthMiddleware:()=>K,listSTDIOClientTools:()=>m2});var P,O,k,x,T,C,j,I,N,A,M,q=a(8717),z=a.n(q);let L=require("zod/v3"),D=L.z.object({apiKey:L.z.string().optional(),headerName:L.z.string().optional(),validateApiKey:L.z.function().args(L.z.string()).returns(L.z.promise(L.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),U="Unauthorized: Missing or invalid API key";function V(e){let t=D.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,n)=>{let s=t.header(r);!s||"apiKey"in e&&s!==o||a&&!await a(s)?i.status(401).json({error:U}):n()}}var F=a(8400),H=a.n(F);function K(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=H().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let G=require("async_hooks"),B=(e,t)=>{globalThis[e]=t},J=e=>globalThis[e];function Z({name:e,fallback:t=!0}){let r=Symbol.for(`xmcp-context-${e}`),o=Symbol.for(`xmcp-context-${e}-fallback-store`);if(J(r))return J(r);let a=new G.AsyncLocalStorage,i=globalThis[o]??{current:null};B(o,i);let n={provider:(e,r)=>(t&&(i.current=e),a.run(e,r)),getContext:()=>{let r=a.getStore();if(r)return r;if(t&&i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:r=>{let o=a.getStore()??(t?i.current:null);if(!o)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(o,r)}};return B(r,n),n}function W(e){let t;if(e instanceof Uint8Array)t=e;else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}function X(e,t){return{type:"image",data:W(e),mimeType:t}}function Y(e,t){return{type:"audio",data:W(e),mimeType:t}}function Q(e,t,r){return{type:"resource",resource:{uri:e,...void 0===r?{}:{mimeType:r},..."string"==typeof t?{text:t}:{blob:W(t)}}}}let ee=Z({name:"http-request-context"});ee.setContext,ee.getContext,ee.provider;let et=Z({name:"request-context",fallback:!1});function er(){try{return et.getContext().value}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var eo=Object.create,ea=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyNames,es=Object.getPrototypeOf,el=Object.prototype.hasOwnProperty,ec=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function eu(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function ed(e,t="|"){return e.map(e=>eI(e)).join(t)}function ep(e,t){return"bigint"==typeof t?t.toString():t}class ef{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function eh(e){return new ef(e)}function em(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let ey=Symbol("evaluating");function eg(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ev(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function e_(e){return ev(e._zod.def)??e._zod.def.shape}function eb(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return eg(this,t,e),e},enumerable:!0,configurable:!0})}function eS(e,t,r){t in e?eg(e,t,r):e[t]=r}function e$(e,t,r,o){let a=e_(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(a,i);r.enumerable&&(r.get?eb(e,i,()=>{let e=t._zod.def.shape[i];return o?o(e,i):e}):eS(e,i,o?o(r.value,i):r.value))}}function ew(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let eE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eR(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eP=eh(()=>{if(e4.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eO(e){if(!1===eR(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eR(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ek(e){return eO(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ex=new Set(["string","number","symbol"]);function eT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eC(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ej(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eI(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let eN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eM(e,t){let r=e_(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function eq(e,t){let r={};e$(r,e,Reflect.ownKeys(e_(e)));var o=r,a=t;for(let e of Reflect.ownKeys(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable&&(t.get?eb(o,e,()=>a[e]):eS(o,e,t.value))}return r}function ez(e,t,r,o="partial"){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let i=r?new Set(eM(t,r)):void 0,n={};return e$(n,t,Reflect.ownKeys(e_(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),eC(t,ew(t._zod.def,{shape:n,checks:[]}))}function eL(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eD(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eU(e){return"string"==typeof e?e:e?.message}function eV(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eF(e,t,r){var o;for(let a=t;a<e.length;a++)(o=e[a]).schema??(o.schema=r)}function eH(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let a=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eU(e.inst?._zod.def?.error?.(e))??eU(a?.(e))??eU(t?.error?.(e))??eU(r.customError?.(e))??eU(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=i,t?.reportInput&&(n.input=e.input),n}let eK=/[\uD800-\uDBFF]/;function eG(e){let t=e.length;if(!eK.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eJ(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function eZ(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eW(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eZ(this,r,o(this))},set(e){eZ(this,r,e)}})}return t}let eX=!1,eY={configurable:!0,get(){eX=!0}};function eQ(t,r,o){let a=Object.getPrototypeOf(t._zod);if(r in a&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(a,r,{configurable:!0,get(){Object.defineProperty(this,r,eY);let e=eX;eX=!1;try{let t=o(this);return eX?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eX=eX||e,t}catch(t){throw delete this[r],eX=eX||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let e0=Object.freeze({status:"aborted"}),e1={value:void 0,enumerable:!1},e2="captureStackTrace"in Error?Error:null;function e9(e,t,r,o){function a(e){this.def=e,this.constr=c,this.traits=new Set}a.prototype={};let i=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{e1.value=new a(n);try{Object.defineProperty(o,"_zod",e1)}finally{e1.value=void 0}}if(o._zod.traits.add(e),t(o,n),i){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,a=e;for(;a&&a!==t;)a=Object.getPrototypeOf(a);let n=a??e;if(!i.has(n)){i.add(n);var s=n,l=r;for(let e in l){let t=Object.getOwnPropertyDescriptor(l,e);t.get?Object.defineProperty(s,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eZ(this,t,r.bind(this))},set(e){eZ(this,t,e)}})}(s,e,t.value)}}}let u=c.prototype;for(let e in u)Object.prototype.hasOwnProperty.call(u,e)&&(e in o||(o[e]=u[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=e2;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e2=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let a=globalThis.__zod_globalConfig?.postProcessor;return a&&a(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class e3 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class e5 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(N=globalThis).__zod_globalConfig??(N.__zod_globalConfig={});let e4=globalThis.__zod_globalConfig;function e6(e){return e&&Object.assign(e4,e),e4}class e8 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let e7="~memo",te=[];function tt(e){return null!==e&&"object"==typeof e}function tr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let to=new WeakMap,ta=[],ti={alloc(e,r,o){let a=t;if(!a)return o;t=void 0;let i={value:o,issues:null};return a.set(r.value,i),ta.push(i),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,a;let i;if("backward"!==r.direction&&(o=r,a=e.value,void 0!==(i=o[e7]?.backEdges)&&tt(a)&&i.has(a)))throw new e8;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,a,i,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var a,i;let n=to.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let a=e(t,r,o);a>s&&(s=a)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=ev(u);c(t?((t,a)=>{let i=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(a&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>i&&(i=l)}return i})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let a=u._cachedInner??(o?t._zod.innerType:void 0);c(a?e(a,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),a=t,1!==(i=s)&&to.set(a,2===i),i}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!tt(d))return r(l,c);let p=c[e7];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[e7]=p),a===c)u=i;else{var f,h;let t;f=p,h=e,(t=f.buckets.get(h))||(t=new WeakMap,f.buckets.set(h,t)),u=t,a=c,i=u}let m=u.get(d);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...tr(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;t=u;let y=ta.length,g=r(l,c);t=void 0;let v=ta.length>y?ta.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?tr(e.issues):te),e)):(v&&(v.issues=g.issues.length?tr(g.issues):te),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},tn=/^[cC][0-9a-z]{6,}$/,ts=/^[0-9a-z]+$/,tl=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,tc=/^[0-9a-vA-V]{20}$/,tu=/^[A-Za-z0-9]{27}$/,td=/^[a-zA-Z0-9_-]{21}$/,tp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tf=/^([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})$/,th=e=>e?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)$/,tm=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ty=/^(?:(?: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])$/,tg=/^(([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}|:))$/,tv=/^((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])$/,t_=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tb=/^https?$/,tS=/^\+[1-9]\d{6,14}$/,t$="(?:(?:\\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])))",tw=(P=t$,RegExp(`^${P}$`));function tE(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let tR=/^[\s\S]{0,}$/,tP=/^-?\d+$/,tO=/^-?\d+(?:\.\d+)?$/,tk=/^(?:true|false)$/i,tx=/^null$/i,tT=/^[^A-Z]*$/,tC=/^[^a-z]*$/,tj=e9("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tI=e=>{let t=e.value;return null!=t&&void 0!==t.length},tN={number:"number",bigint:"bigint",object:"date"},tA=e9("$ZodCheckLessThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tN[typeof o.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tM=e9("$ZodCheckGreaterThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tN[typeof o.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tq=e9("$ZodCheckMultipleOf",(e,t)=>{tj.init(e,t),e._zod.check=r=>{var o;let a,i,n;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(i=Math.round(a=(o=r.value)/t.value),n=4*Number.EPSILON*Math.max(Math.abs(a),1),Math.abs(a-i)<n?0:a-i))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),tz=e9("$ZodCheckNumberFormat",(e,t)=>{tj.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eN[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<a&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),tL=e9("$ZodCheckMaxLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>t.maximum?eG(o):a)<=t.maximum)return;let i=eB(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tD=e9("$ZodCheckMinLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>=t.minimum&&a<2*t.minimum?eG(o):a)>=t.minimum)return;let i=eB(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tU=e9("$ZodCheckLengthEquals",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length,i="string"==typeof o&&a>=t.length&&a<=2*t.length?eG(o):a;if(i===t.length)return;let n=eB(o),s=i>t.length;r.issues.push({origin:n,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tV=e9("$ZodCheckStringFormat",(e,t)=>{var r,o;tj.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tF=e9("$ZodCheckRegex",(e,t)=>{tV.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})}}),tH=e9("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tT),tV.init(e,t)}),tK=e9("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tC),tV.init(e,t)}),tG=e9("$ZodCheckIncludes",(e,t)=>{tj.init(e,t);let r=eT(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tB=e9("$ZodCheckStartsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`^${eT(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tJ=e9("$ZodCheckEndsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`.*${eT(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tZ=e9("$ZodCheckOverwrite",(e,t)=>{tj.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tW{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
6
|
+
`)).replace(/\\r/g,"\r")),r[e]=o}return r}(e)},populate:function(e,t,r={}){let o=c(r&&r.debug),a=c(r&&r.override),i={};if(null===e||"object"!=typeof e||null===t||"object"!=typeof t){let e=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(let r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===a&&(e[r]=t[r],i[r]=t[r]),o&&m(!0===a?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):(e[r]=t[r],i[r]=t[r]);return i}};t.exports.configDotenv=g.configDotenv,t.exports.config=g.config,t.exports.parse=g.parse,t.exports.populate=g.populate,t.exports=g})();e.exports=i,e.exports.config=i.config,e.exports.configDotenv=i.configDotenv,e.exports.parse=i.parse,e.exports.populate=i.populate},8330(e){"use strict";e.exports=JSON.parse('{"name":"xmcp","version":"1.13.2"}')}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,a),i.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var i=Object.create(null);a.r(i);var n={};e=e||[null,t({}),t([]),t(t)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>{n[e]=()=>r[e]});return n.default=()=>r,a.d(i,n),i},a.d=(e,t,r)=>{var o=(t,r)=>{for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,[r]:t[o]})};o(t,"get"),o(r,"value")},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};for(var n in(()=>{"use strict";let e,t,r,o,n,s,l,c,u,d,p,f,h,m,y,g,v,_,b,S,$,w,E,R;a.r(i),a.d(i,{HOST_CONTEXT_CHANGED_METHOD:()=>yi,INITIALIZED_METHOD:()=>m8,INITIALIZE_METHOD:()=>m6,LOG_MESSAGE_METHOD:()=>yo,MCP_APPS_PROTOCOL_VERSION:()=>m4,OPEN_LINK_METHOD:()=>ye,REQUEST_DISPLAY_MODE_METHOD:()=>m7,RESOURCES_READ_METHOD:()=>ya,SIZE_CHANGED_METHOD:()=>yn,UI_MESSAGE_METHOD:()=>yr,UPDATE_MODEL_CONTEXT_METHOD:()=>yt,UrlElicitationRequiredError:()=>l7,acceptedContent:()=>c_,apiKeyAuthMiddleware:()=>V,audio:()=>Y,callSTDIOClientTool:()=>m9,completable:()=>di,createContext:()=>Z,createHTTPClient:()=>m0,createMcpHostBridge:()=>yc,createRequestStateCodec:()=>dl,createSTDIOClient:()=>m1,disconnectSTDIOClient:()=>m3,embeddedResource:()=>Q,extractToolNamesFromRequest:()=>m5,getRequestContext:()=>er,headersToRecord:()=>mW,image:()=>X,inputRequired:()=>cv,inputResponse:()=>cb,isEnvHeader:()=>mZ,isInputRequiredResult:()=>ci,jwtAuthMiddleware:()=>K,listSTDIOClientTools:()=>m2});var P,O,k,x,T,C,j,I,N,A,M,q=a(8717),z=a.n(q);let L=require("zod/v3"),D=L.z.object({apiKey:L.z.string().optional(),headerName:L.z.string().optional(),validateApiKey:L.z.function().args(L.z.string()).returns(L.z.promise(L.z.boolean())).optional()}).strict().refine(e=>void 0!==e.apiKey||void 0!==e.validateApiKey,{message:"Either 'apiKey' or 'validateApiKey' must be provided"}).refine(e=>void 0===e.apiKey||void 0===e.validateApiKey,{message:"'apiKey' and 'validateApiKey' are mutually exclusive - provide only one"}),U="Unauthorized: Missing or invalid API key";function V(e){let t=D.safeParse(e);if(!t.success){let r="apiKey"in e,o="validateApiKey"in e;if(r&&o)throw Error("'apiKey' and 'validateApiKey' are mutually exclusive - provide only one");if(r||o)throw Error(`Invalid configuration: ${t.error.message}`);throw Error("Either 'apiKey' or 'validateApiKey' must be provided")}let r=e.headerName??"x-api-key",o="apiKey"in e?e.apiKey:void 0,a="validateApiKey"in e?e.validateApiKey:void 0;return async(t,i,n)=>{let s=t.header(r);!s||"apiKey"in e&&s!==o||a&&!await a(s)?i.status(401).json({error:U}):n()}}var F=a(8400),H=a.n(F);function K(e){return(t,r,o)=>{let a=t.header("Authorization");if(!a||!a.startsWith("Bearer "))return void r.status(401).json({error:"Unauthorized: Missing or malformed Authorization header"});let i=a.slice(7).trim();if(!i)return void r.status(401).json({error:"Unauthorized: Missing access token"});try{let{secret:r,...a}=e;t.user=H().verify(i,r,a),o()}catch(e){r.status(401).json({error:"Unauthorized: Invalid or expired token"})}}}let G=require("async_hooks"),B=(e,t)=>{globalThis[e]=t},J=e=>globalThis[e];function Z({name:e,fallback:t=!0}){let r=Symbol.for(`xmcp-context-${e}`),o=Symbol.for(`xmcp-context-${e}-fallback-store`);if(J(r))return J(r);let a=new G.AsyncLocalStorage,i=globalThis[o]??{current:null};B(o,i);let n={provider:(e,r)=>(t&&(i.current=e),a.run(e,r)),getContext:()=>{let r=a.getStore();if(r)return r;if(t&&i.current)return i.current;throw Error(`getContext() can only be used within the ${e} context.`)},setContext:r=>{let o=a.getStore()??(t?i.current:null);if(!o)throw Error(`setContext() can only be used within the ${e} context.`);Object.assign(o,r)}};return B(r,n),n}function W(e){let t;if(e instanceof Uint8Array)t=e;else if(e instanceof ArrayBuffer)t=new Uint8Array(e);else throw TypeError("Expected bytes as a Uint8Array or ArrayBuffer");let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}function X(e,t){return{type:"image",data:W(e),mimeType:t}}function Y(e,t){return{type:"audio",data:W(e),mimeType:t}}function Q(e,t,r){return{type:"resource",resource:{uri:e,...void 0===r?{}:{mimeType:r},..."string"==typeof t?{text:t}:{blob:W(t)}}}}let ee=Z({name:"http-request-context"});ee.setContext,ee.getContext,ee.provider;let et=Z({name:"request-context",fallback:!1});function er(){try{return et.getContext().value}catch{throw Error("getRequestContext() can only be used while handling an MCP request.")}}var eo=Object.create,ea=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,en=Object.getOwnPropertyNames,es=Object.getPrototypeOf,el=Object.prototype.hasOwnProperty,ec=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function eu(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function ed(e,t="|"){return e.map(e=>eI(e)).join(t)}function ep(e,t){return"bigint"==typeof t?t.toString():t}class ef{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function eh(e){return new ef(e)}function em(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}let ey=Symbol("evaluating");function eg(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ev(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function e_(e){return ev(e._zod.def)??e._zod.def.shape}function eb(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return eg(this,t,e),e},enumerable:!0,configurable:!0})}function eS(e,t,r){t in e?eg(e,t,r):e[t]=r}function e$(e,t,r,o){let a=e_(t);for(let i of r){let r=Object.getOwnPropertyDescriptor(a,i);r.enumerable&&(r.get?eb(e,i,()=>{let e=t._zod.def.shape[i];return o?o(e,i):e}):eS(e,i,o?o(r.value,i):r.value))}}function ew(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let eE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function eR(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eP=eh(()=>{if(e4.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eO(e){if(!1===eR(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==eR(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function ek(e){return eO(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let ex=new Set(["string","number","symbol"]);function eT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eC(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ej(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eI(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let eN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eM(e,t){let r=e_(e),o=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&o.push(e)}return o}function eq(e,t){let r={};e$(r,e,Reflect.ownKeys(e_(e)));var o=r,a=t;for(let e of Reflect.ownKeys(a)){let t=Object.getOwnPropertyDescriptor(a,e);t.enumerable&&(t.get?eb(o,e,()=>a[e]):eS(o,e,t.value))}return r}function ez(e,t,r,o="partial"){let a=t._zod.def.checks;if(a&&a.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let i=r?new Set(eM(t,r)):void 0,n={};return e$(n,t,Reflect.ownKeys(e_(t)),e&&((t,r)=>i&&!i.has(r)?t:new e({type:"optional",innerType:t}))),eC(t,ew(t._zod.def,{shape:n,checks:[]}))}function eL(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eD(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eU(e){return"string"==typeof e?e:e?.message}function eV(e){let t=[];for(let r of e??[]){let e=r._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let o=e.maximum??e.length??e.size;o>=0&&t.push([o,r])}return t}function eF(e,t,r){var o;for(let a=t;a<e.length;a++)(o=e[a]).schema??(o.schema=r)}function eH(e,t,r){let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let a=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:eU(e.inst?._zod.def?.error?.(e))??eU(a?.(e))??eU(t?.error?.(e))??eU(r.customError?.(e))??eU(r.localeError?.(e))??"Invalid input",n={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(n[t]=e[t]);return n.path??(n.path=[]),n.message=i,t?.reportInput&&(n.input=e.input),n}let eK=/[\uD800-\uDBFF]/;function eG(e){let t=e.length;if(!eK.test(e))return t;let r=t;for(let o=0;o<t-1;o++)(64512&e.charCodeAt(o))==55296&&(64512&e.charCodeAt(o+1))==56320&&(r--,o++);return r}function eB(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eJ(...e){let[t,r,o]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:o}:{...t}}function eZ(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function eW(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eZ(this,r,o(this))},set(e){eZ(this,r,e)}})}return t}let eX=!1,eY={configurable:!0,get(){eX=!0}};function eQ(t,r,o){let a=Object.getPrototypeOf(t._zod);if(r in a&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(a,r,{configurable:!0,get(){Object.defineProperty(this,r,eY);let e=eX;eX=!1;try{let t=o(this);return eX?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eX=eX||e,t}catch(t){throw delete this[r],eX=eX||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let e0=Object.freeze({status:"aborted"}),e1={value:void 0,enumerable:!1},e2="captureStackTrace"in Error?Error:null;function e9(e,t,r,o){function a(e){this.def=e,this.constr=c,this.traits=new Set}a.prototype={};let i=r&&new WeakSet;function n(o,n){if(o._zod){if(o._zod.traits.has(e))return}else{e1.value=new a(n);try{Object.defineProperty(o,"_zod",e1)}finally{e1.value=void 0}}if(o._zod.traits.add(e),t(o,n),i){let e=Object.getPrototypeOf(o),t=o._zod.constr.prototype,a=e;for(;a&&a!==t;)a=Object.getPrototypeOf(a);let n=a??e;if(!i.has(n)){i.add(n);var s=n,l=r;for(let e in l){let t=Object.getOwnPropertyDescriptor(l,e);t.get?Object.defineProperty(s,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eZ(this,t,r.bind(this))},set(e){eZ(this,t,e)}})}(s,e,t.value)}}}let u=c.prototype;for(let e in u)Object.prototype.hasOwnProperty.call(u,e)&&(e in o||(o[e]=u[e].bind(o)))}let s=o?.Parent??Object;class l extends s{}function c(e){let t=o?.Parent?function(e){let t=e2;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return e2=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(l):this;n(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let a=globalThis.__zod_globalConfig?.postProcessor;return a&&a(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:t=>!!o?.Parent&&t instanceof o.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class e3 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class e5 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(N=globalThis).__zod_globalConfig??(N.__zod_globalConfig={});let e4=globalThis.__zod_globalConfig;function e6(e){return e&&Object.assign(e4,e),e4}class e8 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let e7="~memo",te=[];function tt(e){return null!==e&&"object"==typeof e}function tr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let to=new WeakMap,ta=[],ti={alloc(e,r,o){let a=t;if(!a)return o;t=void 0;let i={value:o,issues:null};return a.set(r.value,i),ta.push(i),o},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var o,a;let i;if("backward"!==r.direction&&(o=r,a=e.value,void 0!==(i=o[e7]?.backEdges)&&tt(a)&&i.has(a)))throw new e8;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let o,a,i,n=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,c)=>{let u;if(void 0===o){let t=function e(t,r,o){var a,i;let n=to.get(t);if(void 0!==n)return 2*!!n;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let a=e(t,r,o);a>s&&(s=a)}},c=e=>{e>s&&(s=e)},u=t._zod.def;switch(u.type){case"object":{let t=ev(u);c(t?((t,a)=>{let i=0;for(let n of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,n);if(a&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,o):0;l>i&&(i=l)}return i})(t,!0):1),l(u.catchall);break}case"array":l(u.element);break;case"tuple":for(let e of u.items)l(e);l(u.rest);break;case"record":case"map":l(u.keyType),l(u.valueType);break;case"set":l(u.valueType);break;case"union":for(let e of u.options)l(e);break;case"intersection":l(u.left),l(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(u.innerType);break;case"pipe":l(u.in),l(u.out);break;case"function":l(u.input),l(u.output);break;case"lazy":{let a=u._cachedInner??(o?t._zod.innerType:void 0);c(a?e(a,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in u){let t=Object.getOwnPropertyDescriptor(u,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),a=t,1!==(i=s)&&to.set(a,2===i),i}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,c);2===t||n?o=!0:n=!0}let d=l.value;if(!tt(d))return r(l,c);let p=c[e7];if(p||(p={buckets:new WeakMap,backEdges:void 0},c[e7]=p),a===c)u=i;else{var f,h;let t;f=p,h=e,(t=f.buckets.get(h))||(t=new WeakMap,f.buckets.set(h,t)),u=t,a=c,i=u}let m=u.get(d);if(m)return l.value=m.value,m.issues?m.issues.length&&l.issues.push(...tr(m.issues)):(l.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(m.value)),l;t=u;let y=ta.length,g=r(l,c);t=void 0;let v=ta.length>y?ta.pop():void 0;return g instanceof Promise?g.then(e=>(v&&(v.issues=e.issues.length?tr(e.issues):te),e)):(v&&(v.issues=g.issues.length?tr(g.issues):te),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},tn=/^[cC][0-9a-z]{6,}$/,ts=/^[0-9a-z]+$/,tl=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,tc=/^[0-9a-vA-V]{20}$/,tu=/^[A-Za-z0-9]{27}$/,td=/^[a-zA-Z0-9_-]{21}$/,tp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tf=/^([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})$/,th=e=>e?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)$/,tm=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ty=/^(?:(?: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])$/,tg=/^(([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}|:))$/,tv=/^((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])$/,t_=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tb=/^https?$/,tS=/^\+[1-9]\d{6,14}$/,t$="(?:(?:\\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])))",tw=(P=t$,RegExp(`^${P}$`));function tE(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let tR=/^[\s\S]{0,}$/,tP=/^-?\d+$/,tO=/^-?\d+(?:\.\d+)?$/,tk=/^(?:true|false)$/i,tx=/^null$/i,tT=/^[^A-Z]*$/,tC=/^[^a-z]*$/,tj=e9("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tI=e=>{let t=e.value;return null!=t&&void 0!==t.length},tN={number:"number",bigint:"bigint",object:"date"},tA=e9("$ZodCheckLessThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:tN[typeof o.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tM=e9("$ZodCheckGreaterThan",(e,t)=>{tj.init(e,t);let r=tN[typeof t.value];e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:tN[typeof o.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tq=e9("$ZodCheckMultipleOf",(e,t)=>{tj.init(e,t),e._zod.check=r=>{var o;let a,i,n;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(i=Math.round(a=(o=r.value)/t.value),n=4*Number.EPSILON*Math.max(Math.abs(a),1),Math.abs(a-i)<n?0:a-i))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),tz=e9("$ZodCheckNumberFormat",(e,t)=>{tj.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[a,i]=eN[t.format];e._zod.check=n=>{let s=n.value;if(r){if(!Number.isInteger(s))return void n.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?n.issues.push({input:s,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}):n.issues.push({input:s,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}))}s<a&&n.issues.push({origin:"number",input:s,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>i&&n.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),tL=e9("$ZodCheckMaxLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>t.maximum?eG(o):a)<=t.maximum)return;let i=eB(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tD=e9("$ZodCheckMinLength",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length;if(("string"==typeof o&&a>=t.minimum&&a<2*t.minimum?eG(o):a)>=t.minimum)return;let i=eB(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tU=e9("$ZodCheckLengthEquals",(e,t)=>{var r;tj.init(e,t),(r=e._zod.def).when??(r.when=tI),e._zod.check=r=>{let o=r.value,a=o.length,i="string"==typeof o&&a>=t.length&&a<=2*t.length?eG(o):a;if(i===t.length)return;let n=eB(o),s=i>t.length;r.issues.push({origin:n,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tV=e9("$ZodCheckStringFormat",(e,t)=>{var r,o;tj.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),tF=e9("$ZodCheckRegex",(e,t)=>{tV.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})}}),tH=e9("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tT),tV.init(e,t)}),tK=e9("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tC),tV.init(e,t)}),tG=e9("$ZodCheckIncludes",(e,t)=>{tj.init(e,t);let r=eT(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tB=e9("$ZodCheckStartsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`^${eT(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tJ=e9("$ZodCheckEndsWith",(e,t)=>{tj.init(e,t);let r=RegExp(`.*${eT(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),tZ=e9("$ZodCheckOverwrite",(e,t)=>{tj.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class tW{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
7
7
|
${t.join("\n")}
|
|
8
8
|
};`)(...Object.values(this.closed))}}let tX={major:4,minor:6,patch:7},tY=e9("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tX;let o=e._zod.def.checks,a=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let t of a)for(let r of t._zod.onattach)r(e);if(0===a.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,o)=>{let a;if(t.memo)return t;let i=eL(t);for(let n of r){if(n._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(t)||!n._zod.def.when(t))continue}else if(i)continue;let r=t.issues.length,s=n._zod.check(t);if(s instanceof Promise&&o?.async===!1)throw new e3;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eF(t.issues,r,e),i||(i=eL(t,r)))});else{if(t.issues.length===r)continue;eF(t.issues,r,e),i||(i=eL(t,r))}}return a?a.then(()=>t):t},r=(r,o,i)=>{if(eL(r))return r.aborted=!0,r;let n=t(o,a,i);if(n instanceof Promise){if(!1===i.async)throw new e3;return n.then(t=>e._zod.parse(t,i))}return e._zod.parse(n,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){let t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,o,i)):r(t,o,i)}let n=e._zod.parse(o,i);if(n instanceof Promise){if(!1===i.async)throw new e3;return n.then(e=>t(e,a,i))}return t(n,a,i)}}},{get"~standard"(){var e;return e=this,eZ(e,"~standard",t0(this),!1)},set"~standard"(e){eZ(this,"~standard",e)}}),tQ=(e,t)=>e.issues.length?{issues:e.issues.map(e=>eH(e,t,e6()))}:{value:e.value};function t0(e){return{validate:t=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return tQ(o,r)}catch(e){}return async function(e,t){let r={async:!0};return tQ(await e._zod.run({value:t,issues:[]},r),r)}(e,t)},vendor:"zod",version:1}}let t1=e9("$ZodString",(e,t)=>{tY.init(e,t),e._zod.pattern=t.pattern??tR,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),t2=e9("$ZodStringFormat",(e,t)=>{tV.init(e,t),t1.init(e,t)}),t9=e9("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tf),t2.init(e,t)}),t3=e9("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=th(e))}else t.pattern??(t.pattern=th());t2.init(e,t)}),t5=e9("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tm),t2.init(e,t)});function t4(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let t6=/[\t\n\r]/g;function t8(e){return e.replace(t6,"")}let t7=e9("$ZodURL",(e,t)=>{t2.init(e,t),e._zod.check=r=>{try{var o,a,i,n,s,l;let c=r.value.trim(),u=(o=c,a=t,"normalize"in a||"hostname"in a||"protocol"in a?function(e,t){if(!t.normalize&&t.protocol?.source===tb.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,a):t4(o)||2);if(1===u)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===u)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===u){r.value=t8(c);return}t.hostname&&(i=u,(n=t.hostname).lastIndex=0,!n.test(i.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&&(s=u,(l=t.protocol).lastIndex=0,!l.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?u.href:t8(c);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),re=e9("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),t2.init(e,t)}),rt=e9("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?td:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),t2.init(e,t)}),rr=e9("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tn),t2.init(e,t)}),ro=e9("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ts),t2.init(e,t)}),ra=e9("$ZodULID",(e,t)=>{t.pattern??(t.pattern=tl),t2.init(e,t)}),ri=e9("$ZodXID",(e,t)=>{t.pattern??(t.pattern=tc),t2.init(e,t)}),rn=e9("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tu),t2.init(e,t)}),rs=e9("$ZodISODateTime",(e,t)=>{var r;let o,a,i;t.pattern??(o=["Z"],(r=t).offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),a=`${tE({precision:r.precision,seconds:!0})}(?:${o.join("|")})`,i=r.local?`${a}|${tE({precision:r.precision})}`:a,t.pattern=RegExp(`^${t$}T(?:${i})$`)),t2.init(e,t)}),rl=e9("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tw),t2.init(e,t)}),rc=e9("$ZodISOTime",(e,t)=>{var r;t.pattern??(r=t,t.pattern=RegExp(`^${tE(r)}$`)),t2.init(e,t)}),ru=e9("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tp),t2.init(e,t)}),rd=e9("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ty),t2.init(e,t)}),rp=/^[0-9a-fA-F:.]+$/;function rf(e){return!!rp.test(e)&&t4(`http://[${e}]`)}let rh=e9("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tg),t2.init(e,t),e._zod.check=r=>{rf(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),rm=e9("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tv),t2.init(e,t)}),ry=e9("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=t_),t2.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,o]=t;if(!o)return!1;let a=Number(o);return`${a}`===o&&!(a<0)&&!(a>128)&&rf(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function rg(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let rv=/^[0-9a-zA-Z+/]*={0,2}$/,r_=e9("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=rv),t2.init(e,t),e._zod.check=r=>{rg(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),rb=/^[A-Za-z0-9_-]*$/,rS=e9("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rb),t2.init(e,t),e._zod.check=r=>{!function(e){if(!rb.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return rg(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),r$=e9("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tS),t2.init(e,t)}),rw=e9("$ZodJWT",(e,t)=>{t2.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[o]=r;if(!o)return!1;let a=JSON.parse(atob(o));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),rE=e9("$ZodNumber",(e,t)=>{tY.init(e,t),e._zod.pattern=tO,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let a=r.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return r;let i="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:String(a):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...i?{received:i}:{}}),r}}),rR=e9("$ZodNumberFormat",(e,t)=>{tz.init(e,t),rE.init(e,t)}),rP=e9("$ZodBoolean",(e,t)=>{tY.init(e,t),e._zod.pattern=tk,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let a=r.value;return"boolean"==typeof a||r.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),r}}),rO=e9("$ZodNull",(e,t)=>{tY.init(e,t),e._zod.pattern=tx,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),rk=e9("$ZodAny",(e,t)=>{tY.init(e,t),e._zod.parse=e=>e}),rx=e9("$ZodUnknown",(e,t)=>{tY.init(e,t),e._zod.parse=e=>e}),rT=e9("$ZodNever",(e,t)=>{tY.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rC=e=>Array.isArray(e)?e.length:-1;function rj(e,t,r){e.issues.length&&t.issues.push(...eD(r,e.issues)),t.value[r]=e.value}let rI=e9("$ZodArray",(e,t)=>{tY.init(e,t);let r=e4.memoizer;r?.attach(e),e._zod.parse=(o,a)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),o;o.value=r?r.alloc(e,o,Array(i.length),a):Array(i.length);let n=[],s=a?.abortEarly;for(let e=0;e<i.length;e++){let r=i[e],l=t.element._zod.run({value:r,issues:[]},a);if(l instanceof Promise)n.push(l.then(t=>rj(t,o,e)));else if(rj(l,o,e),s&&0!==l.issues.length&&eL(l))break}return n.length?Promise.all(n).then(()=>o):o},function(e,t){let r=eV(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map(e=>e[0])),a=e._zod.parse;e._zod.parse=(r,i)=>{let n=t(r.value);if(n>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[t,o]of eV(e._zod.def.checks))if(n>t&&o._zod.def.when(r)){let t=r.issues.length;return o._zod.check(r),r.issues[t].continue=!1,eF(r.issues,t,e),r}}return a(r,i)}}(e,rC)});function rN(e,t,r,o,a,i){let n=r in o,s="optional"===i;if(n||!s||"optional"!==a){if(e.issues.length){if(void 0!==a&&s&&!n)return;t.issues.push(...eD(r,e.issues))}if(!n&&void 0===a){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(n||"defaulted"===a&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let rA=[];function rM(e){var t;let r=Object.keys(e.shape),o=Object.getOwnPropertySymbols(e.shape),a=o.length?o:rA,i=a.length?[...r,...a]:r;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let n=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:i,symbolKeys:a,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function rq(e,t,r,o,a,i,n){let s=[],l=a.keySet,c=a.catchall._zod,u=c.def.type,d=c.optin,p=c.optout,f=0;for(let a in t){if(n&&r.issues.length!==f){if(eL(r,f))break;f=r.issues.length}if(l.has(a))continue;if("__proto__"===a){"never"===u&&s.push(a);continue}if("never"===u){s.push(a);continue}let i=c.run({value:t[a],issues:[]},o);i instanceof Promise?e.push(i.then(e=>rN(e,r,a,t,d,p))):rN(i,r,a,t,d,p)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let rz=e9("$ZodObject",(e,t)=>{let r;tY.init(e,t);let o=Object.getOwnPropertyDescriptor(t,"shape"),a=o?.get?o.get.raw:t.shape??{};if(a){let e=()=>{let r={...a};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=a,Object.defineProperty(t,"shape",{get:e})}let i=eh(()=>rM(t));eQ(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let o=t[e]._zod;if(o.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||eg(r,e,new Set),o.values))r[e].add(t);void 0!==o.optin&&r[e].add(void 0)}}return r});let n=t.catchall,s=e4.memoizer;s?.attach(e),e._zod.parse=(t,o)=>{r??(r=i.value);let a=t.value;if(!eR(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value=s?s.alloc(e,t,{},o):{};let l=[],c=r.shape,u=o?.abortEarly,d=t.issues.length;for(let e of r.allKeys){if(u&&t.issues.length!==d){if(eL(t,d))break;d=t.issues.length}if("__proto__"===e)continue;let r=c[e],i=r._zod.optin,n=r._zod.optout,s=r._zod.run({value:a[e],issues:[]},o);s instanceof Promise?l.push(s.then(r=>rN(r,t,e,a,i,n))):rN(s,t,e,a,i,n)}return n?rq(l,a,t,o,i.value,e,!0===u):l.length?Promise.all(l).then(()=>t):t}}),rL=e9("$ZodObjectJIT",(e,t)=>{let r,o;rz.init(e,t);let a=e._zod.parse,i=eh(()=>rM(t)),n=e4.memoizer,s=!e4.jitless,l=s&&eP.value,c=t.catchall;e._zod.parse=(u,d)=>{o??(o=i.value);let p=u.value;return eR(p)?s&&l&&d?.async===!1&&!0!==d.jitless?(r||(r=(t=>{let r=i.value,o=r.symbolKeys,a=new tW(["payload","ctx"],{shape:t,inst:e,memo:n,syms:o}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
9
9
|
let ${e}_ab = false;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmcp",
|
|
3
3
|
"description": "The TypeScript MCP framework",
|
|
4
|
-
"version": "1.13.
|
|
4
|
+
"version": "1.13.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "xmcp",
|
|
7
7
|
"email": "support@xmcp.dev",
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"keywords": [
|
|
24
24
|
"mcp",
|
|
25
|
+
"mcp-server",
|
|
26
|
+
"mcp-framework",
|
|
25
27
|
"modelcontextprotocol",
|
|
28
|
+
"model-context-protocol",
|
|
29
|
+
"typescript",
|
|
30
|
+
"ai-agents",
|
|
26
31
|
"http",
|
|
27
32
|
"stdio"
|
|
28
33
|
],
|