@usex/mikrotik-mcp 5.11.0 → 5.12.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.
@@ -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=!C.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?Mr([],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 Fr(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=>!b(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=>je(e,r,w())))}),t)}var Ir=S(`$ZodUnion`,(e,t)=>{D.init(e,t),x(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),x(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),x(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)))}),x(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=>Fr(t,r,e,i)):Fr(o,r,e,i)}});function Lr(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 Rr=S(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ir.init(e,t);let n=e._zod.parse;x(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(()=>Lr(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)}}),zr=S(`$ZodIntersection`,(e,t)=>{D.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])=>Vr(e,t,n)):Vr(e,i,a)}});function Br(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=Br(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=Br(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 Vr(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=Br(t.value,n.value);if(!c.valid){if(b(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Hr=S(`$ZodRecord`,(e,t)=>{D.init(e,t);let n=C.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=>je(e,i,w())),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(...Oe(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Oe(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`&&E.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=>je(e,i,w())),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(...Oe(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Oe(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}}),Ur=S(`$ZodEnum`,(e,t)=>{D.init(e,t);let n=a(t.entries),r=new Set(n);e._zod.values=r,x(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}}),Wr=S(`$ZodLiteral`,(e,t)=>{D.init(e,t);let n=new Set(t.values);e._zod.values=n,x(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}}),Gr=S(`$ZodTransform`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,C.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(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 et;return n.value=i,n}});function Kr(e,t){return e.value=t.issues.length?void 0:t.value,e}var qr=S(`$ZodOptional`,(e,t)=>{D.init(e,t),x(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,x(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),x(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=>Kr(e,t)):Kr(e,r)}return t.innerType._zod.run(e,n)}}),Jr=S(`$ZodExactOptional`,(e,t)=>{qr.init(e,t),x(e,`values`,e=>e.def.innerType._zod.values),x(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Yr=S(`$ZodNullable`,(e,t)=>{D.init(e,t),x(e,`optin`,e=>e.def.innerType._zod.optin),x(e,`optout`,e=>e.def.innerType._zod.optout),x(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${d(t.source)}|null)$`):void 0}),x(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)}),Xr=S(`$ZodDefault`,(e,t)=>{D.init(e,t),e._zod.optin=`defaulted`,x(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=>Zr(e,t)):Zr(r,t)}});function Zr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Qr=S(`$ZodPrefault`,(e,t)=>{D.init(e,t),e._zod.optin=`defaulted`,x(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))}),$r=S(`$ZodNonOptional`,(e,t)=>{D.init(e,t),x(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=>ei(t,e)):ei(i,e)}});function ei(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 ti(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>je(e,r,w()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ni=S(`$ZodCatch`,(e,t)=>{D.init(e,t),x(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),x(e,`optout`,e=>e.def.innerType._zod.optout),x(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=>ti(e,r,t,n)):ti(e,r,t,n)}}),ri=S(`$ZodPipe`,(e,t)=>{D.init(e,t),x(e,`values`,e=>e.def.in._zod.values),x(e,`optin`,e=>e.def.in._zod.optin),x(e,`optout`,e=>e.def.out._zod.optout),x(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=>ii(e,t.in,n)):ii(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ii(e,t.out,n)):ii(r,t.out,n)}});function ii(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 ai=S(`$ZodPreprocess`,(e,t)=>{ri.init(e,t)}),oi=S(`$ZodReadonly`,(e,t)=>{D.init(e,t),x(e,`propValues`,e=>e.def.innerType._zod.propValues),x(e,`values`,e=>e.def.innerType._zod.values),x(e,`optin`,e=>e.def.innerType?._zod?.optin),x(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(si):si(r)}});function si(e){return e.memo||(e.value=Object.freeze(e.value)),e}var ci=S(`$ZodLazy`,(e,t)=>{D.init(e,t),m(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),x(e,`pattern`,e=>e.innerType?._zod?.pattern),x(e,`propValues`,e=>e.innerType?._zod?.propValues),x(e,`optin`,e=>e.innerType?._zod?.optin??void 0),x(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),li=S(`$ZodCustom`,(e,t)=>{dn.init(e,t),D.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=>ui(t,n,r,e));ui(i,n,r,e)}});function ui(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(Ie(e))}}var di=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},fi=`~memo`,pi=[];function mi(e){return typeof e==`object`&&!!e}function hi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var gi=new WeakMap,_i=0,vi=1,yi=2;function bi(e,t,n){let r=gi.get(e);if(r!==void 0)return r?yi:_i;if(t.has(e))return yi;t.add(e);let i=_i,a=e=>{if(i!==yi&&e?._zod){let r=bi(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=_i;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?vi:o.value?._zod?bi(o.value,t,n):_i;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):vi),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?bi(r,t,!1):vi);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),xi(e,i)}function xi(e,t){return t!==vi&&gi.set(e,t===yi),t}function Si(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ci,wi=[],Ti={alloc(e,t,n){let r=Ci;if(!r)return n;Ci=void 0;let i={value:n,issues:null};return r.set(t.value,i),wi.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`&&Di(n,e.value))throw new di;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=bi(e,new Set,!1);if(i===_i)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===yi||r?n=!0:r=!0}let l=s.value;if(!mi(l))return t(s,c);let u=c[fi];u||(u={buckets:new WeakMap,backEdges:void 0},c[fi]=u);let d;i===c?d=a:(d=Si(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(...hi(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ci=d;let p=wi.length,m=t(s,c);Ci=void 0;let h=wi.length>p?wi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?hi(e.issues):pi),e)):(h&&(h.issues=m.issues.length?hi(m.issues):pi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ei(){return Ti}function Di(e,t){let n=e[fi]?.backEdges;return n!==void 0&&mi(t)&&n.has(t)}var Oi=()=>{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(Fe(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 ki(){return{localeError:Oi()}}var Ai,ji=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 Mi(){return new ji}(Ai=globalThis).__zod_globalRegistry??(Ai.__zod_globalRegistry=Mi());var Ni=globalThis.__zod_globalRegistry;function Pi(e){return e.checks&&=[...e.checks],e}function Fi(e,t){return new e(Pi({type:`string`,...y(t)}))}function Ii(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...y(t)})}function Li(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...y(t)})}function Ri(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...y(t)})}function zi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...y(t)})}function Bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...y(t)})}function Vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...y(t)})}function Hi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...y(t)})}function Ui(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...y(t)})}function Wi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...y(t)})}function Gi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...y(t)})}function Ki(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...y(t)})}function qi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...y(t)})}function Ji(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...y(t)})}function Yi(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...y(t)})}function Xi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...y(t)})}function Zi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...y(t)})}function Qi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...y(t)})}function $i(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...y(t)})}function ea(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...y(t)})}function ta(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...y(t)})}function na(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...y(t)})}function ra(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...y(t)})}function ia(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...y(t)})}function aa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...y(t)})}function oa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...y(t)})}function sa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...y(t)})}function ca(e,t){return new e(Pi({type:`number`,checks:[],...y(t)}))}function la(e,t){return new e(Pi({type:`number`,coerce:!0,checks:[],...y(t)}))}function ua(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...y(t)})}function da(e,t){return new e({type:`boolean`,...y(t)})}function fa(e,t){return new e({type:`undefined`,...y(t)})}function pa(e,t){return new e({type:`null`,...y(t)})}function ma(e){return new e({type:`any`})}function ha(e){return new e({type:`unknown`})}function ga(e,t){return new e({type:`never`,...y(t)})}function _a(e,t){return new mn({check:`less_than`,...y(t),value:e,inclusive:!1})}function va(e,t){return new mn({check:`less_than`,...y(t),value:e,inclusive:!0})}function ya(e,t){return new hn({check:`greater_than`,...y(t),value:e,inclusive:!1})}function ba(e,t){return new hn({check:`greater_than`,...y(t),value:e,inclusive:!0})}function xa(e,t){return new gn({check:`multiple_of`,...y(t),value:e})}function Sa(e,t){return new vn({check:`max_length`,...y(t),maximum:e})}function Ca(e,t){return new yn({check:`min_length`,...y(t),minimum:e})}function wa(e,t){return new bn({check:`length_equals`,...y(t),length:e})}function Ta(e,t){return new Sn({check:`string_format`,format:`regex`,...y(t),pattern:e})}function Ea(e){return new Cn({check:`string_format`,format:`lowercase`,...y(e)})}function Da(e){return new wn({check:`string_format`,format:`uppercase`,...y(e)})}function Oa(e,t){return new Tn({check:`string_format`,format:`includes`,...y(t),includes:e})}function ka(e,t){return new En({check:`string_format`,format:`starts_with`,...y(t),prefix:e})}function Aa(e,t){return new Dn({check:`string_format`,format:`ends_with`,...y(t),suffix:e})}function ja(e){return new On({check:`overwrite`,tx:e})}function Ma(e){return ja(t=>t.normalize(e))}function Na(){return ja(e=>e.trim())}function Pa(){return ja(e=>e.toLowerCase())}function Fa(){return ja(e=>e.toUpperCase())}function Ia(){return ja(e=>oe(e))}function La(e,t,n){return new e({type:`array`,element:t,...y(n)})}function Ra(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...y(n)})}function za(e,t){let n=Ba(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ie(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(Ie(r))}},e(t.value,t)),t);return n}function Ba(e,t){let n=new dn({check:`custom`,...y(t)});return n._zod.check=e,n}function Va(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 Ha(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??Ni,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 k(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 A(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,A(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Va(o.schema,c),t.io===`input`&&Qa(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 Ua(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Wa(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}/${Ua(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+Ua(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 Ga(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;Ga(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 Ka=new Set([`type`,`properties`,`required`,`additionalProperties`]),qa=[`oneOf`,`anyOf`];function Ja(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ya(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ka.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]??Ja(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}h(n,r,e.length===1?e[0]:Ya(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=Ja(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 Xa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ka)if(t in e)return;let n=t.filter(e=>qa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ya(t);else{let e=n[0],i=qa.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=>Ya([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Va(e,r))}function Za(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)):Va(i,s),Va(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())Ga(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)??[])Xa(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)}Va(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:eo(t,`input`,e.processors),output:eo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Qa(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 Qa(r.element,n);if(r.type===`set`)return Qa(r.valueType,n);if(r.type===`lazy`)return Qa(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 Qa(r.innerType,n);if(r.type===`intersection`)return Qa(r.left,n)||Qa(r.right,n);if(r.type===`record`||r.type===`map`)return Qa(r.keyType,n)||Qa(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Qa(r.in,n)||Qa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Qa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Qa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Qa(e,n))return!0;return!!(r.rest&&Qa(r.rest,n))}return!1}var $a=(e,t={})=>n=>{let r=Ha({...n,processors:t});return A(e,r),Wa(r,e),Za(r,e)},eo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ha({...i??{},target:a,io:t,processors:n});return A(e,o),Wa(o,e),Za(o,e)},to=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},no=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ro=(e,t)=>{to(e,`minimum`,t),no(e,`maximum`,t)},io=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ao=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},oo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},so=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},co=(e,t)=>to(e,`minimum`,t.minimum),lo=(e,t)=>no(e,`maximum`,t.maximum),uo=e=>(t,n)=>{so(t,n.format);let[r,i]=e[n.format];to(t,`minimum`,r),no(t,`maximum`,i)},fo={greater_than:(e,t)=>to(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>no(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>io(e,t.value),number_format:uo(ge),bigint_format:uo(_e),min_length:co,max_length:lo,length_equals:(e,t)=>ro(e,t.length),min_size:co,max_size:lo,size_equals:(e,t)=>ro(e,t.size),string_format:(e,t)=>{so(e,t.format),t.pattern&&ao(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)=>oo(e,t.mime)};function po(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)fo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&to(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&to(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&no(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&no(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&io(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&oo(t,i.mime);for(let e of i.patterns??[])ao(t,e);return t}var mo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ho=new Map([[dr,qt],[pr,Jt]]),go=e=>ho.get(e)??e,_o=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=po(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mo[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(go);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}))])}},vo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=po(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)):k(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}))])}},yo=(e,t,n,r)=>{n.type=`boolean`},bo=(e,t,n,r)=>{k(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{k(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Co=(e,t,n,r)=>{k(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{k(e,t,n,r,`Void cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{n.not={}},Eo=(e,t,n,r)=>{},Do=(e,t,n,r)=>{},Oo=(e,t,n,r)=>{k(e,t,n,r,`Date cannot be represented in JSON Schema`)},ko=(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},Ao=(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(k(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(k(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}},jo=(e,t,n,r)=>{k(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Mo=(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},No=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=po(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})))},Po=(e,t,n,r)=>{n.type=`boolean`},Fo=(e,t,n,r)=>{k(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Io=(e,t,n,r)=>{k(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{k(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{k(e,t,n,r,`Map cannot be represented in JSON Schema`)},zo=(e,t,n,r)=>{k(e,t,n,r,`Set cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=po(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=A(a.element,t,{...r,path:[...r.path,`items`]})};function Vo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Vo(t.out):t.type===`catch`?Vo(t.innerType):e._zod.optin}var Ho=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&k(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,A(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`?Vo(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=A(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Uo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>A(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Wo=(e,t,n,r)=>{let i=e._zod.def,a=A(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=A(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)},Go=(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)=>A(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?A(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`?Vo(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}=po(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Ko(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=Ko(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=>Ko(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`)?E:an).source),p):p}var qo=new WeakMap;function Jo(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 qo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ko(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 Yo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=po(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=A(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)h(i.patternProperties,go(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=A(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=qo.get(t);n||(n=[],qo.set(t,n),t.deferred.push(()=>Jo(t))),n.push(e)}i.additionalProperties=A(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Vo(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))}},Xo=(e,t,n,r)=>{let i=e._zod.def,a=A(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`}]},Zo=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Qo=Symbol();function $o(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(k(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Qo):JSON.parse(o)}var es=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=$o(i.defaultValue,e,t,n,r);o!==Qo&&(n.default=o)},ts=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=$o(i.defaultValue,e,t,n,r);o!==Qo&&(n._prefault=o)},ns=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{k(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},rs=(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;A(o,t,r);let s=t.seen.get(e);s.ref=o},is=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},as=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},os=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ss=(e,t,n,r)=>{let i=e._zod.innerType;A(i,t,r);let a=t.seen.get(e);a.ref=i},cs={string:_o,number:vo,boolean:yo,bigint:bo,symbol:xo,null:So,undefined:Co,void:wo,never:To,any:Eo,unknown:Do,date:Oo,enum:ko,literal:Ao,nan:jo,template_literal:Mo,file:No,success:Po,custom:Fo,function:Io,transform:Lo,map:Ro,set:zo,array:Bo,object:Ho,union:Uo,intersection:Wo,tuple:Go,record:Yo,nullable:Xo,nonoptional:Zo,default:es,prefault:ts,catch:ns,pipe:rs,readonly:is,promise:as,optional:os,lazy:ss};function ls(e,t){if(`_idmap`in e){let n=e,r=Ha({...t,processors:cs}),i={};for(let e of n._idmap.entries()){let[t,n]=e;A(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Wa(r,n),h(a,t,Za(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ha({...t,processors:cs});return A(e,n),Wa(n,e),Za(n,e)}var us=new WeakSet([Object.prototype,Error.prototype]);function ds(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 fs=S(`ZodError`,(e,t)=>{st.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);us.has(n)||(us.add(n),ds(n,`format`,e=>t=>ut(e,t)),ds(n,`flatten`,e=>t=>lt(e,t)),ds(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),ds(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}),ps=ft(fs),ms=pt(fs),hs=mt(fs),gs=gt(fs),_s=St(fs),vs=Ct(fs),ys=wt(fs),bs=Tt(fs),xs=Et(fs),Ss=Dt(fs),Cs=Ot(fs),ws=kt(fs);function Ts(){C.localeError||w(ki())}function Es(){C.memoizer||w({memoizer:Ei()})}var j=S(`ZodType`,(e,t)=>(Ts(),D.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(Kc(e,t))},superRefine(e,t){return this.check(qc(e,t))},overwrite(e){return this.check(ja(e))},optional(){return W(this)},exactOptional(){return Dc(this)},nullable(){return kc(this)},nullish(){return W(kc(this))},nonoptional(e){return Fc(this,e)},array(){return L(this)},or(e){return B([this,e])},and(e){return yc(this,e)},transform(e){return zc(this,wc(e))},default(e){return jc(this,e)},prefault(e){return Nc(this,e)},catch(e){return Lc(this,e)},pipe(e){return zc(this,e)},readonly(){return Hc(this)},describe(e){let t=this.clone();return Ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ni.get(this);let t=this.clone();return Ni.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 ze(this,`~standard`,{...Nn(this),jsonSchema:{input:eo(this,`input`),output:eo(this,`output`)}})},set"~standard"(e){Re(this,`~standard`,e)},parse:function e(t,n){return ps(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ms(this,t,n,{callee:e})},safeParse(e,t){return hs(this,e,t)},async safeParseAsync(e,t){return gs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Re(this,`spa`,e)},validate(e,t){return yt(this,e,t)},validateAsync(e,t){return xt(this,e,t)},encode:function e(t,n){return _s(this,t,n,{callee:e})},decode:function e(t,n){return vs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ys(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},safeEncode(e,t){return xs(this,e,t)},safeDecode(e,t){return Ss(this,e,t)},async safeEncodeAsync(e,t){return Cs(this,e,t)},async safeDecodeAsync(e,t){return ws(this,e,t)},toJSONSchema(e){return $a(this,{})(e)},get description(){return Ni.get(this)?.description},get _def(){return this._zod.def}}),Ds=S(`_ZodString`,(e,t)=>{Pn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)},Be({format:e=>po(e).format??null,minLength:e=>po(e).minimum??null,maxLength:e=>po(e).maximum??null},{regex(...e){return this.check(Ta(...e))},includes(...e){return this.check(Oa(...e))},startsWith(...e){return this.check(ka(...e))},endsWith(...e){return this.check(Aa(...e))},min(...e){return this.check(Ca(...e))},max(...e){return this.check(Sa(...e))},length(...e){return this.check(wa(...e))},nonempty(...e){return this.check(Ca(1,...e))},lowercase(e){return this.check(Ea(e))},uppercase(e){return this.check(Da(e))},trim(){return this.check(Na())},normalize(...e){return this.check(Ma(...e))},toLowerCase(){return this.check(Pa())},toUpperCase(){return this.check(Fa())},slugify(){return this.check(Ia())}})),Os=S(`ZodString`,(e,t)=>{Pn.init(e,t),Ds.init(e,t)},{email(e){return this.check(Ii(Ns,e))},url(e){return this.check(Hi(Ls,e))},jwt(e){return this.check(ra($s,e))},emoji(e){return this.check(Ui(zs,e))},guid(e){return this.check(Li(Fs,e))},uuid(e){return this.check(Ri(Is,e))},uuidv4(e){return this.check(zi(Is,e))},uuidv6(e){return this.check(Bi(Is,e))},uuidv7(e){return this.check(Vi(Is,e))},nanoid(e){return this.check(Wi(Bs,e))},cuid(e){return this.check(Gi(Vs,e))},cuid2(e){return this.check(Ki(Hs,e))},ulid(e){return this.check(qi(Us,e))},base64(e){return this.check(ea(Xs,e))},base64url(e){return this.check(ta(Zs,e))},xid(e){return this.check(Ji(Ws,e))},ksuid(e){return this.check(Yi(Gs,e))},ipv4(e){return this.check(Xi(Ks,e))},ipv6(e){return this.check(Zi(qs,e))},cidrv4(e){return this.check(Qi(Js,e))},cidrv6(e){return this.check($i(Ys,e))},e164(e){return this.check(na(Qs,e))},datetime(e){return this.check(ia(ks,e))},date(e){return this.check(aa(As,e))},time(e){return this.check(oa(js,e))},duration(e){return this.check(sa(Ms,e))}});function M(e){return Fi(Os,e)}var N=S(`ZodStringFormat`,(e,t)=>{O.init(e,t),Ds.init(e,t)}),ks=S(`ZodISODateTime`,(e,t)=>{$n.init(e,t),N.init(e,t)}),As=S(`ZodISODate`,(e,t)=>{er.init(e,t),N.init(e,t)}),js=S(`ZodISOTime`,(e,t)=>{tr.init(e,t),N.init(e,t)}),Ms=S(`ZodISODuration`,(e,t)=>{nr.init(e,t),N.init(e,t)}),Ns=S(`ZodEmail`,(e,t)=>{Ln.init(e,t),N.init(e,t)});function Ps(e){return Ii(Ns,e)}var Fs=S(`ZodGUID`,(e,t)=>{Fn.init(e,t),N.init(e,t)}),Is=S(`ZodUUID`,(e,t)=>{In.init(e,t),N.init(e,t)}),Ls=S(`ZodURL`,(e,t)=>{Gn.init(e,t),N.init(e,t)});function Rs(e){return Hi(Ls,e)}var zs=S(`ZodEmoji`,(e,t)=>{Kn.init(e,t),N.init(e,t)}),Bs=S(`ZodNanoID`,(e,t)=>{qn.init(e,t),N.init(e,t)}),Vs=S(`ZodCUID`,(e,t)=>{Jn.init(e,t),N.init(e,t)}),Hs=S(`ZodCUID2`,(e,t)=>{Yn.init(e,t),N.init(e,t)}),Us=S(`ZodULID`,(e,t)=>{Xn.init(e,t),N.init(e,t)}),Ws=S(`ZodXID`,(e,t)=>{Zn.init(e,t),N.init(e,t)}),Gs=S(`ZodKSUID`,(e,t)=>{Qn.init(e,t),N.init(e,t)}),Ks=S(`ZodIPv4`,(e,t)=>{rr.init(e,t),N.init(e,t)}),qs=S(`ZodIPv6`,(e,t)=>{or.init(e,t),N.init(e,t)}),Js=S(`ZodCIDRv4`,(e,t)=>{sr.init(e,t),N.init(e,t)}),Ys=S(`ZodCIDRv6`,(e,t)=>{lr.init(e,t),N.init(e,t)}),Xs=S(`ZodBase64`,(e,t)=>{fr.init(e,t),N.init(e,t)}),Zs=S(`ZodBase64URL`,(e,t)=>{hr.init(e,t),N.init(e,t)}),Qs=S(`ZodE164`,(e,t)=>{gr.init(e,t),N.init(e,t)}),$s=S(`ZodJWT`,(e,t)=>{vr.init(e,t),N.init(e,t)}),ec=S(`ZodNumber`,(e,t)=>{yr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.isFinite=!0},Be({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=po(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=po(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=po(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>po(e).format??null},{gt(e,t){return this.check(ya(e,t))},gte(e,t){return this.check(ba(e,t))},min(e,t){return this.check(ba(e,t))},lt(e,t){return this.check(_a(e,t))},lte(e,t){return this.check(va(e,t))},max(e,t){return this.check(va(e,t))},int(e){return this.check(nc(e))},safe(e){return this.check(nc(e))},positive(e){return this.check(ya(0,e))},nonnegative(e){return this.check(ba(0,e))},negative(e){return this.check(_a(0,e))},nonpositive(e){return this.check(va(0,e))},multipleOf(e,t){return this.check(xa(e,t))},step(e,t){return this.check(xa(e,t))},finite(){return this}}));function P(e){return ca(ec,e)}var tc=S(`ZodNumberFormat`,(e,t)=>{br.init(e,t),ec.init(e,t)});function nc(e){return ua(tc,e)}var rc=S(`ZodBoolean`,(e,t)=>{xr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)});function F(e){return da(rc,e)}var ic=S(`ZodUndefined`,(e,t)=>{Sr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function ac(e){return fa(ic,e)}var oc=S(`ZodNull`,(e,t)=>{Cr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r)});function sc(e){return pa(oc,e)}var cc=S(`ZodAny`,(e,t)=>{wr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function lc(){return ma(cc)}var uc=S(`ZodUnknown`,(e,t)=>{Tr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function I(){return ha(uc)}var dc=S(`ZodNever`,(e,t)=>{Er.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r)});function fc(e){return ga(dc,e)}var pc=S(`ZodArray`,(e,t)=>{Es(),Or.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ca(e,t))},nonempty(e){return this.check(Ca(1,e))},max(e,t){return this.check(Sa(e,t))},length(e,t){return this.check(wa(e,t))},unwrap(){return this.element}});function L(e,t){return La(pc,e,t)}var mc=S(`ZodObject`,(e,t)=>{Es(),Pr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),Ke(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:I()}))},loose(){return this.clone(_(this._zod.def,{catchall:I()}))},strict(){return this.clone(_(this._zod.def,{catchall:fc()}))},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(Tc,this,e[0])},exactPartial(...e){return Te(Ec,this,e[0],`exactPartial`)},required(...e){return Ee(Pc,this,e[0])}});function R(e,t){return new mc({type:`object`,shape:e??{},...y(t)})}function z(e,t){return new mc({type:`object`,shape:e,catchall:I(),...y(t)})}var hc=S(`ZodUnion`,(e,t)=>{Ir.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.options=t.options});function B(e,t){return new hc({type:`union`,options:e,...y(t)})}var gc=S(`ZodDiscriminatedUnion`,(e,t)=>{hc.init(e,t),Rr.init(e,t)});function _c(e,t,n){return new gc({type:`union`,options:t,discriminator:e,...y(n)})}var vc=S(`ZodIntersection`,(e,t)=>{zr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r)});function yc(e,t){return new vc({type:`intersection`,left:e,right:t})}var bc=S(`ZodRecord`,(e,t)=>{Es(),Hr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new bc({type:`record`,keyType:M(),valueType:e,...y(t)}):new bc({type:`record`,keyType:e,valueType:t,...y(n)})}var xc=S(`ZodEnum`,(e,t)=>{Ur.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(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 xc({...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 xc({...t,checks:[],...y(r),entries:i})}});function H(e,t){return new xc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Sc=S(`ZodLiteral`,(e,t)=>{Wr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(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 U(e,t){return new Sc({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var Cc=S(`ZodTransform`,(e,t)=>{Es(),Gr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ie(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(Ie(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function wc(e){return new Cc({type:`transform`,transform:e})}var Tc=S(`ZodOptional`,(e,t)=>{qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function W(e){return new Tc({type:`optional`,innerType:e})}var Ec=S(`ZodExactOptional`,(e,t)=>{Jr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dc(e){return new Ec({type:`optional`,innerType:e})}var Oc=S(`ZodNullable`,(e,t)=>{Yr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kc(e){return new Oc({type:`nullable`,innerType:e})}var Ac=S(`ZodDefault`,(e,t)=>{Xr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jc(e,t){return new Ac({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Mc=S(`ZodPrefault`,(e,t)=>{Qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nc(e,t){return new Mc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Pc=S(`ZodNonOptional`,(e,t)=>{$r.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fc(e,t){return new Pc({type:`nonoptional`,innerType:e,...y(t)})}var Ic=S(`ZodCatch`,(e,t)=>{ni.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Lc(e,t){return new Ic({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Je(t)})}var Rc=S(`ZodPipe`,(e,t)=>{ri.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.in=t.in,e.out=t.out});function zc(e,t){return new Rc({type:`pipe`,in:e,out:t})}var Bc=S(`ZodPreprocess`,(e,t)=>{Rc.init(e,t),ai.init(e,t)}),Vc=S(`ZodReadonly`,(e,t)=>{oi.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Vc({type:`readonly`,innerType:e})}var Uc=S(`ZodLazy`,(e,t)=>{ci.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Wc(e){return new Uc({type:`lazy`,getter:e})}var Gc=S(`ZodCustom`,(e,t)=>{li.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r)});function Kc(e,t={}){return Ra(Gc,e,t)}function qc(e,t){return za(e,t)}function Jc(e,t){return new Bc({type:`pipe`,in:wc(e),out:t})}var Yc={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`},Xc;Xc||={};function Zc(e){return ia(ks,e)}function Qc(e){return aa(As,e)}function $c(e){return la(ec,e)}var el=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],tl=`io.modelcontextprotocol/related-task`,nl=`io.modelcontextprotocol/protocolVersion`,rl=`io.modelcontextprotocol/clientInfo`,il=`io.modelcontextprotocol/serverInfo`,al=`io.modelcontextprotocol/clientCapabilities`,ol=`io.modelcontextprotocol/subscriptionId`,sl=`io.modelcontextprotocol/logLevel`,cl=Wc(()=>B([M(),P(),F(),sc(),V(M(),cl),L(cl)])),G=V(M(),cl),ll=L(cl),ul=B([M(),P().int()]),dl=M(),fl=R({ttl:P().optional()}),pl=R({taskId:M()}),ml=z({progressToken:ul.optional(),[tl]:pl.optional()}),K=R({_meta:ml.optional()}),hl=K.extend({task:fl.optional()}),q=R({method:M(),params:K.loose().optional()}),gl=R({_meta:ml.optional()}),_l=R({method:M(),params:gl.loose().optional()}),vl=z({get[il](){return Ml.optional().catch(void 0)}}),J=z({_meta:vl.optional()}),yl=B([M(),P().int()]),bl=R({jsonrpc:U(`2.0`),id:yl,...q.shape}).strict(),xl=R({jsonrpc:U(`2.0`),..._l.shape}).strict(),Sl=R({jsonrpc:U(`2.0`),id:yl,result:J}).strict(),Cl=R({jsonrpc:U(`2.0`),id:yl.optional(),error:R({code:P().int(),message:M(),data:I().optional()})}).strict(),wl=B([bl,xl,Sl,Cl]),Tl=B([Sl,Cl]),El=J.strict(),Dl=gl.extend({requestId:yl.optional(),reason:M().optional()}),Ol=_l.extend({method:U(`notifications/cancelled`),params:Dl}),kl=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),Al=R({icons:L(kl).optional()}),jl=R({name:M(),title:M().optional()}),Ml=jl.extend({...jl.shape,...Al.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),Nl=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),G).optional(),url:G.optional()}),G.optional())),Pl=z({list:G.optional(),cancel:G.optional(),requests:z({sampling:z({createMessage:G.optional()}).optional(),elicitation:z({create:G.optional()}).optional()}).optional()}),Fl=z({list:G.optional(),cancel:G.optional(),requests:z({tools:z({call:G.optional()}).optional()}).optional()}),Il=R({experimental:V(M(),G).optional(),sampling:R({context:G.optional(),tools:G.optional()}).optional(),elicitation:Nl.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:Pl.optional(),extensions:V(M(),G).optional()}),Ll=K.extend({protocolVersion:M(),capabilities:Il,clientInfo:Ml}),Rl=q.extend({method:U(`initialize`),params:Ll}),zl=R({experimental:V(M(),G).optional(),logging:G.optional(),completions:G.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:Fl.optional(),extensions:V(M(),G).optional()}),Bl=J.extend({protocolVersion:M(),capabilities:zl,serverInfo:Ml,instructions:M().optional()}),Vl=_l.extend({method:U(`notifications/initialized`),params:gl.optional()}),Hl=q.extend({method:U(`server/discover`),params:K.optional()}),Ul=J.extend({supportedVersions:L(M()),capabilities:zl,instructions:M().optional()}),Wl=q.extend({method:U(`ping`),params:K.optional()}),Gl=R({progress:P(),total:W(P()),message:W(M())}),Kl=R({...gl.shape,...Gl.shape,progressToken:ul}),ql=_l.extend({method:U(`notifications/progress`),params:Kl}),Jl=K.extend({cursor:dl.optional()}),Yl=q.extend({params:Jl.optional()}),Xl=J.extend({nextCursor:dl.optional()}),Zl=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),Ql=Zl.extend({text:M()}),$l=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),eu=Zl.extend({blob:$l}),tu=H([`user`,`assistant`]),nu=R({audience:L(tu).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),ru=R({...jl.shape,...Al.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:nu.optional(),_meta:W(z({}))}),iu=R({...jl.shape,...Al.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:nu.optional(),_meta:W(z({}))}),au=Yl.extend({method:U(`resources/list`)}),ou=Xl.extend({resources:L(ru)}),su=Yl.extend({method:U(`resources/templates/list`)}),cu=Xl.extend({resourceTemplates:L(iu)}),lu=K.extend({uri:M()}),uu=lu,du=q.extend({method:U(`resources/read`),params:uu}),fu=J.extend({contents:L(B([Ql,eu]))}),pu=_l.extend({method:U(`notifications/resources/list_changed`),params:gl.optional()}),mu=lu,hu=q.extend({method:U(`resources/subscribe`),params:mu}),gu=lu,_u=q.extend({method:U(`resources/unsubscribe`),params:gu}),vu=R({toolsListChanged:F().optional(),promptsListChanged:F().optional(),resourcesListChanged:F().optional(),resourceSubscriptions:L(M()).optional()}),yu=K.extend({notifications:vu}),bu=q.extend({method:U(`subscriptions/listen`),params:yu}),xu=gl.extend({notifications:vu}),Su=_l.extend({method:U(`notifications/subscriptions/acknowledged`),params:xu}),Cu=vl.extend({[ol]:yl}),wu=J.extend({_meta:Cu}),Tu=gl.extend({uri:M()}),Eu=_l.extend({method:U(`notifications/resources/updated`),params:Tu}),Du=R({name:M(),description:W(M()),required:W(F())}),Ou=R({...jl.shape,...Al.shape,description:W(M()),arguments:W(L(Du)),_meta:W(z({}))}),ku=Yl.extend({method:U(`prompts/list`)}),Au=Xl.extend({prompts:L(Ou)}),ju=K.extend({name:M(),arguments:V(M(),M()).optional()}),Mu=q.extend({method:U(`prompts/get`),params:ju}),Nu=R({type:U(`text`),text:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Pu=R({type:U(`image`),data:$l,mimeType:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Fu=R({type:U(`audio`),data:$l,mimeType:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Iu=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Lu=R({type:U(`resource`),resource:B([Ql,eu]),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Ru=ru.extend({type:U(`resource_link`)}),zu=B([Nu,Pu,Fu,Ru,Lu]),Bu=R({role:tu,content:zu}),Vu=J.extend({description:M().optional(),messages:L(Bu)}),Hu=_l.extend({method:U(`notifications/prompts/list_changed`),params:gl.optional()}),Uu=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),Wu=R({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),Gu=R({...jl.shape,...Al.shape,description:M().optional(),inputSchema:R({type:U(`object`),properties:V(M(),cl).optional(),required:L(M()).optional()}).catchall(I()),outputSchema:z({$schema:M().optional()}).optional(),annotations:Uu.optional(),execution:Wu.optional(),_meta:V(M(),I()).optional()}),Ku=Yl.extend({method:U(`tools/list`)}),qu=Xl.extend({tools:L(Gu)}),Ju=J.extend({content:L(zu).default([]),structuredContent:I().optional(),isError:F().optional()}),Yu=Ju.or(J.extend({toolResult:I()})),Xu=hl.extend({name:M(),arguments:V(M(),I()).optional()}),Zu=q.extend({method:U(`tools/call`),params:Xu}),Qu=_l.extend({method:U(`notifications/tools/list_changed`),params:gl.optional()}),$u=R({autoRefresh:F().default(!0),debounceMs:P().int().nonnegative().default(300)}),ed=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),td=K.extend({level:ed}),nd=q.extend({method:U(`logging/setLevel`),params:td}),rd=gl.extend({level:ed,logger:M().optional(),data:I()}),id=_l.extend({method:U(`notifications/message`),params:rd}),ad=R({name:M().optional()}),od=R({hints:L(ad).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),sd=R({mode:H([`auto`,`required`,`none`]).optional()}),cd=R({type:U(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:L(zu),structuredContent:I().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),ld=_c(`type`,[Nu,Pu,Fu]),ud=_c(`type`,[Nu,Pu,Fu,Iu,cd]),dd=R({role:tu,content:B([ud,L(ud)]),_meta:V(M(),I()).optional()}),fd=hl.extend({messages:L(dd),modelPreferences:od.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:G.optional(),tools:L(Gu).optional(),toolChoice:sd.optional()}),pd=q.extend({method:U(`sampling/createMessage`),params:fd}),md=J.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:tu,content:ld}),hd=J.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:tu,content:B([ud,L(ud)])}),gd=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),_d=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),vd=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),yd=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),bd=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),xd=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),Sd=B([yd,bd]),Cd=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),wd=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),Td=B([Cd,wd]),Ed=B([xd,Sd,Td]),Dd=B([Ed,gd,_d,vd]),Od=hl.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),Dd),required:L(M()).optional()}).catchall(I())}),kd=hl.extend({mode:U(`url`),message:M(),elicitationId:M(),url:M().url()}),Ad=B([Od,kd]),jd=q.extend({method:U(`elicitation/create`),params:Ad}),Md=gl.extend({elicitationId:M()}),Nd=_l.extend({method:U(`notifications/elicitation/complete`),params:Md}),Pd=J.extend({action:H([`accept`,`decline`,`cancel`]),content:Jc(e=>e===null?void 0:e,V(M(),B([M(),P(),F(),L(M())])).optional())}),Fd=R({type:U(`ref/resource`),uri:M()}),Id=R({type:U(`ref/prompt`),name:M()}),Ld=K.extend({ref:B([Id,Fd]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()}),Rd=q.extend({method:U(`completion/complete`),params:Ld}),zd=J.extend({completion:z({values:L(M()).max(100),total:W(P().int()),hasMore:W(F())})}),Bd=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Vd=q.extend({method:U(`roots/list`),params:K.optional()}),Hd=J.extend({roots:L(Bd)}),Ud=_l.extend({method:U(`notifications/roots/list_changed`),params:gl.optional()}),Wd=z({ttl:P().optional(),pollInterval:P().optional()}),Gd=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Kd=R({taskId:M(),status:Gd,ttl:B([P(),sc()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:W(P()),statusMessage:W(M())}),qd=J.extend({task:Kd}),Jd=gl.merge(Kd),Yd=_l.extend({method:U(`notifications/tasks/status`),params:Jd}),Xd=q.extend({method:U(`tasks/get`),params:K.extend({taskId:M()})}),Zd=J.merge(Kd),Qd=q.extend({method:U(`tasks/result`),params:K.extend({taskId:M()})}),$d=J.loose(),ef=Yl.extend({method:U(`tasks/list`)}),tf=Xl.extend({tasks:L(Kd)}),nf=q.extend({method:U(`tasks/cancel`),params:K.extend({taskId:M()})}),rf=J.merge(Kd),af=B([Wl,Rl,Hl,Rd,nd,Mu,ku,au,su,du,hu,_u,bu,Zu,Ku]),of=B([Ol,ql,Vl,Ud]),sf=B([El,md,hd,Pd,Hd]),cf=B([Wl,pd,jd,Vd]),lf=B([Ol,ql,id,Eu,pu,Qu,Hu,Su,Nd]),uf=B([El,Bl,Ul,zd,Vu,Au,ou,cu,fu,Ju,qu,wu]),Y=Rs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Yc.custom,message:`URL must be parseable`,fatal:!0}),Xe}).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`}),df=z({resource:M().url(),authorization_servers:L(Y).optional(),jwks_uri:M().url().optional(),scopes_supported:L(M()).optional(),bearer_methods_supported:L(M()).optional(),resource_signing_alg_values_supported:L(M()).optional(),resource_name:M().optional(),resource_documentation:M().optional(),resource_policy_uri:M().url().optional(),resource_tos_uri:M().url().optional(),tls_client_certificate_bound_access_tokens:F().optional(),authorization_details_types_supported:L(M()).optional(),dpop_signing_alg_values_supported:L(M()).optional(),dpop_bound_access_tokens_required:F().optional()}),ff=z({issuer:M(),authorization_endpoint:Y,token_endpoint:Y,registration_endpoint:Y.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),service_documentation:Y.optional(),revocation_endpoint:Y.optional(),revocation_endpoint_auth_methods_supported:L(M()).optional(),revocation_endpoint_auth_signing_alg_values_supported:L(M()).optional(),introspection_endpoint:M().optional(),introspection_endpoint_auth_methods_supported:L(M()).optional(),introspection_endpoint_auth_signing_alg_values_supported:L(M()).optional(),code_challenge_methods_supported:L(M()).optional(),client_id_metadata_document_supported:F().optional(),authorization_response_iss_parameter_supported:F().optional().catch(void 0)}),pf=z({issuer:M(),authorization_endpoint:Y,token_endpoint:Y,userinfo_endpoint:Y.optional(),jwks_uri:Y,registration_endpoint:Y.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),acr_values_supported:L(M()).optional(),subject_types_supported:L(M()),id_token_signing_alg_values_supported:L(M()),id_token_encryption_alg_values_supported:L(M()).optional(),id_token_encryption_enc_values_supported:L(M()).optional(),userinfo_signing_alg_values_supported:L(M()).optional(),userinfo_encryption_alg_values_supported:L(M()).optional(),userinfo_encryption_enc_values_supported:L(M()).optional(),request_object_signing_alg_values_supported:L(M()).optional(),request_object_encryption_alg_values_supported:L(M()).optional(),request_object_encryption_enc_values_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),display_values_supported:L(M()).optional(),claim_types_supported:L(M()).optional(),claims_supported:L(M()).optional(),service_documentation:M().optional(),claims_locales_supported:L(M()).optional(),ui_locales_supported:L(M()).optional(),claims_parameter_supported:F().optional(),request_parameter_supported:F().optional(),request_uri_parameter_supported:F().optional(),require_request_uri_registration:F().optional(),op_policy_uri:Y.optional(),op_tos_uri:Y.optional(),client_id_metadata_document_supported:F().optional(),authorization_response_iss_parameter_supported:F().optional().catch(void 0)}),mf=R({...pf.shape,...ff.pick({code_challenge_methods_supported:!0}).shape}),hf=R({access_token:M(),id_token:M().optional(),token_type:M(),expires_in:$c().optional(),scope:M().optional(),refresh_token:M().optional()}).strip(),gf=R({issued_token_type:U(`urn:ietf:params:oauth:token-type:id-jag`),access_token:M(),token_type:M().optional(),expires_in:P().optional(),scope:M().optional()}).strip(),_f=R({error:M(),error_description:M().optional(),error_uri:M().optional()}),vf=Y.optional().or(U(``).transform(()=>void 0)),yf=R({redirect_uris:L(Y),token_endpoint_auth_method:M().optional(),grant_types:L(M()).optional(),response_types:L(M()).optional(),application_type:M().optional(),client_name:M().optional(),client_uri:Y.optional(),logo_uri:vf,scope:M().optional(),contacts:L(M()).optional(),tos_uri:vf,policy_uri:M().optional(),jwks_uri:Y.optional(),jwks:lc().optional(),software_id:M().optional(),software_version:M().optional(),software_statement:M().optional()}).strip(),bf=R({client_id:M(),client_secret:M().optional(),client_id_issued_at:P().optional(),client_secret_expires_at:P().optional()}).strip(),xf=yf.merge(bf),Sf=R({error:M(),error_description:M().optional()}).strip(),Cf=R({token:M(),token_type_hint:M().optional()}).strip(),wf=Symbol.for(`mcp.sdk.errorBrands`);function Tf(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,wf,{value:n,enumerable:!1,configurable:!0})}function Ef(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,wf)){let n=t[wf];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 Ef(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 Ef(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Tf(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 Df=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 Ef(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 Ef(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,Tf(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=Wc(()=>B([M(),P(),F(),sc(),V(M(),e),L(e)])),t=V(M(),e),n=B([M(),P().int()]),r=M(),i=R({ttl:P().optional()}),a=R({taskId:M()}),o=z({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=R({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=R({method:M(),params:s.loose().optional()}),u=R({_meta:o.optional()}),d=R({method:M(),params:u.loose().optional()}),f=z({_meta:o.optional()}),p=B([M(),P().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:M().optional()}),ee=d.extend({method:U(`notifications/cancelled`),params:h}),g=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),te=R({icons:L(g).optional()}),ne=R({name:M(),title:M().optional()}),re=ne.extend({...ne.shape,...te.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),ie=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),t).optional(),url:t.optional()}),t.optional())),_=z({list:t.optional(),cancel:t.optional(),requests:z({sampling:z({createMessage:t.optional()}).optional(),elicitation:z({create:t.optional()}).optional()}).optional()}),ae=z({list:t.optional(),cancel:t.optional(),requests:z({tools:z({call:t.optional()}).optional()}).optional()}),oe=R({experimental:V(M(),t).optional(),sampling:R({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:_.optional(),extensions:V(M(),t).optional()}),se=s.extend({protocolVersion:M(),capabilities:oe,clientInfo:re}),ce=l.extend({method:U(`initialize`),params:se}),le=R({experimental:V(M(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:ae.optional(),extensions:V(M(),t).optional()}),ue=f.extend({protocolVersion:M(),capabilities:le,serverInfo:re,instructions:M().optional()}),de=d.extend({method:U(`notifications/initialized`),params:u.optional()}),fe=l.extend({method:U(`ping`),params:s.optional()}),pe=R({progress:P(),total:W(P()),message:W(M())}),v=R({...u.shape,...pe.shape,progressToken:n}),y=d.extend({method:U(`notifications/progress`),params:v}),me=s.extend({cursor:r.optional()}),he=l.extend({params:me.optional()}),ge=f.extend({nextCursor:r.optional()}),_e=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),ve=_e.extend({text:M()}),ye=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),be=_e.extend({blob:ye}),xe=H([`user`,`assistant`]),Se=R({audience:L(xe).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),Ce=R({...ne.shape,...te.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:Se.optional(),_meta:W(z({}))}),we=R({...ne.shape,...te.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:Se.optional(),_meta:W(z({}))}),Te=he.extend({method:U(`resources/list`)}),Ee=ge.extend({resources:L(Ce)}),b=he.extend({method:U(`resources/templates/list`)}),De=ge.extend({resourceTemplates:L(we)}),Oe=s.extend({uri:M()}),ke=Oe,Ae=l.extend({method:U(`resources/read`),params:ke}),je=f.extend({contents:L(B([ve,be]))}),Me=d.extend({method:U(`notifications/resources/list_changed`),params:u.optional()}),Ne=Oe,Pe=l.extend({method:U(`resources/subscribe`),params:Ne}),Fe=Oe,Ie=l.extend({method:U(`resources/unsubscribe`),params:Fe}),Le=u.extend({uri:M()}),Re=d.extend({method:U(`notifications/resources/updated`),params:Le}),ze=R({name:M(),description:W(M()),required:W(F())}),Be=R({...ne.shape,...te.shape,description:W(M()),arguments:W(L(ze)),_meta:W(z({}))}),Ve=he.extend({method:U(`prompts/list`)}),He=ge.extend({prompts:L(Be)}),Ue=s.extend({name:M(),arguments:V(M(),M()).optional()}),We=l.extend({method:U(`prompts/get`),params:Ue}),Ge=R({type:U(`text`),text:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),x=R({type:U(`image`),data:ye,mimeType:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),Ke=R({type:U(`audio`),data:ye,mimeType:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),qe=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Je=R({type:U(`resource`),resource:B([ve,be]),annotations:Se.optional(),_meta:V(M(),I()).optional()}),Ye=Ce.extend({type:U(`resource_link`)}),Xe=B([Ge,x,Ke,Ye,Je]),Ze=R({role:xe,content:Xe}),Qe=f.extend({description:M().optional(),messages:L(Ze)}),$e=d.extend({method:U(`notifications/prompts/list_changed`),params:u.optional()}),S=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),et=R({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),tt=R({...ne.shape,...te.shape,description:M().optional(),inputSchema:R({type:U(`object`),properties:V(M(),e).optional(),required:L(M()).optional()}).catchall(I()),outputSchema:R({type:U(`object`),properties:V(M(),e).optional(),required:L(M()).optional()}).catchall(I()).optional(),annotations:S.optional(),execution:et.optional(),_meta:V(M(),I()).optional()}),C=he.extend({method:U(`tools/list`)}),w=ge.extend({tools:L(tt)}),nt=f.extend({content:L(Xe),structuredContent:V(M(),I()).optional(),isError:F().optional()}),T=c.extend({name:M(),arguments:V(M(),I()).optional()}),rt=l.extend({method:U(`tools/call`),params:T}),it=d.extend({method:U(`notifications/tools/list_changed`),params:u.optional()}),at=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),ot=s.extend({level:at}),st=l.extend({method:U(`logging/setLevel`),params:ot}),ct=u.extend({level:at,logger:M().optional(),data:I()}),lt=d.extend({method:U(`notifications/message`),params:ct}),ut=R({name:M().optional()}),dt=R({hints:L(ut).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),ft=R({mode:H([`auto`,`required`,`none`]).optional()}),pt=R({type:U(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:L(Xe),structuredContent:R({}).loose().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),mt=_c(`type`,[Ge,x,Ke]),ht=_c(`type`,[Ge,x,Ke,qe,pt]),gt=R({role:xe,content:B([ht,L(ht)]),_meta:V(M(),I()).optional()}),_t=c.extend({messages:L(gt),modelPreferences:dt.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:t.optional(),tools:L(tt).optional(),toolChoice:ft.optional()}),vt=l.extend({method:U(`sampling/createMessage`),params:_t}),yt=f.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:xe,content:mt}),bt=f.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:xe,content:B([ht,L(ht)])}),xt=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),St=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),Ct=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),wt=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),Tt=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),Et=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),Dt=B([wt,Tt]),Ot=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),kt=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),At=B([Ot,kt]),jt=B([Et,Dt,At]),Mt=B([jt,xt,St,Ct]),Nt=c.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),Mt),required:L(M()).optional()}).catchall(I())}),Pt=c.extend({mode:U(`url`),message:M(),elicitationId:M(),url:M().url()}),Ft=B([Nt,Pt]),It=l.extend({method:U(`elicitation/create`),params:Ft}),Lt=u.extend({elicitationId:M()}),Rt=d.extend({method:U(`notifications/elicitation/complete`),params:Lt}),zt=f.extend({action:H([`accept`,`decline`,`cancel`]),content:Jc(e=>e===null?void 0:e,V(M(),B([M(),P(),F(),L(M())])).optional())}),Bt=R({type:U(`ref/resource`),uri:M()}),Vt=R({type:U(`ref/prompt`),name:M()}),Ht=s.extend({ref:B([Vt,Bt]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()}),Ut=l.extend({method:U(`completion/complete`),params:Ht}),Wt=f.extend({completion:z({values:L(M()).max(100),total:W(P().int()),hasMore:W(F())})}),Gt=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Kt=l.extend({method:U(`roots/list`),params:s.optional()}),qt=f.extend({roots:L(Gt)}),Jt=d.extend({method:U(`notifications/roots/list_changed`),params:u.optional()}),Yt=z({ttl:P().optional(),pollInterval:P().optional()}),Xt=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=R({taskId:M(),status:Xt,ttl:B([P(),sc()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:W(P()),statusMessage:W(M())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:U(`notifications/tasks/status`),params:$t}),tn=l.extend({method:U(`tasks/get`),params:s.extend({taskId:M()})}),nn=f.merge(Zt),rn=l.extend({method:U(`tasks/result`),params:s.extend({taskId:M()})}),an=f.loose(),E=he.extend({method:U(`tasks/list`)}),on=ge.extend({tasks:L(Zt)}),sn=l.extend({method:U(`tasks/cancel`),params:s.extend({taskId:M()})});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:b,ListResourceTemplatesResultSchema:De,ResourceRequestParamsSchema:Oe,ReadResourceRequestParamsSchema:ke,ReadResourceRequestSchema:Ae,ReadResourceResultSchema:je,ResourceListChangedNotificationSchema:Me,SubscribeRequestParamsSchema:Ne,SubscribeRequestSchema:Pe,UnsubscribeRequestParamsSchema:Fe,UnsubscribeRequestSchema:Ie,ResourceUpdatedNotificationParamsSchema:Le,ResourceUpdatedNotificationSchema:Re,PromptArgumentSchema:ze,PromptSchema:Be,ListPromptsRequestSchema:Ve,ListPromptsResultSchema:He,GetPromptRequestParamsSchema:Ue,GetPromptRequestSchema:We,TextContentSchema:Ge,ImageContentSchema:x,AudioContentSchema:Ke,ToolUseContentSchema:qe,EmbeddedResourceSchema:Je,ResourceLinkSchema:Ye,ContentBlockSchema:Xe,PromptMessageSchema:Ze,GetPromptResultSchema:Qe,PromptListChangedNotificationSchema:$e,ToolAnnotationsSchema:S,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:C,ListToolsResultSchema:w,CallToolResultSchema:nt,CallToolRequestParamsSchema:T,CallToolRequestSchema:rt,ToolListChangedNotificationSchema:it,LoggingLevelSchema:at,SetLevelRequestParamsSchema:ot,SetLevelRequestSchema:st,LoggingMessageNotificationParamsSchema:ct,LoggingMessageNotificationSchema:lt,ModelHintSchema:ut,ModelPreferencesSchema:dt,ToolChoiceSchema:ft,ToolResultContentSchema:pt,SamplingContentSchema:mt,SamplingMessageContentBlockSchema:ht,SamplingMessageSchema:gt,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vt,CreateMessageResultSchema:yt,CreateMessageResultWithToolsSchema:bt,BooleanSchemaSchema:xt,StringSchemaSchema:St,NumberSchemaSchema:Ct,UntitledSingleSelectEnumSchemaSchema:wt,TitledSingleSelectEnumSchemaSchema:Tt,LegacyTitledEnumSchemaSchema:Et,SingleSelectEnumSchemaSchema:Dt,UntitledMultiSelectEnumSchemaSchema:Ot,TitledMultiSelectEnumSchemaSchema:kt,MultiSelectEnumSchemaSchema:At,EnumSchemaSchema:jt,PrimitiveSchemaDefinitionSchema:Mt,ElicitRequestFormParamsSchema:Nt,ElicitRequestURLParamsSchema:Pt,ElicitRequestParamsSchema:Ft,ElicitRequestSchema:It,ElicitationCompleteNotificationParamsSchema:Lt,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:nn,GetTaskPayloadRequestSchema:rn,GetTaskPayloadResultSchema:an,ListTasksRequestSchema:E,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:B([fe,ce,Ut,st,We,Ve,Te,b,Ae,Pe,Ie,rt,C,tn,rn,E,sn]),ClientNotificationSchema:B([ee,y,de,Jt,en]),ClientResultSchema:B([m,yt,bt,zt,qt,nn,on,Qt]),ServerRequestSchema:B([fe,vt,It,Kt,tn,rn,E,sn]),ServerNotificationSchema:B([ee,y,lt,Re,Me,it,$e,en,Rt]),ServerResultSchema:B([m,ue,Wt,Qe,He,Ee,De,je,nt,w,nn,on,Qt]),CallToolResultWireSchema:I().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(nt)}}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=Wc(()=>B([M(),P(),F(),sc(),V(M(),e),L(e)])),t=V(M(),e),n=B([M(),P().int()]),r=M(),i=B([M(),P().int()]),a=H([`user`,`assistant`]),o=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=R({ttl:P().optional()}),l=R({taskId:M()}),u=z({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=R({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=R({_meta:u.optional()}),m=R({method:M(),params:p.loose().optional()}),h=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),ee=R({icons:L(h).optional()}),g=R({name:M(),title:M().optional()}),te=g.extend({...g.shape,...ee.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),ne=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),t).optional(),url:t.optional()}),t.optional())),re=z({list:t.optional(),cancel:t.optional(),requests:z({sampling:z({createMessage:t.optional()}).optional(),elicitation:z({create:t.optional()}).optional()}).optional()}),ie=z({list:t.optional(),cancel:t.optional(),requests:z({tools:z({call:t.optional()}).optional()}).optional()}),_=R({experimental:V(M(),t).optional(),sampling:R({context:t.optional(),tools:t.optional()}).optional(),elicitation:ne.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:re.optional(),extensions:V(M(),t).optional()}),ae=R({experimental:V(M(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:ie.optional(),extensions:V(M(),t).optional()}),oe=R({progress:P(),total:W(P()),message:W(M())}),se=R({...p.shape,...oe.shape,progressToken:n}),ce=m.extend({method:U(`notifications/progress`),params:se}),le=p.extend({level:o,logger:M().optional(),data:I()}),ue=m.extend({method:U(`notifications/message`),params:le}),de=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),fe=de.extend({text:M()}),pe=de.extend({blob:s}),v=R({audience:L(a).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),y=R({...g.shape,...ee.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:v.optional(),_meta:W(z({}))}),me=R({...g.shape,...ee.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:v.optional(),_meta:W(z({}))}),he=m.extend({method:U(`notifications/resources/list_changed`),params:p.optional()}),ge=p.extend({uri:M()}),_e=m.extend({method:U(`notifications/resources/updated`),params:ge}),ve=R({name:M(),description:W(M()),required:W(F())}),ye=R({...g.shape,...ee.shape,description:W(M()),arguments:W(L(ve)),_meta:W(z({}))}),be=m.extend({method:U(`notifications/prompts/list_changed`),params:p.optional()}),xe=R({type:U(`text`),text:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),Se=R({type:U(`image`),data:s,mimeType:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),Ce=R({type:U(`audio`),data:s,mimeType:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),we=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Te=R({type:U(`resource`),resource:B([fe,pe]),annotations:v.optional(),_meta:V(M(),I()).optional()}),Ee=y.extend({type:U(`resource_link`)}),b=B([xe,Se,Ce,Ee,Te]),De=R({role:a,content:b}),Oe=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),ke=m.extend({method:U(`notifications/tools/list_changed`),params:p.optional()}),Ae=R({name:M().optional()}),je=R({hints:L(Ae).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),Me=R({mode:H([`auto`,`required`,`none`]).optional()}),Ne=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),Pe=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),Fe=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),Ie=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),Le=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),Re=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),ze=B([Ie,Le]),Be=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),Ve=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),He=B([Be,Ve]),Ue=B([Re,ze,He]),We=B([Ue,Ne,Pe,Fe]),Ge=f.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),We),required:L(M()).optional()}).catchall(I())}),x=R({type:U(`ref/resource`),uri:M()}),Ke=R({type:U(`ref/prompt`),name:M()}),qe=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Je=_.shape,Ye=R({experimental:Je.experimental,sampling:Je.sampling,elicitation:Je.elicitation,roots:Je.roots,extensions:Je.extensions}),Xe=ae.shape,Ze=R({experimental:Xe.experimental,logging:Xe.logging,completions:Xe.completions,prompts:Xe.prompts,resources:Xe.resources,tools:Xe.tools,extensions:Xe.extensions}),Qe=z({progressToken:n.optional(),[nl]:M(),[rl]:te.optional(),[al]:Ye,[sl]:o.optional()}),$e=R({...g.shape,...ee.shape,description:M().optional(),inputSchema:z({$schema:M().optional(),type:U(`object`)}),outputSchema:z({$schema:M().optional()}).optional(),annotations:Oe.optional(),_meta:V(M(),I()).optional()}),S=R({type:U(`tool_result`),toolUseId:M(),content:L(b),structuredContent:I().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),et=B([xe,Se,Ce,we,S]),tt=R({role:a,content:B([et,L(et)]),_meta:V(M(),I()).optional()}),C=M(),w=z({[il]:te.optional().catch(void 0)}),nt=w.optional();function T(e){return z({_meta:nt,resultType:C.default(`complete`),...e})}let rt=T({}),it=T({nextCursor:r.optional()}),at=T({content:L(b),structuredContent:I().optional(),isError:F().optional()}),ot=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),tools:L($e),nextCursor:r.optional()}),st=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),prompts:L(ye),nextCursor:r.optional()}),ct=T({description:M().optional(),messages:L(De)}),lt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resources:L(y),nextCursor:r.optional()}),ut=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resourceTemplates:L(me),nextCursor:r.optional()}),dt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),contents:L(B([fe,pe]))}),ft=T({completion:R({values:L(M()).max(100),total:P().int().optional(),hasMore:F().optional()}).loose()}),pt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`])}),mt=T({ttlMs:P().int().min(0).catch(0),cacheScope:H([`public`,`private`]).catch(`private`),supportedVersions:L(M()),capabilities:Ze,instructions:M().optional()}),ht=R({messages:L(tt),modelPreferences:je.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:t.optional(),tools:L($e).optional(),toolChoice:Me.optional()}),gt=R({method:U(`sampling/createMessage`),params:ht}),_t=R({method:U(`roots/list`),params:R({_meta:V(M(),I()).optional()}).optional()}),vt=R({...tt.shape,model:M(),stopReason:M().optional()}),yt=R({roots:L(qe)}),bt=R({action:H([`accept`,`decline`,`cancel`]),content:V(M(),B([M(),P(),F(),L(M())])).optional()}),xt=R({mode:U(`url`),message:M(),url:M().url()}),St=B([Ge,xt]),Ct=R({method:U(`elicitation/create`),params:St}),wt=B([gt,_t,Ct]),Tt=B([vt,yt,bt]),Et=V(M(),wt),Dt=V(M(),Tt),Ot=T({inputRequests:Et.optional(),requestState:M().optional()}),kt={inputResponses:Dt.optional(),requestState:M().optional()},At=R({_meta:Qe,...kt}),jt=z({progressToken:n.optional()});function Mt(e,t){return R({method:U(e),params:R({_meta:Qe,...t})})}function Nt(e,t){return R({method:U(e),params:R({_meta:jt.optional(),...t}).optional()})}let Pt={name:M(),arguments:V(M(),I()).optional(),...kt},Ft={cursor:r.optional()},It=Mt(`tools/call`,Pt),Lt=Mt(`tools/list`,Ft),Rt=Mt(`prompts/list`,Ft),zt=Mt(`prompts/get`,{name:M(),arguments:V(M(),M()).optional(),...kt}),Bt=Mt(`resources/list`,Ft),Vt=Mt(`resources/templates/list`,Ft),Ht=Mt(`resources/read`,{uri:M(),...kt}),Ut={ref:B([Ke,x]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()},Wt=Mt(`completion/complete`,Ut),Gt=Mt(`server/discover`,{}),Kt=R({toolsListChanged:F().optional(),promptsListChanged:F().optional(),resourcesListChanged:F().optional(),resourceSubscriptions:L(M()).optional()}),qt={notifications:Kt},Jt=Mt(`subscriptions/listen`,qt),Yt=w.extend({"io.modelcontextprotocol/subscriptionId":i}),Xt=z({_meta:Yt,resultType:C.default(`complete`)}),Zt={"tools/call":Nt(`tools/call`,Pt),"tools/list":Nt(`tools/list`,Ft),"prompts/get":Nt(`prompts/get`,{name:M(),arguments:V(M(),M()).optional()}),"prompts/list":Nt(`prompts/list`,Ft),"resources/list":Nt(`resources/list`,Ft),"resources/templates/list":Nt(`resources/templates/list`,Ft),"resources/read":Nt(`resources/read`,{uri:M()}),"completion/complete":Nt(`completion/complete`,Ut),"server/discover":Nt(`server/discover`,{}),"subscriptions/listen":Nt(`subscriptions/listen`,qt)};function Qt(e){return z({_meta:nt,...e})}let $t={"tools/call":Qt({content:L(b),structuredContent:I().optional(),isError:F().optional()}),"tools/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),tools:L($e),nextCursor:r.optional()}),"prompts/get":Qt({description:M().optional(),messages:L(De)}),"prompts/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),prompts:L(ye),nextCursor:r.optional()}),"resources/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resources:L(y),nextCursor:r.optional()}),"resources/templates/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resourceTemplates:L(me),nextCursor:r.optional()}),"resources/read":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),contents:L(B([fe,pe]))}),"completion/complete":Qt({completion:R({values:L(M()).max(100),total:P().int().optional(),hasMore:F().optional()}).loose()}),"server/discover":Qt({ttlMs:P().int().min(0).catch(0),cacheScope:H([`public`,`private`]).catch(`private`),supportedVersions:L(M()),capabilities:Ze,instructions:M().optional()}),"subscriptions/listen":Qt({})},en=z({"io.modelcontextprotocol/subscriptionId":i.optional()}),tn=R({method:U(`notifications/subscriptions/acknowledged`),params:R({_meta:en.optional(),notifications:Kt})}),nn=R({_meta:en.optional(),requestId:i,reason:M().optional()}),rn=R({method:U(`notifications/cancelled`),params:nn}),an={"notifications/cancelled":rn,"notifications/progress":ce,"notifications/message":ue,"notifications/resources/updated":_e,"notifications/resources/list_changed":he,"notifications/tools/list_changed":ke,"notifications/prompts/list_changed":be,"notifications/subscriptions/acknowledged":tn},E=e=>R({jsonrpc:U(`2.0`),id:B([M(),P().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:b,PromptMessageSchema:De,ToolAnnotationsSchema:Oe,ToolListChangedNotificationSchema:ke,ModelHintSchema:Ae,ModelPreferencesSchema:je,ToolChoiceSchema:Me,BooleanSchemaSchema:Ne,StringSchemaSchema:Pe,NumberSchemaSchema:Fe,UntitledSingleSelectEnumSchemaSchema:Ie,TitledSingleSelectEnumSchemaSchema:Le,LegacyTitledEnumSchemaSchema:Re,SingleSelectEnumSchemaSchema:ze,UntitledMultiSelectEnumSchemaSchema:Be,TitledMultiSelectEnumSchemaSchema:Ve,MultiSelectEnumSchemaSchema:He,EnumSchemaSchema:Ue,PrimitiveSchemaDefinitionSchema:We,ElicitRequestFormParamsSchema:Ge,ResourceTemplateReferenceSchema:x,PromptReferenceSchema:Ke,RootSchema:qe,ClientCapabilities2026Schema:Ye,ServerCapabilities2026Schema:Ze,RequestMetaEnvelopeSchema:Qe,ToolSchema:$e,ToolResultContentSchema:S,SamplingMessageContentBlockSchema:et,SamplingMessageSchema:tt,ResultTypeSchema:C,ResultMetaSchema:w,ResultSchema:rt,PaginatedResultSchema:it,CallToolResultSchema:at,ListToolsResultSchema:ot,ListPromptsResultSchema:st,GetPromptResultSchema:ct,ListResourcesResultSchema:lt,ListResourceTemplatesResultSchema:ut,ReadResourceResultSchema:dt,CompleteResultSchema:ft,CacheableResultSchema:pt,DiscoverResultSchema:mt,CreateMessageRequestParamsSchema:ht,CreateMessageRequestSchema:gt,ListRootsRequestSchema:_t,CreateMessageResultSchema:vt,ListRootsResultSchema:yt,ElicitResultSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,InputRequestSchema:wt,InputResponseSchema:Tt,InputRequestsSchema:Et,InputResponsesSchema:Dt,InputRequiredResultSchema:Ot,InputResponseRequestParamsSchema:At,CallToolRequestSchema:It,ListToolsRequestSchema:Lt,ListPromptsRequestSchema:Rt,GetPromptRequestSchema:zt,ListResourcesRequestSchema:Bt,ListResourceTemplatesRequestSchema:Vt,ReadResourceRequestSchema:Ht,CompleteRequestSchema:Wt,DiscoverRequestSchema:Gt,SubscriptionFilterSchema:Kt,SubscriptionsListenRequestSchema:Jt,SubscriptionsListenResultMetaSchema:Yt,SubscriptionsListenResultSchema:Xt,dispatchRequestSchemas:Zt,dispatchResultSchemas:$t,NotificationMetaSchema:en,SubscriptionsAcknowledgedNotificationSchema:tn,CancelledNotificationParamsSchema:nn,CancelledNotificationSchema:rn,notificationSchemas2026:an,JSONRPCResultResponseSchema:E(rt),CallToolResultResponseSchema:E(B([at,Ot])),ListToolsResultResponseSchema:E(ot),ListPromptsResultResponseSchema:E(st),GetPromptResultResponseSchema:E(B([ct,Ot])),ListResourcesResultResponseSchema:E(lt),ListResourceTemplatesResultResponseSchema:E(ut),ReadResourceResultResponseSchema:E(B([dt,Ot])),CompleteResultResponseSchema:E(ft),DiscoverResultResponseSchema:E(mt)}}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 Ef(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 Ef(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Tf(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:{[il]:t}}:!Sp(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[il]: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":R({method:U(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":R({method:U(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":R({method:U(`roots/list`),params:z({}).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=[nl,al];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{[nl]:e.protocolVersion,[rl]:e.clientInfo,[al]: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(Df.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new X(Df.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(Df.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(Df.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(Df.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(Df.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:()=>nu,AudioContentSchema:()=>Fu,BaseMetadataSchema:()=>jl,BaseRequestParamsSchema:()=>K,BlobResourceContentsSchema:()=>eu,BooleanSchemaSchema:()=>gd,CallToolRequestParamsSchema:()=>Xu,CallToolRequestSchema:()=>Zu,CallToolResultSchema:()=>Ju,CancelTaskRequestSchema:()=>nf,CancelTaskResultSchema:()=>rf,CancelledNotificationParamsSchema:()=>Dl,CancelledNotificationSchema:()=>Ol,ClientCapabilitiesSchema:()=>Il,ClientNotificationSchema:()=>of,ClientRequestSchema:()=>af,ClientResultSchema:()=>sf,ClientTasksCapabilitySchema:()=>Pl,CompatibilityCallToolResultSchema:()=>Yu,CompleteRequestParamsSchema:()=>Ld,CompleteRequestSchema:()=>Rd,CompleteResultSchema:()=>zd,ContentBlockSchema:()=>zu,CreateMessageRequestParamsSchema:()=>fd,CreateMessageRequestSchema:()=>pd,CreateMessageResultSchema:()=>md,CreateMessageResultWithToolsSchema:()=>hd,CreateTaskResultSchema:()=>qd,CursorSchema:()=>dl,DiscoverRequestSchema:()=>Hl,DiscoverResultSchema:()=>Ul,ElicitRequestFormParamsSchema:()=>Od,ElicitRequestParamsSchema:()=>Ad,ElicitRequestSchema:()=>jd,ElicitRequestURLParamsSchema:()=>kd,ElicitResultSchema:()=>Pd,ElicitationCompleteNotificationParamsSchema:()=>Md,ElicitationCompleteNotificationSchema:()=>Nd,EmbeddedResourceSchema:()=>Lu,EmptyResultSchema:()=>El,EnumSchemaSchema:()=>Ed,GetPromptRequestParamsSchema:()=>ju,GetPromptRequestSchema:()=>Mu,GetPromptResultSchema:()=>Vu,GetTaskPayloadRequestSchema:()=>Qd,GetTaskPayloadResultSchema:()=>$d,GetTaskRequestSchema:()=>Xd,GetTaskResultSchema:()=>Zd,IconSchema:()=>kl,IconsSchema:()=>Al,ImageContentSchema:()=>Pu,ImplementationSchema:()=>Ml,InitializeRequestParamsSchema:()=>Ll,InitializeRequestSchema:()=>Rl,InitializeResultSchema:()=>Bl,InitializedNotificationSchema:()=>Vl,JSONArraySchema:()=>ll,JSONObjectSchema:()=>G,JSONRPCErrorResponseSchema:()=>Cl,JSONRPCMessageSchema:()=>wl,JSONRPCNotificationSchema:()=>xl,JSONRPCRequestSchema:()=>bl,JSONRPCResponseSchema:()=>Tl,JSONRPCResultResponseSchema:()=>Sl,JSONValueSchema:()=>cl,LegacyTitledEnumSchemaSchema:()=>xd,ListChangedOptionsBaseSchema:()=>$u,ListPromptsRequestSchema:()=>ku,ListPromptsResultSchema:()=>Au,ListResourceTemplatesRequestSchema:()=>su,ListResourceTemplatesResultSchema:()=>cu,ListResourcesRequestSchema:()=>au,ListResourcesResultSchema:()=>ou,ListRootsRequestSchema:()=>Vd,ListRootsResultSchema:()=>Hd,ListTasksRequestSchema:()=>ef,ListTasksResultSchema:()=>tf,ListToolsRequestSchema:()=>Ku,ListToolsResultSchema:()=>qu,LoggingLevelSchema:()=>ed,LoggingMessageNotificationParamsSchema:()=>rd,LoggingMessageNotificationSchema:()=>id,ModelHintSchema:()=>ad,ModelPreferencesSchema:()=>od,MultiSelectEnumSchemaSchema:()=>Td,NotificationSchema:()=>_l,NotificationsParamsSchema:()=>gl,NumberSchemaSchema:()=>vd,PaginatedRequestParamsSchema:()=>Jl,PaginatedRequestSchema:()=>Yl,PaginatedResultSchema:()=>Xl,PingRequestSchema:()=>Wl,PrimitiveSchemaDefinitionSchema:()=>Dd,ProgressNotificationParamsSchema:()=>Kl,ProgressNotificationSchema:()=>ql,ProgressSchema:()=>Gl,ProgressTokenSchema:()=>ul,PromptArgumentSchema:()=>Du,PromptListChangedNotificationSchema:()=>Hu,PromptMessageSchema:()=>Bu,PromptReferenceSchema:()=>Id,PromptSchema:()=>Ou,ReadResourceRequestParamsSchema:()=>uu,ReadResourceRequestSchema:()=>du,ReadResourceResultSchema:()=>fu,RelatedTaskMetadataSchema:()=>pl,RequestIdSchema:()=>yl,RequestMetaSchema:()=>ml,RequestSchema:()=>q,ResourceContentsSchema:()=>Zl,ResourceLinkSchema:()=>Ru,ResourceListChangedNotificationSchema:()=>pu,ResourceRequestParamsSchema:()=>lu,ResourceSchema:()=>ru,ResourceTemplateReferenceSchema:()=>Fd,ResourceTemplateSchema:()=>iu,ResourceUpdatedNotificationParamsSchema:()=>Tu,ResourceUpdatedNotificationSchema:()=>Eu,ResultMetaObjectSchema:()=>vl,ResultSchema:()=>J,RoleSchema:()=>tu,RootSchema:()=>Bd,RootsListChangedNotificationSchema:()=>Ud,SamplingContentSchema:()=>ld,SamplingMessageContentBlockSchema:()=>ud,SamplingMessageSchema:()=>dd,ServerCapabilitiesSchema:()=>zl,ServerNotificationSchema:()=>lf,ServerRequestSchema:()=>cf,ServerResultSchema:()=>uf,ServerTasksCapabilitySchema:()=>Fl,SetLevelRequestParamsSchema:()=>td,SetLevelRequestSchema:()=>nd,SingleSelectEnumSchemaSchema:()=>Sd,StringSchemaSchema:()=>_d,SubscribeRequestParamsSchema:()=>mu,SubscribeRequestSchema:()=>hu,SubscriptionFilterSchema:()=>vu,SubscriptionsAcknowledgedNotificationParamsSchema:()=>xu,SubscriptionsAcknowledgedNotificationSchema:()=>Su,SubscriptionsListenRequestParamsSchema:()=>yu,SubscriptionsListenRequestSchema:()=>bu,SubscriptionsListenResultMetaSchema:()=>Cu,SubscriptionsListenResultSchema:()=>wu,TaskAugmentedRequestParamsSchema:()=>hl,TaskCreationParamsSchema:()=>Wd,TaskMetadataSchema:()=>fl,TaskSchema:()=>Kd,TaskStatusNotificationParamsSchema:()=>Jd,TaskStatusNotificationSchema:()=>Yd,TaskStatusSchema:()=>Gd,TextContentSchema:()=>Nu,TextResourceContentsSchema:()=>Ql,TitledMultiSelectEnumSchemaSchema:()=>wd,TitledSingleSelectEnumSchemaSchema:()=>bd,ToolAnnotationsSchema:()=>Uu,ToolChoiceSchema:()=>sd,ToolExecutionSchema:()=>Wu,ToolListChangedNotificationSchema:()=>Qu,ToolResultContentSchema:()=>cd,ToolSchema:()=>Gu,ToolUseContentSchema:()=>Iu,UnsubscribeRequestParamsSchema:()=>gu,UnsubscribeRequestSchema:()=>_u,UntitledMultiSelectEnumSchemaSchema:()=>Cd,UntitledSingleSelectEnumSchemaSchema:()=>yd}),nm=e=>bl.safeParse(e).success,rm=e=>xl.safeParse(e).success,im=e=>Sl.safeParse(e).success,am=e=>Cl.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 hs(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=ls(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=ls(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=>Zc({local:e,offset:t,precision:n}))))}function vm(e,t){let n;switch(e){case`email`:n=[Ps()];break;case`uri`:n=[Rs()];break;case`date`:n=[Qc()];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(Od.shape.requestedSchema.shape)]),Tm={string:sm([_d,yd,bd,xd]),number:sm([vd]),integer:sm([vd]),boolean:sm([gd]),array:sm([Cd,wd])},Em=new Set(_d.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(Dd,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(Od.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:gf,OAuthClientInformationFullSchema:xf,OAuthClientInformationSchema:bf,OAuthClientMetadataSchema:yf,OAuthClientRegistrationErrorSchema:Sf,OAuthErrorResponseSchema:_f,OAuthMetadataSchema:ff,OAuthProtectedResourceMetadataSchema:df,OAuthTokenRevocationRequestSchema:Cf,OAuthTokensSchema:hf,OpenIdProviderDiscoveryMetadataSchema:mf,OpenIdProviderMetadataSchema:pf},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=[nl,rl,al,sl],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??el,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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.NotConnected,`Not connected`);if($p(t.method)&&!e.hasNotificationMethod(t.method))throw new X(Df.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 Ef(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 Ef(this,e)}constructor(e){super(e),this.name=new.target.name,Tf(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 Ef(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 Ef(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Tf(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Ef(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 Ef(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Tf(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=wl.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=B([U(`light`),U(`dark`)]).describe(`Color theme preference for the host environment.`),vh=B([U(`inline`),U(`fullscreen`),U(`pip`)]).describe(`Display mode for UI presentation.`),yh=V(B([U(`--color-background-primary`),U(`--color-background-secondary`),U(`--color-background-tertiary`),U(`--color-background-inverse`),U(`--color-background-ghost`),U(`--color-background-info`),U(`--color-background-danger`),U(`--color-background-success`),U(`--color-background-warning`),U(`--color-background-disabled`),U(`--color-text-primary`),U(`--color-text-secondary`),U(`--color-text-tertiary`),U(`--color-text-inverse`),U(`--color-text-ghost`),U(`--color-text-info`),U(`--color-text-danger`),U(`--color-text-success`),U(`--color-text-warning`),U(`--color-text-disabled`),U(`--color-border-primary`),U(`--color-border-secondary`),U(`--color-border-tertiary`),U(`--color-border-inverse`),U(`--color-border-ghost`),U(`--color-border-info`),U(`--color-border-danger`),U(`--color-border-success`),U(`--color-border-warning`),U(`--color-border-disabled`),U(`--color-ring-primary`),U(`--color-ring-secondary`),U(`--color-ring-inverse`),U(`--color-ring-info`),U(`--color-ring-danger`),U(`--color-ring-success`),U(`--color-ring-warning`),U(`--font-sans`),U(`--font-mono`),U(`--font-weight-normal`),U(`--font-weight-medium`),U(`--font-weight-semibold`),U(`--font-weight-bold`),U(`--font-text-xs-size`),U(`--font-text-sm-size`),U(`--font-text-md-size`),U(`--font-text-lg-size`),U(`--font-heading-xs-size`),U(`--font-heading-sm-size`),U(`--font-heading-md-size`),U(`--font-heading-lg-size`),U(`--font-heading-xl-size`),U(`--font-heading-2xl-size`),U(`--font-heading-3xl-size`),U(`--font-text-xs-line-height`),U(`--font-text-sm-line-height`),U(`--font-text-md-line-height`),U(`--font-text-lg-line-height`),U(`--font-heading-xs-line-height`),U(`--font-heading-sm-line-height`),U(`--font-heading-md-line-height`),U(`--font-heading-lg-line-height`),U(`--font-heading-xl-line-height`),U(`--font-heading-2xl-line-height`),U(`--font-heading-3xl-line-height`),U(`--border-radius-xs`),U(`--border-radius-sm`),U(`--border-radius-md`),U(`--border-radius-lg`),U(`--border-radius-xl`),U(`--border-radius-full`),U(`--border-width-regular`),U(`--shadow-hairline`),U(`--shadow-sm`),U(`--shadow-md`),U(`--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 Ga(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;Ga(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 Ka=new Set([`type`,`properties`,`required`,`additionalProperties`]),qa=[`oneOf`,`anyOf`];function Ja(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Ya(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ka.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]??Ja(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}h(n,r,e.length===1?e[0]:Ya(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=Ja(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 Xa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ka)if(t in e)return;let n=t.filter(e=>qa.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Ya(t);else{let e=n[0],i=qa.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=>Ya([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Va(e,r))}function Za(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)):Va(i,s),Va(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())Ga(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)??[])Xa(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)}Va(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:eo(t,`input`,e.processors),output:eo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Qa(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 Qa(r.element,n);if(r.type===`set`)return Qa(r.valueType,n);if(r.type===`lazy`)return Qa(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 Qa(r.innerType,n);if(r.type===`intersection`)return Qa(r.left,n)||Qa(r.right,n);if(r.type===`record`||r.type===`map`)return Qa(r.keyType,n)||Qa(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Qa(r.in,n)||Qa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Qa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Qa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Qa(e,n))return!0;return!!(r.rest&&Qa(r.rest,n))}return!1}var $a=(e,t={})=>n=>{let r=Ha({...n,processors:t});return A(e,r),Wa(r,e),Za(r,e)},eo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ha({...i??{},target:a,io:t,processors:n});return A(e,o),Wa(o,e),Za(o,e)},to=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},no=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},ro=(e,t)=>{to(e,`minimum`,t),no(e,`maximum`,t)},io=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ao=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},oo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},so=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},co=(e,t)=>to(e,`minimum`,t.minimum),lo=(e,t)=>no(e,`maximum`,t.maximum),uo=e=>(t,n)=>{so(t,n.format);let[r,i]=e[n.format];to(t,`minimum`,r),no(t,`maximum`,i)},fo={greater_than:(e,t)=>to(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>no(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>io(e,t.value),number_format:uo(ge),bigint_format:uo(_e),min_length:co,max_length:lo,length_equals:(e,t)=>ro(e,t.length),min_size:co,max_size:lo,size_equals:(e,t)=>ro(e,t.size),string_format:(e,t)=>{so(e,t.format),t.pattern&&ao(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)=>oo(e,t.mime)};function po(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)fo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&to(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&to(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&no(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&no(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&io(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&oo(t,i.mime);for(let e of i.patterns??[])ao(t,e);return t}var mo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ho=new Map([[dr,qt],[pr,Jt]]),go=e=>ho.get(e)??e,_o=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=po(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mo[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(go);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}))])}},vo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=po(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)):k(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}))])}},yo=(e,t,n,r)=>{n.type=`boolean`},bo=(e,t,n,r)=>{k(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},xo=(e,t,n,r)=>{k(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},So=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Co=(e,t,n,r)=>{k(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{k(e,t,n,r,`Void cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{n.not={}},Eo=(e,t,n,r)=>{},Do=(e,t,n,r)=>{},Oo=(e,t,n,r)=>{k(e,t,n,r,`Date cannot be represented in JSON Schema`)},ko=(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},Ao=(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(k(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(k(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}},jo=(e,t,n,r)=>{k(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Mo=(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},No=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=po(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})))},Po=(e,t,n,r)=>{n.type=`boolean`},Fo=(e,t,n,r)=>{k(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Io=(e,t,n,r)=>{k(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Lo=(e,t,n,r)=>{k(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ro=(e,t,n,r)=>{k(e,t,n,r,`Map cannot be represented in JSON Schema`)},zo=(e,t,n,r)=>{k(e,t,n,r,`Set cannot be represented in JSON Schema`)},Bo=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=po(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=A(a.element,t,{...r,path:[...r.path,`items`]})};function Vo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Vo(t.out):t.type===`catch`?Vo(t.innerType):e._zod.optin}var Ho=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&k(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,A(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`?Vo(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=A(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Uo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>A(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Wo=(e,t,n,r)=>{let i=e._zod.def,a=A(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=A(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)},Go=(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)=>A(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?A(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`?Vo(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}=po(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Ko(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=Ko(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=>Ko(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`)?E:an).source),p):p}var qo=new WeakMap;function Jo(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 qo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ko(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 Yo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=po(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=A(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)h(i.patternProperties,go(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=A(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=qo.get(t);n||(n=[],qo.set(t,n),t.deferred.push(()=>Jo(t))),n.push(e)}i.additionalProperties=A(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Vo(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))}},Xo=(e,t,n,r)=>{let i=e._zod.def,a=A(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`}]},Zo=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Qo=Symbol();function $o(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(k(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Qo):JSON.parse(o)}var es=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=$o(i.defaultValue,e,t,n,r);o!==Qo&&(n.default=o)},ts=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=$o(i.defaultValue,e,t,n,r);o!==Qo&&(n._prefault=o)},ns=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{k(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},rs=(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;A(o,t,r);let s=t.seen.get(e);s.ref=o},is=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},as=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},os=(e,t,n,r)=>{let i=e._zod.def;A(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ss=(e,t,n,r)=>{let i=e._zod.innerType;A(i,t,r);let a=t.seen.get(e);a.ref=i},cs={string:_o,number:vo,boolean:yo,bigint:bo,symbol:xo,null:So,undefined:Co,void:wo,never:To,any:Eo,unknown:Do,date:Oo,enum:ko,literal:Ao,nan:jo,template_literal:Mo,file:No,success:Po,custom:Fo,function:Io,transform:Lo,map:Ro,set:zo,array:Bo,object:Ho,union:Uo,intersection:Wo,tuple:Go,record:Yo,nullable:Xo,nonoptional:Zo,default:es,prefault:ts,catch:ns,pipe:rs,readonly:is,promise:as,optional:os,lazy:ss};function ls(e,t){if(`_idmap`in e){let n=e,r=Ha({...t,processors:cs}),i={};for(let e of n._idmap.entries()){let[t,n]=e;A(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Wa(r,n),h(a,t,Za(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=Ha({...t,processors:cs});return A(e,n),Wa(n,e),Za(n,e)}var us=new WeakSet([Object.prototype,Error.prototype]);function ds(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 fs=S(`ZodError`,(e,t)=>{st.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);us.has(n)||(us.add(n),ds(n,`format`,e=>t=>ut(e,t)),ds(n,`flatten`,e=>t=>lt(e,t)),ds(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,s,2)}),ds(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}),ps=ft(fs),ms=pt(fs),hs=mt(fs),gs=gt(fs),_s=St(fs),vs=Ct(fs),ys=wt(fs),bs=Tt(fs),xs=Et(fs),Ss=Dt(fs),Cs=Ot(fs),ws=kt(fs);function Ts(){C.localeError||w(ki())}function Es(){C.memoizer||w({memoizer:Ei()})}var j=S(`ZodType`,(e,t)=>(Ts(),D.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(Kc(e,t))},superRefine(e,t){return this.check(qc(e,t))},overwrite(e){return this.check(ja(e))},optional(){return W(this)},exactOptional(){return Dc(this)},nullable(){return kc(this)},nullish(){return W(kc(this))},nonoptional(e){return Fc(this,e)},array(){return L(this)},or(e){return B([this,e])},and(e){return yc(this,e)},transform(e){return zc(this,wc(e))},default(e){return jc(this,e)},prefault(e){return Nc(this,e)},catch(e){return Lc(this,e)},pipe(e){return zc(this,e)},readonly(){return Hc(this)},describe(e){let t=this.clone();return Ni.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ni.get(this);let t=this.clone();return Ni.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 ze(this,`~standard`,{...Nn(this),jsonSchema:{input:eo(this,`input`),output:eo(this,`output`)}})},set"~standard"(e){Re(this,`~standard`,e)},parse:function e(t,n){return ps(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ms(this,t,n,{callee:e})},safeParse(e,t){return hs(this,e,t)},async safeParseAsync(e,t){return gs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Re(this,`spa`,e)},validate(e,t){return yt(this,e,t)},validateAsync(e,t){return xt(this,e,t)},encode:function e(t,n){return _s(this,t,n,{callee:e})},decode:function e(t,n){return vs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ys(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await bs(this,t,n,{callee:e})},safeEncode(e,t){return xs(this,e,t)},safeDecode(e,t){return Ss(this,e,t)},async safeEncodeAsync(e,t){return Cs(this,e,t)},async safeDecodeAsync(e,t){return ws(this,e,t)},toJSONSchema(e){return $a(this,{})(e)},get description(){return Ni.get(this)?.description},get _def(){return this._zod.def}}),Ds=S(`_ZodString`,(e,t)=>{Pn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_o(e,t,n,r)},Be({format:e=>po(e).format??null,minLength:e=>po(e).minimum??null,maxLength:e=>po(e).maximum??null},{regex(...e){return this.check(Ta(...e))},includes(...e){return this.check(Oa(...e))},startsWith(...e){return this.check(ka(...e))},endsWith(...e){return this.check(Aa(...e))},min(...e){return this.check(Ca(...e))},max(...e){return this.check(Sa(...e))},length(...e){return this.check(wa(...e))},nonempty(...e){return this.check(Ca(1,...e))},lowercase(e){return this.check(Ea(e))},uppercase(e){return this.check(Da(e))},trim(){return this.check(Na())},normalize(...e){return this.check(Ma(...e))},toLowerCase(){return this.check(Pa())},toUpperCase(){return this.check(Fa())},slugify(){return this.check(Ia())}})),Os=S(`ZodString`,(e,t)=>{Pn.init(e,t),Ds.init(e,t)},{email(e){return this.check(Ii(Ns,e))},url(e){return this.check(Hi(Ls,e))},jwt(e){return this.check(ra($s,e))},emoji(e){return this.check(Ui(zs,e))},guid(e){return this.check(Li(Fs,e))},uuid(e){return this.check(Ri(Is,e))},uuidv4(e){return this.check(zi(Is,e))},uuidv6(e){return this.check(Bi(Is,e))},uuidv7(e){return this.check(Vi(Is,e))},nanoid(e){return this.check(Wi(Bs,e))},cuid(e){return this.check(Gi(Vs,e))},cuid2(e){return this.check(Ki(Hs,e))},ulid(e){return this.check(qi(Us,e))},base64(e){return this.check(ea(Xs,e))},base64url(e){return this.check(ta(Zs,e))},xid(e){return this.check(Ji(Ws,e))},ksuid(e){return this.check(Yi(Gs,e))},ipv4(e){return this.check(Xi(Ks,e))},ipv6(e){return this.check(Zi(qs,e))},cidrv4(e){return this.check(Qi(Js,e))},cidrv6(e){return this.check($i(Ys,e))},e164(e){return this.check(na(Qs,e))},datetime(e){return this.check(ia(ks,e))},date(e){return this.check(aa(As,e))},time(e){return this.check(oa(js,e))},duration(e){return this.check(sa(Ms,e))}});function M(e){return Fi(Os,e)}var N=S(`ZodStringFormat`,(e,t)=>{O.init(e,t),Ds.init(e,t)}),ks=S(`ZodISODateTime`,(e,t)=>{$n.init(e,t),N.init(e,t)}),As=S(`ZodISODate`,(e,t)=>{er.init(e,t),N.init(e,t)}),js=S(`ZodISOTime`,(e,t)=>{tr.init(e,t),N.init(e,t)}),Ms=S(`ZodISODuration`,(e,t)=>{nr.init(e,t),N.init(e,t)}),Ns=S(`ZodEmail`,(e,t)=>{Ln.init(e,t),N.init(e,t)});function Ps(e){return Ii(Ns,e)}var Fs=S(`ZodGUID`,(e,t)=>{Fn.init(e,t),N.init(e,t)}),Is=S(`ZodUUID`,(e,t)=>{In.init(e,t),N.init(e,t)}),Ls=S(`ZodURL`,(e,t)=>{Gn.init(e,t),N.init(e,t)});function Rs(e){return Hi(Ls,e)}var zs=S(`ZodEmoji`,(e,t)=>{Kn.init(e,t),N.init(e,t)}),Bs=S(`ZodNanoID`,(e,t)=>{qn.init(e,t),N.init(e,t)}),Vs=S(`ZodCUID`,(e,t)=>{Jn.init(e,t),N.init(e,t)}),Hs=S(`ZodCUID2`,(e,t)=>{Yn.init(e,t),N.init(e,t)}),Us=S(`ZodULID`,(e,t)=>{Xn.init(e,t),N.init(e,t)}),Ws=S(`ZodXID`,(e,t)=>{Zn.init(e,t),N.init(e,t)}),Gs=S(`ZodKSUID`,(e,t)=>{Qn.init(e,t),N.init(e,t)}),Ks=S(`ZodIPv4`,(e,t)=>{rr.init(e,t),N.init(e,t)}),qs=S(`ZodIPv6`,(e,t)=>{or.init(e,t),N.init(e,t)}),Js=S(`ZodCIDRv4`,(e,t)=>{sr.init(e,t),N.init(e,t)}),Ys=S(`ZodCIDRv6`,(e,t)=>{lr.init(e,t),N.init(e,t)}),Xs=S(`ZodBase64`,(e,t)=>{fr.init(e,t),N.init(e,t)}),Zs=S(`ZodBase64URL`,(e,t)=>{hr.init(e,t),N.init(e,t)}),Qs=S(`ZodE164`,(e,t)=>{gr.init(e,t),N.init(e,t)}),$s=S(`ZodJWT`,(e,t)=>{vr.init(e,t),N.init(e,t)}),ec=S(`ZodNumber`,(e,t)=>{yr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r),e.isFinite=!0},Be({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=po(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=po(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=po(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>po(e).format??null},{gt(e,t){return this.check(ya(e,t))},gte(e,t){return this.check(ba(e,t))},min(e,t){return this.check(ba(e,t))},lt(e,t){return this.check(_a(e,t))},lte(e,t){return this.check(va(e,t))},max(e,t){return this.check(va(e,t))},int(e){return this.check(nc(e))},safe(e){return this.check(nc(e))},positive(e){return this.check(ya(0,e))},nonnegative(e){return this.check(ba(0,e))},negative(e){return this.check(_a(0,e))},nonpositive(e){return this.check(va(0,e))},multipleOf(e,t){return this.check(xa(e,t))},step(e,t){return this.check(xa(e,t))},finite(){return this}}));function P(e){return ca(ec,e)}var tc=S(`ZodNumberFormat`,(e,t)=>{br.init(e,t),ec.init(e,t)});function nc(e){return ua(tc,e)}var rc=S(`ZodBoolean`,(e,t)=>{xr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r)});function F(e){return da(rc,e)}var ic=S(`ZodUndefined`,(e,t)=>{Sr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function ac(e){return fa(ic,e)}var oc=S(`ZodNull`,(e,t)=>{Cr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r)});function sc(e){return pa(oc,e)}var cc=S(`ZodAny`,(e,t)=>{wr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function lc(){return ma(cc)}var uc=S(`ZodUnknown`,(e,t)=>{Tr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function I(){return ha(uc)}var dc=S(`ZodNever`,(e,t)=>{Er.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r)});function fc(e){return ga(dc,e)}var pc=S(`ZodArray`,(e,t)=>{Es(),Or.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ca(e,t))},nonempty(e){return this.check(Ca(1,e))},max(e,t){return this.check(Sa(e,t))},length(e,t){return this.check(wa(e,t))},unwrap(){return this.element}});function L(e,t){return La(pc,e,t)}var mc=S(`ZodObject`,(e,t)=>{Es(),Pr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),Ke(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return H(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(_(this._zod.def,{catchall:e}))},passthrough(){return this.clone(_(this._zod.def,{catchall:I()}))},loose(){return this.clone(_(this._zod.def,{catchall:I()}))},strict(){return this.clone(_(this._zod.def,{catchall:fc()}))},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(Tc,this,e[0])},exactPartial(...e){return Te(Ec,this,e[0],`exactPartial`)},required(...e){return Ee(Pc,this,e[0])}});function R(e,t){return new mc({type:`object`,shape:e??{},...y(t)})}function z(e,t){return new mc({type:`object`,shape:e,catchall:I(),...y(t)})}var hc=S(`ZodUnion`,(e,t)=>{Ir.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uo(e,t,n,r),e.options=t.options});function B(e,t){return new hc({type:`union`,options:e,...y(t)})}var gc=S(`ZodDiscriminatedUnion`,(e,t)=>{hc.init(e,t),Rr.init(e,t)});function _c(e,t,n){return new gc({type:`union`,options:t,discriminator:e,...y(n)})}var vc=S(`ZodIntersection`,(e,t)=>{zr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r)});function yc(e,t){return new vc({type:`intersection`,left:e,right:t})}var bc=S(`ZodRecord`,(e,t)=>{Es(),Hr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new bc({type:`record`,keyType:M(),valueType:e,...y(t)}):new bc({type:`record`,keyType:e,valueType:t,...y(n)})}var xc=S(`ZodEnum`,(e,t)=>{Ur.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(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 xc({...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 xc({...t,checks:[],...y(r),entries:i})}});function H(e,t){return new xc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...y(t)})}var Sc=S(`ZodLiteral`,(e,t)=>{Wr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(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 U(e,t){return new Sc({type:`literal`,values:Array.isArray(e)?e:[e],...y(t)})}var Cc=S(`ZodTransform`,(e,t)=>{Es(),Gr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new tt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ie(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(Ie(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function wc(e){return new Cc({type:`transform`,transform:e})}var Tc=S(`ZodOptional`,(e,t)=>{qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function W(e){return new Tc({type:`optional`,innerType:e})}var Ec=S(`ZodExactOptional`,(e,t)=>{Jr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dc(e){return new Ec({type:`optional`,innerType:e})}var Oc=S(`ZodNullable`,(e,t)=>{Yr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kc(e){return new Oc({type:`nullable`,innerType:e})}var Ac=S(`ZodDefault`,(e,t)=>{Xr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jc(e,t){return new Ac({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Mc=S(`ZodPrefault`,(e,t)=>{Qr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ts(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nc(e,t){return new Mc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():de(t)}})}var Pc=S(`ZodNonOptional`,(e,t)=>{$r.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fc(e,t){return new Pc({type:`nonoptional`,innerType:e,...y(t)})}var Ic=S(`ZodCatch`,(e,t)=>{ni.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Lc(e,t){return new Ic({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Je(t)})}var Rc=S(`ZodPipe`,(e,t)=>{ri.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rs(e,t,n,r),e.in=t.in,e.out=t.out});function zc(e,t){return new Rc({type:`pipe`,in:e,out:t})}var Bc=S(`ZodPreprocess`,(e,t)=>{Rc.init(e,t),ai.init(e,t)}),Vc=S(`ZodReadonly`,(e,t)=>{oi.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>is(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Vc({type:`readonly`,innerType:e})}var Uc=S(`ZodLazy`,(e,t)=>{ci.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ss(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Wc(e){return new Uc({type:`lazy`,getter:e})}var Gc=S(`ZodCustom`,(e,t)=>{li.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r)});function Kc(e,t={}){return Ra(Gc,e,t)}function qc(e,t){return za(e,t)}function Jc(e,t){return new Bc({type:`pipe`,in:wc(e),out:t})}var Yc={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`},Xc;Xc||={};function Zc(e){return ia(ks,e)}function Qc(e){return aa(As,e)}function $c(e){return la(ec,e)}var el=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],tl=`io.modelcontextprotocol/related-task`,nl=`io.modelcontextprotocol/protocolVersion`,rl=`io.modelcontextprotocol/clientInfo`,il=`io.modelcontextprotocol/serverInfo`,al=`io.modelcontextprotocol/clientCapabilities`,ol=`io.modelcontextprotocol/subscriptionId`,sl=`io.modelcontextprotocol/logLevel`,cl=Wc(()=>B([M(),P(),F(),sc(),V(M(),cl),L(cl)])),G=V(M(),cl),ll=L(cl),ul=B([M(),P().int()]),dl=M(),fl=R({ttl:P().optional()}),pl=R({taskId:M()}),ml=z({progressToken:ul.optional(),[tl]:pl.optional()}),K=R({_meta:ml.optional()}),hl=K.extend({task:fl.optional()}),q=R({method:M(),params:K.loose().optional()}),gl=R({_meta:ml.optional()}),_l=R({method:M(),params:gl.loose().optional()}),vl=z({get[il](){return Ml.optional().catch(void 0)}}),J=z({_meta:vl.optional()}),yl=B([M(),P().int()]),bl=R({jsonrpc:U(`2.0`),id:yl,...q.shape}).strict(),xl=R({jsonrpc:U(`2.0`),..._l.shape}).strict(),Sl=R({jsonrpc:U(`2.0`),id:yl,result:J}).strict(),Cl=R({jsonrpc:U(`2.0`),id:yl.optional(),error:R({code:P().int(),message:M(),data:I().optional()})}).strict(),wl=B([bl,xl,Sl,Cl]),Tl=B([Sl,Cl]),El=J.strict(),Dl=gl.extend({requestId:yl.optional(),reason:M().optional()}),Ol=_l.extend({method:U(`notifications/cancelled`),params:Dl}),kl=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),Al=R({icons:L(kl).optional()}),jl=R({name:M(),title:M().optional()}),Ml=jl.extend({...jl.shape,...Al.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),Nl=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),G).optional(),url:G.optional()}),G.optional())),Pl=z({list:G.optional(),cancel:G.optional(),requests:z({sampling:z({createMessage:G.optional()}).optional(),elicitation:z({create:G.optional()}).optional()}).optional()}),Fl=z({list:G.optional(),cancel:G.optional(),requests:z({tools:z({call:G.optional()}).optional()}).optional()}),Il=R({experimental:V(M(),G).optional(),sampling:R({context:G.optional(),tools:G.optional()}).optional(),elicitation:Nl.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:Pl.optional(),extensions:V(M(),G).optional()}),Ll=K.extend({protocolVersion:M(),capabilities:Il,clientInfo:Ml}),Rl=q.extend({method:U(`initialize`),params:Ll}),zl=R({experimental:V(M(),G).optional(),logging:G.optional(),completions:G.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:Fl.optional(),extensions:V(M(),G).optional()}),Bl=J.extend({protocolVersion:M(),capabilities:zl,serverInfo:Ml,instructions:M().optional()}),Vl=_l.extend({method:U(`notifications/initialized`),params:gl.optional()}),Hl=q.extend({method:U(`server/discover`),params:K.optional()}),Ul=J.extend({supportedVersions:L(M()),capabilities:zl,instructions:M().optional()}),Wl=q.extend({method:U(`ping`),params:K.optional()}),Gl=R({progress:P(),total:W(P()),message:W(M())}),Kl=R({...gl.shape,...Gl.shape,progressToken:ul}),ql=_l.extend({method:U(`notifications/progress`),params:Kl}),Jl=K.extend({cursor:dl.optional()}),Yl=q.extend({params:Jl.optional()}),Xl=J.extend({nextCursor:dl.optional()}),Zl=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),Ql=Zl.extend({text:M()}),$l=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),eu=Zl.extend({blob:$l}),tu=H([`user`,`assistant`]),nu=R({audience:L(tu).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),ru=R({...jl.shape,...Al.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:nu.optional(),_meta:W(z({}))}),iu=R({...jl.shape,...Al.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:nu.optional(),_meta:W(z({}))}),au=Yl.extend({method:U(`resources/list`)}),ou=Xl.extend({resources:L(ru)}),su=Yl.extend({method:U(`resources/templates/list`)}),cu=Xl.extend({resourceTemplates:L(iu)}),lu=K.extend({uri:M()}),uu=lu,du=q.extend({method:U(`resources/read`),params:uu}),fu=J.extend({contents:L(B([Ql,eu]))}),pu=_l.extend({method:U(`notifications/resources/list_changed`),params:gl.optional()}),mu=lu,hu=q.extend({method:U(`resources/subscribe`),params:mu}),gu=lu,_u=q.extend({method:U(`resources/unsubscribe`),params:gu}),vu=R({toolsListChanged:F().optional(),promptsListChanged:F().optional(),resourcesListChanged:F().optional(),resourceSubscriptions:L(M()).optional()}),yu=K.extend({notifications:vu}),bu=q.extend({method:U(`subscriptions/listen`),params:yu}),xu=gl.extend({notifications:vu}),Su=_l.extend({method:U(`notifications/subscriptions/acknowledged`),params:xu}),Cu=vl.extend({[ol]:yl}),wu=J.extend({_meta:Cu}),Tu=gl.extend({uri:M()}),Eu=_l.extend({method:U(`notifications/resources/updated`),params:Tu}),Du=R({name:M(),description:W(M()),required:W(F())}),Ou=R({...jl.shape,...Al.shape,description:W(M()),arguments:W(L(Du)),_meta:W(z({}))}),ku=Yl.extend({method:U(`prompts/list`)}),Au=Xl.extend({prompts:L(Ou)}),ju=K.extend({name:M(),arguments:V(M(),M()).optional()}),Mu=q.extend({method:U(`prompts/get`),params:ju}),Nu=R({type:U(`text`),text:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Pu=R({type:U(`image`),data:$l,mimeType:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Fu=R({type:U(`audio`),data:$l,mimeType:M(),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Iu=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Lu=R({type:U(`resource`),resource:B([Ql,eu]),annotations:nu.optional(),_meta:V(M(),I()).optional()}),Ru=ru.extend({type:U(`resource_link`)}),zu=B([Nu,Pu,Fu,Ru,Lu]),Bu=R({role:tu,content:zu}),Vu=J.extend({description:M().optional(),messages:L(Bu)}),Hu=_l.extend({method:U(`notifications/prompts/list_changed`),params:gl.optional()}),Uu=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),Wu=R({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),Gu=R({...jl.shape,...Al.shape,description:M().optional(),inputSchema:R({type:U(`object`),properties:V(M(),cl).optional(),required:L(M()).optional()}).catchall(I()),outputSchema:z({$schema:M().optional()}).optional(),annotations:Uu.optional(),execution:Wu.optional(),_meta:V(M(),I()).optional()}),Ku=Yl.extend({method:U(`tools/list`)}),qu=Xl.extend({tools:L(Gu)}),Ju=J.extend({content:L(zu).default([]),structuredContent:I().optional(),isError:F().optional()}),Yu=Ju.or(J.extend({toolResult:I()})),Xu=hl.extend({name:M(),arguments:V(M(),I()).optional()}),Zu=q.extend({method:U(`tools/call`),params:Xu}),Qu=_l.extend({method:U(`notifications/tools/list_changed`),params:gl.optional()}),$u=R({autoRefresh:F().default(!0),debounceMs:P().int().nonnegative().default(300)}),ed=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),td=K.extend({level:ed}),nd=q.extend({method:U(`logging/setLevel`),params:td}),rd=gl.extend({level:ed,logger:M().optional(),data:I()}),id=_l.extend({method:U(`notifications/message`),params:rd}),ad=R({name:M().optional()}),od=R({hints:L(ad).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),sd=R({mode:H([`auto`,`required`,`none`]).optional()}),cd=R({type:U(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:L(zu),structuredContent:I().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),ld=_c(`type`,[Nu,Pu,Fu]),ud=_c(`type`,[Nu,Pu,Fu,Iu,cd]),dd=R({role:tu,content:B([ud,L(ud)]),_meta:V(M(),I()).optional()}),fd=hl.extend({messages:L(dd),modelPreferences:od.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:G.optional(),tools:L(Gu).optional(),toolChoice:sd.optional()}),pd=q.extend({method:U(`sampling/createMessage`),params:fd}),md=J.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:tu,content:ld}),hd=J.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:tu,content:B([ud,L(ud)])}),gd=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),_d=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),vd=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),yd=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),bd=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),xd=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),Sd=B([yd,bd]),Cd=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),wd=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),Td=B([Cd,wd]),Ed=B([xd,Sd,Td]),Dd=B([Ed,gd,_d,vd]),Od=hl.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),Dd),required:L(M()).optional()}).catchall(I())}),kd=hl.extend({mode:U(`url`),message:M(),elicitationId:M(),url:M().url()}),Ad=B([Od,kd]),jd=q.extend({method:U(`elicitation/create`),params:Ad}),Md=gl.extend({elicitationId:M()}),Nd=_l.extend({method:U(`notifications/elicitation/complete`),params:Md}),Pd=J.extend({action:H([`accept`,`decline`,`cancel`]),content:Jc(e=>e===null?void 0:e,V(M(),B([M(),P(),F(),L(M())])).optional())}),Fd=R({type:U(`ref/resource`),uri:M()}),Id=R({type:U(`ref/prompt`),name:M()}),Ld=K.extend({ref:B([Id,Fd]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()}),Rd=q.extend({method:U(`completion/complete`),params:Ld}),zd=J.extend({completion:z({values:L(M()).max(100),total:W(P().int()),hasMore:W(F())})}),Bd=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Vd=q.extend({method:U(`roots/list`),params:K.optional()}),Hd=J.extend({roots:L(Bd)}),Ud=_l.extend({method:U(`notifications/roots/list_changed`),params:gl.optional()}),Wd=z({ttl:P().optional(),pollInterval:P().optional()}),Gd=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Kd=R({taskId:M(),status:Gd,ttl:B([P(),sc()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:W(P()),statusMessage:W(M())}),qd=J.extend({task:Kd}),Jd=gl.merge(Kd),Yd=_l.extend({method:U(`notifications/tasks/status`),params:Jd}),Xd=q.extend({method:U(`tasks/get`),params:K.extend({taskId:M()})}),Zd=J.merge(Kd),Qd=q.extend({method:U(`tasks/result`),params:K.extend({taskId:M()})}),$d=J.loose(),ef=Yl.extend({method:U(`tasks/list`)}),tf=Xl.extend({tasks:L(Kd)}),nf=q.extend({method:U(`tasks/cancel`),params:K.extend({taskId:M()})}),rf=J.merge(Kd),af=B([Wl,Rl,Hl,Rd,nd,Mu,ku,au,su,du,hu,_u,bu,Zu,Ku]),of=B([Ol,ql,Vl,Ud]),sf=B([El,md,hd,Pd,Hd]),cf=B([Wl,pd,jd,Vd]),lf=B([Ol,ql,id,Eu,pu,Qu,Hu,Su,Nd]),uf=B([El,Bl,Ul,zd,Vu,Au,ou,cu,fu,Ju,qu,wu]),Y=Rs().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Yc.custom,message:`URL must be parseable`,fatal:!0}),Xe}).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`}),df=z({resource:M().url(),authorization_servers:L(Y).optional(),jwks_uri:M().url().optional(),scopes_supported:L(M()).optional(),bearer_methods_supported:L(M()).optional(),resource_signing_alg_values_supported:L(M()).optional(),resource_name:M().optional(),resource_documentation:M().optional(),resource_policy_uri:M().url().optional(),resource_tos_uri:M().url().optional(),tls_client_certificate_bound_access_tokens:F().optional(),authorization_details_types_supported:L(M()).optional(),dpop_signing_alg_values_supported:L(M()).optional(),dpop_bound_access_tokens_required:F().optional()}),ff=z({issuer:M(),authorization_endpoint:Y,token_endpoint:Y,registration_endpoint:Y.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),service_documentation:Y.optional(),revocation_endpoint:Y.optional(),revocation_endpoint_auth_methods_supported:L(M()).optional(),revocation_endpoint_auth_signing_alg_values_supported:L(M()).optional(),introspection_endpoint:M().optional(),introspection_endpoint_auth_methods_supported:L(M()).optional(),introspection_endpoint_auth_signing_alg_values_supported:L(M()).optional(),code_challenge_methods_supported:L(M()).optional(),client_id_metadata_document_supported:F().optional(),authorization_response_iss_parameter_supported:F().optional().catch(void 0),dpop_signing_alg_values_supported:L(M()).optional()}),pf=z({issuer:M(),authorization_endpoint:Y,token_endpoint:Y,userinfo_endpoint:Y.optional(),jwks_uri:Y,registration_endpoint:Y.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),acr_values_supported:L(M()).optional(),subject_types_supported:L(M()),id_token_signing_alg_values_supported:L(M()),id_token_encryption_alg_values_supported:L(M()).optional(),id_token_encryption_enc_values_supported:L(M()).optional(),userinfo_signing_alg_values_supported:L(M()).optional(),userinfo_encryption_alg_values_supported:L(M()).optional(),userinfo_encryption_enc_values_supported:L(M()).optional(),request_object_signing_alg_values_supported:L(M()).optional(),request_object_encryption_alg_values_supported:L(M()).optional(),request_object_encryption_enc_values_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),display_values_supported:L(M()).optional(),claim_types_supported:L(M()).optional(),claims_supported:L(M()).optional(),service_documentation:M().optional(),claims_locales_supported:L(M()).optional(),ui_locales_supported:L(M()).optional(),claims_parameter_supported:F().optional(),request_parameter_supported:F().optional(),request_uri_parameter_supported:F().optional(),require_request_uri_registration:F().optional(),op_policy_uri:Y.optional(),op_tos_uri:Y.optional(),client_id_metadata_document_supported:F().optional(),authorization_response_iss_parameter_supported:F().optional().catch(void 0)}),mf=R({...pf.shape,...ff.pick({code_challenge_methods_supported:!0}).shape}),hf=R({access_token:M(),id_token:M().optional(),token_type:M(),expires_in:$c().optional(),scope:M().optional(),refresh_token:M().optional()}).strip(),gf=R({issued_token_type:U(`urn:ietf:params:oauth:token-type:id-jag`),access_token:M(),token_type:M().optional(),expires_in:P().optional(),scope:M().optional()}).strip(),_f=R({error:M(),error_description:M().optional(),error_uri:M().optional()}),vf=Y.optional().or(U(``).transform(()=>void 0)),yf=R({redirect_uris:L(Y),token_endpoint_auth_method:M().optional(),grant_types:L(M()).optional(),response_types:L(M()).optional(),application_type:M().optional(),client_name:M().optional(),client_uri:Y.optional(),logo_uri:vf,scope:M().optional(),contacts:L(M()).optional(),tos_uri:vf,policy_uri:M().optional(),jwks_uri:Y.optional(),jwks:lc().optional(),software_id:M().optional(),software_version:M().optional(),software_statement:M().optional()}).strip(),bf=R({client_id:M(),client_secret:M().optional(),client_id_issued_at:P().optional(),client_secret_expires_at:P().optional()}).strip(),xf=yf.merge(bf),Sf=R({error:M(),error_description:M().optional()}).strip(),Cf=R({token:M(),token_type_hint:M().optional()}).strip(),wf=Symbol.for(`mcp.sdk.errorBrands`);function Tf(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,wf,{value:n,enumerable:!1,configurable:!0})}function Ef(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,wf)){let n=t[wf];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 Ef(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 Ef(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Tf(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 Df=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 Ef(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 Ef(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Tf(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=Wc(()=>B([M(),P(),F(),sc(),V(M(),e),L(e)])),t=V(M(),e),n=B([M(),P().int()]),r=M(),i=R({ttl:P().optional()}),a=R({taskId:M()}),o=z({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=R({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=R({method:M(),params:s.loose().optional()}),u=R({_meta:o.optional()}),d=R({method:M(),params:u.loose().optional()}),f=z({_meta:o.optional()}),p=B([M(),P().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:M().optional()}),ee=d.extend({method:U(`notifications/cancelled`),params:h}),g=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),te=R({icons:L(g).optional()}),ne=R({name:M(),title:M().optional()}),re=ne.extend({...ne.shape,...te.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),ie=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),t).optional(),url:t.optional()}),t.optional())),_=z({list:t.optional(),cancel:t.optional(),requests:z({sampling:z({createMessage:t.optional()}).optional(),elicitation:z({create:t.optional()}).optional()}).optional()}),ae=z({list:t.optional(),cancel:t.optional(),requests:z({tools:z({call:t.optional()}).optional()}).optional()}),oe=R({experimental:V(M(),t).optional(),sampling:R({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:_.optional(),extensions:V(M(),t).optional()}),se=s.extend({protocolVersion:M(),capabilities:oe,clientInfo:re}),ce=l.extend({method:U(`initialize`),params:se}),le=R({experimental:V(M(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:ae.optional(),extensions:V(M(),t).optional()}),ue=f.extend({protocolVersion:M(),capabilities:le,serverInfo:re,instructions:M().optional()}),de=d.extend({method:U(`notifications/initialized`),params:u.optional()}),fe=l.extend({method:U(`ping`),params:s.optional()}),pe=R({progress:P(),total:W(P()),message:W(M())}),v=R({...u.shape,...pe.shape,progressToken:n}),y=d.extend({method:U(`notifications/progress`),params:v}),me=s.extend({cursor:r.optional()}),he=l.extend({params:me.optional()}),ge=f.extend({nextCursor:r.optional()}),_e=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),ve=_e.extend({text:M()}),ye=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),be=_e.extend({blob:ye}),xe=H([`user`,`assistant`]),Se=R({audience:L(xe).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),Ce=R({...ne.shape,...te.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:Se.optional(),_meta:W(z({}))}),we=R({...ne.shape,...te.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:Se.optional(),_meta:W(z({}))}),Te=he.extend({method:U(`resources/list`)}),Ee=ge.extend({resources:L(Ce)}),b=he.extend({method:U(`resources/templates/list`)}),De=ge.extend({resourceTemplates:L(we)}),Oe=s.extend({uri:M()}),ke=Oe,Ae=l.extend({method:U(`resources/read`),params:ke}),je=f.extend({contents:L(B([ve,be]))}),Me=d.extend({method:U(`notifications/resources/list_changed`),params:u.optional()}),Ne=Oe,Pe=l.extend({method:U(`resources/subscribe`),params:Ne}),Fe=Oe,Ie=l.extend({method:U(`resources/unsubscribe`),params:Fe}),Le=u.extend({uri:M()}),Re=d.extend({method:U(`notifications/resources/updated`),params:Le}),ze=R({name:M(),description:W(M()),required:W(F())}),Be=R({...ne.shape,...te.shape,description:W(M()),arguments:W(L(ze)),_meta:W(z({}))}),Ve=he.extend({method:U(`prompts/list`)}),He=ge.extend({prompts:L(Be)}),Ue=s.extend({name:M(),arguments:V(M(),M()).optional()}),We=l.extend({method:U(`prompts/get`),params:Ue}),Ge=R({type:U(`text`),text:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),x=R({type:U(`image`),data:ye,mimeType:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),Ke=R({type:U(`audio`),data:ye,mimeType:M(),annotations:Se.optional(),_meta:V(M(),I()).optional()}),qe=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Je=R({type:U(`resource`),resource:B([ve,be]),annotations:Se.optional(),_meta:V(M(),I()).optional()}),Ye=Ce.extend({type:U(`resource_link`)}),Xe=B([Ge,x,Ke,Ye,Je]),Ze=R({role:xe,content:Xe}),Qe=f.extend({description:M().optional(),messages:L(Ze)}),$e=d.extend({method:U(`notifications/prompts/list_changed`),params:u.optional()}),S=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),et=R({taskSupport:H([`required`,`optional`,`forbidden`]).optional()}),tt=R({...ne.shape,...te.shape,description:M().optional(),inputSchema:R({type:U(`object`),properties:V(M(),e).optional(),required:L(M()).optional()}).catchall(I()),outputSchema:R({type:U(`object`),properties:V(M(),e).optional(),required:L(M()).optional()}).catchall(I()).optional(),annotations:S.optional(),execution:et.optional(),_meta:V(M(),I()).optional()}),C=he.extend({method:U(`tools/list`)}),w=ge.extend({tools:L(tt)}),nt=f.extend({content:L(Xe),structuredContent:V(M(),I()).optional(),isError:F().optional()}),T=c.extend({name:M(),arguments:V(M(),I()).optional()}),rt=l.extend({method:U(`tools/call`),params:T}),it=d.extend({method:U(`notifications/tools/list_changed`),params:u.optional()}),at=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),ot=s.extend({level:at}),st=l.extend({method:U(`logging/setLevel`),params:ot}),ct=u.extend({level:at,logger:M().optional(),data:I()}),lt=d.extend({method:U(`notifications/message`),params:ct}),ut=R({name:M().optional()}),dt=R({hints:L(ut).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),ft=R({mode:H([`auto`,`required`,`none`]).optional()}),pt=R({type:U(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:L(Xe),structuredContent:R({}).loose().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),mt=_c(`type`,[Ge,x,Ke]),ht=_c(`type`,[Ge,x,Ke,qe,pt]),gt=R({role:xe,content:B([ht,L(ht)]),_meta:V(M(),I()).optional()}),_t=c.extend({messages:L(gt),modelPreferences:dt.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:t.optional(),tools:L(tt).optional(),toolChoice:ft.optional()}),vt=l.extend({method:U(`sampling/createMessage`),params:_t}),yt=f.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:xe,content:mt}),bt=f.extend({model:M(),stopReason:W(H([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:xe,content:B([ht,L(ht)])}),xt=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),St=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),Ct=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),wt=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),Tt=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),Et=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),Dt=B([wt,Tt]),Ot=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),kt=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),At=B([Ot,kt]),jt=B([Et,Dt,At]),Mt=B([jt,xt,St,Ct]),Nt=c.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),Mt),required:L(M()).optional()}).catchall(I())}),Pt=c.extend({mode:U(`url`),message:M(),elicitationId:M(),url:M().url()}),Ft=B([Nt,Pt]),It=l.extend({method:U(`elicitation/create`),params:Ft}),Lt=u.extend({elicitationId:M()}),Rt=d.extend({method:U(`notifications/elicitation/complete`),params:Lt}),zt=f.extend({action:H([`accept`,`decline`,`cancel`]),content:Jc(e=>e===null?void 0:e,V(M(),B([M(),P(),F(),L(M())])).optional())}),Bt=R({type:U(`ref/resource`),uri:M()}),Vt=R({type:U(`ref/prompt`),name:M()}),Ht=s.extend({ref:B([Vt,Bt]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()}),Ut=l.extend({method:U(`completion/complete`),params:Ht}),Wt=f.extend({completion:z({values:L(M()).max(100),total:W(P().int()),hasMore:W(F())})}),Gt=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Kt=l.extend({method:U(`roots/list`),params:s.optional()}),qt=f.extend({roots:L(Gt)}),Jt=d.extend({method:U(`notifications/roots/list_changed`),params:u.optional()}),Yt=z({ttl:P().optional(),pollInterval:P().optional()}),Xt=H([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=R({taskId:M(),status:Xt,ttl:B([P(),sc()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:W(P()),statusMessage:W(M())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:U(`notifications/tasks/status`),params:$t}),tn=l.extend({method:U(`tasks/get`),params:s.extend({taskId:M()})}),nn=f.merge(Zt),rn=l.extend({method:U(`tasks/result`),params:s.extend({taskId:M()})}),an=f.loose(),E=he.extend({method:U(`tasks/list`)}),on=ge.extend({tasks:L(Zt)}),sn=l.extend({method:U(`tasks/cancel`),params:s.extend({taskId:M()})});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:b,ListResourceTemplatesResultSchema:De,ResourceRequestParamsSchema:Oe,ReadResourceRequestParamsSchema:ke,ReadResourceRequestSchema:Ae,ReadResourceResultSchema:je,ResourceListChangedNotificationSchema:Me,SubscribeRequestParamsSchema:Ne,SubscribeRequestSchema:Pe,UnsubscribeRequestParamsSchema:Fe,UnsubscribeRequestSchema:Ie,ResourceUpdatedNotificationParamsSchema:Le,ResourceUpdatedNotificationSchema:Re,PromptArgumentSchema:ze,PromptSchema:Be,ListPromptsRequestSchema:Ve,ListPromptsResultSchema:He,GetPromptRequestParamsSchema:Ue,GetPromptRequestSchema:We,TextContentSchema:Ge,ImageContentSchema:x,AudioContentSchema:Ke,ToolUseContentSchema:qe,EmbeddedResourceSchema:Je,ResourceLinkSchema:Ye,ContentBlockSchema:Xe,PromptMessageSchema:Ze,GetPromptResultSchema:Qe,PromptListChangedNotificationSchema:$e,ToolAnnotationsSchema:S,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:C,ListToolsResultSchema:w,CallToolResultSchema:nt,CallToolRequestParamsSchema:T,CallToolRequestSchema:rt,ToolListChangedNotificationSchema:it,LoggingLevelSchema:at,SetLevelRequestParamsSchema:ot,SetLevelRequestSchema:st,LoggingMessageNotificationParamsSchema:ct,LoggingMessageNotificationSchema:lt,ModelHintSchema:ut,ModelPreferencesSchema:dt,ToolChoiceSchema:ft,ToolResultContentSchema:pt,SamplingContentSchema:mt,SamplingMessageContentBlockSchema:ht,SamplingMessageSchema:gt,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vt,CreateMessageResultSchema:yt,CreateMessageResultWithToolsSchema:bt,BooleanSchemaSchema:xt,StringSchemaSchema:St,NumberSchemaSchema:Ct,UntitledSingleSelectEnumSchemaSchema:wt,TitledSingleSelectEnumSchemaSchema:Tt,LegacyTitledEnumSchemaSchema:Et,SingleSelectEnumSchemaSchema:Dt,UntitledMultiSelectEnumSchemaSchema:Ot,TitledMultiSelectEnumSchemaSchema:kt,MultiSelectEnumSchemaSchema:At,EnumSchemaSchema:jt,PrimitiveSchemaDefinitionSchema:Mt,ElicitRequestFormParamsSchema:Nt,ElicitRequestURLParamsSchema:Pt,ElicitRequestParamsSchema:Ft,ElicitRequestSchema:It,ElicitationCompleteNotificationParamsSchema:Lt,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:nn,GetTaskPayloadRequestSchema:rn,GetTaskPayloadResultSchema:an,ListTasksRequestSchema:E,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:B([fe,ce,Ut,st,We,Ve,Te,b,Ae,Pe,Ie,rt,C,tn,rn,E,sn]),ClientNotificationSchema:B([ee,y,de,Jt,en]),ClientResultSchema:B([m,yt,bt,zt,qt,nn,on,Qt]),ServerRequestSchema:B([fe,vt,It,Kt,tn,rn,E,sn]),ServerNotificationSchema:B([ee,y,lt,Re,Me,it,$e,en,Rt]),ServerResultSchema:B([m,ue,Wt,Qe,He,Ee,De,je,nt,w,nn,on,Qt]),CallToolResultWireSchema:I().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(nt)}}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=Wc(()=>B([M(),P(),F(),sc(),V(M(),e),L(e)])),t=V(M(),e),n=B([M(),P().int()]),r=M(),i=B([M(),P().int()]),a=H([`user`,`assistant`]),o=H([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=R({ttl:P().optional()}),l=R({taskId:M()}),u=z({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=R({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=R({_meta:u.optional()}),m=R({method:M(),params:p.loose().optional()}),h=R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:H([`light`,`dark`]).optional()}),ee=R({icons:L(h).optional()}),g=R({name:M(),title:M().optional()}),te=g.extend({...g.shape,...ee.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),ne=Jc(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,yc(R({form:yc(R({applyDefaults:F().optional()}),t).optional(),url:t.optional()}),t.optional())),re=z({list:t.optional(),cancel:t.optional(),requests:z({sampling:z({createMessage:t.optional()}).optional(),elicitation:z({create:t.optional()}).optional()}).optional()}),ie=z({list:t.optional(),cancel:t.optional(),requests:z({tools:z({call:t.optional()}).optional()}).optional()}),_=R({experimental:V(M(),t).optional(),sampling:R({context:t.optional(),tools:t.optional()}).optional(),elicitation:ne.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:re.optional(),extensions:V(M(),t).optional()}),ae=R({experimental:V(M(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:ie.optional(),extensions:V(M(),t).optional()}),oe=R({progress:P(),total:W(P()),message:W(M())}),se=R({...p.shape,...oe.shape,progressToken:n}),ce=m.extend({method:U(`notifications/progress`),params:se}),le=p.extend({level:o,logger:M().optional(),data:I()}),ue=m.extend({method:U(`notifications/message`),params:le}),de=R({uri:M(),mimeType:W(M()),_meta:V(M(),I()).optional()}),fe=de.extend({text:M()}),pe=de.extend({blob:s}),v=R({audience:L(a).optional(),priority:P().min(0).max(1).optional(),lastModified:Zc({offset:!0}).optional()}),y=R({...g.shape,...ee.shape,uri:M(),description:W(M()),mimeType:W(M()),size:W(P()),annotations:v.optional(),_meta:W(z({}))}),me=R({...g.shape,...ee.shape,uriTemplate:M(),description:W(M()),mimeType:W(M()),annotations:v.optional(),_meta:W(z({}))}),he=m.extend({method:U(`notifications/resources/list_changed`),params:p.optional()}),ge=p.extend({uri:M()}),_e=m.extend({method:U(`notifications/resources/updated`),params:ge}),ve=R({name:M(),description:W(M()),required:W(F())}),ye=R({...g.shape,...ee.shape,description:W(M()),arguments:W(L(ve)),_meta:W(z({}))}),be=m.extend({method:U(`notifications/prompts/list_changed`),params:p.optional()}),xe=R({type:U(`text`),text:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),Se=R({type:U(`image`),data:s,mimeType:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),Ce=R({type:U(`audio`),data:s,mimeType:M(),annotations:v.optional(),_meta:V(M(),I()).optional()}),we=R({type:U(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),Te=R({type:U(`resource`),resource:B([fe,pe]),annotations:v.optional(),_meta:V(M(),I()).optional()}),Ee=y.extend({type:U(`resource_link`)}),b=B([xe,Se,Ce,Ee,Te]),De=R({role:a,content:b}),Oe=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),ke=m.extend({method:U(`notifications/tools/list_changed`),params:p.optional()}),Ae=R({name:M().optional()}),je=R({hints:L(Ae).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),Me=R({mode:H([`auto`,`required`,`none`]).optional()}),Ne=R({type:U(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),Pe=R({type:U(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:H([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),Fe=R({type:H([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),Ie=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),Le=R({type:U(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),Re=R({type:U(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),ze=B([Ie,Le]),Be=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:U(`string`),enum:L(M())}),default:L(M()).optional()}),Ve=R({type:U(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()}),He=B([Be,Ve]),Ue=B([Re,ze,He]),We=B([Ue,Ne,Pe,Fe]),Ge=f.extend({mode:U(`form`).optional(),message:M(),requestedSchema:R({type:U(`object`),properties:V(M(),We),required:L(M()).optional()}).catchall(I())}),x=R({type:U(`ref/resource`),uri:M()}),Ke=R({type:U(`ref/prompt`),name:M()}),qe=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),Je=_.shape,Ye=R({experimental:Je.experimental,sampling:Je.sampling,elicitation:Je.elicitation,roots:Je.roots,extensions:Je.extensions}),Xe=ae.shape,Ze=R({experimental:Xe.experimental,logging:Xe.logging,completions:Xe.completions,prompts:Xe.prompts,resources:Xe.resources,tools:Xe.tools,extensions:Xe.extensions}),Qe=z({progressToken:n.optional(),[nl]:M(),[rl]:te.optional(),[al]:Ye,[sl]:o.optional()}),$e=R({...g.shape,...ee.shape,description:M().optional(),inputSchema:z({$schema:M().optional(),type:U(`object`)}),outputSchema:z({$schema:M().optional()}).optional(),annotations:Oe.optional(),_meta:V(M(),I()).optional()}),S=R({type:U(`tool_result`),toolUseId:M(),content:L(b),structuredContent:I().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),et=B([xe,Se,Ce,we,S]),tt=R({role:a,content:B([et,L(et)]),_meta:V(M(),I()).optional()}),C=M(),w=z({[il]:te.optional().catch(void 0)}),nt=w.optional();function T(e){return z({_meta:nt,resultType:C.default(`complete`),...e})}let rt=T({}),it=T({nextCursor:r.optional()}),at=T({content:L(b),structuredContent:I().optional(),isError:F().optional()}),ot=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),tools:L($e),nextCursor:r.optional()}),st=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),prompts:L(ye),nextCursor:r.optional()}),ct=T({description:M().optional(),messages:L(De)}),lt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resources:L(y),nextCursor:r.optional()}),ut=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resourceTemplates:L(me),nextCursor:r.optional()}),dt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),contents:L(B([fe,pe]))}),ft=T({completion:R({values:L(M()).max(100),total:P().int().optional(),hasMore:F().optional()}).loose()}),pt=T({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`])}),mt=T({ttlMs:P().int().min(0).catch(0),cacheScope:H([`public`,`private`]).catch(`private`),supportedVersions:L(M()),capabilities:Ze,instructions:M().optional()}),ht=R({messages:L(tt),modelPreferences:je.optional(),systemPrompt:M().optional(),includeContext:H([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:t.optional(),tools:L($e).optional(),toolChoice:Me.optional()}),gt=R({method:U(`sampling/createMessage`),params:ht}),_t=R({method:U(`roots/list`),params:R({_meta:V(M(),I()).optional()}).optional()}),vt=R({...tt.shape,model:M(),stopReason:M().optional()}),yt=R({roots:L(qe)}),bt=R({action:H([`accept`,`decline`,`cancel`]),content:V(M(),B([M(),P(),F(),L(M())])).optional()}),xt=R({mode:U(`url`),message:M(),url:M().url()}),St=B([Ge,xt]),Ct=R({method:U(`elicitation/create`),params:St}),wt=B([gt,_t,Ct]),Tt=B([vt,yt,bt]),Et=V(M(),wt),Dt=V(M(),Tt),Ot=T({inputRequests:Et.optional(),requestState:M().optional()}),kt={inputResponses:Dt.optional(),requestState:M().optional()},At=R({_meta:Qe,...kt}),jt=z({progressToken:n.optional()});function Mt(e,t){return R({method:U(e),params:R({_meta:Qe,...t})})}function Nt(e,t){return R({method:U(e),params:R({_meta:jt.optional(),...t}).optional()})}let Pt={name:M(),arguments:V(M(),I()).optional(),...kt},Ft={cursor:r.optional()},It=Mt(`tools/call`,Pt),Lt=Mt(`tools/list`,Ft),Rt=Mt(`prompts/list`,Ft),zt=Mt(`prompts/get`,{name:M(),arguments:V(M(),M()).optional(),...kt}),Bt=Mt(`resources/list`,Ft),Vt=Mt(`resources/templates/list`,Ft),Ht=Mt(`resources/read`,{uri:M(),...kt}),Ut={ref:B([Ke,x]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()},Wt=Mt(`completion/complete`,Ut),Gt=Mt(`server/discover`,{}),Kt=R({toolsListChanged:F().optional(),promptsListChanged:F().optional(),resourcesListChanged:F().optional(),resourceSubscriptions:L(M()).optional()}),qt={notifications:Kt},Jt=Mt(`subscriptions/listen`,qt),Yt=w.extend({"io.modelcontextprotocol/subscriptionId":i}),Xt=z({_meta:Yt,resultType:C.default(`complete`)}),Zt={"tools/call":Nt(`tools/call`,Pt),"tools/list":Nt(`tools/list`,Ft),"prompts/get":Nt(`prompts/get`,{name:M(),arguments:V(M(),M()).optional()}),"prompts/list":Nt(`prompts/list`,Ft),"resources/list":Nt(`resources/list`,Ft),"resources/templates/list":Nt(`resources/templates/list`,Ft),"resources/read":Nt(`resources/read`,{uri:M()}),"completion/complete":Nt(`completion/complete`,Ut),"server/discover":Nt(`server/discover`,{}),"subscriptions/listen":Nt(`subscriptions/listen`,qt)};function Qt(e){return z({_meta:nt,...e})}let $t={"tools/call":Qt({content:L(b),structuredContent:I().optional(),isError:F().optional()}),"tools/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),tools:L($e),nextCursor:r.optional()}),"prompts/get":Qt({description:M().optional(),messages:L(De)}),"prompts/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),prompts:L(ye),nextCursor:r.optional()}),"resources/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resources:L(y),nextCursor:r.optional()}),"resources/templates/list":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),resourceTemplates:L(me),nextCursor:r.optional()}),"resources/read":Qt({ttlMs:P().int().min(0),cacheScope:H([`public`,`private`]),contents:L(B([fe,pe]))}),"completion/complete":Qt({completion:R({values:L(M()).max(100),total:P().int().optional(),hasMore:F().optional()}).loose()}),"server/discover":Qt({ttlMs:P().int().min(0).catch(0),cacheScope:H([`public`,`private`]).catch(`private`),supportedVersions:L(M()),capabilities:Ze,instructions:M().optional()}),"subscriptions/listen":Qt({})},en=z({"io.modelcontextprotocol/subscriptionId":i.optional()}),tn=R({method:U(`notifications/subscriptions/acknowledged`),params:R({_meta:en.optional(),notifications:Kt})}),nn=R({_meta:en.optional(),requestId:i,reason:M().optional()}),rn=R({method:U(`notifications/cancelled`),params:nn}),an={"notifications/cancelled":rn,"notifications/progress":ce,"notifications/message":ue,"notifications/resources/updated":_e,"notifications/resources/list_changed":he,"notifications/tools/list_changed":ke,"notifications/prompts/list_changed":be,"notifications/subscriptions/acknowledged":tn},E=e=>R({jsonrpc:U(`2.0`),id:B([M(),P().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:b,PromptMessageSchema:De,ToolAnnotationsSchema:Oe,ToolListChangedNotificationSchema:ke,ModelHintSchema:Ae,ModelPreferencesSchema:je,ToolChoiceSchema:Me,BooleanSchemaSchema:Ne,StringSchemaSchema:Pe,NumberSchemaSchema:Fe,UntitledSingleSelectEnumSchemaSchema:Ie,TitledSingleSelectEnumSchemaSchema:Le,LegacyTitledEnumSchemaSchema:Re,SingleSelectEnumSchemaSchema:ze,UntitledMultiSelectEnumSchemaSchema:Be,TitledMultiSelectEnumSchemaSchema:Ve,MultiSelectEnumSchemaSchema:He,EnumSchemaSchema:Ue,PrimitiveSchemaDefinitionSchema:We,ElicitRequestFormParamsSchema:Ge,ResourceTemplateReferenceSchema:x,PromptReferenceSchema:Ke,RootSchema:qe,ClientCapabilities2026Schema:Ye,ServerCapabilities2026Schema:Ze,RequestMetaEnvelopeSchema:Qe,ToolSchema:$e,ToolResultContentSchema:S,SamplingMessageContentBlockSchema:et,SamplingMessageSchema:tt,ResultTypeSchema:C,ResultMetaSchema:w,ResultSchema:rt,PaginatedResultSchema:it,CallToolResultSchema:at,ListToolsResultSchema:ot,ListPromptsResultSchema:st,GetPromptResultSchema:ct,ListResourcesResultSchema:lt,ListResourceTemplatesResultSchema:ut,ReadResourceResultSchema:dt,CompleteResultSchema:ft,CacheableResultSchema:pt,DiscoverResultSchema:mt,CreateMessageRequestParamsSchema:ht,CreateMessageRequestSchema:gt,ListRootsRequestSchema:_t,CreateMessageResultSchema:vt,ListRootsResultSchema:yt,ElicitResultSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,InputRequestSchema:wt,InputResponseSchema:Tt,InputRequestsSchema:Et,InputResponsesSchema:Dt,InputRequiredResultSchema:Ot,InputResponseRequestParamsSchema:At,CallToolRequestSchema:It,ListToolsRequestSchema:Lt,ListPromptsRequestSchema:Rt,GetPromptRequestSchema:zt,ListResourcesRequestSchema:Bt,ListResourceTemplatesRequestSchema:Vt,ReadResourceRequestSchema:Ht,CompleteRequestSchema:Wt,DiscoverRequestSchema:Gt,SubscriptionFilterSchema:Kt,SubscriptionsListenRequestSchema:Jt,SubscriptionsListenResultMetaSchema:Yt,SubscriptionsListenResultSchema:Xt,dispatchRequestSchemas:Zt,dispatchResultSchemas:$t,NotificationMetaSchema:en,SubscriptionsAcknowledgedNotificationSchema:tn,CancelledNotificationParamsSchema:nn,CancelledNotificationSchema:rn,notificationSchemas2026:an,JSONRPCResultResponseSchema:E(rt),CallToolResultResponseSchema:E(B([at,Ot])),ListToolsResultResponseSchema:E(ot),ListPromptsResultResponseSchema:E(st),GetPromptResultResponseSchema:E(B([ct,Ot])),ListResourcesResultResponseSchema:E(lt),ListResourceTemplatesResultResponseSchema:E(ut),ReadResourceResultResponseSchema:E(B([dt,Ot])),CompleteResultResponseSchema:E(ft),DiscoverResultResponseSchema:E(mt)}}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 Ef(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 Ef(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Tf(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:{[il]:t}}:!Sp(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[il]: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":R({method:U(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":R({method:U(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":R({method:U(`roots/list`),params:z({}).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=[nl,al];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{[nl]:e.protocolVersion,[rl]:e.clientInfo,[al]: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(Df.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new X(Df.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(Df.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(Df.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(Df.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(Df.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:()=>nu,AudioContentSchema:()=>Fu,BaseMetadataSchema:()=>jl,BaseRequestParamsSchema:()=>K,BlobResourceContentsSchema:()=>eu,BooleanSchemaSchema:()=>gd,CallToolRequestParamsSchema:()=>Xu,CallToolRequestSchema:()=>Zu,CallToolResultSchema:()=>Ju,CancelTaskRequestSchema:()=>nf,CancelTaskResultSchema:()=>rf,CancelledNotificationParamsSchema:()=>Dl,CancelledNotificationSchema:()=>Ol,ClientCapabilitiesSchema:()=>Il,ClientNotificationSchema:()=>of,ClientRequestSchema:()=>af,ClientResultSchema:()=>sf,ClientTasksCapabilitySchema:()=>Pl,CompatibilityCallToolResultSchema:()=>Yu,CompleteRequestParamsSchema:()=>Ld,CompleteRequestSchema:()=>Rd,CompleteResultSchema:()=>zd,ContentBlockSchema:()=>zu,CreateMessageRequestParamsSchema:()=>fd,CreateMessageRequestSchema:()=>pd,CreateMessageResultSchema:()=>md,CreateMessageResultWithToolsSchema:()=>hd,CreateTaskResultSchema:()=>qd,CursorSchema:()=>dl,DiscoverRequestSchema:()=>Hl,DiscoverResultSchema:()=>Ul,ElicitRequestFormParamsSchema:()=>Od,ElicitRequestParamsSchema:()=>Ad,ElicitRequestSchema:()=>jd,ElicitRequestURLParamsSchema:()=>kd,ElicitResultSchema:()=>Pd,ElicitationCompleteNotificationParamsSchema:()=>Md,ElicitationCompleteNotificationSchema:()=>Nd,EmbeddedResourceSchema:()=>Lu,EmptyResultSchema:()=>El,EnumSchemaSchema:()=>Ed,GetPromptRequestParamsSchema:()=>ju,GetPromptRequestSchema:()=>Mu,GetPromptResultSchema:()=>Vu,GetTaskPayloadRequestSchema:()=>Qd,GetTaskPayloadResultSchema:()=>$d,GetTaskRequestSchema:()=>Xd,GetTaskResultSchema:()=>Zd,IconSchema:()=>kl,IconsSchema:()=>Al,ImageContentSchema:()=>Pu,ImplementationSchema:()=>Ml,InitializeRequestParamsSchema:()=>Ll,InitializeRequestSchema:()=>Rl,InitializeResultSchema:()=>Bl,InitializedNotificationSchema:()=>Vl,JSONArraySchema:()=>ll,JSONObjectSchema:()=>G,JSONRPCErrorResponseSchema:()=>Cl,JSONRPCMessageSchema:()=>wl,JSONRPCNotificationSchema:()=>xl,JSONRPCRequestSchema:()=>bl,JSONRPCResponseSchema:()=>Tl,JSONRPCResultResponseSchema:()=>Sl,JSONValueSchema:()=>cl,LegacyTitledEnumSchemaSchema:()=>xd,ListChangedOptionsBaseSchema:()=>$u,ListPromptsRequestSchema:()=>ku,ListPromptsResultSchema:()=>Au,ListResourceTemplatesRequestSchema:()=>su,ListResourceTemplatesResultSchema:()=>cu,ListResourcesRequestSchema:()=>au,ListResourcesResultSchema:()=>ou,ListRootsRequestSchema:()=>Vd,ListRootsResultSchema:()=>Hd,ListTasksRequestSchema:()=>ef,ListTasksResultSchema:()=>tf,ListToolsRequestSchema:()=>Ku,ListToolsResultSchema:()=>qu,LoggingLevelSchema:()=>ed,LoggingMessageNotificationParamsSchema:()=>rd,LoggingMessageNotificationSchema:()=>id,ModelHintSchema:()=>ad,ModelPreferencesSchema:()=>od,MultiSelectEnumSchemaSchema:()=>Td,NotificationSchema:()=>_l,NotificationsParamsSchema:()=>gl,NumberSchemaSchema:()=>vd,PaginatedRequestParamsSchema:()=>Jl,PaginatedRequestSchema:()=>Yl,PaginatedResultSchema:()=>Xl,PingRequestSchema:()=>Wl,PrimitiveSchemaDefinitionSchema:()=>Dd,ProgressNotificationParamsSchema:()=>Kl,ProgressNotificationSchema:()=>ql,ProgressSchema:()=>Gl,ProgressTokenSchema:()=>ul,PromptArgumentSchema:()=>Du,PromptListChangedNotificationSchema:()=>Hu,PromptMessageSchema:()=>Bu,PromptReferenceSchema:()=>Id,PromptSchema:()=>Ou,ReadResourceRequestParamsSchema:()=>uu,ReadResourceRequestSchema:()=>du,ReadResourceResultSchema:()=>fu,RelatedTaskMetadataSchema:()=>pl,RequestIdSchema:()=>yl,RequestMetaSchema:()=>ml,RequestSchema:()=>q,ResourceContentsSchema:()=>Zl,ResourceLinkSchema:()=>Ru,ResourceListChangedNotificationSchema:()=>pu,ResourceRequestParamsSchema:()=>lu,ResourceSchema:()=>ru,ResourceTemplateReferenceSchema:()=>Fd,ResourceTemplateSchema:()=>iu,ResourceUpdatedNotificationParamsSchema:()=>Tu,ResourceUpdatedNotificationSchema:()=>Eu,ResultMetaObjectSchema:()=>vl,ResultSchema:()=>J,RoleSchema:()=>tu,RootSchema:()=>Bd,RootsListChangedNotificationSchema:()=>Ud,SamplingContentSchema:()=>ld,SamplingMessageContentBlockSchema:()=>ud,SamplingMessageSchema:()=>dd,ServerCapabilitiesSchema:()=>zl,ServerNotificationSchema:()=>lf,ServerRequestSchema:()=>cf,ServerResultSchema:()=>uf,ServerTasksCapabilitySchema:()=>Fl,SetLevelRequestParamsSchema:()=>td,SetLevelRequestSchema:()=>nd,SingleSelectEnumSchemaSchema:()=>Sd,StringSchemaSchema:()=>_d,SubscribeRequestParamsSchema:()=>mu,SubscribeRequestSchema:()=>hu,SubscriptionFilterSchema:()=>vu,SubscriptionsAcknowledgedNotificationParamsSchema:()=>xu,SubscriptionsAcknowledgedNotificationSchema:()=>Su,SubscriptionsListenRequestParamsSchema:()=>yu,SubscriptionsListenRequestSchema:()=>bu,SubscriptionsListenResultMetaSchema:()=>Cu,SubscriptionsListenResultSchema:()=>wu,TaskAugmentedRequestParamsSchema:()=>hl,TaskCreationParamsSchema:()=>Wd,TaskMetadataSchema:()=>fl,TaskSchema:()=>Kd,TaskStatusNotificationParamsSchema:()=>Jd,TaskStatusNotificationSchema:()=>Yd,TaskStatusSchema:()=>Gd,TextContentSchema:()=>Nu,TextResourceContentsSchema:()=>Ql,TitledMultiSelectEnumSchemaSchema:()=>wd,TitledSingleSelectEnumSchemaSchema:()=>bd,ToolAnnotationsSchema:()=>Uu,ToolChoiceSchema:()=>sd,ToolExecutionSchema:()=>Wu,ToolListChangedNotificationSchema:()=>Qu,ToolResultContentSchema:()=>cd,ToolSchema:()=>Gu,ToolUseContentSchema:()=>Iu,UnsubscribeRequestParamsSchema:()=>gu,UnsubscribeRequestSchema:()=>_u,UntitledMultiSelectEnumSchemaSchema:()=>Cd,UntitledSingleSelectEnumSchemaSchema:()=>yd}),nm=e=>bl.safeParse(e).success,rm=e=>xl.safeParse(e).success,im=e=>Sl.safeParse(e).success,am=e=>Cl.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 hs(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=ls(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=ls(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=>Zc({local:e,offset:t,precision:n}))))}function vm(e,t){let n;switch(e){case`email`:n=[Ps()];break;case`uri`:n=[Rs()];break;case`date`:n=[Qc()];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(Od.shape.requestedSchema.shape)]),Tm={string:sm([_d,yd,bd,xd]),number:sm([vd]),integer:sm([vd]),boolean:sm([gd]),array:sm([Cd,wd])},Em=new Set(_d.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(Dd,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(Od.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:gf,OAuthClientInformationFullSchema:xf,OAuthClientInformationSchema:bf,OAuthClientMetadataSchema:yf,OAuthClientRegistrationErrorSchema:Sf,OAuthErrorResponseSchema:_f,OAuthMetadataSchema:ff,OAuthProtectedResourceMetadataSchema:df,OAuthTokenRevocationRequestSchema:Cf,OAuthTokensSchema:hf,OpenIdProviderDiscoveryMetadataSchema:mf,OpenIdProviderMetadataSchema:pf},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=[nl,rl,al,sl],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??el,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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.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(Df.NotConnected,`Not connected`);if($p(t.method)&&!e.hasNotificationMethod(t.method))throw new X(Df.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 Ef(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 Ef(this,e)}constructor(e){super(e),this.name=new.target.name,Tf(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 Ef(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 Ef(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Tf(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return Ef(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 Ef(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Tf(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=wl.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=B([U(`light`),U(`dark`)]).describe(`Color theme preference for the host environment.`),vh=B([U(`inline`),U(`fullscreen`),U(`pip`)]).describe(`Display mode for UI presentation.`),yh=V(B([U(`--color-background-primary`),U(`--color-background-secondary`),U(`--color-background-tertiary`),U(`--color-background-inverse`),U(`--color-background-ghost`),U(`--color-background-info`),U(`--color-background-danger`),U(`--color-background-success`),U(`--color-background-warning`),U(`--color-background-disabled`),U(`--color-text-primary`),U(`--color-text-secondary`),U(`--color-text-tertiary`),U(`--color-text-inverse`),U(`--color-text-ghost`),U(`--color-text-info`),U(`--color-text-danger`),U(`--color-text-success`),U(`--color-text-warning`),U(`--color-text-disabled`),U(`--color-border-primary`),U(`--color-border-secondary`),U(`--color-border-tertiary`),U(`--color-border-inverse`),U(`--color-border-ghost`),U(`--color-border-info`),U(`--color-border-danger`),U(`--color-border-success`),U(`--color-border-warning`),U(`--color-border-disabled`),U(`--color-ring-primary`),U(`--color-ring-secondary`),U(`--color-ring-inverse`),U(`--color-ring-info`),U(`--color-ring-danger`),U(`--color-ring-success`),U(`--color-ring-warning`),U(`--font-sans`),U(`--font-mono`),U(`--font-weight-normal`),U(`--font-weight-medium`),U(`--font-weight-semibold`),U(`--font-weight-bold`),U(`--font-text-xs-size`),U(`--font-text-sm-size`),U(`--font-text-md-size`),U(`--font-text-lg-size`),U(`--font-heading-xs-size`),U(`--font-heading-sm-size`),U(`--font-heading-md-size`),U(`--font-heading-lg-size`),U(`--font-heading-xl-size`),U(`--font-heading-2xl-size`),U(`--font-heading-3xl-size`),U(`--font-text-xs-line-height`),U(`--font-text-sm-line-height`),U(`--font-text-md-line-height`),U(`--font-text-lg-line-height`),U(`--font-heading-xs-line-height`),U(`--font-heading-sm-line-height`),U(`--font-heading-md-line-height`),U(`--font-heading-lg-line-height`),U(`--font-heading-xl-line-height`),U(`--font-heading-2xl-line-height`),U(`--font-heading-3xl-line-height`),U(`--border-radius-xs`),U(`--border-radius-sm`),U(`--border-radius-md`),U(`--border-radius-lg`),U(`--border-radius-xl`),U(`--border-radius-full`),U(`--border-width-regular`),U(`--shadow-hairline`),U(`--shadow-sm`),U(`--shadow-md`),U(`--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.).