@usex/mikrotik-mcp 5.11.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1076 -279
- package/dist/index.js +1 -1
- package/dist/shared/{library-drn9gmjm.js → library-56rhcw1r.js} +1 -1
- package/dist/shared/{library-tm6yshkz.js → library-mx28f6gt.js} +957 -254
- package/dist/ui/aaa.html +1 -1
- package/dist/ui/connected-devices.html +1 -1
- package/dist/ui/dashboard.html +1 -1
- package/dist/ui/fabric.html +8 -6
- package/dist/ui/firewall-audit.html +1 -1
- package/dist/ui/firewall.html +1 -1
- package/dist/ui/interfaces.html +1 -1
- package/dist/ui/investigations.html +8 -6
- package/dist/ui/observability.html +68 -65
- package/dist/ui/operations.html +8 -6
- package/dist/ui/records.html +21 -19
- package/dist/ui/reports.html +8 -6
- package/dist/ui/round-trip.html +8 -6
- package/dist/ui/service-health.html +8 -6
- package/package.json +8 -7
- package/schemas/README.md +1 -1
- package/schemas/tool-catalog.json +232 -2
- package/schemas/tools/apply_home_policy.json +18 -0
- package/schemas/tools/compare_home_paths.json +29 -0
- package/schemas/tools/diagnose_home_internet.json +20 -0
- package/schemas/tools/get_home_internet.json +7 -0
- package/schemas/tools/name_home_device.json +22 -0
- package/schemas/tools/preview_home_policy.json +34 -0
- package/schemas/tools/refresh_home_devices.json +7 -0
- package/schemas/tools/undo_home_policy.json +18 -0
- /package/dist/shared/{cli-m947aqb2.js → cli-hfeatjkc.js} +0 -0
package/dist/ui/interfaces.html
CHANGED
|
@@ -60,7 +60,7 @@ var e=Object.defineProperty,t=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exp
|
|
|
60
60
|
|
|
61
61
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ce,c=!S.jitless,u=c&&le.value,d=t.catchall,f;e._zod.parse=(i,l)=>{f??=r.value;let p=i.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=a(t.shape),i=o(i,l),d?Nr([],p,i,l,f,e,l?.abortEarly===!0):i):n(i,l):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Ir(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!De(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Me(e,r,C())))}),t)}var Lr=x(`$ZodUnion`,(e,t)=>{E.init(e,t),b(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),b(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),b(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),b(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Ir(t,r,e,i)):Ir(o,r,e,i)}});function Rr(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var zr=x(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Lr.init(e,t);let n=e._zod.parse;b(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||h(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=ee(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=l(()=>Rr(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ce(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Br=x(`$ZodIntersection`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Hr(e,t,n)):Hr(e,i,a)}});function Vr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ue(e)&&ue(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Vr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Vr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Hr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Vr(t.value,n.value);if(!c.valid){if(De(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ur=x(`$ZodRecord`,(e,t)=>{E.init(e,t);let n=S.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!ue(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Me(e,i,C())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...ke(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ke(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&T.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Me(e,i,C())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...ke(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ke(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Wr=x(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,b(e,`pattern`,e=>{let t=a(e.def.entries).filter(e=>fe.has(typeof e));return RegExp(t.length?`^(${t.map(e=>pe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Gr=x(`$ZodLiteral`,(e,t)=>{E.init(e,t);let n=new Set(t.values);e._zod.values=n,b(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?pe(e):e?pe(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Kr=x(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,S.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new tt;return n.value=i,n}});function qr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Jr=x(`$ZodOptional`,(e,t)=>{E.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>qr(e,t)):qr(e,r)}return t.innerType._zod.run(e,n)}}),Yr=x(`$ZodExactOptional`,(e,t)=>{Jr.init(e,t),b(e,`values`,e=>e.def.innerType._zod.values),b(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Xr=x(`$ZodNullable`,(e,t)=>{E.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin),b(e,`optout`,e=>e.def.innerType._zod.optout),b(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)}|null)$`):void 0}),b(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Zr=x(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`defaulted`,b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Qr(e,t)):Qr(r,t)}});function Qr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var $r=x(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`defaulted`,b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ei=x(`$ZodNonOptional`,(e,t)=>{E.init(e,t),b(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ti(t,e)):ti(i,e)}});function ti(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ni(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Me(e,r,C()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ri=x(`$ZodCatch`,(e,t)=>{E.init(e,t),b(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),b(e,`optout`,e=>e.def.innerType._zod.optout),b(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ni(e,r,t,n)):ni(e,r,t,n)}}),ii=x(`$ZodPipe`,(e,t)=>{E.init(e,t),b(e,`values`,e=>e.def.in._zod.values),b(e,`optin`,e=>e.def.in._zod.optin),b(e,`optout`,e=>e.def.out._zod.optout),b(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ai(e,t.in,n)):ai(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ai(e,t.out,n)):ai(r,t.out,n)}});function ai(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var oi=x(`$ZodPreprocess`,(e,t)=>{ii.init(e,t)}),si=x(`$ZodReadonly`,(e,t)=>{E.init(e,t),b(e,`propValues`,e=>e.def.innerType._zod.propValues),b(e,`values`,e=>e.def.innerType._zod.values),b(e,`optin`,e=>e.def.innerType?._zod?.optin),b(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ci):ci(r)}});function ci(e){return e.memo||(e.value=Object.freeze(e.value)),e}var li=x(`$ZodLazy`,(e,t)=>{E.init(e,t),m(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),b(e,`pattern`,e=>e.innerType?._zod?.pattern),b(e,`propValues`,e=>e.innerType?._zod?.propValues),b(e,`optin`,e=>e.innerType?._zod?.optin??void 0),b(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),ui=x(`$ZodCustom`,(e,t)=>{fn.init(e,t),E.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>di(t,n,r,e));di(i,n,r,e)}});function di(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Le(e))}}var fi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},pi=`~memo`,mi=[];function hi(e){return typeof e==`object`&&!!e}function gi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var _i=new WeakMap,vi=0,yi=1,bi=2;function xi(e,t,n){let r=_i.get(e);if(r!==void 0)return r?bi:vi;if(t.has(e))return bi;t.add(e);let i=vi,a=e=>{if(i!==bi&&e?._zod){let r=xi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=vi;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?yi:o.value?._zod?xi(o.value,t,n):vi;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=ee(c);s(e?o(e,!0):yi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?xi(r,t,!1):yi);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 c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Si(e,i)}function Si(e,t){return t!==yi&&_i.set(e,t===bi),t}function Ci(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var wi,Ti=[],Ei={alloc(e,t,n){let r=wi;if(!r)return n;wi=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ti.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Oi(n,e.value))throw new fi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=xi(e,new Set,!1);if(i===vi)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===bi||r?n=!0:r=!0}let l=s.value;if(!hi(l))return t(s,c);let u=c[pi];u||(u={buckets:new WeakMap,backEdges:void 0},c[pi]=u);let d;i===c?d=a:(d=Ci(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...gi(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;wi=d;let p=Ti.length,m=t(s,c);wi=void 0;let h=Ti.length>p?Ti.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?gi(e.issues):mi),e)):(h&&(h.issues=m.issues.length?gi(m.issues):mi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Di(){return Ei}function Oi(e,t){let n=e[pi]?.backEdges;return n!==void 0&&hi(t)&&n.has(t)}var ki=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ie(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${me(e.values[0])}`:`Invalid option: expected one of ${o(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${o(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Ai(){return{localeError:ki()}}var ji,Mi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ni(){return new Mi}(ji=globalThis).__zod_globalRegistry??(ji.__zod_globalRegistry=Ni());var Pi=globalThis.__zod_globalRegistry;function Fi(e){return e.checks&&=[...e.checks],e}function Ii(e,t){return new e(Fi({type:`string`,...y(t)}))}function Li(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}function Ri(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}function zi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}function Bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}function Vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}function Hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}function Ui(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}function Wi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}function Gi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}function Ki(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}function qi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}function Ji(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}function Yi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}function Xi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}function Zi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}function Qi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}function $i(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}function ea(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}function ta(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}function na(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}function ra(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}function ia(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}function aa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}function oa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}function sa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}function ca(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}function la(e,t){return new e(Fi({type:`number`,checks:[],...y(t)}))}function ua(e,t){return new e(Fi({type:`number`,coerce:!0,checks:[],...y(t)}))}function da(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}function fa(e,t){return new e({type:`boolean`,...y(t)})}function pa(e,t){return new e({type:`undefined`,...y(t)})}function ma(e,t){return new e({type:`null`,...y(t)})}function ha(e){return new e({type:`any`})}function ga(e){return new e({type:`unknown`})}function _a(e,t){return new e({type:`never`,...y(t)})}function va(e,t){return new hn({check:`less_than`,...y(t),value:e,inclusive:!1})}function ya(e,t){return new hn({check:`less_than`,...y(t),value:e,inclusive:!0})}function ba(e,t){return new gn({check:`greater_than`,...y(t),value:e,inclusive:!1})}function xa(e,t){return new gn({check:`greater_than`,...y(t),value:e,inclusive:!0})}function Sa(e,t){return new _n({check:`multiple_of`,...y(t),value:e})}function Ca(e,t){return new yn({check:`max_length`,...y(t),maximum:e})}function wa(e,t){return new bn({check:`min_length`,...y(t),minimum:e})}function Ta(e,t){return new xn({check:`length_equals`,...y(t),length:e})}function Ea(e,t){return new Cn({check:`string_format`,format:`regex`,...y(t),pattern:e})}function Da(e){return new wn({check:`string_format`,format:`lowercase`,...y(e)})}function Oa(e){return new Tn({check:`string_format`,format:`uppercase`,...y(e)})}function ka(e,t){return new En({check:`string_format`,format:`includes`,...y(t),includes:e})}function Aa(e,t){return new Dn({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}function ja(e,t){return new On({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}function Ma(e){return new kn({check:`overwrite`,tx:e})}function Na(e){return Ma(t=>t.normalize(e))}function Pa(){return Ma(e=>e.trim())}function Fa(){return Ma(e=>e.toLowerCase())}function Ia(){return Ma(e=>e.toUpperCase())}function La(){return Ma(e=>oe(e))}function Ra(e,t,n){return new e({type:`array`,element:t,...y(n)})}function za(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}function Ba(e,t){let n=Va(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Le(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Le(r))}},e(t.value,t)),t);return n}function Va(e,t){let n=new fn({check:`custom`,...y(t)});return n._zod.check=e,n}function Ha(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&h(e,t,n[t]);return e}function Ua(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Pi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function O(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function k(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,k(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ha(o.schema,c),t.io===`input`&&$a(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wa(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ga(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Wa(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Wa(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
62
|
|
|
63
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ka(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ka(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var qa=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ja=[`oneOf`,`anyOf`];function Ya(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qa.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ya(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}h(n,r,e.length===1?e[0]:Xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ya(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Za(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qa)if(t in e)return;let n=t.filter(e=>Ja.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xa(t);else{let e=n[0],i=Ja.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ha(e,r))}function Qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ha(i,s),Ha(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ka(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Za(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ha(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,h(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:to(t,`input`,e.processors),output:to(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $a(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return $a(r.element,n);if(r.type===`set`)return $a(r.valueType,n);if(r.type===`lazy`)return $a(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return $a(r.innerType,n);if(r.type===`intersection`)return $a(r.left,n)||$a(r.right,n);if(r.type===`record`||r.type===`map`)return $a(r.keyType,n)||$a(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$a(r.in,n)||$a(r.out,n);if(r.type===`object`){for(let e in r.shape)if($a(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($a(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($a(e,n))return!0;return!!(r.rest&&$a(r.rest,n))}return!1}var eo=(e,t={})=>n=>{let r=Ua({...n,processors:t});return k(e,r),Ga(r,e),Qa(r,e)},to=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ua({...i??{},target:a,io:t,processors:n});return k(e,o),Ga(o,e),Qa(o,e)},no=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ro=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},io=(e,t)=>{no(e,`minimum`,t),ro(e,`maximum`,t)},ao=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},oo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},so=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},co=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},lo=(e,t)=>no(e,`minimum`,t.minimum),uo=(e,t)=>ro(e,`maximum`,t.maximum),fo=e=>(t,n)=>{co(t,n.format);let[r,i]=e[n.format];no(t,`minimum`,r),ro(t,`maximum`,i)},po={greater_than:(e,t)=>no(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ro(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ao(e,t.value),number_format:fo(ge),bigint_format:fo(_e),min_length:lo,max_length:uo,length_equals:(e,t)=>io(e,t.length),min_size:lo,max_size:uo,size_equals:(e,t)=>io(e,t.size),string_format:(e,t)=>{co(e,t.format),t.pattern&&oo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>so(e,t.mime)};function mo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)po[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&no(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&no(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ro(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ro(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ao(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&so(t,i.mime);for(let e of i.patterns??[])oo(t,e);return t}var ho={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},go=new Map([[fr,Jt],[mr,Yt]]),_o=e=>go.get(e)??e,vo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=mo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ho[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(_o);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=mo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):O(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},bo=(e,t,n,r)=>{n.type=`boolean`},xo=(e,t,n,r)=>{O(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{O(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},wo=(e,t,n,r)=>{O(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{O(e,t,n,r,`Void cannot be represented in JSON Schema`)},Eo=(e,t,n,r)=>{n.not={}},Do=(e,t,n,r)=>{},Oo=(e,t,n,r)=>{},ko=(e,t,n,r)=>{O(e,t,n,r,`Date cannot be represented in JSON Schema`)},Ao=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);if(o.length===0){n.not={};return}o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},jo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(O(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(O(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Mo=(e,t,n,r)=>{O(e,t,n,r,`NaN cannot be represented in JSON Schema`)},No=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Po=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=mo(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Fo=(e,t,n,r)=>{n.type=`boolean`},Io=(e,t,n,r)=>{O(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{O(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{O(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},zo=(e,t,n,r)=>{O(e,t,n,r,`Map cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{O(e,t,n,r,`Set cannot be represented in JSON Schema`)},Vo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=mo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=k(a.element,t,{...r,path:[...r.path,`items`]})};function Ho(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ho(t.out):t.type===`catch`?Ho(t.innerType):e._zod.optin}var Uo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&O(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)h(i.properties,e,k(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ho(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=k(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Wo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>k(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Go=(e,t,n,r)=>{let i=e._zod.def,a=k(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=k(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>k(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?k(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Ho(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=mo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function qo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=qo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>qo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?T:on).source),p):p}var Jo=new WeakMap;function Yo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Jo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=qo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Xo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=mo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=k(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)h(i.patternProperties,_o(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=k(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Jo.get(t);n||(n=[],Jo.set(t,n),t.deferred.push(()=>Yo(t))),n.push(e)}i.additionalProperties=k(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ho(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Zo=(e,t,n,r)=>{let i=e._zod.def,a=k(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qo=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$o=Symbol();function es(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(O(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$o):JSON.parse(o)}var ts=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=es(i.defaultValue,e,t,n,r);o!==$o&&(n.default=o)},ns=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=es(i.defaultValue,e,t,n,r);o!==$o&&(n._prefault=o)},rs=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{O(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},is=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;k(o,t,r);let s=t.seen.get(e);s.ref=o},as=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},os=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ss=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cs=(e,t,n,r)=>{let i=e._zod.innerType;k(i,t,r);let a=t.seen.get(e);a.ref=i},ls={string:vo,number:yo,boolean:bo,bigint:xo,symbol:So,null:Co,undefined:wo,void:To,never:Eo,any:Do,unknown:Oo,date:ko,enum:Ao,literal:jo,nan:Mo,template_literal:No,file:Po,success:Fo,custom:Io,function:Lo,transform:Ro,map:zo,set:Bo,array:Vo,object:Uo,union:Wo,intersection:Go,tuple:Ko,record:Xo,nullable:Zo,nonoptional:Qo,default:ts,prefault:ns,catch:rs,pipe:is,readonly:as,promise:os,optional:ss,lazy:cs};function us(e,t){if(`_idmap`in e){let n=e,r=Ua({...t,processors:ls}),i={};for(let e of n._idmap.entries()){let[t,n]=e;k(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ga(r,n),h(a,t,Qa(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ua({...t,processors:ls});return k(e,n),Ga(n,e),Qa(n,e)}var ds=new WeakSet([Object.prototype,Error.prototype]);function fs(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var ps=x(`ZodError`,(e,t)=>{ct.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ds.has(n)||(ds.add(n),fs(n,`format`,e=>t=>dt(e,t)),fs(n,`flatten`,e=>t=>ut(e,t)),fs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),fs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ms=pt(ps),hs=mt(ps),gs=ht(ps),_s=_t(ps),vs=Ct(ps),ys=wt(ps),bs=Tt(ps),xs=Et(ps),Ss=Dt(ps),Cs=Ot(ps),ws=kt(ps),Ts=At(ps);function Es(){S.localeError||C(Ai())}function Ds(){S.memoizer||C({memoizer:Di()})}var A=x(`ZodType`,(e,t)=>(Es(),E.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return v(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(qc(e,t))},superRefine(e,t){return this.check(Jc(e,t))},overwrite(e){return this.check(Ma(e))},optional(){return U(this)},exactOptional(){return Oc(this)},nullable(){return Ac(this)},nullish(){return U(Ac(this))},nonoptional(e){return Ic(this,e)},array(){return I(this)},or(e){return z([this,e])},and(e){return bc(this,e)},transform(e){return Bc(this,Tc(e))},default(e){return Mc(this,e)},prefault(e){return Pc(this,e)},catch(e){return Rc(this,e)},pipe(e){return Bc(this,e)},readonly(){return Uc(this)},describe(e){let t=this.clone();return Pi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pi.get(this);let t=this.clone();return Pi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Be(this,`~standard`,{...Pn(this),jsonSchema:{input:to(this,`input`),output:to(this,`output`)}})},set"~standard"(e){ze(this,`~standard`,e)},parse:function e(t,n){return ms(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await hs(this,t,n,{callee:e})},safeParse(e,t){return gs(this,e,t)},async safeParseAsync(e,t){return _s(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ze(this,`spa`,e)},validate(e,t){return bt(this,e,t)},validateAsync(e,t){return St(this,e,t)},encode:function e(t,n){return vs(this,t,n,{callee:e})},decode:function e(t,n){return ys(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await xs(this,t,n,{callee:e})},safeEncode(e,t){return Ss(this,e,t)},safeDecode(e,t){return Cs(this,e,t)},async safeEncodeAsync(e,t){return ws(this,e,t)},async safeDecodeAsync(e,t){return Ts(this,e,t)},toJSONSchema(e){return eo(this,{})(e)},get description(){return Pi.get(this)?.description},get _def(){return this._zod.def}}),Os=x(`_ZodString`,(e,t)=>{Fn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)},Ve({format:e=>mo(e).format??null,minLength:e=>mo(e).minimum??null,maxLength:e=>mo(e).maximum??null},{regex(...e){return this.check(Ea(...e))},includes(...e){return this.check(ka(...e))},startsWith(...e){return this.check(Aa(...e))},endsWith(...e){return this.check(ja(...e))},min(...e){return this.check(wa(...e))},max(...e){return this.check(Ca(...e))},length(...e){return this.check(Ta(...e))},nonempty(...e){return this.check(wa(1,...e))},lowercase(e){return this.check(Da(e))},uppercase(e){return this.check(Oa(e))},trim(){return this.check(Pa())},normalize(...e){return this.check(Na(...e))},toLowerCase(){return this.check(Fa())},toUpperCase(){return this.check(Ia())},slugify(){return this.check(La())}})),ks=x(`ZodString`,(e,t)=>{Fn.init(e,t),Os.init(e,t)},{email(e){return this.check(Li(Ps,e))},url(e){return this.check(Ui(Rs,e))},jwt(e){return this.check(ia(ec,e))},emoji(e){return this.check(Wi(Bs,e))},guid(e){return this.check(Ri(Is,e))},uuid(e){return this.check(zi(Ls,e))},uuidv4(e){return this.check(Bi(Ls,e))},uuidv6(e){return this.check(Vi(Ls,e))},uuidv7(e){return this.check(Hi(Ls,e))},nanoid(e){return this.check(Gi(Vs,e))},cuid(e){return this.check(Ki(Hs,e))},cuid2(e){return this.check(qi(Us,e))},ulid(e){return this.check(Ji(Ws,e))},base64(e){return this.check(ta(Zs,e))},base64url(e){return this.check(na(Qs,e))},xid(e){return this.check(Yi(Gs,e))},ksuid(e){return this.check(Xi(Ks,e))},ipv4(e){return this.check(Zi(qs,e))},ipv6(e){return this.check(Qi(Js,e))},cidrv4(e){return this.check($i(Ys,e))},cidrv6(e){return this.check(ea(Xs,e))},e164(e){return this.check(ra($s,e))},datetime(e){return this.check(aa(As,e))},date(e){return this.check(oa(js,e))},time(e){return this.check(sa(Ms,e))},duration(e){return this.check(ca(Ns,e))}});function j(e){return Ii(ks,e)}var M=x(`ZodStringFormat`,(e,t)=>{D.init(e,t),Os.init(e,t)}),As=x(`ZodISODateTime`,(e,t)=>{er.init(e,t),M.init(e,t)}),js=x(`ZodISODate`,(e,t)=>{tr.init(e,t),M.init(e,t)}),Ms=x(`ZodISOTime`,(e,t)=>{nr.init(e,t),M.init(e,t)}),Ns=x(`ZodISODuration`,(e,t)=>{rr.init(e,t),M.init(e,t)}),Ps=x(`ZodEmail`,(e,t)=>{Rn.init(e,t),M.init(e,t)});function Fs(e){return Li(Ps,e)}var Is=x(`ZodGUID`,(e,t)=>{In.init(e,t),M.init(e,t)}),Ls=x(`ZodUUID`,(e,t)=>{Ln.init(e,t),M.init(e,t)}),Rs=x(`ZodURL`,(e,t)=>{Kn.init(e,t),M.init(e,t)});function zs(e){return Ui(Rs,e)}var Bs=x(`ZodEmoji`,(e,t)=>{qn.init(e,t),M.init(e,t)}),Vs=x(`ZodNanoID`,(e,t)=>{Jn.init(e,t),M.init(e,t)}),Hs=x(`ZodCUID`,(e,t)=>{Yn.init(e,t),M.init(e,t)}),Us=x(`ZodCUID2`,(e,t)=>{Xn.init(e,t),M.init(e,t)}),Ws=x(`ZodULID`,(e,t)=>{Zn.init(e,t),M.init(e,t)}),Gs=x(`ZodXID`,(e,t)=>{Qn.init(e,t),M.init(e,t)}),Ks=x(`ZodKSUID`,(e,t)=>{$n.init(e,t),M.init(e,t)}),qs=x(`ZodIPv4`,(e,t)=>{ir.init(e,t),M.init(e,t)}),Js=x(`ZodIPv6`,(e,t)=>{sr.init(e,t),M.init(e,t)}),Ys=x(`ZodCIDRv4`,(e,t)=>{cr.init(e,t),M.init(e,t)}),Xs=x(`ZodCIDRv6`,(e,t)=>{ur.init(e,t),M.init(e,t)}),Zs=x(`ZodBase64`,(e,t)=>{pr.init(e,t),M.init(e,t)}),Qs=x(`ZodBase64URL`,(e,t)=>{gr.init(e,t),M.init(e,t)}),$s=x(`ZodE164`,(e,t)=>{_r.init(e,t),M.init(e,t)}),ec=x(`ZodJWT`,(e,t)=>{yr.init(e,t),M.init(e,t)}),tc=x(`ZodNumber`,(e,t)=>{br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.isFinite=!0},Ve({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=mo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=mo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=mo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mo(e).format??null},{gt(e,t){return this.check(ba(e,t))},gte(e,t){return this.check(xa(e,t))},min(e,t){return this.check(xa(e,t))},lt(e,t){return this.check(va(e,t))},lte(e,t){return this.check(ya(e,t))},max(e,t){return this.check(ya(e,t))},int(e){return this.check(rc(e))},safe(e){return this.check(rc(e))},positive(e){return this.check(ba(0,e))},nonnegative(e){return this.check(xa(0,e))},negative(e){return this.check(va(0,e))},nonpositive(e){return this.check(ya(0,e))},multipleOf(e,t){return this.check(Sa(e,t))},step(e,t){return this.check(Sa(e,t))},finite(){return this}}));function N(e){return la(tc,e)}var nc=x(`ZodNumberFormat`,(e,t)=>{xr.init(e,t),tc.init(e,t)});function rc(e){return da(nc,e)}var ic=x(`ZodBoolean`,(e,t)=>{Sr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r)});function P(e){return fa(ic,e)}var ac=x(`ZodUndefined`,(e,t)=>{Cr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function oc(e){return pa(ac,e)}var sc=x(`ZodNull`,(e,t)=>{wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function cc(e){return ma(sc,e)}var lc=x(`ZodAny`,(e,t)=>{Tr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function uc(){return ha(lc)}var dc=x(`ZodUnknown`,(e,t)=>{Er.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function F(){return ga(dc)}var fc=x(`ZodNever`,(e,t)=>{Dr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)});function pc(e){return _a(fc,e)}var mc=x(`ZodArray`,(e,t)=>{Ds(),kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(wa(e,t))},nonempty(e){return this.check(wa(1,e))},max(e,t){return this.check(Ca(e,t))},length(e,t){return this.check(Ta(e,t))},unwrap(){return this.element}});function I(e,t){return Ra(mc,e,t)}var hc=x(`ZodObject`,(e,t)=>{Ds(),Fr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),qe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:F()}))},loose(){return this.clone(_(this._zod.def,{catchall:F()}))},strict(){return this.clone(_(this._zod.def,{catchall:pc()}))},strip(){return this.clone(_(this._zod.def,{catchall:void 0}))},extend(e){return xe(this,e)},safeExtend(e){return Ce(this,e)},merge(e){return we(this,e)},pick(e){return ve(this,e)},omit(e){return be(this,e)},partial(...e){return Te(Ec,this,e[0])},exactPartial(...e){return Te(Dc,this,e[0],`exactPartial`)},required(...e){return Ee(Fc,this,e[0])}});function L(e,t){return new hc({type:`object`,shape:e??{},...y(t)})}function R(e,t){return new hc({type:`object`,shape:e,catchall:F(),...y(t)})}var gc=x(`ZodUnion`,(e,t)=>{Lr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.options=t.options});function z(e,t){return new gc({type:`union`,options:e,...y(t)})}var _c=x(`ZodDiscriminatedUnion`,(e,t)=>{gc.init(e,t),zr.init(e,t)});function vc(e,t,n){return new _c({type:`union`,options:t,discriminator:e,...y(n)})}var yc=x(`ZodIntersection`,(e,t)=>{Br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r)});function bc(e,t){return new yc({type:`intersection`,left:e,right:t})}var xc=x(`ZodRecord`,(e,t)=>{Ds(),Ur.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,n){return!t||!t._zod?new xc({type:`record`,keyType:j(),valueType:e,...y(t)}):new xc({type:`record`,keyType:e,valueType:t,...y(n)})}var Sc=x(`ZodEnum`,(e,t)=>{Wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Sc({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Sc({...t,checks:[],...y(r),entries:i})}});function V(e,t){return new Sc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Cc=x(`ZodLiteral`,(e,t)=>{Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new Cc({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var wc=x(`ZodTransform`,(e,t)=>{Ds(),Kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Le(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Le(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Tc(e){return new wc({type:`transform`,transform:e})}var Ec=x(`ZodOptional`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function U(e){return new Ec({type:`optional`,innerType:e})}var Dc=x(`ZodExactOptional`,(e,t)=>{Yr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Dc({type:`optional`,innerType:e})}var kc=x(`ZodNullable`,(e,t)=>{Xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ac(e){return new kc({type:`nullable`,innerType:e})}var jc=x(`ZodDefault`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mc(e,t){return new jc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Nc=x(`ZodPrefault`,(e,t)=>{$r.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pc(e,t){return new Nc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Fc=x(`ZodNonOptional`,(e,t)=>{ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e,t){return new Fc({type:`nonoptional`,innerType:e,...y(t)})}var Lc=x(`ZodCatch`,(e,t)=>{ri.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rc(e,t){return new Lc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ye(t)})}var zc=x(`ZodPipe`,(e,t)=>{ii.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.in=t.in,e.out=t.out});function Bc(e,t){return new zc({type:`pipe`,in:e,out:t})}var Vc=x(`ZodPreprocess`,(e,t)=>{zc.init(e,t),oi.init(e,t)}),Hc=x(`ZodReadonly`,(e,t)=>{si.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Uc(e){return new Hc({type:`readonly`,innerType:e})}var Wc=x(`ZodLazy`,(e,t)=>{li.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Gc(e){return new Wc({type:`lazy`,getter:e})}var Kc=x(`ZodCustom`,(e,t)=>{ui.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r)});function qc(e,t={}){return za(Kc,e,t)}function Jc(e,t){return Ba(e,t)}function Yc(e,t){return new Vc({type:`pipe`,in:Tc(e),out:t})}var Xc={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Zc;Zc||={};function Qc(e){return aa(As,e)}function $c(e){return oa(js,e)}function el(e){return ua(tc,e)}var tl=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],nl=`io.modelcontextprotocol/related-task`,rl=`io.modelcontextprotocol/protocolVersion`,il=`io.modelcontextprotocol/clientInfo`,al=`io.modelcontextprotocol/serverInfo`,ol=`io.modelcontextprotocol/clientCapabilities`,sl=`io.modelcontextprotocol/subscriptionId`,cl=`io.modelcontextprotocol/logLevel`,ll=Gc(()=>z([j(),N(),P(),cc(),B(j(),ll),I(ll)])),W=B(j(),ll),ul=I(ll),dl=z([j(),N().int()]),fl=j(),pl=L({ttl:N().optional()}),ml=L({taskId:j()}),hl=R({progressToken:dl.optional(),[nl]:ml.optional()}),G=L({_meta:hl.optional()}),gl=G.extend({task:pl.optional()}),K=L({method:j(),params:G.loose().optional()}),_l=L({_meta:hl.optional()}),vl=L({method:j(),params:_l.loose().optional()}),yl=R({get[al](){return Nl.optional().catch(void 0)}}),q=R({_meta:yl.optional()}),bl=z([j(),N().int()]),xl=L({jsonrpc:H(`2.0`),id:bl,...K.shape}).strict(),Sl=L({jsonrpc:H(`2.0`),...vl.shape}).strict(),Cl=L({jsonrpc:H(`2.0`),id:bl,result:q}).strict(),wl=L({jsonrpc:H(`2.0`),id:bl.optional(),error:L({code:N().int(),message:j(),data:F().optional()})}).strict(),Tl=z([xl,Sl,Cl,wl]),El=z([Cl,wl]),Dl=q.strict(),Ol=_l.extend({requestId:bl.optional(),reason:j().optional()}),kl=vl.extend({method:H(`notifications/cancelled`),params:Ol}),Al=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),jl=L({icons:I(Al).optional()}),Ml=L({name:j(),title:j().optional()}),Nl=Ml.extend({...Ml.shape,...jl.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),Pl=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),W).optional(),url:W.optional()}),W.optional())),Fl=R({list:W.optional(),cancel:W.optional(),requests:R({sampling:R({createMessage:W.optional()}).optional(),elicitation:R({create:W.optional()}).optional()}).optional()}),Il=R({list:W.optional(),cancel:W.optional(),requests:R({tools:R({call:W.optional()}).optional()}).optional()}),Ll=L({experimental:B(j(),W).optional(),sampling:L({context:W.optional(),tools:W.optional()}).optional(),elicitation:Pl.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:Fl.optional(),extensions:B(j(),W).optional()}),Rl=G.extend({protocolVersion:j(),capabilities:Ll,clientInfo:Nl}),zl=K.extend({method:H(`initialize`),params:Rl}),Bl=L({experimental:B(j(),W).optional(),logging:W.optional(),completions:W.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:Il.optional(),extensions:B(j(),W).optional()}),Vl=q.extend({protocolVersion:j(),capabilities:Bl,serverInfo:Nl,instructions:j().optional()}),Hl=vl.extend({method:H(`notifications/initialized`),params:_l.optional()}),Ul=K.extend({method:H(`server/discover`),params:G.optional()}),Wl=q.extend({supportedVersions:I(j()),capabilities:Bl,instructions:j().optional()}),Gl=K.extend({method:H(`ping`),params:G.optional()}),Kl=L({progress:N(),total:U(N()),message:U(j())}),ql=L({..._l.shape,...Kl.shape,progressToken:dl}),Jl=vl.extend({method:H(`notifications/progress`),params:ql}),Yl=G.extend({cursor:fl.optional()}),Xl=K.extend({params:Yl.optional()}),Zl=q.extend({nextCursor:fl.optional()}),Ql=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),$l=Ql.extend({text:j()}),eu=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),tu=Ql.extend({blob:eu}),nu=V([`user`,`assistant`]),ru=L({audience:I(nu).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),iu=L({...Ml.shape,...jl.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:ru.optional(),_meta:U(R({}))}),au=L({...Ml.shape,...jl.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:ru.optional(),_meta:U(R({}))}),ou=Xl.extend({method:H(`resources/list`)}),su=Zl.extend({resources:I(iu)}),cu=Xl.extend({method:H(`resources/templates/list`)}),lu=Zl.extend({resourceTemplates:I(au)}),uu=G.extend({uri:j()}),du=uu,fu=K.extend({method:H(`resources/read`),params:du}),pu=q.extend({contents:I(z([$l,tu]))}),mu=vl.extend({method:H(`notifications/resources/list_changed`),params:_l.optional()}),hu=uu,gu=K.extend({method:H(`resources/subscribe`),params:hu}),_u=uu,vu=K.extend({method:H(`resources/unsubscribe`),params:_u}),yu=L({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:I(j()).optional()}),bu=G.extend({notifications:yu}),xu=K.extend({method:H(`subscriptions/listen`),params:bu}),Su=_l.extend({notifications:yu}),Cu=vl.extend({method:H(`notifications/subscriptions/acknowledged`),params:Su}),wu=yl.extend({[sl]:bl}),Tu=q.extend({_meta:wu}),Eu=_l.extend({uri:j()}),Du=vl.extend({method:H(`notifications/resources/updated`),params:Eu}),Ou=L({name:j(),description:U(j()),required:U(P())}),ku=L({...Ml.shape,...jl.shape,description:U(j()),arguments:U(I(Ou)),_meta:U(R({}))}),Au=Xl.extend({method:H(`prompts/list`)}),ju=Zl.extend({prompts:I(ku)}),Mu=G.extend({name:j(),arguments:B(j(),j()).optional()}),Nu=K.extend({method:H(`prompts/get`),params:Mu}),Pu=L({type:H(`text`),text:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Fu=L({type:H(`image`),data:eu,mimeType:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Iu=L({type:H(`audio`),data:eu,mimeType:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Lu=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Ru=L({type:H(`resource`),resource:z([$l,tu]),annotations:ru.optional(),_meta:B(j(),F()).optional()}),zu=iu.extend({type:H(`resource_link`)}),Bu=z([Pu,Fu,Iu,zu,Ru]),Vu=L({role:nu,content:Bu}),Hu=q.extend({description:j().optional(),messages:I(Vu)}),Uu=vl.extend({method:H(`notifications/prompts/list_changed`),params:_l.optional()}),Wu=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),Gu=L({taskSupport:V([`required`,`optional`,`forbidden`]).optional()}),Ku=L({...Ml.shape,...jl.shape,description:j().optional(),inputSchema:L({type:H(`object`),properties:B(j(),ll).optional(),required:I(j()).optional()}).catchall(F()),outputSchema:R({$schema:j().optional()}).optional(),annotations:Wu.optional(),execution:Gu.optional(),_meta:B(j(),F()).optional()}),qu=Xl.extend({method:H(`tools/list`)}),Ju=Zl.extend({tools:I(Ku)}),Yu=q.extend({content:I(Bu).default([]),structuredContent:F().optional(),isError:P().optional()}),Xu=Yu.or(q.extend({toolResult:F()})),Zu=gl.extend({name:j(),arguments:B(j(),F()).optional()}),Qu=K.extend({method:H(`tools/call`),params:Zu}),$u=vl.extend({method:H(`notifications/tools/list_changed`),params:_l.optional()}),ed=L({autoRefresh:P().default(!0),debounceMs:N().int().nonnegative().default(300)}),td=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),nd=G.extend({level:td}),rd=K.extend({method:H(`logging/setLevel`),params:nd}),id=_l.extend({level:td,logger:j().optional(),data:F()}),ad=vl.extend({method:H(`notifications/message`),params:id}),od=L({name:j().optional()}),sd=L({hints:I(od).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),cd=L({mode:V([`auto`,`required`,`none`]).optional()}),ld=L({type:H(`tool_result`),toolUseId:j().describe(`The unique identifier for the corresponding tool call.`),content:I(Bu),structuredContent:F().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),ud=vc(`type`,[Pu,Fu,Iu]),dd=vc(`type`,[Pu,Fu,Iu,Lu,ld]),fd=L({role:nu,content:z([dd,I(dd)]),_meta:B(j(),F()).optional()}),pd=gl.extend({messages:I(fd),modelPreferences:sd.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:W.optional(),tools:I(Ku).optional(),toolChoice:cd.optional()}),md=K.extend({method:H(`sampling/createMessage`),params:pd}),hd=q.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`]).or(j())),role:nu,content:ud}),gd=q.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(j())),role:nu,content:z([dd,I(dd)])}),_d=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),vd=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),yd=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),bd=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),xd=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),Sd=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Cd=z([bd,xd]),wd=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),Td=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),Ed=z([wd,Td]),Dd=z([Sd,Cd,Ed]),Od=z([Dd,_d,vd,yd]),kd=gl.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Od),required:I(j()).optional()}).catchall(F())}),Ad=gl.extend({mode:H(`url`),message:j(),elicitationId:j(),url:j().url()}),jd=z([kd,Ad]),Md=K.extend({method:H(`elicitation/create`),params:jd}),Nd=_l.extend({elicitationId:j()}),Pd=vl.extend({method:H(`notifications/elicitation/complete`),params:Nd}),Fd=q.extend({action:V([`accept`,`decline`,`cancel`]),content:Yc(e=>e===null?void 0:e,B(j(),z([j(),N(),P(),I(j())])).optional())}),Id=L({type:H(`ref/resource`),uri:j()}),Ld=L({type:H(`ref/prompt`),name:j()}),Rd=G.extend({ref:z([Ld,Id]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()}),zd=K.extend({method:H(`completion/complete`),params:Rd}),Bd=q.extend({completion:R({values:I(j()).max(100),total:U(N().int()),hasMore:U(P())})}),Vd=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),Hd=K.extend({method:H(`roots/list`),params:G.optional()}),Ud=q.extend({roots:I(Vd)}),Wd=vl.extend({method:H(`notifications/roots/list_changed`),params:_l.optional()}),Gd=R({ttl:N().optional(),pollInterval:N().optional()}),Kd=V([`working`,`input_required`,`completed`,`failed`,`cancelled`]),qd=L({taskId:j(),status:Kd,ttl:z([N(),cc()]),createdAt:j(),lastUpdatedAt:j(),pollInterval:U(N()),statusMessage:U(j())}),Jd=q.extend({task:qd}),Yd=_l.merge(qd),Xd=vl.extend({method:H(`notifications/tasks/status`),params:Yd}),Zd=K.extend({method:H(`tasks/get`),params:G.extend({taskId:j()})}),Qd=q.merge(qd),$d=K.extend({method:H(`tasks/result`),params:G.extend({taskId:j()})}),ef=q.loose(),tf=Xl.extend({method:H(`tasks/list`)}),nf=Zl.extend({tasks:I(qd)}),rf=K.extend({method:H(`tasks/cancel`),params:G.extend({taskId:j()})}),af=q.merge(qd),of=z([Gl,zl,Ul,zd,rd,Nu,Au,ou,cu,fu,gu,vu,xu,Qu,qu]),sf=z([kl,Jl,Hl,Wd]),cf=z([Dl,hd,gd,Fd,Ud]),lf=z([Gl,md,Md,Hd]),uf=z([kl,Jl,ad,Du,mu,$u,Uu,Cu,Pd]),df=z([Dl,Vl,Wl,Bd,Hu,ju,su,lu,pu,Yu,Ju,Tu]),J=zs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Xc.custom,message:`URL must be parseable`,fatal:!0}),Ze}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),ff=R({resource:j().url(),authorization_servers:I(J).optional(),jwks_uri:j().url().optional(),scopes_supported:I(j()).optional(),bearer_methods_supported:I(j()).optional(),resource_signing_alg_values_supported:I(j()).optional(),resource_name:j().optional(),resource_documentation:j().optional(),resource_policy_uri:j().url().optional(),resource_tos_uri:j().url().optional(),tls_client_certificate_bound_access_tokens:P().optional(),authorization_details_types_supported:I(j()).optional(),dpop_signing_alg_values_supported:I(j()).optional(),dpop_bound_access_tokens_required:P().optional()}),pf=R({issuer:j(),authorization_endpoint:J,token_endpoint:J,registration_endpoint:J.optional(),scopes_supported:I(j()).optional(),response_types_supported:I(j()),response_modes_supported:I(j()).optional(),grant_types_supported:I(j()).optional(),token_endpoint_auth_methods_supported:I(j()).optional(),token_endpoint_auth_signing_alg_values_supported:I(j()).optional(),service_documentation:J.optional(),revocation_endpoint:J.optional(),revocation_endpoint_auth_methods_supported:I(j()).optional(),revocation_endpoint_auth_signing_alg_values_supported:I(j()).optional(),introspection_endpoint:j().optional(),introspection_endpoint_auth_methods_supported:I(j()).optional(),introspection_endpoint_auth_signing_alg_values_supported:I(j()).optional(),code_challenge_methods_supported:I(j()).optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0)}),mf=R({issuer:j(),authorization_endpoint:J,token_endpoint:J,userinfo_endpoint:J.optional(),jwks_uri:J,registration_endpoint:J.optional(),scopes_supported:I(j()).optional(),response_types_supported:I(j()),response_modes_supported:I(j()).optional(),grant_types_supported:I(j()).optional(),acr_values_supported:I(j()).optional(),subject_types_supported:I(j()),id_token_signing_alg_values_supported:I(j()),id_token_encryption_alg_values_supported:I(j()).optional(),id_token_encryption_enc_values_supported:I(j()).optional(),userinfo_signing_alg_values_supported:I(j()).optional(),userinfo_encryption_alg_values_supported:I(j()).optional(),userinfo_encryption_enc_values_supported:I(j()).optional(),request_object_signing_alg_values_supported:I(j()).optional(),request_object_encryption_alg_values_supported:I(j()).optional(),request_object_encryption_enc_values_supported:I(j()).optional(),token_endpoint_auth_methods_supported:I(j()).optional(),token_endpoint_auth_signing_alg_values_supported:I(j()).optional(),display_values_supported:I(j()).optional(),claim_types_supported:I(j()).optional(),claims_supported:I(j()).optional(),service_documentation:j().optional(),claims_locales_supported:I(j()).optional(),ui_locales_supported:I(j()).optional(),claims_parameter_supported:P().optional(),request_parameter_supported:P().optional(),request_uri_parameter_supported:P().optional(),require_request_uri_registration:P().optional(),op_policy_uri:J.optional(),op_tos_uri:J.optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0)}),hf=L({...mf.shape,...pf.pick({code_challenge_methods_supported:!0}).shape}),gf=L({access_token:j(),id_token:j().optional(),token_type:j(),expires_in:el().optional(),scope:j().optional(),refresh_token:j().optional()}).strip(),_f=L({issued_token_type:H(`urn:ietf:params:oauth:token-type:id-jag`),access_token:j(),token_type:j().optional(),expires_in:N().optional(),scope:j().optional()}).strip(),vf=L({error:j(),error_description:j().optional(),error_uri:j().optional()}),yf=J.optional().or(H(``).transform(()=>void 0)),bf=L({redirect_uris:I(J),token_endpoint_auth_method:j().optional(),grant_types:I(j()).optional(),response_types:I(j()).optional(),application_type:j().optional(),client_name:j().optional(),client_uri:J.optional(),logo_uri:yf,scope:j().optional(),contacts:I(j()).optional(),tos_uri:yf,policy_uri:j().optional(),jwks_uri:J.optional(),jwks:uc().optional(),software_id:j().optional(),software_version:j().optional(),software_statement:j().optional()}).strip(),xf=L({client_id:j(),client_secret:j().optional(),client_id_issued_at:N().optional(),client_secret_expires_at:N().optional()}).strip(),Sf=bf.merge(xf),Cf=L({error:j(),error_description:j().optional()}).strip(),wf=L({token:j(),token_type_hint:j().optional()}).strip(),Tf=Symbol.for(`mcp.sdk.errorBrands`);function Ef(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Tf,{value:n,enumerable:!1,configurable:!0})}function Df(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Tf)){let n=t[Tf];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Ef(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});var Y=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,Ef(this,new.target)}};(class extends X{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n){super(e,t,n),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var Of=`2026-07-28`;function kf(e){return e>=Of}function Af(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var jf=[`task`,`inputRequests`,`requestState`];function Mf(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||jf.some(t=>t in e)?e:{...e,content:[]}}function Nf(){let e=Gc(()=>z([j(),N(),P(),cc(),B(j(),e),I(e)])),t=B(j(),e),n=z([j(),N().int()]),r=j(),i=L({ttl:N().optional()}),a=L({taskId:j()}),o=R({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=L({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=L({method:j(),params:s.loose().optional()}),u=L({_meta:o.optional()}),d=L({method:j(),params:u.loose().optional()}),f=R({_meta:o.optional()}),p=z([j(),N().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:j().optional()}),ee=d.extend({method:H(`notifications/cancelled`),params:h}),g=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),te=L({icons:I(g).optional()}),ne=L({name:j(),title:j().optional()}),re=ne.extend({...ne.shape,...te.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),ie=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),t).optional(),url:t.optional()}),t.optional())),_=R({list:t.optional(),cancel:t.optional(),requests:R({sampling:R({createMessage:t.optional()}).optional(),elicitation:R({create:t.optional()}).optional()}).optional()}),ae=R({list:t.optional(),cancel:t.optional(),requests:R({tools:R({call:t.optional()}).optional()}).optional()}),oe=L({experimental:B(j(),t).optional(),sampling:L({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:_.optional(),extensions:B(j(),t).optional()}),se=s.extend({protocolVersion:j(),capabilities:oe,clientInfo:re}),ce=l.extend({method:H(`initialize`),params:se}),le=L({experimental:B(j(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:ae.optional(),extensions:B(j(),t).optional()}),ue=f.extend({protocolVersion:j(),capabilities:le,serverInfo:re,instructions:j().optional()}),de=d.extend({method:H(`notifications/initialized`),params:u.optional()}),fe=l.extend({method:H(`ping`),params:s.optional()}),pe=L({progress:N(),total:U(N()),message:U(j())}),v=L({...u.shape,...pe.shape,progressToken:n}),y=d.extend({method:H(`notifications/progress`),params:v}),me=s.extend({cursor:r.optional()}),he=l.extend({params:me.optional()}),ge=f.extend({nextCursor:r.optional()}),_e=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),ve=_e.extend({text:j()}),ye=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),be=_e.extend({blob:ye}),xe=V([`user`,`assistant`]),Se=L({audience:I(xe).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),Ce=L({...ne.shape,...te.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:Se.optional(),_meta:U(R({}))}),we=L({...ne.shape,...te.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:Se.optional(),_meta:U(R({}))}),Te=he.extend({method:H(`resources/list`)}),Ee=ge.extend({resources:I(Ce)}),De=he.extend({method:H(`resources/templates/list`)}),Oe=ge.extend({resourceTemplates:I(we)}),ke=s.extend({uri:j()}),Ae=ke,je=l.extend({method:H(`resources/read`),params:Ae}),Me=f.extend({contents:I(z([ve,be]))}),Ne=d.extend({method:H(`notifications/resources/list_changed`),params:u.optional()}),Pe=ke,Fe=l.extend({method:H(`resources/subscribe`),params:Pe}),Ie=ke,Le=l.extend({method:H(`resources/unsubscribe`),params:Ie}),Re=u.extend({uri:j()}),ze=d.extend({method:H(`notifications/resources/updated`),params:Re}),Be=L({name:j(),description:U(j()),required:U(P())}),Ve=L({...ne.shape,...te.shape,description:U(j()),arguments:U(I(Be)),_meta:U(R({}))}),He=he.extend({method:H(`prompts/list`)}),Ue=ge.extend({prompts:I(Ve)}),We=s.extend({name:j(),arguments:B(j(),j()).optional()}),Ge=l.extend({method:H(`prompts/get`),params:We}),Ke=L({type:H(`text`),text:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),b=L({type:H(`image`),data:ye,mimeType:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),qe=L({type:H(`audio`),data:ye,mimeType:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),Je=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Ye=L({type:H(`resource`),resource:z([ve,be]),annotations:Se.optional(),_meta:B(j(),F()).optional()}),Xe=Ce.extend({type:H(`resource_link`)}),Ze=z([Ke,b,qe,Xe,Ye]),Qe=L({role:xe,content:Ze}),$e=f.extend({description:j().optional(),messages:I(Qe)}),et=d.extend({method:H(`notifications/prompts/list_changed`),params:u.optional()}),x=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),tt=L({taskSupport:V([`required`,`optional`,`forbidden`]).optional()}),nt=L({...ne.shape,...te.shape,description:j().optional(),inputSchema:L({type:H(`object`),properties:B(j(),e).optional(),required:I(j()).optional()}).catchall(F()),outputSchema:L({type:H(`object`),properties:B(j(),e).optional(),required:I(j()).optional()}).catchall(F()).optional(),annotations:x.optional(),execution:tt.optional(),_meta:B(j(),F()).optional()}),S=he.extend({method:H(`tools/list`)}),C=ge.extend({tools:I(nt)}),rt=f.extend({content:I(Ze),structuredContent:B(j(),F()).optional(),isError:P().optional()}),w=c.extend({name:j(),arguments:B(j(),F()).optional()}),it=l.extend({method:H(`tools/call`),params:w}),at=d.extend({method:H(`notifications/tools/list_changed`),params:u.optional()}),ot=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),st=s.extend({level:ot}),ct=l.extend({method:H(`logging/setLevel`),params:st}),lt=u.extend({level:ot,logger:j().optional(),data:F()}),ut=d.extend({method:H(`notifications/message`),params:lt}),dt=L({name:j().optional()}),ft=L({hints:I(dt).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),pt=L({mode:V([`auto`,`required`,`none`]).optional()}),mt=L({type:H(`tool_result`),toolUseId:j().describe(`The unique identifier for the corresponding tool call.`),content:I(Ze),structuredContent:L({}).loose().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),ht=vc(`type`,[Ke,b,qe]),gt=vc(`type`,[Ke,b,qe,Je,mt]),_t=L({role:xe,content:z([gt,I(gt)]),_meta:B(j(),F()).optional()}),vt=c.extend({messages:I(_t),modelPreferences:ft.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:t.optional(),tools:I(nt).optional(),toolChoice:pt.optional()}),yt=l.extend({method:H(`sampling/createMessage`),params:vt}),bt=f.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`]).or(j())),role:xe,content:ht}),xt=f.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(j())),role:xe,content:z([gt,I(gt)])}),St=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),Ct=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),wt=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),Tt=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),Et=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),Dt=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Ot=z([Tt,Et]),kt=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),At=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),jt=z([kt,At]),Mt=z([Dt,Ot,jt]),Nt=z([Mt,St,Ct,wt]),Pt=c.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Nt),required:I(j()).optional()}).catchall(F())}),Ft=c.extend({mode:H(`url`),message:j(),elicitationId:j(),url:j().url()}),It=z([Pt,Ft]),Lt=l.extend({method:H(`elicitation/create`),params:It}),Rt=u.extend({elicitationId:j()}),zt=d.extend({method:H(`notifications/elicitation/complete`),params:Rt}),Bt=f.extend({action:V([`accept`,`decline`,`cancel`]),content:Yc(e=>e===null?void 0:e,B(j(),z([j(),N(),P(),I(j())])).optional())}),Vt=L({type:H(`ref/resource`),uri:j()}),Ht=L({type:H(`ref/prompt`),name:j()}),Ut=s.extend({ref:z([Ht,Vt]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()}),Wt=l.extend({method:H(`completion/complete`),params:Ut}),Gt=f.extend({completion:R({values:I(j()).max(100),total:U(N().int()),hasMore:U(P())})}),Kt=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),qt=l.extend({method:H(`roots/list`),params:s.optional()}),Jt=f.extend({roots:I(Kt)}),Yt=d.extend({method:H(`notifications/roots/list_changed`),params:u.optional()}),Xt=R({ttl:N().optional(),pollInterval:N().optional()}),Zt=V([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Qt=L({taskId:j(),status:Zt,ttl:z([N(),cc()]),createdAt:j(),lastUpdatedAt:j(),pollInterval:U(N()),statusMessage:U(j())}),$t=f.extend({task:Qt}),en=u.merge(Qt),tn=d.extend({method:H(`notifications/tasks/status`),params:en}),nn=l.extend({method:H(`tasks/get`),params:s.extend({taskId:j()})}),rn=f.merge(Qt),an=l.extend({method:H(`tasks/result`),params:s.extend({taskId:j()})}),on=f.loose(),T=he.extend({method:H(`tasks/list`)}),sn=ge.extend({tasks:I(Qt)}),cn=l.extend({method:H(`tasks/cancel`),params:s.extend({taskId:j()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:ee,IconSchema:g,IconsSchema:te,BaseMetadataSchema:ne,ImplementationSchema:re,ClientTasksCapabilitySchema:_,ServerTasksCapabilitySchema:ae,ClientCapabilitiesSchema:oe,InitializeRequestParamsSchema:se,InitializeRequestSchema:ce,ServerCapabilitiesSchema:le,InitializeResultSchema:ue,InitializedNotificationSchema:de,PingRequestSchema:fe,ProgressSchema:pe,ProgressNotificationParamsSchema:v,ProgressNotificationSchema:y,PaginatedRequestParamsSchema:me,PaginatedRequestSchema:he,PaginatedResultSchema:ge,ResourceContentsSchema:_e,TextResourceContentsSchema:ve,BlobResourceContentsSchema:be,RoleSchema:xe,AnnotationsSchema:Se,ResourceSchema:Ce,ResourceTemplateSchema:we,ListResourcesRequestSchema:Te,ListResourcesResultSchema:Ee,ListResourceTemplatesRequestSchema:De,ListResourceTemplatesResultSchema:Oe,ResourceRequestParamsSchema:ke,ReadResourceRequestParamsSchema:Ae,ReadResourceRequestSchema:je,ReadResourceResultSchema:Me,ResourceListChangedNotificationSchema:Ne,SubscribeRequestParamsSchema:Pe,SubscribeRequestSchema:Fe,UnsubscribeRequestParamsSchema:Ie,UnsubscribeRequestSchema:Le,ResourceUpdatedNotificationParamsSchema:Re,ResourceUpdatedNotificationSchema:ze,PromptArgumentSchema:Be,PromptSchema:Ve,ListPromptsRequestSchema:He,ListPromptsResultSchema:Ue,GetPromptRequestParamsSchema:We,GetPromptRequestSchema:Ge,TextContentSchema:Ke,ImageContentSchema:b,AudioContentSchema:qe,ToolUseContentSchema:Je,EmbeddedResourceSchema:Ye,ResourceLinkSchema:Xe,ContentBlockSchema:Ze,PromptMessageSchema:Qe,GetPromptResultSchema:$e,PromptListChangedNotificationSchema:et,ToolAnnotationsSchema:x,ToolExecutionSchema:tt,ToolSchema:nt,ListToolsRequestSchema:S,ListToolsResultSchema:C,CallToolResultSchema:rt,CallToolRequestParamsSchema:w,CallToolRequestSchema:it,ToolListChangedNotificationSchema:at,LoggingLevelSchema:ot,SetLevelRequestParamsSchema:st,SetLevelRequestSchema:ct,LoggingMessageNotificationParamsSchema:lt,LoggingMessageNotificationSchema:ut,ModelHintSchema:dt,ModelPreferencesSchema:ft,ToolChoiceSchema:pt,ToolResultContentSchema:mt,SamplingContentSchema:ht,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:_t,CreateMessageRequestParamsSchema:vt,CreateMessageRequestSchema:yt,CreateMessageResultSchema:bt,CreateMessageResultWithToolsSchema:xt,BooleanSchemaSchema:St,StringSchemaSchema:Ct,NumberSchemaSchema:wt,UntitledSingleSelectEnumSchemaSchema:Tt,TitledSingleSelectEnumSchemaSchema:Et,LegacyTitledEnumSchemaSchema:Dt,SingleSelectEnumSchemaSchema:Ot,UntitledMultiSelectEnumSchemaSchema:kt,TitledMultiSelectEnumSchemaSchema:At,MultiSelectEnumSchemaSchema:jt,EnumSchemaSchema:Mt,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:Pt,ElicitRequestURLParamsSchema:Ft,ElicitRequestParamsSchema:It,ElicitRequestSchema:Lt,ElicitationCompleteNotificationParamsSchema:Rt,ElicitationCompleteNotificationSchema:zt,ElicitResultSchema:Bt,ResourceTemplateReferenceSchema:Vt,PromptReferenceSchema:Ht,CompleteRequestParamsSchema:Ut,CompleteRequestSchema:Wt,CompleteResultSchema:Gt,RootSchema:Kt,ListRootsRequestSchema:qt,ListRootsResultSchema:Jt,RootsListChangedNotificationSchema:Yt,TaskCreationParamsSchema:Xt,TaskStatusSchema:Zt,TaskSchema:Qt,CreateTaskResultSchema:$t,TaskStatusNotificationParamsSchema:en,TaskStatusNotificationSchema:tn,GetTaskRequestSchema:nn,GetTaskResultSchema:rn,GetTaskPayloadRequestSchema:an,GetTaskPayloadResultSchema:on,ListTasksRequestSchema:T,ListTasksResultSchema:sn,CancelTaskRequestSchema:cn,CancelTaskResultSchema:f.merge(Qt),ClientRequestSchema:z([fe,ce,Wt,ct,Ge,He,Te,De,je,Fe,Le,it,S,nn,an,T,cn]),ClientNotificationSchema:z([ee,y,de,Yt,tn]),ClientResultSchema:z([m,bt,xt,Bt,Jt,rn,sn,$t]),ServerRequestSchema:z([fe,yt,Lt,qt,nn,an,T,cn]),ServerNotificationSchema:z([ee,y,ut,ze,Ne,at,et,tn,zt]),ServerResultSchema:z([m,ue,Gt,$e,Ue,Ee,Oe,Me,rt,C,rn,sn,$t]),CallToolResultWireSchema:F().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of jf)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Mf).pipe(rt)}}var Pf;function Ff(){return Pf??=Nf()}function If(e){return e.type!==`object`}var Lf=new Set([`const`,`enum`,`default`,`examples`]),Rf=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function zf(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Bf(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(zf(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=i(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&zf(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Lf.has(o)?s:Rf.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Vf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Hf={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Uf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Wf;function Gf(){if(Wf)return Wf;let e=Ff();return Wf={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Wf}function Kf(e){return Object.prototype.hasOwnProperty.call(Vf,e)}function qf(e){return Object.prototype.hasOwnProperty.call(Hf,e)}function Jf(e){return Object.prototype.hasOwnProperty.call(Uf,e)}function Yf(e){return Jf(e)?Gf().resultSchemas[e]:void 0}function Xf(e){return Kf(e)?Gf().requestSchemas[e]:void 0}function Zf(e){return qf(e)?Gf().notificationSchemas[e]:void 0}Object.keys(Vf),Object.keys(Hf);function Qf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $f(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ep={ok:!1,reason:`not-in-era`};function tp(e){return Qf(e)&&Qf(e.outputSchema)&&If(e.outputSchema)}function np(e){return e}var rp={era:`2025-11-25`,hasRequestMethod:Kf,hasNotificationMethod:qf,validateRequest:(e,t)=>$f(Xf(e),t),validateResult:(e,t)=>$f(Yf(e),t),validateNotification:(e,t)=>$f(Zf(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ep,validateInputResponse:()=>ep,samplingResultVariant:((e,t)=>{let n=Ff();return $f(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=Af(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&If(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Qf(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:np(e)}}return{kind:`complete`,result:np(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>tp(e))?t:{...t,tools:n.map(e=>tp(e)?{...e,outputSchema:Bf(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function ip(){let e=Gc(()=>z([j(),N(),P(),cc(),B(j(),e),I(e)])),t=B(j(),e),n=z([j(),N().int()]),r=j(),i=z([j(),N().int()]),a=V([`user`,`assistant`]),o=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=L({ttl:N().optional()}),l=L({taskId:j()}),u=R({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=L({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=L({_meta:u.optional()}),m=L({method:j(),params:p.loose().optional()}),h=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),ee=L({icons:I(h).optional()}),g=L({name:j(),title:j().optional()}),te=g.extend({...g.shape,...ee.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),ne=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),t).optional(),url:t.optional()}),t.optional())),re=R({list:t.optional(),cancel:t.optional(),requests:R({sampling:R({createMessage:t.optional()}).optional(),elicitation:R({create:t.optional()}).optional()}).optional()}),ie=R({list:t.optional(),cancel:t.optional(),requests:R({tools:R({call:t.optional()}).optional()}).optional()}),_=L({experimental:B(j(),t).optional(),sampling:L({context:t.optional(),tools:t.optional()}).optional(),elicitation:ne.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:re.optional(),extensions:B(j(),t).optional()}),ae=L({experimental:B(j(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:ie.optional(),extensions:B(j(),t).optional()}),oe=L({progress:N(),total:U(N()),message:U(j())}),se=L({...p.shape,...oe.shape,progressToken:n}),ce=m.extend({method:H(`notifications/progress`),params:se}),le=p.extend({level:o,logger:j().optional(),data:F()}),ue=m.extend({method:H(`notifications/message`),params:le}),de=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),fe=de.extend({text:j()}),pe=de.extend({blob:s}),v=L({audience:I(a).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),y=L({...g.shape,...ee.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:v.optional(),_meta:U(R({}))}),me=L({...g.shape,...ee.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:v.optional(),_meta:U(R({}))}),he=m.extend({method:H(`notifications/resources/list_changed`),params:p.optional()}),ge=p.extend({uri:j()}),_e=m.extend({method:H(`notifications/resources/updated`),params:ge}),ve=L({name:j(),description:U(j()),required:U(P())}),ye=L({...g.shape,...ee.shape,description:U(j()),arguments:U(I(ve)),_meta:U(R({}))}),be=m.extend({method:H(`notifications/prompts/list_changed`),params:p.optional()}),xe=L({type:H(`text`),text:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),Se=L({type:H(`image`),data:s,mimeType:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),Ce=L({type:H(`audio`),data:s,mimeType:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),we=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Te=L({type:H(`resource`),resource:z([fe,pe]),annotations:v.optional(),_meta:B(j(),F()).optional()}),Ee=y.extend({type:H(`resource_link`)}),De=z([xe,Se,Ce,Ee,Te]),Oe=L({role:a,content:De}),ke=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),Ae=m.extend({method:H(`notifications/tools/list_changed`),params:p.optional()}),je=L({name:j().optional()}),Me=L({hints:I(je).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),Ne=L({mode:V([`auto`,`required`,`none`]).optional()}),Pe=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),Fe=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),Ie=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),Le=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),Re=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),ze=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Be=z([Le,Re]),Ve=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),He=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),Ue=z([Ve,He]),We=z([ze,Be,Ue]),Ge=z([We,Pe,Fe,Ie]),Ke=f.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Ge),required:I(j()).optional()}).catchall(F())}),b=L({type:H(`ref/resource`),uri:j()}),qe=L({type:H(`ref/prompt`),name:j()}),Je=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),Ye=_.shape,Xe=L({experimental:Ye.experimental,sampling:Ye.sampling,elicitation:Ye.elicitation,roots:Ye.roots,extensions:Ye.extensions}),Ze=ae.shape,Qe=L({experimental:Ze.experimental,logging:Ze.logging,completions:Ze.completions,prompts:Ze.prompts,resources:Ze.resources,tools:Ze.tools,extensions:Ze.extensions}),$e=R({progressToken:n.optional(),[rl]:j(),[il]:te.optional(),[ol]:Xe,[cl]:o.optional()}),et=L({...g.shape,...ee.shape,description:j().optional(),inputSchema:R({$schema:j().optional(),type:H(`object`)}),outputSchema:R({$schema:j().optional()}).optional(),annotations:ke.optional(),_meta:B(j(),F()).optional()}),x=L({type:H(`tool_result`),toolUseId:j(),content:I(De),structuredContent:F().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),tt=z([xe,Se,Ce,we,x]),nt=L({role:a,content:z([tt,I(tt)]),_meta:B(j(),F()).optional()}),S=j(),C=R({[al]:te.optional().catch(void 0)}),rt=C.optional();function w(e){return R({_meta:rt,resultType:S.default(`complete`),...e})}let it=w({}),at=w({nextCursor:r.optional()}),ot=w({content:I(De),structuredContent:F().optional(),isError:P().optional()}),st=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),tools:I(et),nextCursor:r.optional()}),ct=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),prompts:I(ye),nextCursor:r.optional()}),lt=w({description:j().optional(),messages:I(Oe)}),ut=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resources:I(y),nextCursor:r.optional()}),dt=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resourceTemplates:I(me),nextCursor:r.optional()}),ft=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),contents:I(z([fe,pe]))}),pt=w({completion:L({values:I(j()).max(100),total:N().int().optional(),hasMore:P().optional()}).loose()}),mt=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`])}),ht=w({ttlMs:N().int().min(0).catch(0),cacheScope:V([`public`,`private`]).catch(`private`),supportedVersions:I(j()),capabilities:Qe,instructions:j().optional()}),gt=L({messages:I(nt),modelPreferences:Me.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:t.optional(),tools:I(et).optional(),toolChoice:Ne.optional()}),_t=L({method:H(`sampling/createMessage`),params:gt}),vt=L({method:H(`roots/list`),params:L({_meta:B(j(),F()).optional()}).optional()}),yt=L({...nt.shape,model:j(),stopReason:j().optional()}),bt=L({roots:I(Je)}),xt=L({action:V([`accept`,`decline`,`cancel`]),content:B(j(),z([j(),N(),P(),I(j())])).optional()}),St=L({mode:H(`url`),message:j(),url:j().url()}),Ct=z([Ke,St]),wt=L({method:H(`elicitation/create`),params:Ct}),Tt=z([_t,vt,wt]),Et=z([yt,bt,xt]),Dt=B(j(),Tt),Ot=B(j(),Et),kt=w({inputRequests:Dt.optional(),requestState:j().optional()}),At={inputResponses:Ot.optional(),requestState:j().optional()},jt=L({_meta:$e,...At}),Mt=R({progressToken:n.optional()});function Nt(e,t){return L({method:H(e),params:L({_meta:$e,...t})})}function Pt(e,t){return L({method:H(e),params:L({_meta:Mt.optional(),...t}).optional()})}let Ft={name:j(),arguments:B(j(),F()).optional(),...At},It={cursor:r.optional()},Lt=Nt(`tools/call`,Ft),Rt=Nt(`tools/list`,It),zt=Nt(`prompts/list`,It),Bt=Nt(`prompts/get`,{name:j(),arguments:B(j(),j()).optional(),...At}),Vt=Nt(`resources/list`,It),Ht=Nt(`resources/templates/list`,It),Ut=Nt(`resources/read`,{uri:j(),...At}),Wt={ref:z([qe,b]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()},Gt=Nt(`completion/complete`,Wt),Kt=Nt(`server/discover`,{}),qt=L({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:I(j()).optional()}),Jt={notifications:qt},Yt=Nt(`subscriptions/listen`,Jt),Xt=C.extend({"io.modelcontextprotocol/subscriptionId":i}),Zt=R({_meta:Xt,resultType:S.default(`complete`)}),Qt={"tools/call":Pt(`tools/call`,Ft),"tools/list":Pt(`tools/list`,It),"prompts/get":Pt(`prompts/get`,{name:j(),arguments:B(j(),j()).optional()}),"prompts/list":Pt(`prompts/list`,It),"resources/list":Pt(`resources/list`,It),"resources/templates/list":Pt(`resources/templates/list`,It),"resources/read":Pt(`resources/read`,{uri:j()}),"completion/complete":Pt(`completion/complete`,Wt),"server/discover":Pt(`server/discover`,{}),"subscriptions/listen":Pt(`subscriptions/listen`,Jt)};function $t(e){return R({_meta:rt,...e})}let en={"tools/call":$t({content:I(De),structuredContent:F().optional(),isError:P().optional()}),"tools/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),tools:I(et),nextCursor:r.optional()}),"prompts/get":$t({description:j().optional(),messages:I(Oe)}),"prompts/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),prompts:I(ye),nextCursor:r.optional()}),"resources/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resources:I(y),nextCursor:r.optional()}),"resources/templates/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resourceTemplates:I(me),nextCursor:r.optional()}),"resources/read":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),contents:I(z([fe,pe]))}),"completion/complete":$t({completion:L({values:I(j()).max(100),total:N().int().optional(),hasMore:P().optional()}).loose()}),"server/discover":$t({ttlMs:N().int().min(0).catch(0),cacheScope:V([`public`,`private`]).catch(`private`),supportedVersions:I(j()),capabilities:Qe,instructions:j().optional()}),"subscriptions/listen":$t({})},tn=R({"io.modelcontextprotocol/subscriptionId":i.optional()}),nn=L({method:H(`notifications/subscriptions/acknowledged`),params:L({_meta:tn.optional(),notifications:qt})}),rn=L({_meta:tn.optional(),requestId:i,reason:j().optional()}),an=L({method:H(`notifications/cancelled`),params:rn}),on={"notifications/cancelled":an,"notifications/progress":ce,"notifications/message":ue,"notifications/resources/updated":_e,"notifications/resources/list_changed":he,"notifications/tools/list_changed":Ae,"notifications/prompts/list_changed":be,"notifications/subscriptions/acknowledged":nn},T=e=>L({jsonrpc:H(`2.0`),id:z([j(),N().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:ee,BaseMetadataSchema:g,ImplementationSchema:te,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:_,ServerCapabilitiesSchema:ae,ProgressSchema:oe,ProgressNotificationParamsSchema:se,ProgressNotificationSchema:ce,LoggingMessageNotificationParamsSchema:le,LoggingMessageNotificationSchema:ue,ResourceContentsSchema:de,TextResourceContentsSchema:fe,BlobResourceContentsSchema:pe,AnnotationsSchema:v,ResourceSchema:y,ResourceTemplateSchema:me,ResourceListChangedNotificationSchema:he,ResourceUpdatedNotificationParamsSchema:ge,ResourceUpdatedNotificationSchema:_e,PromptArgumentSchema:ve,PromptSchema:ye,PromptListChangedNotificationSchema:be,TextContentSchema:xe,ImageContentSchema:Se,AudioContentSchema:Ce,ToolUseContentSchema:we,EmbeddedResourceSchema:Te,ResourceLinkSchema:Ee,ContentBlockSchema:De,PromptMessageSchema:Oe,ToolAnnotationsSchema:ke,ToolListChangedNotificationSchema:Ae,ModelHintSchema:je,ModelPreferencesSchema:Me,ToolChoiceSchema:Ne,BooleanSchemaSchema:Pe,StringSchemaSchema:Fe,NumberSchemaSchema:Ie,UntitledSingleSelectEnumSchemaSchema:Le,TitledSingleSelectEnumSchemaSchema:Re,LegacyTitledEnumSchemaSchema:ze,SingleSelectEnumSchemaSchema:Be,UntitledMultiSelectEnumSchemaSchema:Ve,TitledMultiSelectEnumSchemaSchema:He,MultiSelectEnumSchemaSchema:Ue,EnumSchemaSchema:We,PrimitiveSchemaDefinitionSchema:Ge,ElicitRequestFormParamsSchema:Ke,ResourceTemplateReferenceSchema:b,PromptReferenceSchema:qe,RootSchema:Je,ClientCapabilities2026Schema:Xe,ServerCapabilities2026Schema:Qe,RequestMetaEnvelopeSchema:$e,ToolSchema:et,ToolResultContentSchema:x,SamplingMessageContentBlockSchema:tt,SamplingMessageSchema:nt,ResultTypeSchema:S,ResultMetaSchema:C,ResultSchema:it,PaginatedResultSchema:at,CallToolResultSchema:ot,ListToolsResultSchema:st,ListPromptsResultSchema:ct,GetPromptResultSchema:lt,ListResourcesResultSchema:ut,ListResourceTemplatesResultSchema:dt,ReadResourceResultSchema:ft,CompleteResultSchema:pt,CacheableResultSchema:mt,DiscoverResultSchema:ht,CreateMessageRequestParamsSchema:gt,CreateMessageRequestSchema:_t,ListRootsRequestSchema:vt,CreateMessageResultSchema:yt,ListRootsResultSchema:bt,ElicitResultSchema:xt,ElicitRequestURLParamsSchema:St,ElicitRequestParamsSchema:Ct,ElicitRequestSchema:wt,InputRequestSchema:Tt,InputResponseSchema:Et,InputRequestsSchema:Dt,InputResponsesSchema:Ot,InputRequiredResultSchema:kt,InputResponseRequestParamsSchema:jt,CallToolRequestSchema:Lt,ListToolsRequestSchema:Rt,ListPromptsRequestSchema:zt,GetPromptRequestSchema:Bt,ListResourcesRequestSchema:Vt,ListResourceTemplatesRequestSchema:Ht,ReadResourceRequestSchema:Ut,CompleteRequestSchema:Gt,DiscoverRequestSchema:Kt,SubscriptionFilterSchema:qt,SubscriptionsListenRequestSchema:Yt,SubscriptionsListenResultMetaSchema:Xt,SubscriptionsListenResultSchema:Zt,dispatchRequestSchemas:Qt,dispatchResultSchemas:en,NotificationMetaSchema:tn,SubscriptionsAcknowledgedNotificationSchema:nn,CancelledNotificationParamsSchema:rn,CancelledNotificationSchema:an,notificationSchemas2026:on,JSONRPCResultResponseSchema:T(it),CallToolResultResponseSchema:T(z([ot,kt])),ListToolsResultResponseSchema:T(st),ListPromptsResultResponseSchema:T(ct),GetPromptResultResponseSchema:T(z([lt,kt])),ListResourcesResultResponseSchema:T(ut),ListResourceTemplatesResultResponseSchema:T(dt),ReadResourceResultResponseSchema:T(z([ft,kt])),CompleteResultResponseSchema:T(pt),DiscoverResultResponseSchema:T(ht)}}var ap;function op(){return ap??=ip()}var sp=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function cp(e){return sp.includes(e)}var lp=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function up(e){return e[lp]}function dp(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function fp(e){return e===`public`||e===`private`}var Z=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Q=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Ef(this,new.target)}static fromError(t,n,r){if(t===Z.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new mp(e.elicitations,n)}if(t===Z.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new hp({supported:e.supported,requested:e.requested},n)}if(t===Z.InvalidParams||t===Z.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===Z.ResourceNotFound||Object.keys(e).length===1))return new pp(e.uri,n)}if(t===Z.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new gp({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},pp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(Z.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},mp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Z.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},hp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Z.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},gp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(Z.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},_p=0,vp=`private`,yp=[`tools/call`,`prompts/get`,`resources/read`];function bp(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||yp.includes(e))return t;throw new Q(Z.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function xp(e,t){let n=up(t);if(t.resultType!==`complete`||!cp(e))return n===void 0?t:Ep(t);let r=t,i=dp(r.ttlMs)?r.ttlMs:wp(n),a=fp(r.cacheScope)?r.cacheScope:Tp(n),o={...r,ttlMs:i,cacheScope:a};return delete o[lp],o}function Sp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Cp(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[al]:t}}:!Sp(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[al]:t}}}function wp(e){return e!==void 0&&dp(e.ttlMs)?e.ttlMs:_p}function Tp(e){return e!==void 0&&fp(e.cacheScope)?e.cacheScope:vp}function Ep(e){let t={...e};return delete t[lp],t}var Dp=[`elicitation/create`,`sampling/createMessage`,`roots/list`],Op;function kp(){if(Op)return Op;let e=op();return Op={request:{"elicitation/create":L({method:H(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":L({method:H(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":L({method:H(`roots/list`),params:R({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Op}function Ap(e){return Dp.includes(e)}function jp(e){return Ap(e)?kp().request[e]:void 0}function Mp(e){return Ap(e)?kp().response[e]:void 0}var Np={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Pp={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Fp(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Ip(e){return Object.prototype.hasOwnProperty.call(Pp,e)}function Lp(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Rp(e){return Fp(e)?op().dispatchRequestSchemas[e]:void 0}function zp(e){return Lp(e)?op().dispatchResultSchemas[e]:void 0}function Bp(e){return Ip(e)?op().notificationSchemas2026[e]:void 0}Object.keys(Np),Object.keys(Pp);function Vp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Hp(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Up={ok:!1,reason:`not-in-era`},Wp=[rl,ol];function Gp(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Vp(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Vp(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Vp(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Kp={era:`2026-07-28`,hasRequestMethod:Fp,hasNotificationMethod:Ip,hasInputRequestMethod:e=>jp(e)!==void 0,validateRequest:(e,t)=>Hp(Rp(e),t),validateResult:(e,t)=>Hp(zp(e),t),validateNotification:(e,t)=>Hp(Bp(e),t),validateInputRequest:(e,t)=>Hp(jp(e),t),validateInputResponse:(e,t)=>Hp(Mp(e),t),samplingResultVariant:()=>Up,outboundEnvelope(e){return{[rl]:e.protocolVersion,[il]:e.clientInfo,[ol]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Wp)n in e||t.push({key:n,problem:`missing`});let n=op().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>Af(e),inputRequestSchema:jp,decodeResult(e,t){if(!Vp(t))return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Vp(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new X(Y.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=Jp(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return Cp(xp(e,bp(e,Gp(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=op().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},qp;function Jp(){if(qp)return qp;let e=op();return qp={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},qp}var Yp=`2026-07-28`;function Xp(e){return e!==void 0&&kf(e)?Kp:rp}function Zp(e){return e.revision===void 0?e.era===`modern`?Kp.era:rp.era:Xp(e.revision).era}function Qp(e){return em.some(t=>t.hasRequestMethod(e))}function $p(e){return em.some(t=>t.hasNotificationMethod(e))}var em=[rp,Kp],tm=n({AnnotationsSchema:()=>ru,AudioContentSchema:()=>Iu,BaseMetadataSchema:()=>Ml,BaseRequestParamsSchema:()=>G,BlobResourceContentsSchema:()=>tu,BooleanSchemaSchema:()=>_d,CallToolRequestParamsSchema:()=>Zu,CallToolRequestSchema:()=>Qu,CallToolResultSchema:()=>Yu,CancelTaskRequestSchema:()=>rf,CancelTaskResultSchema:()=>af,CancelledNotificationParamsSchema:()=>Ol,CancelledNotificationSchema:()=>kl,ClientCapabilitiesSchema:()=>Ll,ClientNotificationSchema:()=>sf,ClientRequestSchema:()=>of,ClientResultSchema:()=>cf,ClientTasksCapabilitySchema:()=>Fl,CompatibilityCallToolResultSchema:()=>Xu,CompleteRequestParamsSchema:()=>Rd,CompleteRequestSchema:()=>zd,CompleteResultSchema:()=>Bd,ContentBlockSchema:()=>Bu,CreateMessageRequestParamsSchema:()=>pd,CreateMessageRequestSchema:()=>md,CreateMessageResultSchema:()=>hd,CreateMessageResultWithToolsSchema:()=>gd,CreateTaskResultSchema:()=>Jd,CursorSchema:()=>fl,DiscoverRequestSchema:()=>Ul,DiscoverResultSchema:()=>Wl,ElicitRequestFormParamsSchema:()=>kd,ElicitRequestParamsSchema:()=>jd,ElicitRequestSchema:()=>Md,ElicitRequestURLParamsSchema:()=>Ad,ElicitResultSchema:()=>Fd,ElicitationCompleteNotificationParamsSchema:()=>Nd,ElicitationCompleteNotificationSchema:()=>Pd,EmbeddedResourceSchema:()=>Ru,EmptyResultSchema:()=>Dl,EnumSchemaSchema:()=>Dd,GetPromptRequestParamsSchema:()=>Mu,GetPromptRequestSchema:()=>Nu,GetPromptResultSchema:()=>Hu,GetTaskPayloadRequestSchema:()=>$d,GetTaskPayloadResultSchema:()=>ef,GetTaskRequestSchema:()=>Zd,GetTaskResultSchema:()=>Qd,IconSchema:()=>Al,IconsSchema:()=>jl,ImageContentSchema:()=>Fu,ImplementationSchema:()=>Nl,InitializeRequestParamsSchema:()=>Rl,InitializeRequestSchema:()=>zl,InitializeResultSchema:()=>Vl,InitializedNotificationSchema:()=>Hl,JSONArraySchema:()=>ul,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>wl,JSONRPCMessageSchema:()=>Tl,JSONRPCNotificationSchema:()=>Sl,JSONRPCRequestSchema:()=>xl,JSONRPCResponseSchema:()=>El,JSONRPCResultResponseSchema:()=>Cl,JSONValueSchema:()=>ll,LegacyTitledEnumSchemaSchema:()=>Sd,ListChangedOptionsBaseSchema:()=>ed,ListPromptsRequestSchema:()=>Au,ListPromptsResultSchema:()=>ju,ListResourceTemplatesRequestSchema:()=>cu,ListResourceTemplatesResultSchema:()=>lu,ListResourcesRequestSchema:()=>ou,ListResourcesResultSchema:()=>su,ListRootsRequestSchema:()=>Hd,ListRootsResultSchema:()=>Ud,ListTasksRequestSchema:()=>tf,ListTasksResultSchema:()=>nf,ListToolsRequestSchema:()=>qu,ListToolsResultSchema:()=>Ju,LoggingLevelSchema:()=>td,LoggingMessageNotificationParamsSchema:()=>id,LoggingMessageNotificationSchema:()=>ad,ModelHintSchema:()=>od,ModelPreferencesSchema:()=>sd,MultiSelectEnumSchemaSchema:()=>Ed,NotificationSchema:()=>vl,NotificationsParamsSchema:()=>_l,NumberSchemaSchema:()=>yd,PaginatedRequestParamsSchema:()=>Yl,PaginatedRequestSchema:()=>Xl,PaginatedResultSchema:()=>Zl,PingRequestSchema:()=>Gl,PrimitiveSchemaDefinitionSchema:()=>Od,ProgressNotificationParamsSchema:()=>ql,ProgressNotificationSchema:()=>Jl,ProgressSchema:()=>Kl,ProgressTokenSchema:()=>dl,PromptArgumentSchema:()=>Ou,PromptListChangedNotificationSchema:()=>Uu,PromptMessageSchema:()=>Vu,PromptReferenceSchema:()=>Ld,PromptSchema:()=>ku,ReadResourceRequestParamsSchema:()=>du,ReadResourceRequestSchema:()=>fu,ReadResourceResultSchema:()=>pu,RelatedTaskMetadataSchema:()=>ml,RequestIdSchema:()=>bl,RequestMetaSchema:()=>hl,RequestSchema:()=>K,ResourceContentsSchema:()=>Ql,ResourceLinkSchema:()=>zu,ResourceListChangedNotificationSchema:()=>mu,ResourceRequestParamsSchema:()=>uu,ResourceSchema:()=>iu,ResourceTemplateReferenceSchema:()=>Id,ResourceTemplateSchema:()=>au,ResourceUpdatedNotificationParamsSchema:()=>Eu,ResourceUpdatedNotificationSchema:()=>Du,ResultMetaObjectSchema:()=>yl,ResultSchema:()=>q,RoleSchema:()=>nu,RootSchema:()=>Vd,RootsListChangedNotificationSchema:()=>Wd,SamplingContentSchema:()=>ud,SamplingMessageContentBlockSchema:()=>dd,SamplingMessageSchema:()=>fd,ServerCapabilitiesSchema:()=>Bl,ServerNotificationSchema:()=>uf,ServerRequestSchema:()=>lf,ServerResultSchema:()=>df,ServerTasksCapabilitySchema:()=>Il,SetLevelRequestParamsSchema:()=>nd,SetLevelRequestSchema:()=>rd,SingleSelectEnumSchemaSchema:()=>Cd,StringSchemaSchema:()=>vd,SubscribeRequestParamsSchema:()=>hu,SubscribeRequestSchema:()=>gu,SubscriptionFilterSchema:()=>yu,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Su,SubscriptionsAcknowledgedNotificationSchema:()=>Cu,SubscriptionsListenRequestParamsSchema:()=>bu,SubscriptionsListenRequestSchema:()=>xu,SubscriptionsListenResultMetaSchema:()=>wu,SubscriptionsListenResultSchema:()=>Tu,TaskAugmentedRequestParamsSchema:()=>gl,TaskCreationParamsSchema:()=>Gd,TaskMetadataSchema:()=>pl,TaskSchema:()=>qd,TaskStatusNotificationParamsSchema:()=>Yd,TaskStatusNotificationSchema:()=>Xd,TaskStatusSchema:()=>Kd,TextContentSchema:()=>Pu,TextResourceContentsSchema:()=>$l,TitledMultiSelectEnumSchemaSchema:()=>Td,TitledSingleSelectEnumSchemaSchema:()=>xd,ToolAnnotationsSchema:()=>Wu,ToolChoiceSchema:()=>cd,ToolExecutionSchema:()=>Gu,ToolListChangedNotificationSchema:()=>$u,ToolResultContentSchema:()=>ld,ToolSchema:()=>Ku,ToolUseContentSchema:()=>Lu,UnsubscribeRequestParamsSchema:()=>_u,UnsubscribeRequestSchema:()=>vu,UntitledMultiSelectEnumSchemaSchema:()=>wd,UntitledSingleSelectEnumSchemaSchema:()=>bd}),nm=e=>xl.safeParse(e).success,rm=e=>Sl.safeParse(e).success,im=e=>Cl.safeParse(e).success,am=e=>wl.safeParse(e).success;Z.InvalidRequest,Z.UnsupportedProtocolVersion,Z.InvalidParams,Z.MethodNotFound,Z.InvalidParams,Z.MissingRequiredClientCapability,Z.ParseError,Z.InvalidRequest,Z.MethodNotFound,Z.UnsupportedProtocolVersion,Z.MissingRequiredClientCapability;function om(e,t){return gs(e,t)}function sm(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function cm(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var lm=!1,um=`draft-2020-12`;function dm(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:um});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);lm||(lm=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=us(e,{target:um,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&fm(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function fm(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||fm(e)))}return!1}function pm(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function mm(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>pm(e)).join(`, `)}:{success:!0,data:n.value}}function hm(e){let t=us(e,{target:um,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var gm=/\\\.\\d\{(\d+)\}/;function _m(e){let t=gm.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>Qc({local:e,offset:t,precision:n}))))}function vm(e,t){let n;switch(e){case`email`:n=[Fs()];break;case`uri`:n=[zs()];break;case`date`:n=[$c()];break;case`date-time`:n=_m(t)}return new Set(n.map(e=>hm(e)).filter(e=>e!==void 0))}function ym(e,t,n){return n!==`zod`||vm(e,t).has(t)}function bm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xm(e){try{return dm(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Q(Z.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Sm=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Cm(e){return Sm.has(e)||e.startsWith(`x-`)}var wm=new Set([`$schema`,...Object.keys(kd.shape.requestedSchema.shape)]),Tm={string:sm([vd,bd,xd,Sd]),number:sm([yd]),integer:sm([yd]),boolean:sm([_d]),array:sm([wd,Td])},Em=new Set(vd.shape.format.unwrap().options);function Dm(e,t,n,r){if(!bm(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Tm,e.type)?Tm[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Cm(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Em.has(e.format)?(typeof s!=`string`||!ym(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Om(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&bm(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Dm(n,`properties.${e}`,t,r)])):wm.has(i)?n[i]=a:Cm(i)||r.push(i);if(r.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function km(e,t){if(!bm(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!om(Od,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Am(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Am(e,t[r],`${n}[${r}]`)):!bm(e)||!bm(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Am(r,t[e],i):Cm(e)?[]:[i]})}function jm(e){if(!cm(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Om(xm(e.requestedSchema),t),r=om(kd.shape.requestedSchema,n);if(!r.success)throw new Q(Z.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${km(n,r.error.message)}`);let i=Am(n,r.data);if(i.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Mm(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Mm,{elicit(e){try{return{method:`elicitation/create`,params:jm(e)}}catch(e){throw e instanceof Q?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Nm=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Pm={IdJagTokenExchangeResponseSchema:_f,OAuthClientInformationFullSchema:Sf,OAuthClientInformationSchema:xf,OAuthClientMetadataSchema:bf,OAuthClientRegistrationErrorSchema:Cf,OAuthErrorResponseSchema:vf,OAuthMetadataSchema:pf,OAuthProtectedResourceMetadataSchema:ff,OAuthTokenRevocationRequestSchema:wf,OAuthTokensSchema:gf,OpenIdProviderDiscoveryMetadataSchema:hf,OpenIdProviderMetadataSchema:mf},Fm={},Im={};function Lm(e,t){let n=e.slice(0,-6);Fm[n]=t,Im[n]=e=>t.safeParse(e).success}for(let e of Nm)Lm(e,tm[e]);for(let[e,t]of Object.entries(Pm))Lm(e,t);Object.freeze(Fm),Object.freeze(Im);function Rm(e){switch(e){case`initialize`:case`notifications/initialized`:return Xp(void 0);case`server/discover`:return Xp(Yp);default:return}}var zm=[rl,il,ol,cl],Bm=[`inputResponses`,`requestState`];function Vm(e,t){let n=e.params;if(!Km(n))return{message:e,lifted:{}};let r=n._meta,i=Km(r)?zm.filter(e=>e in r):[],a=t===`request`?Bm.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Km(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Hm(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Um(e){return()=>e}var Wm=Um(void 0),Gm=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??tl,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new X(Y.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new X(Y.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),im(e)||am(e)?this._onresponse(e):nm(e)?this._onrequest(e,t):rm(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new X(Y.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Vm(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Zp(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if($p(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Vm(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Zp(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(Z.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Qp(n.method)&&!i.hasRequestMethod(n.method)){o(Z.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(Z.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(Z.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:Jm(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Wm:Um(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),cm(t))return u(e,t,n);let i=Hm(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(Z.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:Z.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),im(e)?n(e):n(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),cm(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Hm(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return Xp(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Rm(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Qp(t)&&!e.hasRequestMethod(t))throw new X(Y.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof X?e:new X(Y.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let ee={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),ee.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let g=this._envelopeOutbound(ee),te=!1,ne=e=>{te||(this._progressHandlers.delete(h),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof X?e:new X(Y.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(te=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(Ym(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;mm(n,o).then(e=>{e.success?d(e.data):f(new X(Y.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>ne(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let re=r?.timeout??6e4;this._setupTimeout(h,re,r?.maxTotalTimeout,()=>ne(new X(Y.RequestTimeout,`Request timed out`,{timeout:re})),r?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new X(Y.NotConnected,`Not connected`);if($p(t.method)&&!e.hasNotificationMethod(t.method))throw new X(Y.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Qp(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Q(Z.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await mm(t.params,{...r.params});if(!a.success)throw new Q(Z.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!$p(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Q(Z.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await mm(t.params,{...r.params});if(!i.success)throw new Q(Z.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Km(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jm(e){let t={},n=[];if(!qm(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!qm(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Ym(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}t((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);var Xm=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Zm=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Qm=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,$m=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,eh=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,th=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,nh=/^(?:\/(?:[^~/]|~0|~1)*)*$/,rh=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,ih=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,ah=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,oh=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function sh(e){return e.test.bind(e)}ch.bind(void 0,!1),sh(Qm),sh($m),sh(eh),sh(Zm),sh(ah),sh(oh),sh(th),sh(nh),sh(rh),sh(ih);function ch(e,t){let n=t.match(Xm);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}globalThis.crypto;var lh=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e){super(e),this.name=new.target.name,Ef(this,new.target)}};(class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}}),class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Ef(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Ef(this,new.target)}};var uh=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},dh=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},fh=new Set;function ph(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;fh.has(o)||(fh.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},mh(t)):e=>s({method:a,params:e})]}function mh(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var hh=`2026-01-26`,gh=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Tl.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},_h=z([H(`light`),H(`dark`)]).describe(`Color theme preference for the host environment.`),vh=z([H(`inline`),H(`fullscreen`),H(`pip`)]).describe(`Display mode for UI presentation.`),yh=B(z([H(`--color-background-primary`),H(`--color-background-secondary`),H(`--color-background-tertiary`),H(`--color-background-inverse`),H(`--color-background-ghost`),H(`--color-background-info`),H(`--color-background-danger`),H(`--color-background-success`),H(`--color-background-warning`),H(`--color-background-disabled`),H(`--color-text-primary`),H(`--color-text-secondary`),H(`--color-text-tertiary`),H(`--color-text-inverse`),H(`--color-text-ghost`),H(`--color-text-info`),H(`--color-text-danger`),H(`--color-text-success`),H(`--color-text-warning`),H(`--color-text-disabled`),H(`--color-border-primary`),H(`--color-border-secondary`),H(`--color-border-tertiary`),H(`--color-border-inverse`),H(`--color-border-ghost`),H(`--color-border-info`),H(`--color-border-danger`),H(`--color-border-success`),H(`--color-border-warning`),H(`--color-border-disabled`),H(`--color-ring-primary`),H(`--color-ring-secondary`),H(`--color-ring-inverse`),H(`--color-ring-info`),H(`--color-ring-danger`),H(`--color-ring-success`),H(`--color-ring-warning`),H(`--font-sans`),H(`--font-mono`),H(`--font-weight-normal`),H(`--font-weight-medium`),H(`--font-weight-semibold`),H(`--font-weight-bold`),H(`--font-text-xs-size`),H(`--font-text-sm-size`),H(`--font-text-md-size`),H(`--font-text-lg-size`),H(`--font-heading-xs-size`),H(`--font-heading-sm-size`),H(`--font-heading-md-size`),H(`--font-heading-lg-size`),H(`--font-heading-xl-size`),H(`--font-heading-2xl-size`),H(`--font-heading-3xl-size`),H(`--font-text-xs-line-height`),H(`--font-text-sm-line-height`),H(`--font-text-md-line-height`),H(`--font-text-lg-line-height`),H(`--font-heading-xs-line-height`),H(`--font-heading-sm-line-height`),H(`--font-heading-md-line-height`),H(`--font-heading-lg-line-height`),H(`--font-heading-xl-line-height`),H(`--font-heading-2xl-line-height`),H(`--font-heading-3xl-line-height`),H(`--border-radius-xs`),H(`--border-radius-sm`),H(`--border-radius-md`),H(`--border-radius-lg`),H(`--border-radius-xl`),H(`--border-radius-full`),H(`--border-width-regular`),H(`--shadow-hairline`),H(`--shadow-sm`),H(`--shadow-md`),H(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
63
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ka(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ka(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var qa=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ja=[`oneOf`,`anyOf`];function Ya(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!qa.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ya(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}h(n,r,e.length===1?e[0]:Xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ya(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Za(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of qa)if(t in e)return;let n=t.filter(e=>Ja.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Xa(t);else{let e=n[0],i=Ja.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ha(e,r))}function Qa(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ha(i,s),Ha(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ka(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Za(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ha(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,h(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:to(t,`input`,e.processors),output:to(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function $a(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return $a(r.element,n);if(r.type===`set`)return $a(r.valueType,n);if(r.type===`lazy`)return $a(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return $a(r.innerType,n);if(r.type===`intersection`)return $a(r.left,n)||$a(r.right,n);if(r.type===`record`||r.type===`map`)return $a(r.keyType,n)||$a(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:$a(r.in,n)||$a(r.out,n);if(r.type===`object`){for(let e in r.shape)if($a(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if($a(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if($a(e,n))return!0;return!!(r.rest&&$a(r.rest,n))}return!1}var eo=(e,t={})=>n=>{let r=Ua({...n,processors:t});return k(e,r),Ga(r,e),Qa(r,e)},to=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ua({...i??{},target:a,io:t,processors:n});return k(e,o),Ga(o,e),Qa(o,e)},no=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ro=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},io=(e,t)=>{no(e,`minimum`,t),ro(e,`maximum`,t)},ao=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},oo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},so=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},co=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},lo=(e,t)=>no(e,`minimum`,t.minimum),uo=(e,t)=>ro(e,`maximum`,t.maximum),fo=e=>(t,n)=>{co(t,n.format);let[r,i]=e[n.format];no(t,`minimum`,r),ro(t,`maximum`,i)},po={greater_than:(e,t)=>no(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ro(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ao(e,t.value),number_format:fo(ge),bigint_format:fo(_e),min_length:lo,max_length:uo,length_equals:(e,t)=>io(e,t.length),min_size:lo,max_size:uo,size_equals:(e,t)=>io(e,t.size),string_format:(e,t)=>{co(e,t.format),t.pattern&&oo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>so(e,t.mime)};function mo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)po[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&no(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&no(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ro(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ro(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ao(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&so(t,i.mime);for(let e of i.patterns??[])oo(t,e);return t}var ho={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},go=new Map([[fr,Jt],[mr,Yt]]),_o=e=>go.get(e)??e,vo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=mo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ho[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(_o);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=mo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):O(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},bo=(e,t,n,r)=>{n.type=`boolean`},xo=(e,t,n,r)=>{O(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{O(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},Co=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},wo=(e,t,n,r)=>{O(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{O(e,t,n,r,`Void cannot be represented in JSON Schema`)},Eo=(e,t,n,r)=>{n.not={}},Do=(e,t,n,r)=>{},Oo=(e,t,n,r)=>{},ko=(e,t,n,r)=>{O(e,t,n,r,`Date cannot be represented in JSON Schema`)},Ao=(e,t,n,r)=>{let i=e._zod.def,o=a(i.entries);if(o.length===0){n.not={};return}o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},jo=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(O(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(O(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Mo=(e,t,n,r)=>{O(e,t,n,r,`NaN cannot be represented in JSON Schema`)},No=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Po=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=mo(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Fo=(e,t,n,r)=>{n.type=`boolean`},Io=(e,t,n,r)=>{O(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{O(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{O(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},zo=(e,t,n,r)=>{O(e,t,n,r,`Map cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{O(e,t,n,r,`Set cannot be represented in JSON Schema`)},Vo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=mo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=k(a.element,t,{...r,path:[...r.path,`items`]})};function Ho(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ho(t.out):t.type===`catch`?Ho(t.innerType):e._zod.optin}var Uo=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&O(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)h(i.properties,e,k(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ho(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=k(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Wo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>k(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Go=(e,t,n,r)=>{let i=e._zod.def,a=k(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=k(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ko=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>k(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?k(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Ho(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=mo(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function qo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=qo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>qo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?T:on).source),p):p}var Jo=new WeakMap;function Yo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Jo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=qo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Xo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=mo(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=k(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)h(i.patternProperties,_o(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=k(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Jo.get(t);n||(n=[],Jo.set(t,n),t.deferred.push(()=>Yo(t))),n.push(e)}i.additionalProperties=k(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ho(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Zo=(e,t,n,r)=>{let i=e._zod.def,a=k(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qo=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$o=Symbol();function es(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(O(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$o):JSON.parse(o)}var ts=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=es(i.defaultValue,e,t,n,r);o!==$o&&(n.default=o)},ns=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=es(i.defaultValue,e,t,n,r);o!==$o&&(n._prefault=o)},rs=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{O(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},is=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;k(o,t,r);let s=t.seen.get(e);s.ref=o},as=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},os=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ss=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cs=(e,t,n,r)=>{let i=e._zod.innerType;k(i,t,r);let a=t.seen.get(e);a.ref=i},ls={string:vo,number:yo,boolean:bo,bigint:xo,symbol:So,null:Co,undefined:wo,void:To,never:Eo,any:Do,unknown:Oo,date:ko,enum:Ao,literal:jo,nan:Mo,template_literal:No,file:Po,success:Fo,custom:Io,function:Lo,transform:Ro,map:zo,set:Bo,array:Vo,object:Uo,union:Wo,intersection:Go,tuple:Ko,record:Xo,nullable:Zo,nonoptional:Qo,default:ts,prefault:ns,catch:rs,pipe:is,readonly:as,promise:os,optional:ss,lazy:cs};function us(e,t){if(`_idmap`in e){let n=e,r=Ua({...t,processors:ls}),i={};for(let e of n._idmap.entries()){let[t,n]=e;k(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Ga(r,n),h(a,t,Qa(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ua({...t,processors:ls});return k(e,n),Ga(n,e),Qa(n,e)}var ds=new WeakSet([Object.prototype,Error.prototype]);function fs(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var ps=x(`ZodError`,(e,t)=>{ct.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ds.has(n)||(ds.add(n),fs(n,`format`,e=>t=>dt(e,t)),fs(n,`flatten`,e=>t=>ut(e,t)),fs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),fs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,s,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),ms=pt(ps),hs=mt(ps),gs=ht(ps),_s=_t(ps),vs=Ct(ps),ys=wt(ps),bs=Tt(ps),xs=Et(ps),Ss=Dt(ps),Cs=Ot(ps),ws=kt(ps),Ts=At(ps);function Es(){S.localeError||C(Ai())}function Ds(){S.memoizer||C({memoizer:Di()})}var A=x(`ZodType`,(e,t)=>(Es(),E.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return v(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(qc(e,t))},superRefine(e,t){return this.check(Jc(e,t))},overwrite(e){return this.check(Ma(e))},optional(){return U(this)},exactOptional(){return Oc(this)},nullable(){return Ac(this)},nullish(){return U(Ac(this))},nonoptional(e){return Ic(this,e)},array(){return I(this)},or(e){return z([this,e])},and(e){return bc(this,e)},transform(e){return Bc(this,Tc(e))},default(e){return Mc(this,e)},prefault(e){return Pc(this,e)},catch(e){return Rc(this,e)},pipe(e){return Bc(this,e)},readonly(){return Uc(this)},describe(e){let t=this.clone();return Pi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Pi.get(this);let t=this.clone();return Pi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Be(this,`~standard`,{...Pn(this),jsonSchema:{input:to(this,`input`),output:to(this,`output`)}})},set"~standard"(e){ze(this,`~standard`,e)},parse:function e(t,n){return ms(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await hs(this,t,n,{callee:e})},safeParse(e,t){return gs(this,e,t)},async safeParseAsync(e,t){return _s(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ze(this,`spa`,e)},validate(e,t){return bt(this,e,t)},validateAsync(e,t){return St(this,e,t)},encode:function e(t,n){return vs(this,t,n,{callee:e})},decode:function e(t,n){return ys(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await xs(this,t,n,{callee:e})},safeEncode(e,t){return Ss(this,e,t)},safeDecode(e,t){return Cs(this,e,t)},async safeEncodeAsync(e,t){return ws(this,e,t)},async safeDecodeAsync(e,t){return Ts(this,e,t)},toJSONSchema(e){return eo(this,{})(e)},get description(){return Pi.get(this)?.description},get _def(){return this._zod.def}}),Os=x(`_ZodString`,(e,t)=>{Fn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)},Ve({format:e=>mo(e).format??null,minLength:e=>mo(e).minimum??null,maxLength:e=>mo(e).maximum??null},{regex(...e){return this.check(Ea(...e))},includes(...e){return this.check(ka(...e))},startsWith(...e){return this.check(Aa(...e))},endsWith(...e){return this.check(ja(...e))},min(...e){return this.check(wa(...e))},max(...e){return this.check(Ca(...e))},length(...e){return this.check(Ta(...e))},nonempty(...e){return this.check(wa(1,...e))},lowercase(e){return this.check(Da(e))},uppercase(e){return this.check(Oa(e))},trim(){return this.check(Pa())},normalize(...e){return this.check(Na(...e))},toLowerCase(){return this.check(Fa())},toUpperCase(){return this.check(Ia())},slugify(){return this.check(La())}})),ks=x(`ZodString`,(e,t)=>{Fn.init(e,t),Os.init(e,t)},{email(e){return this.check(Li(Ps,e))},url(e){return this.check(Ui(Rs,e))},jwt(e){return this.check(ia(ec,e))},emoji(e){return this.check(Wi(Bs,e))},guid(e){return this.check(Ri(Is,e))},uuid(e){return this.check(zi(Ls,e))},uuidv4(e){return this.check(Bi(Ls,e))},uuidv6(e){return this.check(Vi(Ls,e))},uuidv7(e){return this.check(Hi(Ls,e))},nanoid(e){return this.check(Gi(Vs,e))},cuid(e){return this.check(Ki(Hs,e))},cuid2(e){return this.check(qi(Us,e))},ulid(e){return this.check(Ji(Ws,e))},base64(e){return this.check(ta(Zs,e))},base64url(e){return this.check(na(Qs,e))},xid(e){return this.check(Yi(Gs,e))},ksuid(e){return this.check(Xi(Ks,e))},ipv4(e){return this.check(Zi(qs,e))},ipv6(e){return this.check(Qi(Js,e))},cidrv4(e){return this.check($i(Ys,e))},cidrv6(e){return this.check(ea(Xs,e))},e164(e){return this.check(ra($s,e))},datetime(e){return this.check(aa(As,e))},date(e){return this.check(oa(js,e))},time(e){return this.check(sa(Ms,e))},duration(e){return this.check(ca(Ns,e))}});function j(e){return Ii(ks,e)}var M=x(`ZodStringFormat`,(e,t)=>{D.init(e,t),Os.init(e,t)}),As=x(`ZodISODateTime`,(e,t)=>{er.init(e,t),M.init(e,t)}),js=x(`ZodISODate`,(e,t)=>{tr.init(e,t),M.init(e,t)}),Ms=x(`ZodISOTime`,(e,t)=>{nr.init(e,t),M.init(e,t)}),Ns=x(`ZodISODuration`,(e,t)=>{rr.init(e,t),M.init(e,t)}),Ps=x(`ZodEmail`,(e,t)=>{Rn.init(e,t),M.init(e,t)});function Fs(e){return Li(Ps,e)}var Is=x(`ZodGUID`,(e,t)=>{In.init(e,t),M.init(e,t)}),Ls=x(`ZodUUID`,(e,t)=>{Ln.init(e,t),M.init(e,t)}),Rs=x(`ZodURL`,(e,t)=>{Kn.init(e,t),M.init(e,t)});function zs(e){return Ui(Rs,e)}var Bs=x(`ZodEmoji`,(e,t)=>{qn.init(e,t),M.init(e,t)}),Vs=x(`ZodNanoID`,(e,t)=>{Jn.init(e,t),M.init(e,t)}),Hs=x(`ZodCUID`,(e,t)=>{Yn.init(e,t),M.init(e,t)}),Us=x(`ZodCUID2`,(e,t)=>{Xn.init(e,t),M.init(e,t)}),Ws=x(`ZodULID`,(e,t)=>{Zn.init(e,t),M.init(e,t)}),Gs=x(`ZodXID`,(e,t)=>{Qn.init(e,t),M.init(e,t)}),Ks=x(`ZodKSUID`,(e,t)=>{$n.init(e,t),M.init(e,t)}),qs=x(`ZodIPv4`,(e,t)=>{ir.init(e,t),M.init(e,t)}),Js=x(`ZodIPv6`,(e,t)=>{sr.init(e,t),M.init(e,t)}),Ys=x(`ZodCIDRv4`,(e,t)=>{cr.init(e,t),M.init(e,t)}),Xs=x(`ZodCIDRv6`,(e,t)=>{ur.init(e,t),M.init(e,t)}),Zs=x(`ZodBase64`,(e,t)=>{pr.init(e,t),M.init(e,t)}),Qs=x(`ZodBase64URL`,(e,t)=>{gr.init(e,t),M.init(e,t)}),$s=x(`ZodE164`,(e,t)=>{_r.init(e,t),M.init(e,t)}),ec=x(`ZodJWT`,(e,t)=>{yr.init(e,t),M.init(e,t)}),tc=x(`ZodNumber`,(e,t)=>{br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.isFinite=!0},Ve({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=mo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=mo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=mo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mo(e).format??null},{gt(e,t){return this.check(ba(e,t))},gte(e,t){return this.check(xa(e,t))},min(e,t){return this.check(xa(e,t))},lt(e,t){return this.check(va(e,t))},lte(e,t){return this.check(ya(e,t))},max(e,t){return this.check(ya(e,t))},int(e){return this.check(rc(e))},safe(e){return this.check(rc(e))},positive(e){return this.check(ba(0,e))},nonnegative(e){return this.check(xa(0,e))},negative(e){return this.check(va(0,e))},nonpositive(e){return this.check(ya(0,e))},multipleOf(e,t){return this.check(Sa(e,t))},step(e,t){return this.check(Sa(e,t))},finite(){return this}}));function N(e){return la(tc,e)}var nc=x(`ZodNumberFormat`,(e,t)=>{xr.init(e,t),tc.init(e,t)});function rc(e){return da(nc,e)}var ic=x(`ZodBoolean`,(e,t)=>{Sr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r)});function P(e){return fa(ic,e)}var ac=x(`ZodUndefined`,(e,t)=>{Cr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r)});function oc(e){return pa(ac,e)}var sc=x(`ZodNull`,(e,t)=>{wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function cc(e){return ma(sc,e)}var lc=x(`ZodAny`,(e,t)=>{Tr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function uc(){return ha(lc)}var dc=x(`ZodUnknown`,(e,t)=>{Er.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function F(){return ga(dc)}var fc=x(`ZodNever`,(e,t)=>{Dr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eo(e,t,n,r)});function pc(e){return _a(fc,e)}var mc=x(`ZodArray`,(e,t)=>{Ds(),kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(wa(e,t))},nonempty(e){return this.check(wa(1,e))},max(e,t){return this.check(Ca(e,t))},length(e,t){return this.check(Ta(e,t))},unwrap(){return this.element}});function I(e,t){return Ra(mc,e,t)}var hc=x(`ZodObject`,(e,t)=>{Ds(),Fr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),qe(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return V(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:F()}))},loose(){return this.clone(_(this._zod.def,{catchall:F()}))},strict(){return this.clone(_(this._zod.def,{catchall:pc()}))},strip(){return this.clone(_(this._zod.def,{catchall:void 0}))},extend(e){return xe(this,e)},safeExtend(e){return Ce(this,e)},merge(e){return we(this,e)},pick(e){return ve(this,e)},omit(e){return be(this,e)},partial(...e){return Te(Ec,this,e[0])},exactPartial(...e){return Te(Dc,this,e[0],`exactPartial`)},required(...e){return Ee(Fc,this,e[0])}});function L(e,t){return new hc({type:`object`,shape:e??{},...y(t)})}function R(e,t){return new hc({type:`object`,shape:e,catchall:F(),...y(t)})}var gc=x(`ZodUnion`,(e,t)=>{Lr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.options=t.options});function z(e,t){return new gc({type:`union`,options:e,...y(t)})}var _c=x(`ZodDiscriminatedUnion`,(e,t)=>{gc.init(e,t),zr.init(e,t)});function vc(e,t,n){return new _c({type:`union`,options:t,discriminator:e,...y(n)})}var yc=x(`ZodIntersection`,(e,t)=>{Br.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r)});function bc(e,t){return new yc({type:`intersection`,left:e,right:t})}var xc=x(`ZodRecord`,(e,t)=>{Ds(),Ur.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function B(e,t,n){return!t||!t._zod?new xc({type:`record`,keyType:j(),valueType:e,...y(t)}):new xc({type:`record`,keyType:e,valueType:t,...y(n)})}var Sc=x(`ZodEnum`,(e,t)=>{Wr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Sc({...t,checks:[],...y(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Sc({...t,checks:[],...y(r),entries:i})}});function V(e,t){return new Sc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Cc=x(`ZodLiteral`,(e,t)=>{Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function H(e,t){return new Cc({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var wc=x(`ZodTransform`,(e,t)=>{Ds(),Kr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new nt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Le(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Le(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Tc(e){return new wc({type:`transform`,transform:e})}var Ec=x(`ZodOptional`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function U(e){return new Ec({type:`optional`,innerType:e})}var Dc=x(`ZodExactOptional`,(e,t)=>{Yr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oc(e){return new Dc({type:`optional`,innerType:e})}var kc=x(`ZodNullable`,(e,t)=>{Xr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ac(e){return new kc({type:`nullable`,innerType:e})}var jc=x(`ZodDefault`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Mc(e,t){return new jc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Nc=x(`ZodPrefault`,(e,t)=>{$r.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pc(e,t){return new Nc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Fc=x(`ZodNonOptional`,(e,t)=>{ei.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ic(e,t){return new Fc({type:`nonoptional`,innerType:e,...y(t)})}var Lc=x(`ZodCatch`,(e,t)=>{ri.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Rc(e,t){return new Lc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Ye(t)})}var zc=x(`ZodPipe`,(e,t)=>{ii.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.in=t.in,e.out=t.out});function Bc(e,t){return new zc({type:`pipe`,in:e,out:t})}var Vc=x(`ZodPreprocess`,(e,t)=>{zc.init(e,t),oi.init(e,t)}),Hc=x(`ZodReadonly`,(e,t)=>{si.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>as(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Uc(e){return new Hc({type:`readonly`,innerType:e})}var Wc=x(`ZodLazy`,(e,t)=>{li.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cs(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Gc(e){return new Wc({type:`lazy`,getter:e})}var Kc=x(`ZodCustom`,(e,t)=>{ui.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r)});function qc(e,t={}){return za(Kc,e,t)}function Jc(e,t){return Ba(e,t)}function Yc(e,t){return new Vc({type:`pipe`,in:Tc(e),out:t})}var Xc={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Zc;Zc||={};function Qc(e){return aa(As,e)}function $c(e){return oa(js,e)}function el(e){return ua(tc,e)}var tl=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],nl=`io.modelcontextprotocol/related-task`,rl=`io.modelcontextprotocol/protocolVersion`,il=`io.modelcontextprotocol/clientInfo`,al=`io.modelcontextprotocol/serverInfo`,ol=`io.modelcontextprotocol/clientCapabilities`,sl=`io.modelcontextprotocol/subscriptionId`,cl=`io.modelcontextprotocol/logLevel`,ll=Gc(()=>z([j(),N(),P(),cc(),B(j(),ll),I(ll)])),W=B(j(),ll),ul=I(ll),dl=z([j(),N().int()]),fl=j(),pl=L({ttl:N().optional()}),ml=L({taskId:j()}),hl=R({progressToken:dl.optional(),[nl]:ml.optional()}),G=L({_meta:hl.optional()}),gl=G.extend({task:pl.optional()}),K=L({method:j(),params:G.loose().optional()}),_l=L({_meta:hl.optional()}),vl=L({method:j(),params:_l.loose().optional()}),yl=R({get[al](){return Nl.optional().catch(void 0)}}),q=R({_meta:yl.optional()}),bl=z([j(),N().int()]),xl=L({jsonrpc:H(`2.0`),id:bl,...K.shape}).strict(),Sl=L({jsonrpc:H(`2.0`),...vl.shape}).strict(),Cl=L({jsonrpc:H(`2.0`),id:bl,result:q}).strict(),wl=L({jsonrpc:H(`2.0`),id:bl.optional(),error:L({code:N().int(),message:j(),data:F().optional()})}).strict(),Tl=z([xl,Sl,Cl,wl]),El=z([Cl,wl]),Dl=q.strict(),Ol=_l.extend({requestId:bl.optional(),reason:j().optional()}),kl=vl.extend({method:H(`notifications/cancelled`),params:Ol}),Al=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),jl=L({icons:I(Al).optional()}),Ml=L({name:j(),title:j().optional()}),Nl=Ml.extend({...Ml.shape,...jl.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),Pl=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),W).optional(),url:W.optional()}),W.optional())),Fl=R({list:W.optional(),cancel:W.optional(),requests:R({sampling:R({createMessage:W.optional()}).optional(),elicitation:R({create:W.optional()}).optional()}).optional()}),Il=R({list:W.optional(),cancel:W.optional(),requests:R({tools:R({call:W.optional()}).optional()}).optional()}),Ll=L({experimental:B(j(),W).optional(),sampling:L({context:W.optional(),tools:W.optional()}).optional(),elicitation:Pl.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:Fl.optional(),extensions:B(j(),W).optional()}),Rl=G.extend({protocolVersion:j(),capabilities:Ll,clientInfo:Nl}),zl=K.extend({method:H(`initialize`),params:Rl}),Bl=L({experimental:B(j(),W).optional(),logging:W.optional(),completions:W.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:Il.optional(),extensions:B(j(),W).optional()}),Vl=q.extend({protocolVersion:j(),capabilities:Bl,serverInfo:Nl,instructions:j().optional()}),Hl=vl.extend({method:H(`notifications/initialized`),params:_l.optional()}),Ul=K.extend({method:H(`server/discover`),params:G.optional()}),Wl=q.extend({supportedVersions:I(j()),capabilities:Bl,instructions:j().optional()}),Gl=K.extend({method:H(`ping`),params:G.optional()}),Kl=L({progress:N(),total:U(N()),message:U(j())}),ql=L({..._l.shape,...Kl.shape,progressToken:dl}),Jl=vl.extend({method:H(`notifications/progress`),params:ql}),Yl=G.extend({cursor:fl.optional()}),Xl=K.extend({params:Yl.optional()}),Zl=q.extend({nextCursor:fl.optional()}),Ql=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),$l=Ql.extend({text:j()}),eu=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),tu=Ql.extend({blob:eu}),nu=V([`user`,`assistant`]),ru=L({audience:I(nu).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),iu=L({...Ml.shape,...jl.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:ru.optional(),_meta:U(R({}))}),au=L({...Ml.shape,...jl.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:ru.optional(),_meta:U(R({}))}),ou=Xl.extend({method:H(`resources/list`)}),su=Zl.extend({resources:I(iu)}),cu=Xl.extend({method:H(`resources/templates/list`)}),lu=Zl.extend({resourceTemplates:I(au)}),uu=G.extend({uri:j()}),du=uu,fu=K.extend({method:H(`resources/read`),params:du}),pu=q.extend({contents:I(z([$l,tu]))}),mu=vl.extend({method:H(`notifications/resources/list_changed`),params:_l.optional()}),hu=uu,gu=K.extend({method:H(`resources/subscribe`),params:hu}),_u=uu,vu=K.extend({method:H(`resources/unsubscribe`),params:_u}),yu=L({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:I(j()).optional()}),bu=G.extend({notifications:yu}),xu=K.extend({method:H(`subscriptions/listen`),params:bu}),Su=_l.extend({notifications:yu}),Cu=vl.extend({method:H(`notifications/subscriptions/acknowledged`),params:Su}),wu=yl.extend({[sl]:bl}),Tu=q.extend({_meta:wu}),Eu=_l.extend({uri:j()}),Du=vl.extend({method:H(`notifications/resources/updated`),params:Eu}),Ou=L({name:j(),description:U(j()),required:U(P())}),ku=L({...Ml.shape,...jl.shape,description:U(j()),arguments:U(I(Ou)),_meta:U(R({}))}),Au=Xl.extend({method:H(`prompts/list`)}),ju=Zl.extend({prompts:I(ku)}),Mu=G.extend({name:j(),arguments:B(j(),j()).optional()}),Nu=K.extend({method:H(`prompts/get`),params:Mu}),Pu=L({type:H(`text`),text:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Fu=L({type:H(`image`),data:eu,mimeType:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Iu=L({type:H(`audio`),data:eu,mimeType:j(),annotations:ru.optional(),_meta:B(j(),F()).optional()}),Lu=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Ru=L({type:H(`resource`),resource:z([$l,tu]),annotations:ru.optional(),_meta:B(j(),F()).optional()}),zu=iu.extend({type:H(`resource_link`)}),Bu=z([Pu,Fu,Iu,zu,Ru]),Vu=L({role:nu,content:Bu}),Hu=q.extend({description:j().optional(),messages:I(Vu)}),Uu=vl.extend({method:H(`notifications/prompts/list_changed`),params:_l.optional()}),Wu=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),Gu=L({taskSupport:V([`required`,`optional`,`forbidden`]).optional()}),Ku=L({...Ml.shape,...jl.shape,description:j().optional(),inputSchema:L({type:H(`object`),properties:B(j(),ll).optional(),required:I(j()).optional()}).catchall(F()),outputSchema:R({$schema:j().optional()}).optional(),annotations:Wu.optional(),execution:Gu.optional(),_meta:B(j(),F()).optional()}),qu=Xl.extend({method:H(`tools/list`)}),Ju=Zl.extend({tools:I(Ku)}),Yu=q.extend({content:I(Bu).default([]),structuredContent:F().optional(),isError:P().optional()}),Xu=Yu.or(q.extend({toolResult:F()})),Zu=gl.extend({name:j(),arguments:B(j(),F()).optional()}),Qu=K.extend({method:H(`tools/call`),params:Zu}),$u=vl.extend({method:H(`notifications/tools/list_changed`),params:_l.optional()}),ed=L({autoRefresh:P().default(!0),debounceMs:N().int().nonnegative().default(300)}),td=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),nd=G.extend({level:td}),rd=K.extend({method:H(`logging/setLevel`),params:nd}),id=_l.extend({level:td,logger:j().optional(),data:F()}),ad=vl.extend({method:H(`notifications/message`),params:id}),od=L({name:j().optional()}),sd=L({hints:I(od).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),cd=L({mode:V([`auto`,`required`,`none`]).optional()}),ld=L({type:H(`tool_result`),toolUseId:j().describe(`The unique identifier for the corresponding tool call.`),content:I(Bu),structuredContent:F().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),ud=vc(`type`,[Pu,Fu,Iu]),dd=vc(`type`,[Pu,Fu,Iu,Lu,ld]),fd=L({role:nu,content:z([dd,I(dd)]),_meta:B(j(),F()).optional()}),pd=gl.extend({messages:I(fd),modelPreferences:sd.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:W.optional(),tools:I(Ku).optional(),toolChoice:cd.optional()}),md=K.extend({method:H(`sampling/createMessage`),params:pd}),hd=q.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`]).or(j())),role:nu,content:ud}),gd=q.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(j())),role:nu,content:z([dd,I(dd)])}),_d=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),vd=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),yd=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),bd=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),xd=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),Sd=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Cd=z([bd,xd]),wd=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),Td=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),Ed=z([wd,Td]),Dd=z([Sd,Cd,Ed]),Od=z([Dd,_d,vd,yd]),kd=gl.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Od),required:I(j()).optional()}).catchall(F())}),Ad=gl.extend({mode:H(`url`),message:j(),elicitationId:j(),url:j().url()}),jd=z([kd,Ad]),Md=K.extend({method:H(`elicitation/create`),params:jd}),Nd=_l.extend({elicitationId:j()}),Pd=vl.extend({method:H(`notifications/elicitation/complete`),params:Nd}),Fd=q.extend({action:V([`accept`,`decline`,`cancel`]),content:Yc(e=>e===null?void 0:e,B(j(),z([j(),N(),P(),I(j())])).optional())}),Id=L({type:H(`ref/resource`),uri:j()}),Ld=L({type:H(`ref/prompt`),name:j()}),Rd=G.extend({ref:z([Ld,Id]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()}),zd=K.extend({method:H(`completion/complete`),params:Rd}),Bd=q.extend({completion:R({values:I(j()).max(100),total:U(N().int()),hasMore:U(P())})}),Vd=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),Hd=K.extend({method:H(`roots/list`),params:G.optional()}),Ud=q.extend({roots:I(Vd)}),Wd=vl.extend({method:H(`notifications/roots/list_changed`),params:_l.optional()}),Gd=R({ttl:N().optional(),pollInterval:N().optional()}),Kd=V([`working`,`input_required`,`completed`,`failed`,`cancelled`]),qd=L({taskId:j(),status:Kd,ttl:z([N(),cc()]),createdAt:j(),lastUpdatedAt:j(),pollInterval:U(N()),statusMessage:U(j())}),Jd=q.extend({task:qd}),Yd=_l.merge(qd),Xd=vl.extend({method:H(`notifications/tasks/status`),params:Yd}),Zd=K.extend({method:H(`tasks/get`),params:G.extend({taskId:j()})}),Qd=q.merge(qd),$d=K.extend({method:H(`tasks/result`),params:G.extend({taskId:j()})}),ef=q.loose(),tf=Xl.extend({method:H(`tasks/list`)}),nf=Zl.extend({tasks:I(qd)}),rf=K.extend({method:H(`tasks/cancel`),params:G.extend({taskId:j()})}),af=q.merge(qd),of=z([Gl,zl,Ul,zd,rd,Nu,Au,ou,cu,fu,gu,vu,xu,Qu,qu]),sf=z([kl,Jl,Hl,Wd]),cf=z([Dl,hd,gd,Fd,Ud]),lf=z([Gl,md,Md,Hd]),uf=z([kl,Jl,ad,Du,mu,$u,Uu,Cu,Pd]),df=z([Dl,Vl,Wl,Bd,Hu,ju,su,lu,pu,Yu,Ju,Tu]),J=zs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Xc.custom,message:`URL must be parseable`,fatal:!0}),Ze}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),ff=R({resource:j().url(),authorization_servers:I(J).optional(),jwks_uri:j().url().optional(),scopes_supported:I(j()).optional(),bearer_methods_supported:I(j()).optional(),resource_signing_alg_values_supported:I(j()).optional(),resource_name:j().optional(),resource_documentation:j().optional(),resource_policy_uri:j().url().optional(),resource_tos_uri:j().url().optional(),tls_client_certificate_bound_access_tokens:P().optional(),authorization_details_types_supported:I(j()).optional(),dpop_signing_alg_values_supported:I(j()).optional(),dpop_bound_access_tokens_required:P().optional()}),pf=R({issuer:j(),authorization_endpoint:J,token_endpoint:J,registration_endpoint:J.optional(),scopes_supported:I(j()).optional(),response_types_supported:I(j()),response_modes_supported:I(j()).optional(),grant_types_supported:I(j()).optional(),token_endpoint_auth_methods_supported:I(j()).optional(),token_endpoint_auth_signing_alg_values_supported:I(j()).optional(),service_documentation:J.optional(),revocation_endpoint:J.optional(),revocation_endpoint_auth_methods_supported:I(j()).optional(),revocation_endpoint_auth_signing_alg_values_supported:I(j()).optional(),introspection_endpoint:j().optional(),introspection_endpoint_auth_methods_supported:I(j()).optional(),introspection_endpoint_auth_signing_alg_values_supported:I(j()).optional(),code_challenge_methods_supported:I(j()).optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0),dpop_signing_alg_values_supported:I(j()).optional()}),mf=R({issuer:j(),authorization_endpoint:J,token_endpoint:J,userinfo_endpoint:J.optional(),jwks_uri:J,registration_endpoint:J.optional(),scopes_supported:I(j()).optional(),response_types_supported:I(j()),response_modes_supported:I(j()).optional(),grant_types_supported:I(j()).optional(),acr_values_supported:I(j()).optional(),subject_types_supported:I(j()),id_token_signing_alg_values_supported:I(j()),id_token_encryption_alg_values_supported:I(j()).optional(),id_token_encryption_enc_values_supported:I(j()).optional(),userinfo_signing_alg_values_supported:I(j()).optional(),userinfo_encryption_alg_values_supported:I(j()).optional(),userinfo_encryption_enc_values_supported:I(j()).optional(),request_object_signing_alg_values_supported:I(j()).optional(),request_object_encryption_alg_values_supported:I(j()).optional(),request_object_encryption_enc_values_supported:I(j()).optional(),token_endpoint_auth_methods_supported:I(j()).optional(),token_endpoint_auth_signing_alg_values_supported:I(j()).optional(),display_values_supported:I(j()).optional(),claim_types_supported:I(j()).optional(),claims_supported:I(j()).optional(),service_documentation:j().optional(),claims_locales_supported:I(j()).optional(),ui_locales_supported:I(j()).optional(),claims_parameter_supported:P().optional(),request_parameter_supported:P().optional(),request_uri_parameter_supported:P().optional(),require_request_uri_registration:P().optional(),op_policy_uri:J.optional(),op_tos_uri:J.optional(),client_id_metadata_document_supported:P().optional(),authorization_response_iss_parameter_supported:P().optional().catch(void 0)}),hf=L({...mf.shape,...pf.pick({code_challenge_methods_supported:!0}).shape}),gf=L({access_token:j(),id_token:j().optional(),token_type:j(),expires_in:el().optional(),scope:j().optional(),refresh_token:j().optional()}).strip(),_f=L({issued_token_type:H(`urn:ietf:params:oauth:token-type:id-jag`),access_token:j(),token_type:j().optional(),expires_in:N().optional(),scope:j().optional()}).strip(),vf=L({error:j(),error_description:j().optional(),error_uri:j().optional()}),yf=J.optional().or(H(``).transform(()=>void 0)),bf=L({redirect_uris:I(J),token_endpoint_auth_method:j().optional(),grant_types:I(j()).optional(),response_types:I(j()).optional(),application_type:j().optional(),client_name:j().optional(),client_uri:J.optional(),logo_uri:yf,scope:j().optional(),contacts:I(j()).optional(),tos_uri:yf,policy_uri:j().optional(),jwks_uri:J.optional(),jwks:uc().optional(),software_id:j().optional(),software_version:j().optional(),software_statement:j().optional()}).strip(),xf=L({client_id:j(),client_secret:j().optional(),client_id_issued_at:N().optional(),client_secret_expires_at:N().optional()}).strip(),Sf=bf.merge(xf),Cf=L({error:j(),error_description:j().optional()}).strip(),wf=L({token:j(),token_type_hint:j().optional()}).strip(),Tf=Symbol.for(`mcp.sdk.errorBrands`);function Ef(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Tf,{value:n,enumerable:!1,configurable:!0})}function Df(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Tf)){let n=t[Tf];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Ef(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});var Y=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),X=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Ef(this,new.target)}};(class extends X{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var Of=`2026-07-28`;function kf(e){return e>=Of}function Af(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var jf=[`task`,`inputRequests`,`requestState`];function Mf(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||jf.some(t=>t in e)?e:{...e,content:[]}}function Nf(){let e=Gc(()=>z([j(),N(),P(),cc(),B(j(),e),I(e)])),t=B(j(),e),n=z([j(),N().int()]),r=j(),i=L({ttl:N().optional()}),a=L({taskId:j()}),o=R({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=L({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=L({method:j(),params:s.loose().optional()}),u=L({_meta:o.optional()}),d=L({method:j(),params:u.loose().optional()}),f=R({_meta:o.optional()}),p=z([j(),N().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:j().optional()}),ee=d.extend({method:H(`notifications/cancelled`),params:h}),g=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),te=L({icons:I(g).optional()}),ne=L({name:j(),title:j().optional()}),re=ne.extend({...ne.shape,...te.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),ie=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),t).optional(),url:t.optional()}),t.optional())),_=R({list:t.optional(),cancel:t.optional(),requests:R({sampling:R({createMessage:t.optional()}).optional(),elicitation:R({create:t.optional()}).optional()}).optional()}),ae=R({list:t.optional(),cancel:t.optional(),requests:R({tools:R({call:t.optional()}).optional()}).optional()}),oe=L({experimental:B(j(),t).optional(),sampling:L({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:_.optional(),extensions:B(j(),t).optional()}),se=s.extend({protocolVersion:j(),capabilities:oe,clientInfo:re}),ce=l.extend({method:H(`initialize`),params:se}),le=L({experimental:B(j(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:ae.optional(),extensions:B(j(),t).optional()}),ue=f.extend({protocolVersion:j(),capabilities:le,serverInfo:re,instructions:j().optional()}),de=d.extend({method:H(`notifications/initialized`),params:u.optional()}),fe=l.extend({method:H(`ping`),params:s.optional()}),pe=L({progress:N(),total:U(N()),message:U(j())}),v=L({...u.shape,...pe.shape,progressToken:n}),y=d.extend({method:H(`notifications/progress`),params:v}),me=s.extend({cursor:r.optional()}),he=l.extend({params:me.optional()}),ge=f.extend({nextCursor:r.optional()}),_e=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),ve=_e.extend({text:j()}),ye=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),be=_e.extend({blob:ye}),xe=V([`user`,`assistant`]),Se=L({audience:I(xe).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),Ce=L({...ne.shape,...te.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:Se.optional(),_meta:U(R({}))}),we=L({...ne.shape,...te.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:Se.optional(),_meta:U(R({}))}),Te=he.extend({method:H(`resources/list`)}),Ee=ge.extend({resources:I(Ce)}),De=he.extend({method:H(`resources/templates/list`)}),Oe=ge.extend({resourceTemplates:I(we)}),ke=s.extend({uri:j()}),Ae=ke,je=l.extend({method:H(`resources/read`),params:Ae}),Me=f.extend({contents:I(z([ve,be]))}),Ne=d.extend({method:H(`notifications/resources/list_changed`),params:u.optional()}),Pe=ke,Fe=l.extend({method:H(`resources/subscribe`),params:Pe}),Ie=ke,Le=l.extend({method:H(`resources/unsubscribe`),params:Ie}),Re=u.extend({uri:j()}),ze=d.extend({method:H(`notifications/resources/updated`),params:Re}),Be=L({name:j(),description:U(j()),required:U(P())}),Ve=L({...ne.shape,...te.shape,description:U(j()),arguments:U(I(Be)),_meta:U(R({}))}),He=he.extend({method:H(`prompts/list`)}),Ue=ge.extend({prompts:I(Ve)}),We=s.extend({name:j(),arguments:B(j(),j()).optional()}),Ge=l.extend({method:H(`prompts/get`),params:We}),Ke=L({type:H(`text`),text:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),b=L({type:H(`image`),data:ye,mimeType:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),qe=L({type:H(`audio`),data:ye,mimeType:j(),annotations:Se.optional(),_meta:B(j(),F()).optional()}),Je=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Ye=L({type:H(`resource`),resource:z([ve,be]),annotations:Se.optional(),_meta:B(j(),F()).optional()}),Xe=Ce.extend({type:H(`resource_link`)}),Ze=z([Ke,b,qe,Xe,Ye]),Qe=L({role:xe,content:Ze}),$e=f.extend({description:j().optional(),messages:I(Qe)}),et=d.extend({method:H(`notifications/prompts/list_changed`),params:u.optional()}),x=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),tt=L({taskSupport:V([`required`,`optional`,`forbidden`]).optional()}),nt=L({...ne.shape,...te.shape,description:j().optional(),inputSchema:L({type:H(`object`),properties:B(j(),e).optional(),required:I(j()).optional()}).catchall(F()),outputSchema:L({type:H(`object`),properties:B(j(),e).optional(),required:I(j()).optional()}).catchall(F()).optional(),annotations:x.optional(),execution:tt.optional(),_meta:B(j(),F()).optional()}),S=he.extend({method:H(`tools/list`)}),C=ge.extend({tools:I(nt)}),rt=f.extend({content:I(Ze),structuredContent:B(j(),F()).optional(),isError:P().optional()}),w=c.extend({name:j(),arguments:B(j(),F()).optional()}),it=l.extend({method:H(`tools/call`),params:w}),at=d.extend({method:H(`notifications/tools/list_changed`),params:u.optional()}),ot=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),st=s.extend({level:ot}),ct=l.extend({method:H(`logging/setLevel`),params:st}),lt=u.extend({level:ot,logger:j().optional(),data:F()}),ut=d.extend({method:H(`notifications/message`),params:lt}),dt=L({name:j().optional()}),ft=L({hints:I(dt).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),pt=L({mode:V([`auto`,`required`,`none`]).optional()}),mt=L({type:H(`tool_result`),toolUseId:j().describe(`The unique identifier for the corresponding tool call.`),content:I(Ze),structuredContent:L({}).loose().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),ht=vc(`type`,[Ke,b,qe]),gt=vc(`type`,[Ke,b,qe,Je,mt]),_t=L({role:xe,content:z([gt,I(gt)]),_meta:B(j(),F()).optional()}),vt=c.extend({messages:I(_t),modelPreferences:ft.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:t.optional(),tools:I(nt).optional(),toolChoice:pt.optional()}),yt=l.extend({method:H(`sampling/createMessage`),params:vt}),bt=f.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`]).or(j())),role:xe,content:ht}),xt=f.extend({model:j(),stopReason:U(V([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(j())),role:xe,content:z([gt,I(gt)])}),St=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),Ct=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),wt=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),Tt=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),Et=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),Dt=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Ot=z([Tt,Et]),kt=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),At=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),jt=z([kt,At]),Mt=z([Dt,Ot,jt]),Nt=z([Mt,St,Ct,wt]),Pt=c.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Nt),required:I(j()).optional()}).catchall(F())}),Ft=c.extend({mode:H(`url`),message:j(),elicitationId:j(),url:j().url()}),It=z([Pt,Ft]),Lt=l.extend({method:H(`elicitation/create`),params:It}),Rt=u.extend({elicitationId:j()}),zt=d.extend({method:H(`notifications/elicitation/complete`),params:Rt}),Bt=f.extend({action:V([`accept`,`decline`,`cancel`]),content:Yc(e=>e===null?void 0:e,B(j(),z([j(),N(),P(),I(j())])).optional())}),Vt=L({type:H(`ref/resource`),uri:j()}),Ht=L({type:H(`ref/prompt`),name:j()}),Ut=s.extend({ref:z([Ht,Vt]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()}),Wt=l.extend({method:H(`completion/complete`),params:Ut}),Gt=f.extend({completion:R({values:I(j()).max(100),total:U(N().int()),hasMore:U(P())})}),Kt=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),qt=l.extend({method:H(`roots/list`),params:s.optional()}),Jt=f.extend({roots:I(Kt)}),Yt=d.extend({method:H(`notifications/roots/list_changed`),params:u.optional()}),Xt=R({ttl:N().optional(),pollInterval:N().optional()}),Zt=V([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Qt=L({taskId:j(),status:Zt,ttl:z([N(),cc()]),createdAt:j(),lastUpdatedAt:j(),pollInterval:U(N()),statusMessage:U(j())}),$t=f.extend({task:Qt}),en=u.merge(Qt),tn=d.extend({method:H(`notifications/tasks/status`),params:en}),nn=l.extend({method:H(`tasks/get`),params:s.extend({taskId:j()})}),rn=f.merge(Qt),an=l.extend({method:H(`tasks/result`),params:s.extend({taskId:j()})}),on=f.loose(),T=he.extend({method:H(`tasks/list`)}),sn=ge.extend({tasks:I(Qt)}),cn=l.extend({method:H(`tasks/cancel`),params:s.extend({taskId:j()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:ee,IconSchema:g,IconsSchema:te,BaseMetadataSchema:ne,ImplementationSchema:re,ClientTasksCapabilitySchema:_,ServerTasksCapabilitySchema:ae,ClientCapabilitiesSchema:oe,InitializeRequestParamsSchema:se,InitializeRequestSchema:ce,ServerCapabilitiesSchema:le,InitializeResultSchema:ue,InitializedNotificationSchema:de,PingRequestSchema:fe,ProgressSchema:pe,ProgressNotificationParamsSchema:v,ProgressNotificationSchema:y,PaginatedRequestParamsSchema:me,PaginatedRequestSchema:he,PaginatedResultSchema:ge,ResourceContentsSchema:_e,TextResourceContentsSchema:ve,BlobResourceContentsSchema:be,RoleSchema:xe,AnnotationsSchema:Se,ResourceSchema:Ce,ResourceTemplateSchema:we,ListResourcesRequestSchema:Te,ListResourcesResultSchema:Ee,ListResourceTemplatesRequestSchema:De,ListResourceTemplatesResultSchema:Oe,ResourceRequestParamsSchema:ke,ReadResourceRequestParamsSchema:Ae,ReadResourceRequestSchema:je,ReadResourceResultSchema:Me,ResourceListChangedNotificationSchema:Ne,SubscribeRequestParamsSchema:Pe,SubscribeRequestSchema:Fe,UnsubscribeRequestParamsSchema:Ie,UnsubscribeRequestSchema:Le,ResourceUpdatedNotificationParamsSchema:Re,ResourceUpdatedNotificationSchema:ze,PromptArgumentSchema:Be,PromptSchema:Ve,ListPromptsRequestSchema:He,ListPromptsResultSchema:Ue,GetPromptRequestParamsSchema:We,GetPromptRequestSchema:Ge,TextContentSchema:Ke,ImageContentSchema:b,AudioContentSchema:qe,ToolUseContentSchema:Je,EmbeddedResourceSchema:Ye,ResourceLinkSchema:Xe,ContentBlockSchema:Ze,PromptMessageSchema:Qe,GetPromptResultSchema:$e,PromptListChangedNotificationSchema:et,ToolAnnotationsSchema:x,ToolExecutionSchema:tt,ToolSchema:nt,ListToolsRequestSchema:S,ListToolsResultSchema:C,CallToolResultSchema:rt,CallToolRequestParamsSchema:w,CallToolRequestSchema:it,ToolListChangedNotificationSchema:at,LoggingLevelSchema:ot,SetLevelRequestParamsSchema:st,SetLevelRequestSchema:ct,LoggingMessageNotificationParamsSchema:lt,LoggingMessageNotificationSchema:ut,ModelHintSchema:dt,ModelPreferencesSchema:ft,ToolChoiceSchema:pt,ToolResultContentSchema:mt,SamplingContentSchema:ht,SamplingMessageContentBlockSchema:gt,SamplingMessageSchema:_t,CreateMessageRequestParamsSchema:vt,CreateMessageRequestSchema:yt,CreateMessageResultSchema:bt,CreateMessageResultWithToolsSchema:xt,BooleanSchemaSchema:St,StringSchemaSchema:Ct,NumberSchemaSchema:wt,UntitledSingleSelectEnumSchemaSchema:Tt,TitledSingleSelectEnumSchemaSchema:Et,LegacyTitledEnumSchemaSchema:Dt,SingleSelectEnumSchemaSchema:Ot,UntitledMultiSelectEnumSchemaSchema:kt,TitledMultiSelectEnumSchemaSchema:At,MultiSelectEnumSchemaSchema:jt,EnumSchemaSchema:Mt,PrimitiveSchemaDefinitionSchema:Nt,ElicitRequestFormParamsSchema:Pt,ElicitRequestURLParamsSchema:Ft,ElicitRequestParamsSchema:It,ElicitRequestSchema:Lt,ElicitationCompleteNotificationParamsSchema:Rt,ElicitationCompleteNotificationSchema:zt,ElicitResultSchema:Bt,ResourceTemplateReferenceSchema:Vt,PromptReferenceSchema:Ht,CompleteRequestParamsSchema:Ut,CompleteRequestSchema:Wt,CompleteResultSchema:Gt,RootSchema:Kt,ListRootsRequestSchema:qt,ListRootsResultSchema:Jt,RootsListChangedNotificationSchema:Yt,TaskCreationParamsSchema:Xt,TaskStatusSchema:Zt,TaskSchema:Qt,CreateTaskResultSchema:$t,TaskStatusNotificationParamsSchema:en,TaskStatusNotificationSchema:tn,GetTaskRequestSchema:nn,GetTaskResultSchema:rn,GetTaskPayloadRequestSchema:an,GetTaskPayloadResultSchema:on,ListTasksRequestSchema:T,ListTasksResultSchema:sn,CancelTaskRequestSchema:cn,CancelTaskResultSchema:f.merge(Qt),ClientRequestSchema:z([fe,ce,Wt,ct,Ge,He,Te,De,je,Fe,Le,it,S,nn,an,T,cn]),ClientNotificationSchema:z([ee,y,de,Yt,tn]),ClientResultSchema:z([m,bt,xt,Bt,Jt,rn,sn,$t]),ServerRequestSchema:z([fe,yt,Lt,qt,nn,an,T,cn]),ServerNotificationSchema:z([ee,y,ut,ze,Ne,at,et,tn,zt]),ServerResultSchema:z([m,ue,Gt,$e,Ue,Ee,Oe,Me,rt,C,rn,sn,$t]),CallToolResultWireSchema:F().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of jf)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Mf).pipe(rt)}}var Pf;function Ff(){return Pf??=Nf()}function If(e){return e.type!==`object`}var Lf=new Set([`const`,`enum`,`default`,`examples`]),Rf=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function zf(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Bf(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(zf(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=i(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&zf(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Lf.has(o)?s:Rf.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Vf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Hf={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Uf={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Wf;function Gf(){if(Wf)return Wf;let e=Ff();return Wf={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Wf}function Kf(e){return Object.prototype.hasOwnProperty.call(Vf,e)}function qf(e){return Object.prototype.hasOwnProperty.call(Hf,e)}function Jf(e){return Object.prototype.hasOwnProperty.call(Uf,e)}function Yf(e){return Jf(e)?Gf().resultSchemas[e]:void 0}function Xf(e){return Kf(e)?Gf().requestSchemas[e]:void 0}function Zf(e){return qf(e)?Gf().notificationSchemas[e]:void 0}Object.keys(Vf),Object.keys(Hf);function Qf(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $f(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ep={ok:!1,reason:`not-in-era`};function tp(e){return Qf(e)&&Qf(e.outputSchema)&&If(e.outputSchema)}function np(e){return e}var rp={era:`2025-11-25`,hasRequestMethod:Kf,hasNotificationMethod:qf,validateRequest:(e,t)=>$f(Xf(e),t),validateResult:(e,t)=>$f(Yf(e),t),validateNotification:(e,t)=>$f(Zf(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>ep,validateInputResponse:()=>ep,samplingResultVariant:((e,t)=>{let n=Ff();return $f(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=Af(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&If(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Qf(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:np(e)}}return{kind:`complete`,result:np(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>tp(e))?t:{...t,tools:n.map(e=>tp(e)?{...e,outputSchema:Bf(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function ip(){let e=Gc(()=>z([j(),N(),P(),cc(),B(j(),e),I(e)])),t=B(j(),e),n=z([j(),N().int()]),r=j(),i=z([j(),N().int()]),a=V([`user`,`assistant`]),o=V([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=j().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=L({ttl:N().optional()}),l=L({taskId:j()}),u=R({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=L({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=L({_meta:u.optional()}),m=L({method:j(),params:p.loose().optional()}),h=L({src:j(),mimeType:j().optional(),sizes:I(j()).optional(),theme:V([`light`,`dark`]).optional()}),ee=L({icons:I(h).optional()}),g=L({name:j(),title:j().optional()}),te=g.extend({...g.shape,...ee.shape,version:j(),websiteUrl:j().optional(),description:j().optional()}),ne=Yc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,bc(L({form:bc(L({applyDefaults:P().optional()}),t).optional(),url:t.optional()}),t.optional())),re=R({list:t.optional(),cancel:t.optional(),requests:R({sampling:R({createMessage:t.optional()}).optional(),elicitation:R({create:t.optional()}).optional()}).optional()}),ie=R({list:t.optional(),cancel:t.optional(),requests:R({tools:R({call:t.optional()}).optional()}).optional()}),_=L({experimental:B(j(),t).optional(),sampling:L({context:t.optional(),tools:t.optional()}).optional(),elicitation:ne.optional(),roots:L({listChanged:P().optional()}).optional(),tasks:re.optional(),extensions:B(j(),t).optional()}),ae=L({experimental:B(j(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:L({listChanged:P().optional()}).optional(),resources:L({subscribe:P().optional(),listChanged:P().optional()}).optional(),tools:L({listChanged:P().optional()}).optional(),tasks:ie.optional(),extensions:B(j(),t).optional()}),oe=L({progress:N(),total:U(N()),message:U(j())}),se=L({...p.shape,...oe.shape,progressToken:n}),ce=m.extend({method:H(`notifications/progress`),params:se}),le=p.extend({level:o,logger:j().optional(),data:F()}),ue=m.extend({method:H(`notifications/message`),params:le}),de=L({uri:j(),mimeType:U(j()),_meta:B(j(),F()).optional()}),fe=de.extend({text:j()}),pe=de.extend({blob:s}),v=L({audience:I(a).optional(),priority:N().min(0).max(1).optional(),lastModified:Qc({offset:!0}).optional()}),y=L({...g.shape,...ee.shape,uri:j(),description:U(j()),mimeType:U(j()),size:U(N()),annotations:v.optional(),_meta:U(R({}))}),me=L({...g.shape,...ee.shape,uriTemplate:j(),description:U(j()),mimeType:U(j()),annotations:v.optional(),_meta:U(R({}))}),he=m.extend({method:H(`notifications/resources/list_changed`),params:p.optional()}),ge=p.extend({uri:j()}),_e=m.extend({method:H(`notifications/resources/updated`),params:ge}),ve=L({name:j(),description:U(j()),required:U(P())}),ye=L({...g.shape,...ee.shape,description:U(j()),arguments:U(I(ve)),_meta:U(R({}))}),be=m.extend({method:H(`notifications/prompts/list_changed`),params:p.optional()}),xe=L({type:H(`text`),text:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),Se=L({type:H(`image`),data:s,mimeType:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),Ce=L({type:H(`audio`),data:s,mimeType:j(),annotations:v.optional(),_meta:B(j(),F()).optional()}),we=L({type:H(`tool_use`),name:j(),id:j(),input:B(j(),F()),_meta:B(j(),F()).optional()}),Te=L({type:H(`resource`),resource:z([fe,pe]),annotations:v.optional(),_meta:B(j(),F()).optional()}),Ee=y.extend({type:H(`resource_link`)}),De=z([xe,Se,Ce,Ee,Te]),Oe=L({role:a,content:De}),ke=L({title:j().optional(),readOnlyHint:P().optional(),destructiveHint:P().optional(),idempotentHint:P().optional(),openWorldHint:P().optional()}),Ae=m.extend({method:H(`notifications/tools/list_changed`),params:p.optional()}),je=L({name:j().optional()}),Me=L({hints:I(je).optional(),costPriority:N().min(0).max(1).optional(),speedPriority:N().min(0).max(1).optional(),intelligencePriority:N().min(0).max(1).optional()}),Ne=L({mode:V([`auto`,`required`,`none`]).optional()}),Pe=L({type:H(`boolean`),title:j().optional(),description:j().optional(),default:P().optional()}),Fe=L({type:H(`string`),title:j().optional(),description:j().optional(),minLength:N().optional(),maxLength:N().optional(),format:V([`email`,`uri`,`date`,`date-time`]).optional(),default:j().optional()}),Ie=L({type:V([`number`,`integer`]),title:j().optional(),description:j().optional(),minimum:N().optional(),maximum:N().optional(),default:N().optional()}),Le=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),default:j().optional()}),Re=L({type:H(`string`),title:j().optional(),description:j().optional(),oneOf:I(L({const:j(),title:j()})),default:j().optional()}),ze=L({type:H(`string`),title:j().optional(),description:j().optional(),enum:I(j()),enumNames:I(j()).optional(),default:j().optional()}),Be=z([Le,Re]),Ve=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({type:H(`string`),enum:I(j())}),default:I(j()).optional()}),He=L({type:H(`array`),title:j().optional(),description:j().optional(),minItems:N().optional(),maxItems:N().optional(),items:L({anyOf:I(L({const:j(),title:j()}))}),default:I(j()).optional()}),Ue=z([Ve,He]),We=z([ze,Be,Ue]),Ge=z([We,Pe,Fe,Ie]),Ke=f.extend({mode:H(`form`).optional(),message:j(),requestedSchema:L({type:H(`object`),properties:B(j(),Ge),required:I(j()).optional()}).catchall(F())}),b=L({type:H(`ref/resource`),uri:j()}),qe=L({type:H(`ref/prompt`),name:j()}),Je=L({uri:j().startsWith(`file://`),name:j().optional(),_meta:B(j(),F()).optional()}),Ye=_.shape,Xe=L({experimental:Ye.experimental,sampling:Ye.sampling,elicitation:Ye.elicitation,roots:Ye.roots,extensions:Ye.extensions}),Ze=ae.shape,Qe=L({experimental:Ze.experimental,logging:Ze.logging,completions:Ze.completions,prompts:Ze.prompts,resources:Ze.resources,tools:Ze.tools,extensions:Ze.extensions}),$e=R({progressToken:n.optional(),[rl]:j(),[il]:te.optional(),[ol]:Xe,[cl]:o.optional()}),et=L({...g.shape,...ee.shape,description:j().optional(),inputSchema:R({$schema:j().optional(),type:H(`object`)}),outputSchema:R({$schema:j().optional()}).optional(),annotations:ke.optional(),_meta:B(j(),F()).optional()}),x=L({type:H(`tool_result`),toolUseId:j(),content:I(De),structuredContent:F().optional(),isError:P().optional(),_meta:B(j(),F()).optional()}),tt=z([xe,Se,Ce,we,x]),nt=L({role:a,content:z([tt,I(tt)]),_meta:B(j(),F()).optional()}),S=j(),C=R({[al]:te.optional().catch(void 0)}),rt=C.optional();function w(e){return R({_meta:rt,resultType:S.default(`complete`),...e})}let it=w({}),at=w({nextCursor:r.optional()}),ot=w({content:I(De),structuredContent:F().optional(),isError:P().optional()}),st=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),tools:I(et),nextCursor:r.optional()}),ct=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),prompts:I(ye),nextCursor:r.optional()}),lt=w({description:j().optional(),messages:I(Oe)}),ut=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resources:I(y),nextCursor:r.optional()}),dt=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resourceTemplates:I(me),nextCursor:r.optional()}),ft=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),contents:I(z([fe,pe]))}),pt=w({completion:L({values:I(j()).max(100),total:N().int().optional(),hasMore:P().optional()}).loose()}),mt=w({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`])}),ht=w({ttlMs:N().int().min(0).catch(0),cacheScope:V([`public`,`private`]).catch(`private`),supportedVersions:I(j()),capabilities:Qe,instructions:j().optional()}),gt=L({messages:I(nt),modelPreferences:Me.optional(),systemPrompt:j().optional(),includeContext:V([`none`,`thisServer`,`allServers`]).optional(),temperature:N().optional(),maxTokens:N().int(),stopSequences:I(j()).optional(),metadata:t.optional(),tools:I(et).optional(),toolChoice:Ne.optional()}),_t=L({method:H(`sampling/createMessage`),params:gt}),vt=L({method:H(`roots/list`),params:L({_meta:B(j(),F()).optional()}).optional()}),yt=L({...nt.shape,model:j(),stopReason:j().optional()}),bt=L({roots:I(Je)}),xt=L({action:V([`accept`,`decline`,`cancel`]),content:B(j(),z([j(),N(),P(),I(j())])).optional()}),St=L({mode:H(`url`),message:j(),url:j().url()}),Ct=z([Ke,St]),wt=L({method:H(`elicitation/create`),params:Ct}),Tt=z([_t,vt,wt]),Et=z([yt,bt,xt]),Dt=B(j(),Tt),Ot=B(j(),Et),kt=w({inputRequests:Dt.optional(),requestState:j().optional()}),At={inputResponses:Ot.optional(),requestState:j().optional()},jt=L({_meta:$e,...At}),Mt=R({progressToken:n.optional()});function Nt(e,t){return L({method:H(e),params:L({_meta:$e,...t})})}function Pt(e,t){return L({method:H(e),params:L({_meta:Mt.optional(),...t}).optional()})}let Ft={name:j(),arguments:B(j(),F()).optional(),...At},It={cursor:r.optional()},Lt=Nt(`tools/call`,Ft),Rt=Nt(`tools/list`,It),zt=Nt(`prompts/list`,It),Bt=Nt(`prompts/get`,{name:j(),arguments:B(j(),j()).optional(),...At}),Vt=Nt(`resources/list`,It),Ht=Nt(`resources/templates/list`,It),Ut=Nt(`resources/read`,{uri:j(),...At}),Wt={ref:z([qe,b]),argument:L({name:j(),value:j()}),context:L({arguments:B(j(),j()).optional()}).optional()},Gt=Nt(`completion/complete`,Wt),Kt=Nt(`server/discover`,{}),qt=L({toolsListChanged:P().optional(),promptsListChanged:P().optional(),resourcesListChanged:P().optional(),resourceSubscriptions:I(j()).optional()}),Jt={notifications:qt},Yt=Nt(`subscriptions/listen`,Jt),Xt=C.extend({"io.modelcontextprotocol/subscriptionId":i}),Zt=R({_meta:Xt,resultType:S.default(`complete`)}),Qt={"tools/call":Pt(`tools/call`,Ft),"tools/list":Pt(`tools/list`,It),"prompts/get":Pt(`prompts/get`,{name:j(),arguments:B(j(),j()).optional()}),"prompts/list":Pt(`prompts/list`,It),"resources/list":Pt(`resources/list`,It),"resources/templates/list":Pt(`resources/templates/list`,It),"resources/read":Pt(`resources/read`,{uri:j()}),"completion/complete":Pt(`completion/complete`,Wt),"server/discover":Pt(`server/discover`,{}),"subscriptions/listen":Pt(`subscriptions/listen`,Jt)};function $t(e){return R({_meta:rt,...e})}let en={"tools/call":$t({content:I(De),structuredContent:F().optional(),isError:P().optional()}),"tools/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),tools:I(et),nextCursor:r.optional()}),"prompts/get":$t({description:j().optional(),messages:I(Oe)}),"prompts/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),prompts:I(ye),nextCursor:r.optional()}),"resources/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resources:I(y),nextCursor:r.optional()}),"resources/templates/list":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),resourceTemplates:I(me),nextCursor:r.optional()}),"resources/read":$t({ttlMs:N().int().min(0),cacheScope:V([`public`,`private`]),contents:I(z([fe,pe]))}),"completion/complete":$t({completion:L({values:I(j()).max(100),total:N().int().optional(),hasMore:P().optional()}).loose()}),"server/discover":$t({ttlMs:N().int().min(0).catch(0),cacheScope:V([`public`,`private`]).catch(`private`),supportedVersions:I(j()),capabilities:Qe,instructions:j().optional()}),"subscriptions/listen":$t({})},tn=R({"io.modelcontextprotocol/subscriptionId":i.optional()}),nn=L({method:H(`notifications/subscriptions/acknowledged`),params:L({_meta:tn.optional(),notifications:qt})}),rn=L({_meta:tn.optional(),requestId:i,reason:j().optional()}),an=L({method:H(`notifications/cancelled`),params:rn}),on={"notifications/cancelled":an,"notifications/progress":ce,"notifications/message":ue,"notifications/resources/updated":_e,"notifications/resources/list_changed":he,"notifications/tools/list_changed":Ae,"notifications/prompts/list_changed":be,"notifications/subscriptions/acknowledged":nn},T=e=>L({jsonrpc:H(`2.0`),id:z([j(),N().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:ee,BaseMetadataSchema:g,ImplementationSchema:te,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:_,ServerCapabilitiesSchema:ae,ProgressSchema:oe,ProgressNotificationParamsSchema:se,ProgressNotificationSchema:ce,LoggingMessageNotificationParamsSchema:le,LoggingMessageNotificationSchema:ue,ResourceContentsSchema:de,TextResourceContentsSchema:fe,BlobResourceContentsSchema:pe,AnnotationsSchema:v,ResourceSchema:y,ResourceTemplateSchema:me,ResourceListChangedNotificationSchema:he,ResourceUpdatedNotificationParamsSchema:ge,ResourceUpdatedNotificationSchema:_e,PromptArgumentSchema:ve,PromptSchema:ye,PromptListChangedNotificationSchema:be,TextContentSchema:xe,ImageContentSchema:Se,AudioContentSchema:Ce,ToolUseContentSchema:we,EmbeddedResourceSchema:Te,ResourceLinkSchema:Ee,ContentBlockSchema:De,PromptMessageSchema:Oe,ToolAnnotationsSchema:ke,ToolListChangedNotificationSchema:Ae,ModelHintSchema:je,ModelPreferencesSchema:Me,ToolChoiceSchema:Ne,BooleanSchemaSchema:Pe,StringSchemaSchema:Fe,NumberSchemaSchema:Ie,UntitledSingleSelectEnumSchemaSchema:Le,TitledSingleSelectEnumSchemaSchema:Re,LegacyTitledEnumSchemaSchema:ze,SingleSelectEnumSchemaSchema:Be,UntitledMultiSelectEnumSchemaSchema:Ve,TitledMultiSelectEnumSchemaSchema:He,MultiSelectEnumSchemaSchema:Ue,EnumSchemaSchema:We,PrimitiveSchemaDefinitionSchema:Ge,ElicitRequestFormParamsSchema:Ke,ResourceTemplateReferenceSchema:b,PromptReferenceSchema:qe,RootSchema:Je,ClientCapabilities2026Schema:Xe,ServerCapabilities2026Schema:Qe,RequestMetaEnvelopeSchema:$e,ToolSchema:et,ToolResultContentSchema:x,SamplingMessageContentBlockSchema:tt,SamplingMessageSchema:nt,ResultTypeSchema:S,ResultMetaSchema:C,ResultSchema:it,PaginatedResultSchema:at,CallToolResultSchema:ot,ListToolsResultSchema:st,ListPromptsResultSchema:ct,GetPromptResultSchema:lt,ListResourcesResultSchema:ut,ListResourceTemplatesResultSchema:dt,ReadResourceResultSchema:ft,CompleteResultSchema:pt,CacheableResultSchema:mt,DiscoverResultSchema:ht,CreateMessageRequestParamsSchema:gt,CreateMessageRequestSchema:_t,ListRootsRequestSchema:vt,CreateMessageResultSchema:yt,ListRootsResultSchema:bt,ElicitResultSchema:xt,ElicitRequestURLParamsSchema:St,ElicitRequestParamsSchema:Ct,ElicitRequestSchema:wt,InputRequestSchema:Tt,InputResponseSchema:Et,InputRequestsSchema:Dt,InputResponsesSchema:Ot,InputRequiredResultSchema:kt,InputResponseRequestParamsSchema:jt,CallToolRequestSchema:Lt,ListToolsRequestSchema:Rt,ListPromptsRequestSchema:zt,GetPromptRequestSchema:Bt,ListResourcesRequestSchema:Vt,ListResourceTemplatesRequestSchema:Ht,ReadResourceRequestSchema:Ut,CompleteRequestSchema:Gt,DiscoverRequestSchema:Kt,SubscriptionFilterSchema:qt,SubscriptionsListenRequestSchema:Yt,SubscriptionsListenResultMetaSchema:Xt,SubscriptionsListenResultSchema:Zt,dispatchRequestSchemas:Qt,dispatchResultSchemas:en,NotificationMetaSchema:tn,SubscriptionsAcknowledgedNotificationSchema:nn,CancelledNotificationParamsSchema:rn,CancelledNotificationSchema:an,notificationSchemas2026:on,JSONRPCResultResponseSchema:T(it),CallToolResultResponseSchema:T(z([ot,kt])),ListToolsResultResponseSchema:T(st),ListPromptsResultResponseSchema:T(ct),GetPromptResultResponseSchema:T(z([lt,kt])),ListResourcesResultResponseSchema:T(ut),ListResourceTemplatesResultResponseSchema:T(dt),ReadResourceResultResponseSchema:T(z([ft,kt])),CompleteResultResponseSchema:T(pt),DiscoverResultResponseSchema:T(ht)}}var ap;function op(){return ap??=ip()}var sp=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function cp(e){return sp.includes(e)}var lp=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function up(e){return e[lp]}function dp(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function fp(e){return e===`public`||e===`private`}var Z=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Q=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Ef(this,new.target)}static fromError(t,n,r){if(t===Z.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new mp(e.elicitations,n)}if(t===Z.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new hp({supported:e.supported,requested:e.requested},n)}if(t===Z.InvalidParams||t===Z.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===Z.ResourceNotFound||Object.keys(e).length===1))return new pp(e.uri,n)}if(t===Z.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new gp({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},pp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(Z.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},mp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Z.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},hp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Z.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},gp=class extends Q{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(Z.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},_p=0,vp=`private`,yp=[`tools/call`,`prompts/get`,`resources/read`];function bp(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||yp.includes(e))return t;throw new Q(Z.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function xp(e,t){let n=up(t);if(t.resultType!==`complete`||!cp(e))return n===void 0?t:Ep(t);let r=t,i=dp(r.ttlMs)?r.ttlMs:wp(n),a=fp(r.cacheScope)?r.cacheScope:Tp(n),o={...r,ttlMs:i,cacheScope:a};return delete o[lp],o}function Sp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Cp(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[al]:t}}:!Sp(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[al]:t}}}function wp(e){return e!==void 0&&dp(e.ttlMs)?e.ttlMs:_p}function Tp(e){return e!==void 0&&fp(e.cacheScope)?e.cacheScope:vp}function Ep(e){let t={...e};return delete t[lp],t}var Dp=[`elicitation/create`,`sampling/createMessage`,`roots/list`],Op;function kp(){if(Op)return Op;let e=op();return Op={request:{"elicitation/create":L({method:H(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":L({method:H(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":L({method:H(`roots/list`),params:R({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Op}function Ap(e){return Dp.includes(e)}function jp(e){return Ap(e)?kp().request[e]:void 0}function Mp(e){return Ap(e)?kp().response[e]:void 0}var Np={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Pp={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Fp(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Ip(e){return Object.prototype.hasOwnProperty.call(Pp,e)}function Lp(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Rp(e){return Fp(e)?op().dispatchRequestSchemas[e]:void 0}function zp(e){return Lp(e)?op().dispatchResultSchemas[e]:void 0}function Bp(e){return Ip(e)?op().notificationSchemas2026[e]:void 0}Object.keys(Np),Object.keys(Pp);function Vp(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Hp(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Up={ok:!1,reason:`not-in-era`},Wp=[rl,ol];function Gp(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Vp(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Vp(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Vp(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Kp={era:`2026-07-28`,hasRequestMethod:Fp,hasNotificationMethod:Ip,hasInputRequestMethod:e=>jp(e)!==void 0,validateRequest:(e,t)=>Hp(Rp(e),t),validateResult:(e,t)=>Hp(zp(e),t),validateNotification:(e,t)=>Hp(Bp(e),t),validateInputRequest:(e,t)=>Hp(jp(e),t),validateInputResponse:(e,t)=>Hp(Mp(e),t),samplingResultVariant:()=>Up,outboundEnvelope(e){return{[rl]:e.protocolVersion,[il]:e.clientInfo,[ol]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Wp)n in e||t.push({key:n,problem:`missing`});let n=op().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>Af(e),inputRequestSchema:jp,decodeResult(e,t){if(!Vp(t))return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Vp(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new X(Y.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=Jp(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new X(Y.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return Cp(xp(e,bp(e,Gp(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=op().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},qp;function Jp(){if(qp)return qp;let e=op();return qp={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},qp}var Yp=`2026-07-28`;function Xp(e){return e!==void 0&&kf(e)?Kp:rp}function Zp(e){return e.revision===void 0?e.era===`modern`?Kp.era:rp.era:Xp(e.revision).era}function Qp(e){return em.some(t=>t.hasRequestMethod(e))}function $p(e){return em.some(t=>t.hasNotificationMethod(e))}var em=[rp,Kp],tm=n({AnnotationsSchema:()=>ru,AudioContentSchema:()=>Iu,BaseMetadataSchema:()=>Ml,BaseRequestParamsSchema:()=>G,BlobResourceContentsSchema:()=>tu,BooleanSchemaSchema:()=>_d,CallToolRequestParamsSchema:()=>Zu,CallToolRequestSchema:()=>Qu,CallToolResultSchema:()=>Yu,CancelTaskRequestSchema:()=>rf,CancelTaskResultSchema:()=>af,CancelledNotificationParamsSchema:()=>Ol,CancelledNotificationSchema:()=>kl,ClientCapabilitiesSchema:()=>Ll,ClientNotificationSchema:()=>sf,ClientRequestSchema:()=>of,ClientResultSchema:()=>cf,ClientTasksCapabilitySchema:()=>Fl,CompatibilityCallToolResultSchema:()=>Xu,CompleteRequestParamsSchema:()=>Rd,CompleteRequestSchema:()=>zd,CompleteResultSchema:()=>Bd,ContentBlockSchema:()=>Bu,CreateMessageRequestParamsSchema:()=>pd,CreateMessageRequestSchema:()=>md,CreateMessageResultSchema:()=>hd,CreateMessageResultWithToolsSchema:()=>gd,CreateTaskResultSchema:()=>Jd,CursorSchema:()=>fl,DiscoverRequestSchema:()=>Ul,DiscoverResultSchema:()=>Wl,ElicitRequestFormParamsSchema:()=>kd,ElicitRequestParamsSchema:()=>jd,ElicitRequestSchema:()=>Md,ElicitRequestURLParamsSchema:()=>Ad,ElicitResultSchema:()=>Fd,ElicitationCompleteNotificationParamsSchema:()=>Nd,ElicitationCompleteNotificationSchema:()=>Pd,EmbeddedResourceSchema:()=>Ru,EmptyResultSchema:()=>Dl,EnumSchemaSchema:()=>Dd,GetPromptRequestParamsSchema:()=>Mu,GetPromptRequestSchema:()=>Nu,GetPromptResultSchema:()=>Hu,GetTaskPayloadRequestSchema:()=>$d,GetTaskPayloadResultSchema:()=>ef,GetTaskRequestSchema:()=>Zd,GetTaskResultSchema:()=>Qd,IconSchema:()=>Al,IconsSchema:()=>jl,ImageContentSchema:()=>Fu,ImplementationSchema:()=>Nl,InitializeRequestParamsSchema:()=>Rl,InitializeRequestSchema:()=>zl,InitializeResultSchema:()=>Vl,InitializedNotificationSchema:()=>Hl,JSONArraySchema:()=>ul,JSONObjectSchema:()=>W,JSONRPCErrorResponseSchema:()=>wl,JSONRPCMessageSchema:()=>Tl,JSONRPCNotificationSchema:()=>Sl,JSONRPCRequestSchema:()=>xl,JSONRPCResponseSchema:()=>El,JSONRPCResultResponseSchema:()=>Cl,JSONValueSchema:()=>ll,LegacyTitledEnumSchemaSchema:()=>Sd,ListChangedOptionsBaseSchema:()=>ed,ListPromptsRequestSchema:()=>Au,ListPromptsResultSchema:()=>ju,ListResourceTemplatesRequestSchema:()=>cu,ListResourceTemplatesResultSchema:()=>lu,ListResourcesRequestSchema:()=>ou,ListResourcesResultSchema:()=>su,ListRootsRequestSchema:()=>Hd,ListRootsResultSchema:()=>Ud,ListTasksRequestSchema:()=>tf,ListTasksResultSchema:()=>nf,ListToolsRequestSchema:()=>qu,ListToolsResultSchema:()=>Ju,LoggingLevelSchema:()=>td,LoggingMessageNotificationParamsSchema:()=>id,LoggingMessageNotificationSchema:()=>ad,ModelHintSchema:()=>od,ModelPreferencesSchema:()=>sd,MultiSelectEnumSchemaSchema:()=>Ed,NotificationSchema:()=>vl,NotificationsParamsSchema:()=>_l,NumberSchemaSchema:()=>yd,PaginatedRequestParamsSchema:()=>Yl,PaginatedRequestSchema:()=>Xl,PaginatedResultSchema:()=>Zl,PingRequestSchema:()=>Gl,PrimitiveSchemaDefinitionSchema:()=>Od,ProgressNotificationParamsSchema:()=>ql,ProgressNotificationSchema:()=>Jl,ProgressSchema:()=>Kl,ProgressTokenSchema:()=>dl,PromptArgumentSchema:()=>Ou,PromptListChangedNotificationSchema:()=>Uu,PromptMessageSchema:()=>Vu,PromptReferenceSchema:()=>Ld,PromptSchema:()=>ku,ReadResourceRequestParamsSchema:()=>du,ReadResourceRequestSchema:()=>fu,ReadResourceResultSchema:()=>pu,RelatedTaskMetadataSchema:()=>ml,RequestIdSchema:()=>bl,RequestMetaSchema:()=>hl,RequestSchema:()=>K,ResourceContentsSchema:()=>Ql,ResourceLinkSchema:()=>zu,ResourceListChangedNotificationSchema:()=>mu,ResourceRequestParamsSchema:()=>uu,ResourceSchema:()=>iu,ResourceTemplateReferenceSchema:()=>Id,ResourceTemplateSchema:()=>au,ResourceUpdatedNotificationParamsSchema:()=>Eu,ResourceUpdatedNotificationSchema:()=>Du,ResultMetaObjectSchema:()=>yl,ResultSchema:()=>q,RoleSchema:()=>nu,RootSchema:()=>Vd,RootsListChangedNotificationSchema:()=>Wd,SamplingContentSchema:()=>ud,SamplingMessageContentBlockSchema:()=>dd,SamplingMessageSchema:()=>fd,ServerCapabilitiesSchema:()=>Bl,ServerNotificationSchema:()=>uf,ServerRequestSchema:()=>lf,ServerResultSchema:()=>df,ServerTasksCapabilitySchema:()=>Il,SetLevelRequestParamsSchema:()=>nd,SetLevelRequestSchema:()=>rd,SingleSelectEnumSchemaSchema:()=>Cd,StringSchemaSchema:()=>vd,SubscribeRequestParamsSchema:()=>hu,SubscribeRequestSchema:()=>gu,SubscriptionFilterSchema:()=>yu,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Su,SubscriptionsAcknowledgedNotificationSchema:()=>Cu,SubscriptionsListenRequestParamsSchema:()=>bu,SubscriptionsListenRequestSchema:()=>xu,SubscriptionsListenResultMetaSchema:()=>wu,SubscriptionsListenResultSchema:()=>Tu,TaskAugmentedRequestParamsSchema:()=>gl,TaskCreationParamsSchema:()=>Gd,TaskMetadataSchema:()=>pl,TaskSchema:()=>qd,TaskStatusNotificationParamsSchema:()=>Yd,TaskStatusNotificationSchema:()=>Xd,TaskStatusSchema:()=>Kd,TextContentSchema:()=>Pu,TextResourceContentsSchema:()=>$l,TitledMultiSelectEnumSchemaSchema:()=>Td,TitledSingleSelectEnumSchemaSchema:()=>xd,ToolAnnotationsSchema:()=>Wu,ToolChoiceSchema:()=>cd,ToolExecutionSchema:()=>Gu,ToolListChangedNotificationSchema:()=>$u,ToolResultContentSchema:()=>ld,ToolSchema:()=>Ku,ToolUseContentSchema:()=>Lu,UnsubscribeRequestParamsSchema:()=>_u,UnsubscribeRequestSchema:()=>vu,UntitledMultiSelectEnumSchemaSchema:()=>wd,UntitledSingleSelectEnumSchemaSchema:()=>bd}),nm=e=>xl.safeParse(e).success,rm=e=>Sl.safeParse(e).success,im=e=>Cl.safeParse(e).success,am=e=>wl.safeParse(e).success;Z.InvalidRequest,Z.UnsupportedProtocolVersion,Z.InvalidParams,Z.MethodNotFound,Z.InvalidParams,Z.MissingRequiredClientCapability,Z.ParseError,Z.InvalidRequest,Z.MethodNotFound,Z.UnsupportedProtocolVersion,Z.MissingRequiredClientCapability;function om(e,t){return gs(e,t)}function sm(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function cm(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var lm=!1,um=`draft-2020-12`;function dm(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:um});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);lm||(lm=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=us(e,{target:um,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&fm(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function fm(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||fm(e)))}return!1}function pm(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function mm(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>pm(e)).join(`, `)}:{success:!0,data:n.value}}function hm(e){let t=us(e,{target:um,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var gm=/\\\.\\d\{(\d+)\}/;function _m(e){let t=gm.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>Qc({local:e,offset:t,precision:n}))))}function vm(e,t){let n;switch(e){case`email`:n=[Fs()];break;case`uri`:n=[zs()];break;case`date`:n=[$c()];break;case`date-time`:n=_m(t)}return new Set(n.map(e=>hm(e)).filter(e=>e!==void 0))}function ym(e,t,n){return n!==`zod`||vm(e,t).has(t)}function bm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xm(e){try{return dm(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Q(Z.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Sm=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Cm(e){return Sm.has(e)||e.startsWith(`x-`)}var wm=new Set([`$schema`,...Object.keys(kd.shape.requestedSchema.shape)]),Tm={string:sm([vd,bd,xd,Sd]),number:sm([yd]),integer:sm([yd]),boolean:sm([_d]),array:sm([wd,Td])},Em=new Set(vd.shape.format.unwrap().options);function Dm(e,t,n,r){if(!bm(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Tm,e.type)?Tm[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Cm(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?Em.has(e.format)?(typeof s!=`string`||!ym(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function Om(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&bm(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Dm(n,`properties.${e}`,t,r)])):wm.has(i)?n[i]=a:Cm(i)||r.push(i);if(r.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function km(e,t){if(!bm(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!om(Od,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Am(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Am(e,t[r],`${n}[${r}]`)):!bm(e)||!bm(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Am(r,t[e],i):Cm(e)?[]:[i]})}function jm(e){if(!cm(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=Om(xm(e.requestedSchema),t),r=om(kd.shape.requestedSchema,n);if(!r.success)throw new Q(Z.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${km(n,r.error.message)}`);let i=Am(n,r.data);if(i.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Q(Z.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Mm(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Mm,{elicit(e){try{return{method:`elicitation/create`,params:jm(e)}}catch(e){throw e instanceof Q?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Nm=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Pm={IdJagTokenExchangeResponseSchema:_f,OAuthClientInformationFullSchema:Sf,OAuthClientInformationSchema:xf,OAuthClientMetadataSchema:bf,OAuthClientRegistrationErrorSchema:Cf,OAuthErrorResponseSchema:vf,OAuthMetadataSchema:pf,OAuthProtectedResourceMetadataSchema:ff,OAuthTokenRevocationRequestSchema:wf,OAuthTokensSchema:gf,OpenIdProviderDiscoveryMetadataSchema:hf,OpenIdProviderMetadataSchema:mf},Fm={},Im={};function Lm(e,t){let n=e.slice(0,-6);Fm[n]=t,Im[n]=e=>t.safeParse(e).success}for(let e of Nm)Lm(e,tm[e]);for(let[e,t]of Object.entries(Pm))Lm(e,t);Object.freeze(Fm),Object.freeze(Im);function Rm(e){switch(e){case`initialize`:case`notifications/initialized`:return Xp(void 0);case`server/discover`:return Xp(Yp);default:return}}var zm=[rl,il,ol,cl],Bm=[`inputResponses`,`requestState`];function Vm(e,t){let n=e.params;if(!Km(n))return{message:e,lifted:{}};let r=n._meta,i=Km(r)?zm.filter(e=>e in r):[],a=t===`request`?Bm.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Km(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Hm(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Um(e){return()=>e}var Wm=Um(void 0),Gm=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??tl,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new X(Y.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new X(Y.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),im(e)||am(e)?this._onresponse(e):nm(e)?this._onrequest(e,t):rm(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new X(Y.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Vm(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Zp(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if($p(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Vm(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Zp(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(Z.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Qp(n.method)&&!i.hasRequestMethod(n.method)){o(Z.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(Z.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(Z.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:Jm(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Wm:Um(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),cm(t))return u(e,t,n);let i=Hm(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(Z.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:Z.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),im(e)?n(e):n(Q.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),cm(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Hm(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return Xp(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Rm(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Qp(t)&&!e.hasRequestMethod(t))throw new X(Y.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof X?e:new X(Y.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let ee={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),ee.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let g=this._envelopeOutbound(ee),te=!1,ne=e=>{te||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof X?e:new X(Y.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(te=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(Ym(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;mm(n,o).then(e=>{e.success?d(e.data):f(new X(Y.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>ne(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let re=r?.timeout??6e4;this._setupTimeout(h,re,r?.maxTotalTimeout,()=>ne(new X(Y.RequestTimeout,`Request timed out`,{timeout:re})),r?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new X(Y.NotConnected,`Not connected`);if($p(t.method)&&!e.hasNotificationMethod(t.method))throw new X(Y.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Qp(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Q(Z.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await mm(t.params,{...r.params});if(!a.success)throw new Q(Z.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!$p(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Q(Z.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await mm(t.params,{...r.params});if(!i.success)throw new Q(Z.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Km(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Jm(e){let t={},n=[];if(!qm(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!qm(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Ym(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}t((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);var Xm=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Zm=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Qm=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,$m=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,eh=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,th=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,nh=/^(?:\/(?:[^~/]|~0|~1)*)*$/,rh=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,ih=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,ah=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,oh=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function sh(e){return e.test.bind(e)}ch.bind(void 0,!1),sh(Qm),sh($m),sh(eh),sh(Zm),sh(ah),sh(oh),sh(th),sh(nh),sh(rh),sh(ih);function ch(e,t){let n=t.match(Xm);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}globalThis.crypto;var lh=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e){super(e),this.name=new.target.name,Ef(this,new.target)}};(class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}}),class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},class extends lh{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Ef(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Df(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Df(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Ef(this,new.target)}};var uh=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},dh=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},fh=new Set;function ph(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;fh.has(o)||(fh.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},mh(t)):e=>s({method:a,params:e})]}function mh(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var hh=`2026-01-26`,gh=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=Tl.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},_h=z([H(`light`),H(`dark`)]).describe(`Color theme preference for the host environment.`),vh=z([H(`inline`),H(`fullscreen`),H(`pip`)]).describe(`Display mode for UI presentation.`),yh=B(z([H(`--color-background-primary`),H(`--color-background-secondary`),H(`--color-background-tertiary`),H(`--color-background-inverse`),H(`--color-background-ghost`),H(`--color-background-info`),H(`--color-background-danger`),H(`--color-background-success`),H(`--color-background-warning`),H(`--color-background-disabled`),H(`--color-text-primary`),H(`--color-text-secondary`),H(`--color-text-tertiary`),H(`--color-text-inverse`),H(`--color-text-ghost`),H(`--color-text-info`),H(`--color-text-danger`),H(`--color-text-success`),H(`--color-text-warning`),H(`--color-text-disabled`),H(`--color-border-primary`),H(`--color-border-secondary`),H(`--color-border-tertiary`),H(`--color-border-inverse`),H(`--color-border-ghost`),H(`--color-border-info`),H(`--color-border-danger`),H(`--color-border-success`),H(`--color-border-warning`),H(`--color-border-disabled`),H(`--color-ring-primary`),H(`--color-ring-secondary`),H(`--color-ring-inverse`),H(`--color-ring-info`),H(`--color-ring-danger`),H(`--color-ring-success`),H(`--color-ring-warning`),H(`--font-sans`),H(`--font-mono`),H(`--font-weight-normal`),H(`--font-weight-medium`),H(`--font-weight-semibold`),H(`--font-weight-bold`),H(`--font-text-xs-size`),H(`--font-text-sm-size`),H(`--font-text-md-size`),H(`--font-text-lg-size`),H(`--font-heading-xs-size`),H(`--font-heading-sm-size`),H(`--font-heading-md-size`),H(`--font-heading-lg-size`),H(`--font-heading-xl-size`),H(`--font-heading-2xl-size`),H(`--font-heading-3xl-size`),H(`--font-text-xs-line-height`),H(`--font-text-sm-line-height`),H(`--font-text-md-line-height`),H(`--font-text-lg-line-height`),H(`--font-heading-xs-line-height`),H(`--font-heading-sm-line-height`),H(`--font-heading-md-line-height`),H(`--font-heading-lg-line-height`),H(`--font-heading-xl-line-height`),H(`--font-heading-2xl-line-height`),H(`--font-heading-3xl-line-height`),H(`--border-radius-xs`),H(`--border-radius-sm`),H(`--border-radius-md`),H(`--border-radius-lg`),H(`--border-radius-xl`),H(`--border-radius-full`),H(`--border-width-regular`),H(`--shadow-hairline`),H(`--shadow-sm`),H(`--shadow-md`),H(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
64
64
|
|
|
65
65
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
66
66
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|