broods 0.31.0 → 0.32.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.
@@ -1,4 +1,4 @@
1
- import{$a as Ql,$b as Du,$c as kd,$d as bm,Aa as Di,Ab as Su,Ac as pd,Ad as Ze,Ae as Gm,Ba as Ui,Bb as yu,Bc as hd,Bd as Qd,Be as Bm,Ca as Hi,Cb as _u,Cc as fd,Cd as em,Ce as Ym,Da as Fi,Db as vu,Dc as gd,Dd as tm,De as Wm,Ea as xi,Eb as bu,Ec as Sd,Ed as G,Ee as Zm,Fa as Ka,Fb as Ru,Fc as yd,Fd as rm,Fe as Xm,Ga as wi,Gb as zu,Gc as _d,Gd as am,Ge as Qm,Ha as Ki,Hb as $u,Hc as vd,Hd as om,He as ep,Ia as Ti,Ib as Eu,Ic as bd,Id as sm,Ie as tp,Ja as Ci,Jb as Pu,Jc as an,Jd as nm,Je as rp,Ka as qi,Kb as wu,Kc as F,Kd as im,Ke as ap,La as ji,Lb as rn,Lc as Rd,Ld as cm,Le as it,Ma as Ll,Mb as i,Mc as zd,Md as ie,Me as tn,Na as Vl,Nb as Tu,Nc as $d,Nd as lm,Oa as Dl,Ob as Cu,Oc as Ed,Od as um,Pa as Ul,Pb as ln,Pc as Pd,Pd as I,Qa as Hl,Qb as qu,Qc as wd,Qd as dm,Ra as Fl,Rb as ju,Rc as on,Rd as mm,Sa as xl,Sb as Nu,Sc as W,Sd as pm,Ta as Kl,Tb as Iu,Tc as sn,Td as hm,Ua as Jl,Ub as Ou,Uc as Td,Ud as fm,Va as Gl,Vb as ku,Vc as Cd,Vd as Q,Wa as Bl,Wb as Mu,Wc as qd,Wd as gm,Xa as Yl,Xb as Au,Xc as jd,Xd as Sm,Ya as Wl,Yb as Kr,Yc as Nd,Yd as ym,Za as Zl,Zb as Lu,Zc as Id,Zd as _m,_a as Xl,_b as Vu,_c as Od,_d as vm,ab as eu,ac as Uu,ad as Md,ae as Rm,bb as tu,bc as Hu,bd as nt,be as zm,cb as ru,cc as Fu,cd as Ad,ce as $m,db as au,dc as xu,dd as un,de as Em,eb as ou,ec as Ku,ed as Ld,ee as Pm,fb as su,fc as Ju,fd as te,fe as wm,gb as nu,gc as Gu,gd as Vd,ge as Tm,hb as iu,hc as Bu,hd as Dd,he as Cm,ib as cu,ic as Yu,id as Ud,ie as qm,jb as lu,jc as Wu,jd as Hd,je as jm,kb as uu,kc as Zu,kd as nn,ke as Nm,lb as du,lc as Xu,ld as Fd,le as Im,mb as mu,mc as Qu,md as xd,me as Om,nb as xr,nc as ed,nd as N,ne as km,ob as xa,oc as td,od as Kd,oe as Mm,pb as zi,pc as rd,pd as Jd,pe as Am,qa as Ja,qb as Ji,qc as ad,qd as T,qe as Lm,ra as Ni,rb as Gi,rc as od,rd as Gd,re as Vm,sa as jt,sb as Bi,sc as sd,sd as re,se as Dm,ta as Ii,tb as Yi,tc as nd,td as Bd,te as Um,ua as Oi,ub as Je,uc as id,ud as Z,ue as Hm,va as ki,vb as pu,vc as cd,vd as Yd,ve as Fm,wa as Mi,wb as hu,wc as ld,wd as Wd,we as Yt,xa as Ai,xb as fu,xc as ud,xd as Zd,xe as xm,ya as Li,yb as gu,yc as dd,yd as Nt,ye as Km,za as Vi,zb as cn,zc as md,zd as Xd,ze as Jm}from"./chunk-e66afphr.js";import{Ne as Pi}from"./chunk-rx5qcgbh.js";var op={};Pi(op,{$brand:()=>Ni,$input:()=>Fi,$output:()=>Hi,NEVER:()=>Ja,TimePrecision:()=>Ki,ZodAny:()=>Ad,ZodArray:()=>xd,ZodBase64:()=>ld,ZodBase64URL:()=>dd,ZodBigInt:()=>sn,ZodBigIntFormat:()=>Cd,ZodBoolean:()=>on,ZodCIDRv4:()=>sd,ZodCIDRv6:()=>id,ZodCUID:()=>Fu,ZodCUID2:()=>Ku,ZodCatch:()=>Cm,ZodCodec:()=>km,ZodCustom:()=>Bm,ZodCustomStringFormat:()=>Sd,ZodDate:()=>nn,ZodDefault:()=>bm,ZodDiscriminatedUnion:()=>Zd,ZodE164:()=>pd,ZodEmail:()=>Cu,ZodEmoji:()=>Vu,ZodEnum:()=>cm,ZodError:()=>pu,ZodExactOptional:()=>gm,ZodFile:()=>dm,ZodFirstPartyTypeKind:()=>Qs,ZodFunction:()=>Jm,ZodGUID:()=>qu,ZodIPv4:()=>Qu,ZodIPv6:()=>ad,ZodISODate:()=>Gi,ZodISODateTime:()=>Ji,ZodISODuration:()=>Yi,ZodISOTime:()=>Bi,ZodIntersection:()=>Xd,ZodIssueCode:()=>en,ZodJWT:()=>fd,ZodKSUID:()=>Zu,ZodLazy:()=>Fm,ZodLiteral:()=>um,ZodMAC:()=>td,ZodMap:()=>om,ZodNaN:()=>jm,ZodNanoID:()=>Uu,ZodNever:()=>Vd,ZodNonOptional:()=>Em,ZodNull:()=>Md,ZodNullable:()=>ym,ZodNumber:()=>an,ZodNumberFormat:()=>Rd,ZodObject:()=>Jd,ZodOptional:()=>fm,ZodPipe:()=>Im,ZodPrefault:()=>zm,ZodPreprocess:()=>Lm,ZodPromise:()=>xm,ZodReadonly:()=>Vm,ZodRealError:()=>hu,ZodRecord:()=>tm,ZodSet:()=>nm,ZodString:()=>rn,ZodStringFormat:()=>Tu,ZodSuccess:()=>wm,ZodSymbol:()=>Nd,ZodTemplateLiteral:()=>Um,ZodTransform:()=>pm,ZodTuple:()=>Qd,ZodType:()=>Pu,ZodULID:()=>Gu,ZodURL:()=>Au,ZodUUID:()=>Nu,ZodUndefined:()=>Od,ZodUnion:()=>Bd,ZodUnknown:()=>Ld,ZodVoid:()=>Ud,ZodXID:()=>Yu,ZodXor:()=>Yd,_ZodString:()=>wu,_default:()=>Rm,_function:()=>Gm,any:()=>un,array:()=>N,base64:()=>ud,base64url:()=>md,bigint:()=>Td,boolean:()=>W,catch:()=>qm,check:()=>Ym,cidrv4:()=>nd,cidrv6:()=>cd,clone:()=>Ii,codec:()=>Mm,coerce:()=>Fr,config:()=>jt,core:()=>xa,cuid:()=>xu,cuid2:()=>Ju,custom:()=>Wm,date:()=>Fd,decode:()=>_u,decodeAsync:()=>bu,describe:()=>Qm,discriminatedUnion:()=>Nt,e164:()=>hd,email:()=>ln,emoji:()=>Du,encode:()=>yu,encodeAsync:()=>vu,endsWith:()=>ou,enum:()=>ie,exactOptional:()=>Sm,file:()=>mm,flattenError:()=>ki,float32:()=>$d,float64:()=>Ed,formatError:()=>Mi,fromJSONSchema:()=>Ei,function:()=>Gm,getErrorMap:()=>Cl,globalRegistry:()=>Ka,gt:()=>Dl,gte:()=>Ul,guid:()=>ju,hash:()=>bd,hex:()=>vd,hostname:()=>_d,httpUrl:()=>Lu,includes:()=>ru,instanceof:()=>tp,int:()=>zd,int32:()=>Pd,int64:()=>qd,intersection:()=>Ze,invertCodec:()=>Am,ipv4:()=>ed,ipv6:()=>od,iso:()=>Je,json:()=>ap,jwt:()=>gd,keyof:()=>Kd,ksuid:()=>Xu,lazy:()=>Yt,length:()=>Xl,literal:()=>I,locales:()=>Ui,looseObject:()=>re,looseRecord:()=>am,lowercase:()=>eu,lt:()=>Ll,lte:()=>Vl,mac:()=>rd,map:()=>sm,maxLength:()=>Wl,maxSize:()=>Gl,meta:()=>ep,mime:()=>nu,minLength:()=>Zl,minSize:()=>Bl,multipleOf:()=>Jl,nan:()=>Nm,nanoid:()=>Hu,nativeEnum:()=>lm,negative:()=>Fl,never:()=>Dd,nonnegative:()=>Kl,nonoptional:()=>Pm,nonpositive:()=>xl,normalize:()=>cu,null:()=>nt,nullable:()=>_m,nullish:()=>vm,number:()=>F,object:()=>T,optional:()=>Q,overwrite:()=>iu,parse:()=>fu,parseAsync:()=>gu,partialRecord:()=>rm,pipe:()=>Om,positive:()=>Hl,prefault:()=>$m,preprocess:()=>it,prettifyError:()=>Li,promise:()=>Km,property:()=>su,readonly:()=>Dm,record:()=>G,refine:()=>Zm,regex:()=>Ql,regexes:()=>Vi,registry:()=>xi,safeDecode:()=>zu,safeDecodeAsync:()=>Eu,safeEncode:()=>Ru,safeEncodeAsync:()=>$u,safeParse:()=>cn,safeParseAsync:()=>Su,set:()=>im,setErrorMap:()=>Tl,size:()=>Yl,slugify:()=>mu,startsWith:()=>au,strictObject:()=>Gd,string:()=>i,stringFormat:()=>yd,stringbool:()=>rp,success:()=>Tm,superRefine:()=>Xm,symbol:()=>Id,templateLiteral:()=>Hm,toJSONSchema:()=>xr,toLowerCase:()=>uu,toUpperCase:()=>du,transform:()=>hm,treeifyError:()=>Ai,trim:()=>lu,tuple:()=>em,uint32:()=>wd,uint64:()=>jd,ulid:()=>Bu,undefined:()=>kd,union:()=>Z,unknown:()=>te,uppercase:()=>tu,url:()=>Kr,util:()=>Oi,uuid:()=>Iu,uuidv4:()=>Ou,uuidv6:()=>ku,uuidv7:()=>Mu,void:()=>Hd,xid:()=>Wu,xor:()=>Wd});var en={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"};function Tl(e){jt({customError:e})}function Cl(){return jt().customError}var Qs;(function(e){})(Qs||(Qs={}));var B={...tn,...zi,iso:Je},ql=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function jl(e,t){let r=e.$schema;if(r==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(r==="http://json-schema.org/draft-07/schema#")return"draft-7";if(r==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function Nl(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let a=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===a){let o=r[1];if(!o||!t.defs[o])throw Error(`Reference not found: ${e}`);return t.defs[o]}throw Error(`Reference not found: ${e}`)}function $i(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return B.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return B.lazy(()=>{if(!t.refs.has(o))throw Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let s=Nl(o,t),n=Oe(s,t);return t.refs.set(o,n),t.processing.delete(o),n}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return B.null();if(o.length===0)return B.never();if(o.length===1)return B.literal(o[0]);if(o.every((n)=>typeof n==="string"))return B.enum(o);let s=o.map((n)=>B.literal(n));if(s.length<2)return s[0];return B.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return B.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map((s)=>{let n={...e,type:s};return $i(n,t)});if(o.length===0)return B.never();if(o.length===1)return o[0];return B.union(o)}if(!r)return B.any();let a;switch(r){case"string":{let o=B.string();if(e.format){let s=e.format;if(s==="email")o=o.check(B.email());else if(s==="uri"||s==="uri-reference")o=o.check(B.url());else if(s==="uuid"||s==="guid")o=o.check(B.uuid());else if(s==="date-time")o=o.check(B.iso.datetime());else if(s==="date")o=o.check(B.iso.date());else if(s==="time")o=o.check(B.iso.time());else if(s==="duration")o=o.check(B.iso.duration());else if(s==="ipv4")o=o.check(B.ipv4());else if(s==="ipv6")o=o.check(B.ipv6());else if(s==="mac")o=o.check(B.mac());else if(s==="cidr")o=o.check(B.cidrv4());else if(s==="cidr-v6")o=o.check(B.cidrv6());else if(s==="base64")o=o.check(B.base64());else if(s==="base64url")o=o.check(B.base64url());else if(s==="e164")o=o.check(B.e164());else if(s==="jwt")o=o.check(B.jwt());else if(s==="emoji")o=o.check(B.emoji());else if(s==="nanoid")o=o.check(B.nanoid());else if(s==="cuid")o=o.check(B.cuid());else if(s==="cuid2")o=o.check(B.cuid2());else if(s==="ulid")o=o.check(B.ulid());else if(s==="xid")o=o.check(B.xid());else if(s==="ksuid")o=o.check(B.ksuid())}if(typeof e.minLength==="number")o=o.min(e.minLength);if(typeof e.maxLength==="number")o=o.max(e.maxLength);if(e.pattern)o=o.regex(new RegExp(e.pattern));a=o;break}case"number":case"integer":{let o=r==="integer"?B.number().int():B.number();if(typeof e.minimum==="number")o=o.min(e.minimum);if(typeof e.maximum==="number")o=o.max(e.maximum);if(typeof e.exclusiveMinimum==="number")o=o.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")o=o.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")o=o.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")o=o.lt(e.maximum);if(typeof e.multipleOf==="number")o=o.multipleOf(e.multipleOf);a=o;break}case"boolean":{a=B.boolean();break}case"null":{a=B.null();break}case"object":{let o={},s=e.properties||{},n=new Set(e.required||[]);for(let[c,u]of Object.entries(s)){let h=Oe(u,t);o[c]=n.has(c)?h:h.optional()}if(e.propertyNames){let c=Oe(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?Oe(e.additionalProperties,t):B.any();if(Object.keys(o).length===0){a=B.record(c,u);break}let h=B.object(o).passthrough(),f=B.looseRecord(c,u);a=B.intersection(h,f);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),h=[];for(let z of u){let E=Oe(c[z],t),_=B.string().regex(new RegExp(z));h.push(B.looseRecord(_,E))}let f=[];if(Object.keys(o).length>0)f.push(B.object(o).passthrough());if(f.push(...h),f.length===0)a=B.object({}).passthrough();else if(f.length===1)a=f[0];else{let z=B.intersection(f[0],f[1]);for(let E=2;E<f.length;E++)z=B.intersection(z,f[E]);a=z}break}let l=B.object(o);if(e.additionalProperties===!1)a=l.strict();else if(typeof e.additionalProperties==="object")a=l.catchall(Oe(e.additionalProperties,t));else a=l.passthrough();break}case"array":{let{prefixItems:o,items:s}=e;if(o&&Array.isArray(o)){let n=o.map((c)=>Oe(c,t)),l=s&&typeof s==="object"&&!Array.isArray(s)?Oe(s,t):void 0;if(l)a=B.tuple(n).rest(l);else a=B.tuple(n);if(typeof e.minItems==="number")a=a.check(B.minLength(e.minItems));if(typeof e.maxItems==="number")a=a.check(B.maxLength(e.maxItems))}else if(Array.isArray(s)){let n=s.map((c)=>Oe(c,t)),l=e.additionalItems&&typeof e.additionalItems==="object"?Oe(e.additionalItems,t):void 0;if(l)a=B.tuple(n).rest(l);else a=B.tuple(n);if(typeof e.minItems==="number")a=a.check(B.minLength(e.minItems));if(typeof e.maxItems==="number")a=a.check(B.maxLength(e.maxItems))}else if(s!==void 0){let n=Oe(s,t),l=B.array(n);if(typeof e.minItems==="number")l=l.min(e.minItems);if(typeof e.maxItems==="number")l=l.max(e.maxItems);a=l}else a=B.array(B.any());break}default:throw Error(`Unsupported type: ${r}`)}return a}function Oe(e,t){if(typeof e==="boolean")return e?B.any():B.never();let r=$i(e,t),a=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map((u)=>Oe(u,t)),c=B.union(l);r=a?B.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map((u)=>Oe(u,t)),c=B.xor(l);r=a?B.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=a?r:B.any();else{let l=a?r:Oe(e.allOf[0],t),c=a?0:1;for(let u=c;u<e.allOf.length;u++)l=B.intersection(l,Oe(e.allOf[u],t));r=l}if(e.nullable===!0&&t.version==="openapi-3.0")r=B.nullable(r);if(e.readOnly===!0)r=B.readonly(r);if(e.default!==void 0)r=r.default(e.default);let o={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of s)if(l in e)o[l]=e[l];let n=["contentEncoding","contentMediaType","contentSchema"];for(let l of n)if(l in e)o[l]=e[l];for(let l of Object.keys(e))if(!ql.has(l))o[l]=e[l];if(Object.keys(o).length>0)t.registry.add(r,o);if(e.description)r=r.describe(e.description);return r}function Ei(e,t){if(typeof e==="boolean")return e?B.any():B.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let a=jl(r,t?.defaultTarget),o=r.$defs||r.definitions||{},s={version:a,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ka};return Oe(r,s)}var Fr={};Pi(Fr,{bigint:()=>Ml,boolean:()=>kl,date:()=>Al,number:()=>Ol,string:()=>Il});function Il(e){return wi(rn,e)}function Ol(e){return Ti(an,e)}function kl(e){return Ci(on,e)}function Ml(e){return qi(sn,e)}function Al(e){return ji(nn,e)}jt(Di());var{create:sp,defineProperty:Ga,getOwnPropertyDescriptor:np,getOwnPropertyNames:ip,getPrototypeOf:cp}=Object,lp=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wi=(e,t)=>{let r={};for(var a in e)Ga(r,a,{get:e[a],enumerable:!0});if(t)Ga(r,Symbol.toStringTag,{value:"Module"});return r},up=(e,t,r,a)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var o=ip(t),s=0,n=o.length,l;s<n;s++)if(l=o[s],!lp.call(e,l)&&l!==r)Ga(e,l,{get:((c)=>t[c]).bind(null,l),enumerable:!(a=np(t,l))||a.enumerable})}return e},Ba=(e,t,r)=>(r=e!=null?sp(cp(e)):{},up(t||!e||!e.__esModule?Ga(r,"default",{value:e,enumerable:!0}):r,e));var dp=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Zi=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),mp=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),pp=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Xi(e){return typeof e==="string"&&Zi.has(e.replace(/#$/,""))}function Qi(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(dp.has(r))return"2020-12";if(Zi.has(r))return"2019-09";if(mp.has(r)||pp.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Wt="2025-11-25";var mn=[Wt,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],pn="io.modelcontextprotocol/related-task",lt="io.modelcontextprotocol/protocolVersion",Jr="io.modelcontextprotocol/clientInfo",Qe="io.modelcontextprotocol/serverInfo",ut="io.modelcontextprotocol/clientCapabilities",Zt="io.modelcontextprotocol/subscriptionId",Ot="io.modelcontextprotocol/logLevel";var Xt="2.0";var ct=Yt(()=>Z([i(),F(),W(),nt(),G(i(),ct),N(ct)])),ve=G(i(),ct),hn=N(ct),Gr=Z([i(),F().int()]),Br=i(),Ya=T({ttl:F().optional()}),Wa=T({taskId:i()}),Yr=re({progressToken:Gr.optional(),[pn]:Wa.optional()}),qe=T({_meta:Yr.optional()}),kt=qe.extend({task:Ya.optional()}),be=T({method:i(),params:qe.loose().optional()}),ke=T({_meta:Yr.optional()}),Me=T({method:i(),params:ke.loose().optional()}),Wr=re({get[Qe](){return tr.optional().catch(void 0)}}),Re=re({_meta:Wr.optional()}),dt=Z([i(),F().int()]),Zr=T({jsonrpc:I(Xt),id:dt,...be.shape}).strict(),Xr=T({jsonrpc:I(Xt),...Me.shape}).strict(),Qt=T({jsonrpc:I(Xt),id:dt,result:Re}).strict(),er=T({jsonrpc:I(Xt),id:dt.optional(),error:T({code:F().int(),message:i(),data:te().optional()})}).strict(),Za=Z([Zr,Xr,Qt,er]),fn=Z([Qt,er]),Qr=Re.strict(),Xa=ke.extend({requestId:dt.optional(),reason:i().optional()}),ea=Me.extend({method:I("notifications/cancelled"),params:Xa}),Qa=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),mt=T({icons:N(Qa).optional()}),Xe=T({name:i(),title:i().optional()}),tr=Xe.extend({...Xe.shape,...mt.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),fp=Ze(T({applyDefaults:W().optional()}),ve),gp=it((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Ze(T({form:fp.optional(),url:ve.optional()}),ve.optional())),eo=re({list:ve.optional(),cancel:ve.optional(),requests:re({sampling:re({createMessage:ve.optional()}).optional(),elicitation:re({create:ve.optional()}).optional()}).optional()}),to=re({list:ve.optional(),cancel:ve.optional(),requests:re({tools:re({call:ve.optional()}).optional()}).optional()}),ro=T({experimental:G(i(),ve).optional(),sampling:T({context:ve.optional(),tools:ve.optional()}).optional(),elicitation:gp.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:eo.optional(),extensions:G(i(),ve).optional()}),ao=qe.extend({protocolVersion:i(),capabilities:ro,clientInfo:tr}),oo=be.extend({method:I("initialize"),params:ao}),ta=T({experimental:G(i(),ve).optional(),logging:ve.optional(),completions:ve.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:to.optional(),extensions:G(i(),ve).optional()}),so=Re.extend({protocolVersion:i(),capabilities:ta,serverInfo:tr,instructions:i().optional()}),no=Me.extend({method:I("notifications/initialized"),params:ke.optional()}),io=be.extend({method:I("server/discover"),params:qe.optional()}),co=Re.extend({supportedVersions:N(i()),capabilities:ta,instructions:i().optional()}),ra=be.extend({method:I("ping"),params:qe.optional()}),lo=T({progress:F(),total:Q(F()),message:Q(i())}),uo=T({...ke.shape,...lo.shape,progressToken:Gr}),aa=Me.extend({method:I("notifications/progress"),params:uo}),mo=qe.extend({cursor:Br.optional()}),pt=be.extend({params:mo.optional()}),ht=Re.extend({nextCursor:Br.optional()}),oa=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),sa=oa.extend({text:i()}),gn=i().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),na=oa.extend({blob:gn}),ft=ie(["user","assistant"]),et=T({audience:N(ft).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),ia=T({...Xe.shape,...mt.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:et.optional(),_meta:Q(re({}))}),po=T({...Xe.shape,...mt.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:et.optional(),_meta:Q(re({}))}),ho=pt.extend({method:I("resources/list")}),fo=ht.extend({resources:N(ia)}),go=pt.extend({method:I("resources/templates/list")}),So=ht.extend({resourceTemplates:N(po)}),rr=qe.extend({uri:i()}),yo=rr,_o=be.extend({method:I("resources/read"),params:yo}),vo=Re.extend({contents:N(Z([sa,na]))}),bo=Me.extend({method:I("notifications/resources/list_changed"),params:ke.optional()}),Ro=rr,zo=be.extend({method:I("resources/subscribe"),params:Ro}),$o=rr,Eo=be.extend({method:I("resources/unsubscribe"),params:$o}),ca=T({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:N(i()).optional()}),Po=qe.extend({notifications:ca}),wo=be.extend({method:I("subscriptions/listen"),params:Po}),To=ke.extend({notifications:ca}),Co=Me.extend({method:I("notifications/subscriptions/acknowledged"),params:To}),qo=Wr.extend({[Zt]:dt}),jo=Re.extend({_meta:qo}),No=ke.extend({uri:i()}),Io=Me.extend({method:I("notifications/resources/updated"),params:No}),Oo=T({name:i(),description:Q(i()),required:Q(W())}),ko=T({...Xe.shape,...mt.shape,description:Q(i()),arguments:Q(N(Oo)),_meta:Q(re({}))}),Mo=pt.extend({method:I("prompts/list")}),Ao=ht.extend({prompts:N(ko)}),Lo=qe.extend({name:i(),arguments:G(i(),i()).optional()}),Vo=be.extend({method:I("prompts/get"),params:Lo}),ar=T({type:I("text"),text:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),or=T({type:I("image"),data:gn,mimeType:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),sr=T({type:I("audio"),data:gn,mimeType:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),Do=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),Uo=T({type:I("resource"),resource:Z([sa,na]),annotations:et.optional(),_meta:G(i(),te()).optional()}),Ho=ia.extend({type:I("resource_link")}),nr=Z([ar,or,sr,Ho,Uo]),Fo=T({role:ft,content:nr}),xo=Re.extend({description:i().optional(),messages:N(Fo)}),Ko=Me.extend({method:I("notifications/prompts/list_changed"),params:ke.optional()}),Jo=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),Go=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),la=T({...Xe.shape,...mt.shape,description:i().optional(),inputSchema:T({type:I("object"),properties:G(i(),ct).optional(),required:N(i()).optional()}).catchall(te()),outputSchema:re({$schema:i().optional()}).optional(),annotations:Jo.optional(),execution:Go.optional(),_meta:G(i(),te()).optional()}),Bo=pt.extend({method:I("tools/list")}),Yo=ht.extend({tools:N(la)}),ua=Re.extend({content:N(nr).default([]),structuredContent:te().optional(),isError:W().optional()}),Sn=ua.or(Re.extend({toolResult:te()})),Wo=kt.extend({name:i(),arguments:G(i(),te()).optional()}),Zo=be.extend({method:I("tools/call"),params:Wo}),Xo=Me.extend({method:I("notifications/tools/list_changed"),params:ke.optional()}),yn=T({autoRefresh:W().default(!0),debounceMs:F().int().nonnegative().default(300)}),gt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Qo=qe.extend({level:gt}),es=be.extend({method:I("logging/setLevel"),params:Qo}),ts=ke.extend({level:gt,logger:i().optional(),data:te()}),rs=Me.extend({method:I("notifications/message"),params:ts}),as=T({name:i().optional()}),os=T({hints:N(as).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),ss=T({mode:ie(["auto","required","none"]).optional()}),ns=T({type:I("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:N(nr),structuredContent:te().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),is=Nt("type",[ar,or,sr]),It=Nt("type",[ar,or,sr,Do,ns]),cs=T({role:ft,content:Z([It,N(It)]),_meta:G(i(),te()).optional()}),ls=kt.extend({messages:N(cs),modelPreferences:os.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:ve.optional(),tools:N(la).optional(),toolChoice:ss.optional()}),us=be.extend({method:I("sampling/createMessage"),params:ls}),ds=Re.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(i())),role:ft,content:is}),ms=Re.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:ft,content:Z([It,N(It)])}),da=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),ir=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),cr=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),ma=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),pa=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),ha=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),ps=Z([ma,pa]),fa=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),ga=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),hs=Z([fa,ga]),fs=Z([ha,ps,hs]),Sa=Z([fs,da,ir,cr]),lr=kt.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),Sa),required:N(i()).optional()}).catchall(te())}),gs=kt.extend({mode:I("url"),message:i(),elicitationId:i(),url:i().url()}),Ss=Z([lr,gs]),ys=be.extend({method:I("elicitation/create"),params:Ss}),_s=ke.extend({elicitationId:i()}),vs=Me.extend({method:I("notifications/elicitation/complete"),params:_s}),bs=Re.extend({action:ie(["accept","decline","cancel"]),content:it((e)=>e===null?void 0:e,G(i(),Z([i(),F(),W(),N(i())])).optional())}),Rs=T({type:I("ref/resource"),uri:i()}),zs=T({type:I("ref/prompt"),name:i()}),$s=qe.extend({ref:Z([zs,Rs]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()}),Es=be.extend({method:I("completion/complete"),params:$s}),Ps=Re.extend({completion:re({values:N(i()).max(100),total:Q(F().int()),hasMore:Q(W())})}),ws=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),Ts=be.extend({method:I("roots/list"),params:qe.optional()}),Cs=Re.extend({roots:N(ws)}),qs=Me.extend({method:I("notifications/roots/list_changed"),params:ke.optional()}),_n=re({ttl:F().optional(),pollInterval:F().optional()}),js=ie(["working","input_required","completed","failed","cancelled"]),St=T({taskId:i(),status:js,ttl:Z([F(),nt()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:Q(F()),statusMessage:Q(i())}),vn=Re.extend({task:St}),Ns=ke.merge(St),bn=Me.extend({method:I("notifications/tasks/status"),params:Ns}),Rn=be.extend({method:I("tasks/get"),params:qe.extend({taskId:i()})}),zn=Re.merge(St),$n=be.extend({method:I("tasks/result"),params:qe.extend({taskId:i()})}),En=Re.loose(),Pn=pt.extend({method:I("tasks/list")}),wn=ht.extend({tasks:N(St)}),Tn=be.extend({method:I("tasks/cancel"),params:qe.extend({taskId:i()})}),Cn=Re.merge(St),qn=Z([ra,oo,io,Es,es,Vo,Mo,ho,go,_o,zo,Eo,wo,Zo,Bo]),jn=Z([ea,aa,no,qs]),Nn=Z([Qr,ds,ms,bs,Cs]),In=Z([ra,us,ys,Ts]),On=Z([ea,aa,rs,Io,bo,Xo,Ko,Co,vs]),kn=Z([Qr,so,co,Ps,xo,Ao,fo,So,vo,ua,Yo,jo]),Ce=Kr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:en.custom,message:"URL must be parseable",fatal:!0}),Ja}).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"}),Mn=re({resource:i().url(),authorization_servers:N(Ce).optional(),jwks_uri:i().url().optional(),scopes_supported:N(i()).optional(),bearer_methods_supported:N(i()).optional(),resource_signing_alg_values_supported:N(i()).optional(),resource_name:i().optional(),resource_documentation:i().optional(),resource_policy_uri:i().url().optional(),resource_tos_uri:i().url().optional(),tls_client_certificate_bound_access_tokens:W().optional(),authorization_details_types_supported:N(i()).optional(),dpop_signing_alg_values_supported:N(i()).optional(),dpop_bound_access_tokens_required:W().optional()}),Is=re({issuer:i(),authorization_endpoint:Ce,token_endpoint:Ce,registration_endpoint:Ce.optional(),scopes_supported:N(i()).optional(),response_types_supported:N(i()),response_modes_supported:N(i()).optional(),grant_types_supported:N(i()).optional(),token_endpoint_auth_methods_supported:N(i()).optional(),token_endpoint_auth_signing_alg_values_supported:N(i()).optional(),service_documentation:Ce.optional(),revocation_endpoint:Ce.optional(),revocation_endpoint_auth_methods_supported:N(i()).optional(),revocation_endpoint_auth_signing_alg_values_supported:N(i()).optional(),introspection_endpoint:i().optional(),introspection_endpoint_auth_methods_supported:N(i()).optional(),introspection_endpoint_auth_signing_alg_values_supported:N(i()).optional(),code_challenge_methods_supported:N(i()).optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),Os=re({issuer:i(),authorization_endpoint:Ce,token_endpoint:Ce,userinfo_endpoint:Ce.optional(),jwks_uri:Ce,registration_endpoint:Ce.optional(),scopes_supported:N(i()).optional(),response_types_supported:N(i()),response_modes_supported:N(i()).optional(),grant_types_supported:N(i()).optional(),acr_values_supported:N(i()).optional(),subject_types_supported:N(i()),id_token_signing_alg_values_supported:N(i()),id_token_encryption_alg_values_supported:N(i()).optional(),id_token_encryption_enc_values_supported:N(i()).optional(),userinfo_signing_alg_values_supported:N(i()).optional(),userinfo_encryption_alg_values_supported:N(i()).optional(),userinfo_encryption_enc_values_supported:N(i()).optional(),request_object_signing_alg_values_supported:N(i()).optional(),request_object_encryption_alg_values_supported:N(i()).optional(),request_object_encryption_enc_values_supported:N(i()).optional(),token_endpoint_auth_methods_supported:N(i()).optional(),token_endpoint_auth_signing_alg_values_supported:N(i()).optional(),display_values_supported:N(i()).optional(),claim_types_supported:N(i()).optional(),claims_supported:N(i()).optional(),service_documentation:i().optional(),claims_locales_supported:N(i()).optional(),ui_locales_supported:N(i()).optional(),claims_parameter_supported:W().optional(),request_parameter_supported:W().optional(),request_uri_parameter_supported:W().optional(),require_request_uri_registration:W().optional(),op_policy_uri:Ce.optional(),op_tos_uri:Ce.optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),An=T({...Os.shape,...Is.pick({code_challenge_methods_supported:!0}).shape}),Ln=T({access_token:i(),id_token:i().optional(),token_type:i(),expires_in:Fr.number().optional(),scope:i().optional(),refresh_token:i().optional()}).strip(),Vn=T({issued_token_type:I("urn:ietf:params:oauth:token-type:id-jag"),access_token:i(),token_type:i().optional(),expires_in:F().optional(),scope:i().optional()}).strip(),Dn=T({error:i(),error_description:i().optional(),error_uri:i().optional()}),dn=Ce.optional().or(I("").transform(()=>{return})),ks=T({redirect_uris:N(Ce),token_endpoint_auth_method:i().optional(),grant_types:N(i()).optional(),response_types:N(i()).optional(),application_type:i().optional(),client_name:i().optional(),client_uri:Ce.optional(),logo_uri:dn,scope:i().optional(),contacts:N(i()).optional(),tos_uri:dn,policy_uri:i().optional(),jwks_uri:Ce.optional(),jwks:un().optional(),software_id:i().optional(),software_version:i().optional(),software_statement:i().optional()}).strip(),Ms=T({client_id:i(),client_secret:i().optional(),client_id_issued_at:F().optional(),client_secret_expires_at:F().optional()}).strip(),Un=ks.merge(Ms),Hn=T({error:i(),error_description:i().optional()}).strip(),Fn=T({token:i(),token_type_hint:i().optional()}).strip();var Gn=Symbol.for("mcp.sdk.errorBrands");function Zn(e,t){let r=new Set,a=t;while(typeof a==="function"){let o=a.mcpBrand;if(Object.prototype.hasOwnProperty.call(a,"mcpBrand")&&typeof o==="string")r.add(o);a=Object.getPrototypeOf(a)}if(r.size===0)return;Object.defineProperty(e,Gn,{value:r,enumerable:!1,configurable:!0})}function dr(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Gn)){let r=t[Gn];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var tS=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return dr(this,t)}static isInstance(t){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 dr(this,t)}constructor(t,r,a){super(r);this.code=t,this.errorUri=a,this.name="OAuthError",Zn(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},pe=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}({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return dr(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 dr(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name="SdkError",Zn(this,new.target)}},rS=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ec(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Pp(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function hc(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Xn(e,t){let r={};for(let[a,o]of Object.entries(e)){if(o===void 0)continue;let s=t===void 0?void 0:t[a];if(s===void 0){r[a]=o;continue}if(ec(o)&&ec(s)){let n={};for(let[l,c]of Object.entries(o))if(c!==void 0&&s[l]===void 0&&!Pp(a,l,s))n[l]=c;if(Object.keys(n).length>0)r[a]=n}}return Object.keys(r).length>0?r:void 0}var fc="2026-07-28",aS=[fc];function pr(e){return e>=fc}function gc(e){return e.filter((t)=>!pr(t))}function Qn(e){return e.filter((t)=>pr(t))}function Sc(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var yc=["task","inputRequests","requestState"];function ei(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||yc.some((t)=>(t in e)))return e;return{...e,content:[]}}function wp(){let e=Yt(()=>Z([i(),F(),W(),nt(),G(i(),e),N(e)])),t=G(i(),e),r=Z([i(),F().int()]),a=i(),o=T({ttl:F().optional()}),s=T({taskId:i()}),n=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),l=T({_meta:n.optional()}),c=l.extend({task:o.optional()}),u=T({method:i(),params:l.loose().optional()}),h=T({_meta:n.optional()}),f=T({method:i(),params:h.loose().optional()}),z=re({_meta:n.optional()}),E=Z([i(),F().int()]),_=z.strict(),v=h.extend({requestId:E.optional(),reason:i().optional()}),g=f.extend({method:I("notifications/cancelled"),params:v}),d=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),y=T({icons:N(d).optional()}),m=T({name:i(),title:i().optional()}),b=m.extend({...m.shape,...y.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),P=Ze(T({applyDefaults:W().optional()}),t),S=it((Ie)=>{if(Ie&&typeof Ie==="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0)return{form:{}};return Ie},Ze(T({form:P.optional(),url:t.optional()}),t.optional())),p=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),w=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),A=T({experimental:G(i(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:p.optional(),extensions:G(i(),t).optional()}),x=l.extend({protocolVersion:i(),capabilities:A,clientInfo:b}),L=u.extend({method:I("initialize"),params:x}),U=T({experimental:G(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:w.optional(),extensions:G(i(),t).optional()}),X=z.extend({protocolVersion:i(),capabilities:U,serverInfo:b,instructions:i().optional()}),Y=f.extend({method:I("notifications/initialized"),params:h.optional()}),me=u.extend({method:I("ping"),params:l.optional()}),ye=T({progress:F(),total:Q(F()),message:Q(i())}),ge=T({...h.shape,...ye.shape,progressToken:r}),Ee=f.extend({method:I("notifications/progress"),params:ge}),he=l.extend({cursor:a.optional()}),j=u.extend({params:he.optional()}),k=z.extend({nextCursor:a.optional()}),H=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),R=H.extend({text:i()}),q=i().refine((Ie)=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),O=H.extend({blob:q}),K=ie(["user","assistant"]),ee=T({audience:N(K).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),de=T({...m.shape,...y.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:ee.optional(),_meta:Q(re({}))}),ne=T({...m.shape,...y.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:ee.optional(),_meta:Q(re({}))}),Se=j.extend({method:I("resources/list")}),Ae=k.extend({resources:N(de)}),C=j.extend({method:I("resources/templates/list")}),M=k.extend({resourceTemplates:N(ne)}),V=l.extend({uri:i()}),oe=V,se=u.extend({method:I("resources/read"),params:oe}),le=z.extend({contents:N(Z([R,O]))}),ze=f.extend({method:I("notifications/resources/list_changed"),params:h.optional()}),we=V,je=u.extend({method:I("resources/subscribe"),params:we}),Pe=V,_e=u.extend({method:I("resources/unsubscribe"),params:Pe}),He=h.extend({uri:i()}),Te=f.extend({method:I("notifications/resources/updated"),params:He}),Ye=T({name:i(),description:Q(i()),required:Q(W())}),xe=T({...m.shape,...y.shape,description:Q(i()),arguments:Q(N(Ye)),_meta:Q(re({}))}),We=j.extend({method:I("prompts/list")}),tt=k.extend({prompts:N(xe)}),rt=l.extend({name:i(),arguments:G(i(),i()).optional()}),bt=u.extend({method:I("prompts/get"),params:rt}),Rt=T({type:I("text"),text:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),zt=T({type:I("image"),data:q,mimeType:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),$t=T({type:I("audio"),data:q,mimeType:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),gr=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),at=T({type:I("resource"),resource:Z([R,O]),annotations:ee.optional(),_meta:G(i(),te()).optional()}),Sr=de.extend({type:I("resource_link")}),Fe=Z([Rt,zt,$t,Sr,at]),Lt=T({role:K,content:Fe}),Vt=z.extend({description:i().optional(),messages:N(Lt)}),Et=f.extend({method:I("notifications/prompts/list_changed"),params:h.optional()}),yr=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),Dt=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Pt=T({...m.shape,...y.shape,description:i().optional(),inputSchema:T({type:I("object"),properties:G(i(),e).optional(),required:N(i()).optional()}).catchall(te()),outputSchema:T({type:I("object"),properties:G(i(),e).optional(),required:N(i()).optional()}).catchall(te()).optional(),annotations:yr.optional(),execution:Dt.optional(),_meta:G(i(),te()).optional()}),Ut=j.extend({method:I("tools/list")}),Ht=k.extend({tools:N(Pt)}),Ft=z.extend({content:N(Fe),structuredContent:G(i(),te()).optional(),isError:W().optional()}),Ne=c.extend({name:i(),arguments:G(i(),te()).optional()}),_r=u.extend({method:I("tools/call"),params:Ne}),wa=f.extend({method:I("notifications/tools/list_changed"),params:h.optional()}),xt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),vr=l.extend({level:xt}),br=u.extend({method:I("logging/setLevel"),params:vr}),Rr=h.extend({level:xt,logger:i().optional(),data:te()}),zr=f.extend({method:I("notifications/message"),params:Rr}),$r=T({name:i().optional()}),Er=T({hints:N($r).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Pr=T({mode:ie(["auto","required","none"]).optional()}),Ta=T({type:I("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:N(Fe),structuredContent:T({}).loose().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),wr=Nt("type",[Rt,zt,$t]),ot=Nt("type",[Rt,zt,$t,gr,Ta]),Tr=T({role:K,content:Z([ot,N(ot)]),_meta:G(i(),te()).optional()}),Cr=c.extend({messages:N(Tr),modelPreferences:Er.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:t.optional(),tools:N(Pt).optional(),toolChoice:Pr.optional()}),qr=u.extend({method:I("sampling/createMessage"),params:Cr}),jr=z.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(i())),role:K,content:wr}),Nr=z.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:K,content:Z([ot,N(ot)])}),Ir=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),Or=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),kr=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Mr=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),Ar=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),Lr=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),Vr=Z([Mr,Ar]),wt=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),Tt=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),Ca=Z([wt,Tt]),qa=Z([Lr,Vr,Ca]),De=Z([qa,Ir,Or,kr]),Ue=c.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),De),required:N(i()).optional()}).catchall(te())}),Dr=c.extend({mode:I("url"),message:i(),elicitationId:i(),url:i().url()}),Ke=Z([Ue,Dr]),ja=u.extend({method:I("elicitation/create"),params:Ke}),Na=h.extend({elicitationId:i()}),Ia=f.extend({method:I("notifications/elicitation/complete"),params:Na}),Oa=z.extend({action:ie(["accept","decline","cancel"]),content:it((Ie)=>Ie===null?void 0:Ie,G(i(),Z([i(),F(),W(),N(i())])).optional())}),ka=T({type:I("ref/resource"),uri:i()}),Ma=T({type:I("ref/prompt"),name:i()}),Aa=l.extend({ref:Z([Ma,ka]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()}),Ur=u.extend({method:I("completion/complete"),params:Aa}),La=z.extend({completion:re({values:N(i()).max(100),total:Q(F().int()),hasMore:Q(W())})}),Va=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),Kt=u.extend({method:I("roots/list"),params:l.optional()}),Hr=z.extend({roots:N(Va)}),Da=f.extend({method:I("notifications/roots/list_changed"),params:h.optional()}),Ua=re({ttl:F().optional(),pollInterval:F().optional()}),Ha=ie(["working","input_required","completed","failed","cancelled"]),st=T({taskId:i(),status:Ha,ttl:Z([F(),nt()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:Q(F()),statusMessage:Q(i())}),Le=z.extend({task:st}),Fa=h.merge(st),Ct=f.extend({method:I("notifications/tasks/status"),params:Fa}),Jt=u.extend({method:I("tasks/get"),params:l.extend({taskId:i()})}),Gt=z.merge(st),Bt=u.extend({method:I("tasks/result"),params:l.extend({taskId:i()})}),Xs=z.loose(),Ve=j.extend({method:I("tasks/list")}),$e=k.extend({tasks:N(st)}),qt=u.extend({method:I("tasks/cancel"),params:l.extend({taskId:i()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:a,TaskMetadataSchema:o,RelatedTaskMetadataSchema:s,RequestMetaSchema:n,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:h,NotificationSchema:f,ResultSchema:z,RequestIdSchema:E,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:g,IconSchema:d,IconsSchema:y,BaseMetadataSchema:m,ImplementationSchema:b,ClientTasksCapabilitySchema:p,ServerTasksCapabilitySchema:w,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:x,InitializeRequestSchema:L,ServerCapabilitiesSchema:U,InitializeResultSchema:X,InitializedNotificationSchema:Y,PingRequestSchema:me,ProgressSchema:ye,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:Ee,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:j,PaginatedResultSchema:k,ResourceContentsSchema:H,TextResourceContentsSchema:R,BlobResourceContentsSchema:O,RoleSchema:K,AnnotationsSchema:ee,ResourceSchema:de,ResourceTemplateSchema:ne,ListResourcesRequestSchema:Se,ListResourcesResultSchema:Ae,ListResourceTemplatesRequestSchema:C,ListResourceTemplatesResultSchema:M,ResourceRequestParamsSchema:V,ReadResourceRequestParamsSchema:oe,ReadResourceRequestSchema:se,ReadResourceResultSchema:le,ResourceListChangedNotificationSchema:ze,SubscribeRequestParamsSchema:we,SubscribeRequestSchema:je,UnsubscribeRequestParamsSchema:Pe,UnsubscribeRequestSchema:_e,ResourceUpdatedNotificationParamsSchema:He,ResourceUpdatedNotificationSchema:Te,PromptArgumentSchema:Ye,PromptSchema:xe,ListPromptsRequestSchema:We,ListPromptsResultSchema:tt,GetPromptRequestParamsSchema:rt,GetPromptRequestSchema:bt,TextContentSchema:Rt,ImageContentSchema:zt,AudioContentSchema:$t,ToolUseContentSchema:gr,EmbeddedResourceSchema:at,ResourceLinkSchema:Sr,ContentBlockSchema:Fe,PromptMessageSchema:Lt,GetPromptResultSchema:Vt,PromptListChangedNotificationSchema:Et,ToolAnnotationsSchema:yr,ToolExecutionSchema:Dt,ToolSchema:Pt,ListToolsRequestSchema:Ut,ListToolsResultSchema:Ht,CallToolResultSchema:Ft,CallToolRequestParamsSchema:Ne,CallToolRequestSchema:_r,ToolListChangedNotificationSchema:wa,LoggingLevelSchema:xt,SetLevelRequestParamsSchema:vr,SetLevelRequestSchema:br,LoggingMessageNotificationParamsSchema:Rr,LoggingMessageNotificationSchema:zr,ModelHintSchema:$r,ModelPreferencesSchema:Er,ToolChoiceSchema:Pr,ToolResultContentSchema:Ta,SamplingContentSchema:wr,SamplingMessageContentBlockSchema:ot,SamplingMessageSchema:Tr,CreateMessageRequestParamsSchema:Cr,CreateMessageRequestSchema:qr,CreateMessageResultSchema:jr,CreateMessageResultWithToolsSchema:Nr,BooleanSchemaSchema:Ir,StringSchemaSchema:Or,NumberSchemaSchema:kr,UntitledSingleSelectEnumSchemaSchema:Mr,TitledSingleSelectEnumSchemaSchema:Ar,LegacyTitledEnumSchemaSchema:Lr,SingleSelectEnumSchemaSchema:Vr,UntitledMultiSelectEnumSchemaSchema:wt,TitledMultiSelectEnumSchemaSchema:Tt,MultiSelectEnumSchemaSchema:Ca,EnumSchemaSchema:qa,PrimitiveSchemaDefinitionSchema:De,ElicitRequestFormParamsSchema:Ue,ElicitRequestURLParamsSchema:Dr,ElicitRequestParamsSchema:Ke,ElicitRequestSchema:ja,ElicitationCompleteNotificationParamsSchema:Na,ElicitationCompleteNotificationSchema:Ia,ElicitResultSchema:Oa,ResourceTemplateReferenceSchema:ka,PromptReferenceSchema:Ma,CompleteRequestParamsSchema:Aa,CompleteRequestSchema:Ur,CompleteResultSchema:La,RootSchema:Va,ListRootsRequestSchema:Kt,ListRootsResultSchema:Hr,RootsListChangedNotificationSchema:Da,TaskCreationParamsSchema:Ua,TaskStatusSchema:Ha,TaskSchema:st,CreateTaskResultSchema:Le,TaskStatusNotificationParamsSchema:Fa,TaskStatusNotificationSchema:Ct,GetTaskRequestSchema:Jt,GetTaskResultSchema:Gt,GetTaskPayloadRequestSchema:Bt,GetTaskPayloadResultSchema:Xs,ListTasksRequestSchema:Ve,ListTasksResultSchema:$e,CancelTaskRequestSchema:qt,CancelTaskResultSchema:z.merge(st),ClientRequestSchema:Z([me,L,Ur,br,bt,We,Se,C,se,je,_e,_r,Ut,Jt,Bt,Ve,qt]),ClientNotificationSchema:Z([g,Ee,Y,Da,Ct]),ClientResultSchema:Z([_,jr,Nr,Oa,Hr,Gt,$e,Le]),ServerRequestSchema:Z([me,qr,ja,Kt,Jt,Bt,Ve,qt]),ServerNotificationSchema:Z([g,Ee,zr,Te,ze,wa,Et,Ct,Ia]),ServerResultSchema:Z([_,X,La,Vt,tt,Ae,M,le,Ft,Ht,Gt,$e,Le]),CallToolResultWireSchema:te().superRefine((Ie,wl)=>{if(typeof Ie!=="object"||Ie===null||Array.isArray(Ie)||Ie.content!==void 0)return;for(let Ri of yc)if(Ri in Ie){wl.addIssue({code:"custom",message:`content is required when the body carries '${Ri}' — another result family cannot default into an empty tools/call success`});return}}).transform(ei).pipe(Ft)}}var Tp;function _c(){return Tp??=wp()}function vc(e){return e.type!=="object"}var Cp=new Set(["const","enum","default","examples"]),qp=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function tc(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function jp(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(tc(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Xi(e.$schema)&&e.$recursiveAnchor!==!0,a=(o,s)=>{if(Array.isArray(o))return o.map((c)=>a(c,!1));if(o===null||typeof o!=="object")return o;if(!s&&tc(o.$id))return o;let n={},l=!1;for(let[c,u]of Object.entries(o))if(s)n[c]=a(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")n[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)l=!0;else if(Cp.has(c))n[c]=u;else if(qp.has(c))n[c]=a(u,!0);else n[c]=a(u,!1);if(l)if("$ref"in n)n.allOf=[...Array.isArray(n.allOf)?n.allOf:[],{$ref:"#/properties/result"}];else n.$ref="#/properties/result";return n};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:a(e,!1)},required:["result"]}}var bc={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},Rc={"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},Np={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},As;function ti(){if(As)return As;let e=_c();return As={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}},As}function zc(e){return Object.prototype.hasOwnProperty.call(bc,e)}function $c(e){return Object.prototype.hasOwnProperty.call(Rc,e)}function Ip(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Op(e){return Ip(e)?ti().resultSchemas[e]:void 0}function kp(e){return zc(e)?ti().requestSchemas[e]:void 0}function Mp(e){return $c(e)?ti().notificationSchemas[e]:void 0}var oS=Object.keys(bc),sS=Object.keys(Rc);function Bn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Ls(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var rc={ok:!1,reason:"not-in-era"};function ac(e){return Bn(e)&&Bn(e.outputSchema)&&vc(e.outputSchema)}function oc(e){return e}var ri={era:"2025-11-25",hasRequestMethod:zc,hasNotificationMethod:$c,validateRequest:(e,t)=>Ls(kp(e),t),validateResult:(e,t)=>Ls(Op(e),t),validateNotification:(e,t)=>Ls(Mp(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>rc,validateInputResponse:()=>rc,samplingResultVariant:(e,t)=>{let r=_c();return Ls(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=Sc(e),a=r.structuredContent;if(a===void 0)return r;let o=typeof a!=="object"||a===null||Array.isArray(a),s=t!==void 0&&vc(t);if(!o&&!s)return r;return{...r,structuredContent:{result:a}}},decodeResult(e,t){if(Bn(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:oc(r)}}return{kind:"complete",result:oc(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((a)=>ac(a)))return t;return{...t,tools:r.map((a)=>ac(a)?{...a,outputSchema:jp(a.outputSchema)}:a)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function Ap(){let e=Yt(()=>Z([i(),F(),W(),nt(),G(i(),e),N(e)])),t=G(i(),e),r=Z([i(),F().int()]),a=i(),o=Z([i(),F().int()]),s=ie(["user","assistant"]),n=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),l=i().refine(($e)=>{try{return atob($e),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=T({ttl:F().optional()}),u=T({taskId:i()}),h=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=T({_meta:h.optional()}),z=f.extend({task:c.optional()}),E=T({_meta:h.optional()}),_=T({method:i(),params:E.loose().optional()}),v=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),g=T({icons:N(v).optional()}),d=T({name:i(),title:i().optional()}),y=d.extend({...d.shape,...g.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),m=Ze(T({applyDefaults:W().optional()}),t),b=it(($e)=>{if($e&&typeof $e==="object"&&!Array.isArray($e)&&Object.keys($e).length===0)return{form:{}};return $e},Ze(T({form:m.optional(),url:t.optional()}),t.optional())),P=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),S=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),p=T({experimental:G(i(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:P.optional(),extensions:G(i(),t).optional()}),w=T({experimental:G(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:S.optional(),extensions:G(i(),t).optional()}),A=T({progress:F(),total:Q(F()),message:Q(i())}),x=T({...E.shape,...A.shape,progressToken:r}),L=_.extend({method:I("notifications/progress"),params:x}),U=E.extend({level:n,logger:i().optional(),data:te()}),X=_.extend({method:I("notifications/message"),params:U}),Y=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),me=Y.extend({text:i()}),ye=Y.extend({blob:l}),ge=T({audience:N(s).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),Ee=T({...d.shape,...g.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:ge.optional(),_meta:Q(re({}))}),he=T({...d.shape,...g.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:ge.optional(),_meta:Q(re({}))}),j=_.extend({method:I("notifications/resources/list_changed"),params:E.optional()}),k=E.extend({uri:i()}),H=_.extend({method:I("notifications/resources/updated"),params:k}),R=T({name:i(),description:Q(i()),required:Q(W())}),q=T({...d.shape,...g.shape,description:Q(i()),arguments:Q(N(R)),_meta:Q(re({}))}),O=_.extend({method:I("notifications/prompts/list_changed"),params:E.optional()}),K=T({type:I("text"),text:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),ee=T({type:I("image"),data:l,mimeType:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),de=T({type:I("audio"),data:l,mimeType:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),ne=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),Se=T({type:I("resource"),resource:Z([me,ye]),annotations:ge.optional(),_meta:G(i(),te()).optional()}),Ae=Ee.extend({type:I("resource_link")}),C=Z([K,ee,de,Ae,Se]),M=T({role:s,content:C}),V=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),oe=_.extend({method:I("notifications/tools/list_changed"),params:E.optional()}),se=T({name:i().optional()}),le=T({hints:N(se).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),ze=T({mode:ie(["auto","required","none"]).optional()}),we=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),je=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),Pe=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),_e=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),He=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),Te=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),Ye=Z([_e,He]),xe=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),We=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),tt=Z([xe,We]),rt=Z([Te,Ye,tt]),bt=Z([rt,we,je,Pe]),Rt=z.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),bt),required:N(i()).optional()}).catchall(te())}),zt=T({type:I("ref/resource"),uri:i()}),$t=T({type:I("ref/prompt"),name:i()}),gr=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),at=p.shape,Sr=T({experimental:at.experimental,sampling:at.sampling,elicitation:at.elicitation,roots:at.roots,extensions:at.extensions}),Fe=w.shape,Lt=T({experimental:Fe.experimental,logging:Fe.logging,completions:Fe.completions,prompts:Fe.prompts,resources:Fe.resources,tools:Fe.tools,extensions:Fe.extensions}),Vt=re({progressToken:r.optional(),[lt]:i(),[Jr]:y.optional(),[ut]:Sr,[Ot]:n.optional()}),Et=T({...d.shape,...g.shape,description:i().optional(),inputSchema:re({$schema:i().optional(),type:I("object")}),outputSchema:re({$schema:i().optional()}).optional(),annotations:V.optional(),_meta:G(i(),te()).optional()}),yr=T({type:I("tool_result"),toolUseId:i(),content:N(C),structuredContent:te().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),Dt=Z([K,ee,de,ne,yr]),Pt=T({role:s,content:Z([Dt,N(Dt)]),_meta:G(i(),te()).optional()}),Ut=i(),Ht=re({[Qe]:y.optional().catch(void 0)}),Ft=Ht.optional();function Ne($e){return re({_meta:Ft,resultType:Ut.default("complete"),...$e})}let _r=Ne({}),wa=Ne({nextCursor:a.optional()}),xt=Ne({content:N(C),structuredContent:te().optional(),isError:W().optional()}),vr=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:N(Et),nextCursor:a.optional()}),br=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:N(q),nextCursor:a.optional()}),Rr=Ne({description:i().optional(),messages:N(M)}),zr=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:N(Ee),nextCursor:a.optional()}),$r=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:N(he),nextCursor:a.optional()}),Er=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:N(Z([me,ye]))}),Pr=Ne({completion:T({values:N(i()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),Ta=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"])}),wr=Ne({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:N(i()),capabilities:Lt,instructions:i().optional()}),ot=T({messages:N(Pt),modelPreferences:le.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:t.optional(),tools:N(Et).optional(),toolChoice:ze.optional()}),Tr=T({method:I("sampling/createMessage"),params:ot}),Cr=T({method:I("roots/list"),params:T({_meta:G(i(),te()).optional()}).optional()}),qr=T({...Pt.shape,model:i(),stopReason:i().optional()}),jr=T({roots:N(gr)}),Nr=T({action:ie(["accept","decline","cancel"]),content:G(i(),Z([i(),F(),W(),N(i())])).optional()}),Ir=T({mode:I("url"),message:i(),url:i().url()}),Or=Z([Rt,Ir]),kr=T({method:I("elicitation/create"),params:Or}),Mr=Z([Tr,Cr,kr]),Ar=Z([qr,jr,Nr]),Lr=G(i(),Mr),Vr=G(i(),Ar),wt=Ne({inputRequests:Lr.optional(),requestState:i().optional()}),Tt={inputResponses:Vr.optional(),requestState:i().optional()},Ca=T({_meta:Vt,...Tt}),qa=re({progressToken:r.optional()});function De($e,qt){return T({method:I($e),params:T({_meta:Vt,...qt})})}function Ue($e,qt){return T({method:I($e),params:T({_meta:qa.optional(),...qt}).optional()})}let Dr={name:i(),arguments:G(i(),te()).optional(),...Tt},Ke={cursor:a.optional()},ja=De("tools/call",Dr),Na=De("tools/list",Ke),Ia=De("prompts/list",Ke),Oa=De("prompts/get",{name:i(),arguments:G(i(),i()).optional(),...Tt}),ka=De("resources/list",Ke),Ma=De("resources/templates/list",Ke),Aa=De("resources/read",{uri:i(),...Tt}),Ur={ref:Z([$t,zt]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()},La=De("completion/complete",Ur),Va=De("server/discover",{}),Kt=T({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:N(i()).optional()}),Hr={notifications:Kt},Da=De("subscriptions/listen",Hr),Ua=Ht.extend({"io.modelcontextprotocol/subscriptionId":o}),Ha=re({_meta:Ua,resultType:Ut.default("complete")}),st={"tools/call":Ue("tools/call",Dr),"tools/list":Ue("tools/list",Ke),"prompts/get":Ue("prompts/get",{name:i(),arguments:G(i(),i()).optional()}),"prompts/list":Ue("prompts/list",Ke),"resources/list":Ue("resources/list",Ke),"resources/templates/list":Ue("resources/templates/list",Ke),"resources/read":Ue("resources/read",{uri:i()}),"completion/complete":Ue("completion/complete",Ur),"server/discover":Ue("server/discover",{}),"subscriptions/listen":Ue("subscriptions/listen",Hr)};function Le($e){return re({_meta:Ft,...$e})}let Fa={"tools/call":Le({content:N(C),structuredContent:te().optional(),isError:W().optional()}),"tools/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:N(Et),nextCursor:a.optional()}),"prompts/get":Le({description:i().optional(),messages:N(M)}),"prompts/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:N(q),nextCursor:a.optional()}),"resources/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:N(Ee),nextCursor:a.optional()}),"resources/templates/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:N(he),nextCursor:a.optional()}),"resources/read":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:N(Z([me,ye]))}),"completion/complete":Le({completion:T({values:N(i()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),"server/discover":Le({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:N(i()),capabilities:Lt,instructions:i().optional()}),"subscriptions/listen":Le({})},Ct=re({"io.modelcontextprotocol/subscriptionId":o.optional()}),Jt=T({method:I("notifications/subscriptions/acknowledged"),params:T({_meta:Ct.optional(),notifications:Kt})}),Gt=T({_meta:Ct.optional(),requestId:o,reason:i().optional()}),Bt=T({method:I("notifications/cancelled"),params:Gt}),Xs={"notifications/cancelled":Bt,"notifications/progress":L,"notifications/message":X,"notifications/resources/updated":H,"notifications/resources/list_changed":j,"notifications/tools/list_changed":oe,"notifications/prompts/list_changed":O,"notifications/subscriptions/acknowledged":Jt},Ve=($e)=>T({jsonrpc:I("2.0"),id:Z([i(),F().int()]),result:$e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:a,RequestIdSchema:o,RoleSchema:s,LoggingLevelSchema:n,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:h,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:z,NotificationsParamsSchema:E,NotificationSchema:_,IconSchema:v,IconsSchema:g,BaseMetadataSchema:d,ImplementationSchema:y,ClientTasksCapabilitySchema:P,ServerTasksCapabilitySchema:S,ClientCapabilitiesSchema:p,ServerCapabilitiesSchema:w,ProgressSchema:A,ProgressNotificationParamsSchema:x,ProgressNotificationSchema:L,LoggingMessageNotificationParamsSchema:U,LoggingMessageNotificationSchema:X,ResourceContentsSchema:Y,TextResourceContentsSchema:me,BlobResourceContentsSchema:ye,AnnotationsSchema:ge,ResourceSchema:Ee,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:j,ResourceUpdatedNotificationParamsSchema:k,ResourceUpdatedNotificationSchema:H,PromptArgumentSchema:R,PromptSchema:q,PromptListChangedNotificationSchema:O,TextContentSchema:K,ImageContentSchema:ee,AudioContentSchema:de,ToolUseContentSchema:ne,EmbeddedResourceSchema:Se,ResourceLinkSchema:Ae,ContentBlockSchema:C,PromptMessageSchema:M,ToolAnnotationsSchema:V,ToolListChangedNotificationSchema:oe,ModelHintSchema:se,ModelPreferencesSchema:le,ToolChoiceSchema:ze,BooleanSchemaSchema:we,StringSchemaSchema:je,NumberSchemaSchema:Pe,UntitledSingleSelectEnumSchemaSchema:_e,TitledSingleSelectEnumSchemaSchema:He,LegacyTitledEnumSchemaSchema:Te,SingleSelectEnumSchemaSchema:Ye,UntitledMultiSelectEnumSchemaSchema:xe,TitledMultiSelectEnumSchemaSchema:We,MultiSelectEnumSchemaSchema:tt,EnumSchemaSchema:rt,PrimitiveSchemaDefinitionSchema:bt,ElicitRequestFormParamsSchema:Rt,ResourceTemplateReferenceSchema:zt,PromptReferenceSchema:$t,RootSchema:gr,ClientCapabilities2026Schema:Sr,ServerCapabilities2026Schema:Lt,RequestMetaEnvelopeSchema:Vt,ToolSchema:Et,ToolResultContentSchema:yr,SamplingMessageContentBlockSchema:Dt,SamplingMessageSchema:Pt,ResultTypeSchema:Ut,ResultMetaSchema:Ht,ResultSchema:_r,PaginatedResultSchema:wa,CallToolResultSchema:xt,ListToolsResultSchema:vr,ListPromptsResultSchema:br,GetPromptResultSchema:Rr,ListResourcesResultSchema:zr,ListResourceTemplatesResultSchema:$r,ReadResourceResultSchema:Er,CompleteResultSchema:Pr,CacheableResultSchema:Ta,DiscoverResultSchema:wr,CreateMessageRequestParamsSchema:ot,CreateMessageRequestSchema:Tr,ListRootsRequestSchema:Cr,CreateMessageResultSchema:qr,ListRootsResultSchema:jr,ElicitResultSchema:Nr,ElicitRequestURLParamsSchema:Ir,ElicitRequestParamsSchema:Or,ElicitRequestSchema:kr,InputRequestSchema:Mr,InputResponseSchema:Ar,InputRequestsSchema:Lr,InputResponsesSchema:Vr,InputRequiredResultSchema:wt,InputResponseRequestParamsSchema:Ca,CallToolRequestSchema:ja,ListToolsRequestSchema:Na,ListPromptsRequestSchema:Ia,GetPromptRequestSchema:Oa,ListResourcesRequestSchema:ka,ListResourceTemplatesRequestSchema:Ma,ReadResourceRequestSchema:Aa,CompleteRequestSchema:La,DiscoverRequestSchema:Va,SubscriptionFilterSchema:Kt,SubscriptionsListenRequestSchema:Da,SubscriptionsListenResultMetaSchema:Ua,SubscriptionsListenResultSchema:Ha,dispatchRequestSchemas:st,dispatchResultSchemas:Fa,NotificationMetaSchema:Ct,SubscriptionsAcknowledgedNotificationSchema:Jt,CancelledNotificationParamsSchema:Gt,CancelledNotificationSchema:Bt,notificationSchemas2026:Xs,JSONRPCResultResponseSchema:Ve(_r),CallToolResultResponseSchema:Ve(Z([xt,wt])),ListToolsResultResponseSchema:Ve(vr),ListPromptsResultResponseSchema:Ve(br),GetPromptResultResponseSchema:Ve(Z([Rr,wt])),ListResourcesResultResponseSchema:Ve(zr),ListResourceTemplatesResultResponseSchema:Ve($r),ReadResourceResultResponseSchema:Ve(Z([Er,wt])),CompleteResultResponseSchema:Ve(Pr),DiscoverResultResponseSchema:Ve(wr)}}var Lp;function At(){return Lp??=Ap()}var Vp=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Dp(e){return Vp.includes(e)}var ur=Symbol("modelcontextprotocol.resultCacheHintFallback");function xs(e,t){if(t===void 0)return e;let r=e[ur];if(r===void 0)return{...e,[ur]:t};let a={},o=r.ttlMs??t.ttlMs;if(o!==void 0)a.ttlMs=o;let s=r.cacheScope??t.cacheScope;if(s!==void 0)a.cacheScope=s;return{...e,[ur]:a}}function Up(e){return e[ur]}function ai(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function oi(e){return e==="public"||e==="private"}function si(e,t){if(e.ttlMs!==void 0&&!ai(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!oi(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var J=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}({}),ae=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return dr(this,t)}static isInstance(t){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 dr(this,t)}constructor(t,r,a){super(r);this.code=t,this.data=a,this.name="ProtocolError",Zn(this,new.target)}static fromError(t,r,a){if(t===J.UrlElicitationRequired&&a){let o=a;if(o.elicitations)return new Hp(o.elicitations,r)}if(t===J.UnsupportedProtocolVersion&&a){let o=a;if(Array.isArray(o.supported)&&typeof o.requested==="string")return new Ec({supported:o.supported,requested:o.requested},r)}if(t===J.InvalidParams||t===J.ResourceNotFound){let o=a;if(typeof o?.uri==="string"&&(t===J.ResourceNotFound||Object.keys(o).length===1))return new ni(o.uri,r)}if(t===J.MissingRequiredClientCapability&&a){let o=a;if(o.requiredCapabilities!==null&&typeof o.requiredCapabilities==="object"&&!Array.isArray(o.requiredCapabilities))return new ii({requiredCapabilities:o.requiredCapabilities},r)}return new e(t,r,a)}},ni=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(J.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Hp=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(J.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ec=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(J.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},ii=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(J.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Fp=0,xp="private",Kp=["tools/call","prompts/get","resources/read"];function Jp(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Kp.includes(e))return t;throw new ae(J.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Gp(e,t){let r=Up(t);if(t.resultType!=="complete"||!Dp(e))return r===void 0?t:Xp(t);let a=t,o=ai(a.ttlMs)?a.ttlMs:Wp(r),s=oi(a.cacheScope)?a.cacheScope:Zp(r),n={...a,ttlMs:o,cacheScope:s};return delete n[ur],n}function Bp(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Yp(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Qe]:t}};if(!Bp(r))return e;if(r[Qe]!==void 0)return e;return{...e,_meta:{...r,[Qe]:t}}}function Wp(e){return e!==void 0&&ai(e.ttlMs)?e.ttlMs:Fp}function Zp(e){return e!==void 0&&oi(e.cacheScope)?e.cacheScope:xp}function Xp(e){let t={...e};return delete t[ur],t}var Qp=["elicitation/create","sampling/createMessage","roots/list"],Vs;function Pc(){if(Vs)return Vs;let e=At();return Vs={request:{"elicitation/create":T({method:I("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":T({method:I("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":T({method:I("roots/list"),params:re({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Vs}function wc(e){return Qp.includes(e)}function xn(e){return wc(e)?Pc().request[e]:void 0}function eh(e){return wc(e)?Pc().response[e]:void 0}var ci={"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},Tc={"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 Cc(e){return Object.prototype.hasOwnProperty.call(ci,e)}function qc(e){return Object.prototype.hasOwnProperty.call(Tc,e)}function th(e){return Object.prototype.hasOwnProperty.call(ci,e)}function rh(e){return Cc(e)?At().dispatchRequestSchemas[e]:void 0}function ah(e){return th(e)?At().dispatchResultSchemas[e]:void 0}function oh(e){return qc(e)?At().notificationSchemas2026[e]:void 0}var nS=Object.keys(ci),iS=Object.keys(Tc);function va(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ya(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var sh={ok:!1,reason:"not-in-era"},nh=[lt,ut];function ih(e,t){let r=t,a=!1,o=()=>{if(!a)r={...r},a=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((l)=>va(l)&&("execution"in l)))o().tools=s.map((l)=>{if(!va(l)||!("execution"in l))return l;let c={...l};return delete c.execution,c});let n=t.capabilities;if(va(n)&&"tasks"in n){let l={...n};delete l.tasks,o().capabilities=l}return r}var li={era:"2026-07-28",hasRequestMethod:Cc,hasNotificationMethod:qc,hasInputRequestMethod:(e)=>xn(e)!==void 0,validateRequest:(e,t)=>ya(rh(e),t),validateResult:(e,t)=>ya(ah(e),t),validateNotification:(e,t)=>ya(oh(e),t),validateInputRequest:(e,t)=>ya(xn(e),t),validateInputResponse:(e,t)=>ya(eh(e),t),samplingResultVariant:()=>sh,outboundEnvelope(e){return{[lt]:e.protocolVersion,[Jr]:e.clientInfo,[ut]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ot]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let a of nh)if(!(a in e))t.push({key:a,problem:"missing"});let r=At().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let a of r.error.issues){let o=a.path.map(String),s=o.length>0?o.join("."):"_meta";if(o.length===1&&t.some((n)=>n.key===s&&n.problem==="missing"))continue;t.push({key:s,problem:a.message})}return t},projectCallToolResult:(e)=>Sc(e),inputRequestSchema:xn,decodeResult(e,t){if(!va(t))return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(pe.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 r!=="string")return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let n=t.inputRequests,l=va(n)?n:{},c=t.requestState;if(Object.keys(l).length===0&&typeof c!=="string")return{kind:"invalid",error:new ue(pe.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"})};return{kind:"input_required",inputRequests:l,...typeof c==="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new ue(pe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let a=ch(),o=Object.hasOwn(a,e)?a[e]:void 0;if(o!==void 0){let n=o.safeParse(t);if(!n.success)return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return Yp(Gp(e,Jp(e,ih(e,t))),r)},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=At().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((r)=>r.message).join("; ")}`}},Ds;function ch(){if(Ds)return Ds;let e=At();return Ds={"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},Ds}var za="2026-07-28";function yt(e){return e!==void 0&&pr(e)?li:ri}function sc(e){if(e.revision!==void 0)return yt(e.revision).era;return e.era==="modern"?li.era:ri.era}function Kn(e){return jc.some((t)=>t.hasRequestMethod(e))}function Jn(e){return jc.some((t)=>t.hasNotificationMethod(e))}var jc=[ri,li];function nc(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ui(e){if(!nc(e))return;let t=e._meta;return nc(t)?t:void 0}function lh(e){let t=ui(e);return t!==void 0&&lt in t}function uh(e){let t=ui(e)?.[lt];return typeof t==="string"?t:void 0}function dh(e){return yt(za).validateEnvelopeMeta(e)}var mh=Wi({AnnotationsSchema:()=>et,AudioContentSchema:()=>sr,BaseMetadataSchema:()=>Xe,BaseRequestParamsSchema:()=>qe,BlobResourceContentsSchema:()=>na,BooleanSchemaSchema:()=>da,CallToolRequestParamsSchema:()=>Wo,CallToolRequestSchema:()=>Zo,CallToolResultSchema:()=>ua,CancelTaskRequestSchema:()=>Tn,CancelTaskResultSchema:()=>Cn,CancelledNotificationParamsSchema:()=>Xa,CancelledNotificationSchema:()=>ea,ClientCapabilitiesSchema:()=>ro,ClientNotificationSchema:()=>jn,ClientRequestSchema:()=>qn,ClientResultSchema:()=>Nn,ClientTasksCapabilitySchema:()=>eo,CompatibilityCallToolResultSchema:()=>Sn,CompleteRequestParamsSchema:()=>$s,CompleteRequestSchema:()=>Es,CompleteResultSchema:()=>Ps,ContentBlockSchema:()=>nr,CreateMessageRequestParamsSchema:()=>ls,CreateMessageRequestSchema:()=>us,CreateMessageResultSchema:()=>ds,CreateMessageResultWithToolsSchema:()=>ms,CreateTaskResultSchema:()=>vn,CursorSchema:()=>Br,DiscoverRequestSchema:()=>io,DiscoverResultSchema:()=>co,ElicitRequestFormParamsSchema:()=>lr,ElicitRequestParamsSchema:()=>Ss,ElicitRequestSchema:()=>ys,ElicitRequestURLParamsSchema:()=>gs,ElicitResultSchema:()=>bs,ElicitationCompleteNotificationParamsSchema:()=>_s,ElicitationCompleteNotificationSchema:()=>vs,EmbeddedResourceSchema:()=>Uo,EmptyResultSchema:()=>Qr,EnumSchemaSchema:()=>fs,GetPromptRequestParamsSchema:()=>Lo,GetPromptRequestSchema:()=>Vo,GetPromptResultSchema:()=>xo,GetTaskPayloadRequestSchema:()=>$n,GetTaskPayloadResultSchema:()=>En,GetTaskRequestSchema:()=>Rn,GetTaskResultSchema:()=>zn,IconSchema:()=>Qa,IconsSchema:()=>mt,ImageContentSchema:()=>or,ImplementationSchema:()=>tr,InitializeRequestParamsSchema:()=>ao,InitializeRequestSchema:()=>oo,InitializeResultSchema:()=>so,InitializedNotificationSchema:()=>no,JSONArraySchema:()=>hn,JSONObjectSchema:()=>ve,JSONRPCErrorResponseSchema:()=>er,JSONRPCMessageSchema:()=>Za,JSONRPCNotificationSchema:()=>Xr,JSONRPCRequestSchema:()=>Zr,JSONRPCResponseSchema:()=>fn,JSONRPCResultResponseSchema:()=>Qt,JSONValueSchema:()=>ct,LegacyTitledEnumSchemaSchema:()=>ha,ListChangedOptionsBaseSchema:()=>yn,ListPromptsRequestSchema:()=>Mo,ListPromptsResultSchema:()=>Ao,ListResourceTemplatesRequestSchema:()=>go,ListResourceTemplatesResultSchema:()=>So,ListResourcesRequestSchema:()=>ho,ListResourcesResultSchema:()=>fo,ListRootsRequestSchema:()=>Ts,ListRootsResultSchema:()=>Cs,ListTasksRequestSchema:()=>Pn,ListTasksResultSchema:()=>wn,ListToolsRequestSchema:()=>Bo,ListToolsResultSchema:()=>Yo,LoggingLevelSchema:()=>gt,LoggingMessageNotificationParamsSchema:()=>ts,LoggingMessageNotificationSchema:()=>rs,ModelHintSchema:()=>as,ModelPreferencesSchema:()=>os,MultiSelectEnumSchemaSchema:()=>hs,NotificationSchema:()=>Me,NotificationsParamsSchema:()=>ke,NumberSchemaSchema:()=>cr,PaginatedRequestParamsSchema:()=>mo,PaginatedRequestSchema:()=>pt,PaginatedResultSchema:()=>ht,PingRequestSchema:()=>ra,PrimitiveSchemaDefinitionSchema:()=>Sa,ProgressNotificationParamsSchema:()=>uo,ProgressNotificationSchema:()=>aa,ProgressSchema:()=>lo,ProgressTokenSchema:()=>Gr,PromptArgumentSchema:()=>Oo,PromptListChangedNotificationSchema:()=>Ko,PromptMessageSchema:()=>Fo,PromptReferenceSchema:()=>zs,PromptSchema:()=>ko,ReadResourceRequestParamsSchema:()=>yo,ReadResourceRequestSchema:()=>_o,ReadResourceResultSchema:()=>vo,RelatedTaskMetadataSchema:()=>Wa,RequestIdSchema:()=>dt,RequestMetaSchema:()=>Yr,RequestSchema:()=>be,ResourceContentsSchema:()=>oa,ResourceLinkSchema:()=>Ho,ResourceListChangedNotificationSchema:()=>bo,ResourceRequestParamsSchema:()=>rr,ResourceSchema:()=>ia,ResourceTemplateReferenceSchema:()=>Rs,ResourceTemplateSchema:()=>po,ResourceUpdatedNotificationParamsSchema:()=>No,ResourceUpdatedNotificationSchema:()=>Io,ResultMetaObjectSchema:()=>Wr,ResultSchema:()=>Re,RoleSchema:()=>ft,RootSchema:()=>ws,RootsListChangedNotificationSchema:()=>qs,SamplingContentSchema:()=>is,SamplingMessageContentBlockSchema:()=>It,SamplingMessageSchema:()=>cs,ServerCapabilitiesSchema:()=>ta,ServerNotificationSchema:()=>On,ServerRequestSchema:()=>In,ServerResultSchema:()=>kn,ServerTasksCapabilitySchema:()=>to,SetLevelRequestParamsSchema:()=>Qo,SetLevelRequestSchema:()=>es,SingleSelectEnumSchemaSchema:()=>ps,StringSchemaSchema:()=>ir,SubscribeRequestParamsSchema:()=>Ro,SubscribeRequestSchema:()=>zo,SubscriptionFilterSchema:()=>ca,SubscriptionsAcknowledgedNotificationParamsSchema:()=>To,SubscriptionsAcknowledgedNotificationSchema:()=>Co,SubscriptionsListenRequestParamsSchema:()=>Po,SubscriptionsListenRequestSchema:()=>wo,SubscriptionsListenResultMetaSchema:()=>qo,SubscriptionsListenResultSchema:()=>jo,TaskAugmentedRequestParamsSchema:()=>kt,TaskCreationParamsSchema:()=>_n,TaskMetadataSchema:()=>Ya,TaskSchema:()=>St,TaskStatusNotificationParamsSchema:()=>Ns,TaskStatusNotificationSchema:()=>bn,TaskStatusSchema:()=>js,TextContentSchema:()=>ar,TextResourceContentsSchema:()=>sa,TitledMultiSelectEnumSchemaSchema:()=>ga,TitledSingleSelectEnumSchemaSchema:()=>pa,ToolAnnotationsSchema:()=>Jo,ToolChoiceSchema:()=>ss,ToolExecutionSchema:()=>Go,ToolListChangedNotificationSchema:()=>Xo,ToolResultContentSchema:()=>ns,ToolSchema:()=>la,ToolUseContentSchema:()=>Do,UnsubscribeRequestParamsSchema:()=>$o,UnsubscribeRequestSchema:()=>Eo,UntitledMultiSelectEnumSchemaSchema:()=>fa,UntitledSingleSelectEnumSchemaSchema:()=>ma});var ph=(e)=>Zr.safeParse(e).success,hh=(e)=>Xr.safeParse(e).success,ic=(e)=>Qt.safeParse(e).success,fh=(e)=>er.safeParse(e).success;var _t=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Nc(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Ic(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var cc="x-mcp-header",gh=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Sh=new Set(["string","integer","boolean","number"]);function Oc(e){let t=[],r=new Map,a=(s,n,l)=>{if(s===null||typeof s!=="object")return;let c=s;if(cc in c){if(!l||n.length===0)return`${Us(n)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let h=c[cc];if(typeof h!=="string"||h.length===0)return`${Us(n)}: x-mcp-header MUST be a non-empty string`;if(!gh.test(h))return`${Us(n)}: x-mcp-header '${h}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let f=typeof c.type==="string"?c.type:void 0;if(f===void 0||!Sh.has(f))return`${Us(n)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${f??"<none>"}`;let z=h.toLowerCase(),E=r.get(z);if(E!==void 0)return`x-mcp-header '${h}' is not case-insensitively unique (also declared as '${E}')`;r.set(z,h),t.push({path:n,headerName:h,type:f})}let u=c.properties;if(u!==null&&typeof u==="object")for(let[h,f]of Object.entries(u)){let z=a(f,[...n,h],l);if(z!==void 0)return z}for(let h of yh){let f=c[h];if(f===void 0)continue;let z=Array.isArray(f)?f:f!==null&&typeof f==="object"&&_h.has(h)?Object.values(f):[f];for(let E of z){let _=a(E,[...n,`<${h}>`],!1);if(_!==void 0)return _}}},o=a(e,[],!0);return o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o}}var yh=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],_h=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Us(e){return e.length===0?"<root>":e.join(".")}var Fs=-32020,cS=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[J.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[Fs,J.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[J.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[J.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[J.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[Fs],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[J.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[Fs],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],lS={[J.ParseError]:400,[J.InvalidRequest]:400,[J.MethodNotFound]:404,[J.UnsupportedProtocolVersion]:400,[J.MissingRequiredClientCapability]:400,[Fs]:400};function Hs(e,t,r,a,o){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:a.code,message:a.message,...a.data!==void 0&&{data:a.data},settled:o}}function uS(e){if(!lh(e))return!1;let t=uh(e);if(t===void 0||!pr(t))return!1;let r=ui(e);return r!==void 0&&dh(r).length===0}function dS(e,t){switch(e.reason){case"http-method":return Hs("http-method","modern-only-method-not-allowed",405,new ae(-32000,"Method not allowed."),!0);case"batch":return Hs("jsonrpc-shape","modern-only-batch-not-supported",400,new ae(J.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return Hs("jsonrpc-shape","modern-only-response-post",400,new ae(J.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return Hs("era-classification","modern-only-missing-envelope",400,r===void 0?new ae(J.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new Ec({supported:[...t],requested:r}),!0)}}}function Ks(e,t){return cn(e,t)}function _a(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function mr(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var lc=!1,Yn="draft-2020-12";function vt(e,t="input"){let r=e["~standard"],a;if(r.jsonSchema)a=r.jsonSchema[t]({target:Yn});else if(r.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().");if(!lc)lc=!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.");a=xr(e,{target:Yn,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(a.type!==void 0)return a;return kc(a)?{type:"object",...a}:a}if(a.type!==void 0&&a.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(a.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...a}}function kc(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every((a)=>a!==null&&typeof a==="object"&&(a.type==="object"||kc(a)))}return!1}function vh(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Mt(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((a)=>vh(a)).join(", ")};return{success:!0,data:r.value}}function bh(e){let t=xr(e,{target:Yn,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var Rh=/\\\.\\d\{(\d+)\}/;function zh(e){let t=Rh.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((a)=>[!1,!0].flatMap((o)=>r.map((s)=>Je.datetime({local:a,offset:o,precision:s}))))}function $h(e,t){let r;switch(e){case"email":r=[ln()];break;case"uri":r=[Kr()];break;case"date":r=[Je.date()];break;case"date-time":r=zh(t);break}return new Set(r.map((a)=>bh(a)).filter((a)=>a!==void 0))}function Eh(e,t,r){if(r!=="zod")return!0;return $h(e,t).has(t)}function Mc(e){let t=vt(e,"input"),r=t.properties||{},a=t.required||[];return Object.entries(r).map(([o,s])=>({name:o,description:s?.description,required:a.includes(o)}))}function Ra(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ph(e){try{return vt(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ae(J.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var wh=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function di(e){return wh.has(e)||e.startsWith("x-")}var Th=new Set(["$schema",...Object.keys(lr.shape.requestedSchema.shape)]),uc={string:_a([ir,ma,pa,ha]),number:_a([cr]),integer:_a([cr]),boolean:_a([da]),array:_a([fa,ga])},Ch=new Set(ir.shape.format.unwrap().options);function qh(e,t,r,a){if(!Ra(e))return e;let o=typeof e.type==="string"&&Object.hasOwn(uc,e.type)?uc[e.type]:void 0;if(o===void 0)return e;let s={};for(let[n,l]of Object.entries(e))if(o.has(n)||di(n))s[n]=l;else if(n==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Ch.has(e.format))s[n]=l;else if(typeof l!=="string"||!Eh(e.format,l,r))a.push(`${t}.${n}`)}else a.push(`${t}.${n}`);return s}function jh(e,t){let r={},a=[];for(let[o,s]of Object.entries(e))if(o==="properties"&&Ra(s))r[o]=Object.fromEntries(Object.entries(s).map(([n,l])=>[n,qh(l,`properties.${n}`,t,a)]));else if(Th.has(o))r[o]=s;else if(!di(o))a.push(o);if(a.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${a.join(", ")}`);return r}function Nh(e,t){if(!Ra(e.properties))return t;let r=Object.entries(e.properties).filter(([,a])=>!Ks(Sa,a).success).map(([a])=>`properties.${a}`);return r.length>0?r.join(", "):t}function Wn(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((a,o)=>Wn(a,t[o],`${r}[${o}]`));if(!Ra(e)||!Ra(t))return[];return Object.entries(e).flatMap(([a,o])=>{let s=r?`${r}.${a}`:a;if(!Object.prototype.hasOwnProperty.call(t,a))return di(a)?[]:[s];return Wn(o,t[a],s)})}function Ih(e){if(!mr(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=jh(Ph(e.requestedSchema),t),a=Ks(lr.shape.requestedSchema,r);if(!a.success)throw new ae(J.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Nh(r,a.error.message)}`);let o=Wn(r,a.data);if(o.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);let s=(a.data.required??[]).filter((n)=>!Object.prototype.hasOwnProperty.call(a.data.properties,n));if(s.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}function Oh(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)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}}}var mS=Object.assign(Oh,{elicit(e){try{return{method:"elicitation/create",params:Ih(e)}}catch(t){throw t instanceof ae?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Ac=250;function Lc(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Vc(e,t){return new Promise((r,a)=>{if(t?.aborted){a(t.reason instanceof ue?t.reason:new ue(pe.RequestTimeout,String(t.reason)));return}let o=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(o),a(t?.reason instanceof ue?t.reason:new ue(pe.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Dc(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(a)=>t.abort(a),dispose:()=>e?.removeEventListener("abort",r)}}var kh=["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"],Mh={IdJagTokenExchangeResponseSchema:Vn,OAuthClientInformationFullSchema:Un,OAuthClientInformationSchema:Ms,OAuthClientMetadataSchema:ks,OAuthClientRegistrationErrorSchema:Hn,OAuthErrorResponseSchema:Dn,OAuthMetadataSchema:Is,OAuthProtectedResourceMetadataSchema:Mn,OAuthTokenRevocationRequestSchema:Fn,OAuthTokensSchema:Ln,OpenIdProviderDiscoveryMetadataSchema:An,OpenIdProviderMetadataSchema:Os},Uc={},Hc={};function Fc(e,t){let r=e.slice(0,-6);Uc[r]=t,Hc[r]=(a)=>t.safeParse(a).success}for(let e of kh)Fc(e,mh[e]);for(let[e,t]of Object.entries(Mh))Fc(e,t);var pS=Object.freeze(Uc),hS=Object.freeze(Hc);function Ah(e){switch(e){case"initialize":case"notifications/initialized":return yt(void 0);case"server/discover":return yt(za);default:return}}var Lh=60000,Vh=[lt,Jr,ut,Ot],Dh=["inputResponses","requestState"];function dc(e,t){let r=e.params;if(!ba(r))return{message:e,lifted:{}};let a=r._meta,o=ba(a)?Vh.filter((c)=>(c in a)):[],s=t==="request"?Dh.filter((c)=>(c in r)):[];if(o.length===0&&s.length===0)return{message:e,lifted:{}};let n={},l={...r};if(o.length>0&&ba(a)){let c={},u={...a};for(let h of o)c[h]=a[h],delete u[h];if(n.envelope=c,Object.keys(u).length>0)l._meta=u;else delete l._meta}for(let c of s){if(c==="inputResponses")n.inputResponses=l[c];if(c==="requestState")n.requestState=l[c];delete l[c]}return{message:{...e,params:l},lifted:n}}function mc(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(a){let o=e.validateResult(t,a);if(o.ok)return{value:o.value};return{issues:[{message:o.reason==="invalid"?o.message:`not-in-era: ${t}`}]}}}}}function $a(e){return()=>e}var Uh=$a(void 0);function mi(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:$a(t)}}}var xc;function fS(e,t){xc(e,t)}var Kc=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;static{xc=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??mn,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(pe.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){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,a,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:a})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(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 r=this.transport?.onerror;this._transport.onerror=(o)=>{r?.(o),this._onerror(o)};let a=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{if(a?.(o,s),ic(o)||fh(o))this._onresponse(o);else if(ph(o))this._onrequest(o,s);else if(hh(o))this._onnotification(o,s);else this._onerror(Error(`Unknown message type: ${JSON.stringify(o)}`))},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 a of this._timeoutInfo.values())clearTimeout(a.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(pe.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let a of e.values())a(r);for(let a of t.values())a.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=dc(e,"notification"),a=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let n=sc(t.classification);if(n!==a.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${n} but this instance serves ${a.era}`));return}}if(Jn(r.method)&&!a.hasNotificationMethod(r.method))return;let o=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(o===void 0&&s===void 0)return;Promise.resolve().then(()=>o===void 0?s(r):o(r,a)).catch((n)=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,t){let{message:r,lifted:a}=dc(e,"request"),o=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 s=this._transport,n=(v,g,d)=>{let y={jsonrpc:"2.0",id:r.id,error:{code:v,message:g,...d!==void 0&&{data:d}}};s?.send(y).catch((m)=>this._onerror(Error(`Failed to send an error response: ${m}`)))};if(t?.classification!==void 0){let v=sc(t.classification);if(v!==o.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${o.era}`));let g=t.classification.revision??v;n(J.UnsupportedProtocolVersion,`Unsupported protocol version: ${g}`,{supported:this._supportedProtocolVersions,requested:g});return}}if(Kn(r.method)&&!o.hasRequestMethod(r.method)){n(J.MethodNotFound,"Method not found");return}let l=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(l===void 0){n(J.MethodNotFound,"Method not found");return}let c=o.checkInboundEnvelope(a);if(c!==void 0){n(J.InvalidParams,c);return}let u=(v,g)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...g,relatedRequestId:r.id}),h=(v,g,d)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,g,{...d,relatedRequestId:r.id}),f=new AbortController;this._requestHandlerAbortControllers.set(r.id,f);let z=a.inputResponses===void 0?void 0:Hh(a.inputResponses),E={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...a.envelope!==void 0&&{envelope:a.envelope},...z!==void 0&&{inputResponses:z.accepted},...z!==void 0&&z.droppedKeys.length>0&&{droppedInputResponseKeys:z.droppedKeys},requestState:a.requestState===void 0?Uh:$a(a.requestState),signal:f.signal,send:(v,g,d)=>{let y=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(y,v.method),mr(g))return h(v,g,d);let m=mc(y,v.method);if(m===void 0)throw TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(v,m,g)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},_=this.buildContext(E,t);Promise.resolve().then(()=>l(r,_)).then(async(v)=>{if(f.signal.aborted)return;let g;try{g=o.encodeResult(r.method,v,this._outboundServerInfo())}catch(y){this._onerror(Error(`Failed to encode result for ${r.method}: ${y}`)),n(J.InternalError,"Internal error");return}let d={result:g,jsonrpc:"2.0",id:r.id};await s?.send(d)},async(v)=>{if(f.signal.aborted)return;let g=Number.isSafeInteger(v.code)?v.code:J.InternalError,d={jsonrpc:"2.0",id:r.id,error:{code:o.encodeErrorCode(g),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(d)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===f)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,a=Number(t),o=this._progressHandlers.get(a);if(!o){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&s&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(l){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),s(l);return}o(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),ic(e))r(e);else r(ae.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let a=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(a,e.method),mr(t))return this._requestWithSchemaViaCodec(a,e,t,r);let o=mc(a,e.method);if(o===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(a,e,o,t)}_negotiatedWireCodec(){return yt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Ah(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Kn(t)&&!e.hasRequestMethod(t))throw new ue(pe.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let a=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(a,e.method),this._requestWithSchemaViaCodec(a,e,t,r)}_requestWithSchemaViaCodec(e,t,r,a){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n,headers:l}=a??{},c=Date.now(),u,h;return new Promise((f,z)=>{let E=(S)=>{z(S)};if(!this._transport){E(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(S){E(S);return}if(a?.signal?.aborted){let S=a.signal.reason;throw S instanceof ue?S:new ue(pe.RequestTimeout,String(S))}let _=e.era===za&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;h=v;let g={...t,jsonrpc:"2.0",id:v};if(a?.onprogress)this._progressHandlers.set(v,a.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:v}};let d=this._envelopeOutbound(g),y=!1,m=(S)=>{if(y)return;if(this._progressHandlers.delete(v),_===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(S)}}),{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n}).catch((p)=>this._onerror(Error(`Failed to send cancellation: ${p}`)));else _.abort();z(S instanceof ue?S:new ue(pe.RequestTimeout,String(S)))};this._responseHandlers.set(v,(S)=>{if(a?.signal?.aborted)return;if(y=!0,S instanceof Error)return z(S);let p;try{p=e.decodeResult(t.method,S.result)}catch(A){return z(A instanceof Error?A:Error(String(A)))}if(p.kind==="invalid")return z(p.error);if(p.kind==="input_required"){if(a?.allowInputRequired===!0)return f(Fh(p));let A={codec:e,request:t,resultSchema:r,options:a,flowStartedAt:c,retry:(x,L)=>this._requestWithSchemaViaCodec(e,x===void 0?{method:t.method}:{method:t.method,params:x},r,L)};return f(this._resolveNonCompleteResult(p,A))}let w=p.result;Mt(r,w).then((A)=>{if(A.success)f(A.data);else z(new ue(pe.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},z)}),u=()=>m(a?.signal?.reason),a?.signal?.addEventListener("abort",u,{once:!0});let b=a?.timeout??Lh,P=()=>m(new ue(pe.RequestTimeout,"Request timed out",{timeout:b}));this._setupTimeout(v,b,a?.maxTotalTimeout,P,a?.resetTimeoutOnProgress??!1),this._transport.send(d,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n,headers:l,requestSignal:_?.signal}).catch((S)=>{this._progressHandlers.delete(v),z(S)})}).finally(()=>{if(u)a?.signal?.removeEventListener("abort",u);if(h!==void 0)this._responseHandlers.delete(h),this._cleanupTimeout(h)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(pe.NotConnected,"Not connected");if(Jn(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(pe.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 a=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(a,r).catch((o)=>this._onerror(o))});return}await this._transport.send(a,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let a;if(typeof t==="function"){if(!Kn(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);a=(o,s)=>{let n=this._negotiatedWireCodec(),l=n.validateRequest(e,o);if(!l.ok&&l.reason==="not-in-era")l=n.validateInputRequest(e,o);if(!l.ok){if(l.reason==="not-in-era")throw new ae(J.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(l.message)}return Promise.resolve(t(l.value,s))}}else if(r)a=async(o,s)=>{let n=await Mt(t.params,{...o.params});if(!n.success)throw new ae(J.InvalidParams,`Invalid params for ${e}: ${n.error}`);return r(n.data,s)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,a))}_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,r){if(typeof t==="function"){if(!Jn(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(a,o)=>{let s=o.validateNotification(e,a);if(!s.ok){if(s.reason==="not-in-era")throw new ae(J.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(a)=>{let o=await Mt(t.params,{...a.params});if(!o.success)throw new ae(J.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,a)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ba(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Jc(e,t){let r={...e};for(let a in t){let o=a,s=t[o];if(s===void 0)continue;let n=r[o];r[o]=ba(n)&&ba(s)?{...n,...s}:s}return r}function pc(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Hh(e){let t={},r=[];if(!pc(e))return{accepted:t,droppedKeys:r};for(let[a,o]of Object.entries(e)){if(!pc(o)||"method"in o||"result"in o){r.push(a);continue}t[a]=o}return{accepted:t,droppedKeys:r}}function Fh(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
1
+ import{$a as Gl,$b as ku,$c as Cd,$d as Q,Aa as Oi,Ab as Je,Ac as id,Ad as Z,Ae as Hm,Ba as ki,Bb as pu,Bc as cd,Bd as Yd,Be as Fm,Ca as Mi,Cb as hu,Cc as ld,Cd as Wd,Ce as Yt,Da as Ai,Db as fu,Dc as ud,Dd as Zd,De as xm,Ea as Li,Eb as gu,Ec as dd,Ed as Nt,Ee as Km,Fa as Vi,Fb as cn,Fc as md,Fd as Xd,Fe as Jm,Ga as Di,Gb as Su,Gc as pd,Gd as Ze,Ge as Gm,Ha as Ui,Hb as yu,Hc as hd,Hd as Qd,He as Bm,Ia as Hi,Ib as _u,Ic as fd,Id as em,Ie as Ym,Ja as Fi,Jb as vu,Jc as gd,Jd as tm,Je as Wm,Ka as xi,Kb as bu,Kc as Sd,Kd as G,Ke as Zm,La as Ka,Lb as Ru,Lc as yd,Ld as rm,Le as Xm,Ma as wi,Mb as zu,Mc as _d,Md as am,Me as Qm,Na as Ki,Nb as $u,Nc as vd,Nd as om,Ne as ep,Oa as Ti,Ob as Eu,Oc as bd,Od as sm,Oe as tp,Pa as Ci,Pb as Pu,Pc as an,Pd as nm,Pe as rp,Qa as qi,Qb as wu,Qc as F,Qd as im,Qe as ap,Ra as ji,Rb as rn,Rc as Rd,Rd as cm,Re as it,Sa as Ll,Sb as i,Sc as zd,Sd as ie,Se as tn,Ta as Vl,Tb as Tu,Tc as $d,Td as lm,Ua as Dl,Ub as Cu,Uc as Ed,Ud as um,Va as Ul,Vb as ln,Vc as Pd,Vd as I,Wa as Hl,Wb as qu,Wc as wd,Wd as dm,Xa as Fl,Xb as ju,Xc as on,Xd as mm,Ya as xl,Yb as Nu,Yc as W,Yd as pm,Za as Kl,Zb as Iu,Zc as sn,Zd as hm,_a as Jl,_b as Ou,_c as Td,_d as fm,ab as Bl,ac as Mu,ad as qd,ae as gm,bb as Yl,bc as Au,bd as jd,be as Sm,cb as Wl,cc as Kr,cd as Nd,ce as ym,db as Zl,dc as Lu,dd as Id,de as _m,eb as Xl,ec as Vu,ed as Od,ee as vm,fb as Ql,fc as Du,fd as kd,fe as bm,gb as eu,gc as Uu,gd as Md,ge as Rm,hb as tu,hc as Hu,hd as nt,he as zm,ib as ru,ic as Fu,id as Ad,ie as $m,jb as au,jc as xu,jd as un,je as Em,kb as ou,kc as Ku,kd as Ld,ke as Pm,lb as su,lc as Ju,ld as te,le as wm,mb as nu,mc as Gu,md as Vd,me as Tm,nb as iu,nc as Bu,nd as Dd,ne as Cm,ob as cu,oc as Yu,od as Ud,oe as qm,pb as lu,pc as Wu,pd as Hd,pe as jm,qb as uu,qc as Zu,qd as nn,qe as Nm,rb as du,rc as Xu,rd as Fd,re as Im,sb as mu,sc as Qu,sd as xd,se as Om,tb as xr,tc as ed,td as N,te as km,ub as xa,uc as td,ud as Kd,ue as Mm,vb as zi,vc as rd,vd as Jd,ve as Am,wa as Ja,wb as Ji,wc as ad,wd as T,we as Lm,xa as Ni,xb as Gi,xc as od,xd as Gd,xe as Vm,ya as jt,yb as Bi,yc as sd,yd as re,ye as Dm,za as Ii,zb as Yi,zc as nd,zd as Bd,ze as Um}from"./chunk-ss48287m.js";import{Te as Pi}from"./chunk-7qxgm62s.js";var op={};Pi(op,{$brand:()=>Ni,$input:()=>Fi,$output:()=>Hi,NEVER:()=>Ja,TimePrecision:()=>Ki,ZodAny:()=>Ad,ZodArray:()=>xd,ZodBase64:()=>ld,ZodBase64URL:()=>dd,ZodBigInt:()=>sn,ZodBigIntFormat:()=>Cd,ZodBoolean:()=>on,ZodCIDRv4:()=>sd,ZodCIDRv6:()=>id,ZodCUID:()=>Fu,ZodCUID2:()=>Ku,ZodCatch:()=>Cm,ZodCodec:()=>km,ZodCustom:()=>Bm,ZodCustomStringFormat:()=>Sd,ZodDate:()=>nn,ZodDefault:()=>bm,ZodDiscriminatedUnion:()=>Zd,ZodE164:()=>pd,ZodEmail:()=>Cu,ZodEmoji:()=>Vu,ZodEnum:()=>cm,ZodError:()=>pu,ZodExactOptional:()=>gm,ZodFile:()=>dm,ZodFirstPartyTypeKind:()=>Qs,ZodFunction:()=>Jm,ZodGUID:()=>qu,ZodIPv4:()=>Qu,ZodIPv6:()=>ad,ZodISODate:()=>Gi,ZodISODateTime:()=>Ji,ZodISODuration:()=>Yi,ZodISOTime:()=>Bi,ZodIntersection:()=>Xd,ZodIssueCode:()=>en,ZodJWT:()=>fd,ZodKSUID:()=>Zu,ZodLazy:()=>Fm,ZodLiteral:()=>um,ZodMAC:()=>td,ZodMap:()=>om,ZodNaN:()=>jm,ZodNanoID:()=>Uu,ZodNever:()=>Vd,ZodNonOptional:()=>Em,ZodNull:()=>Md,ZodNullable:()=>ym,ZodNumber:()=>an,ZodNumberFormat:()=>Rd,ZodObject:()=>Jd,ZodOptional:()=>fm,ZodPipe:()=>Im,ZodPrefault:()=>zm,ZodPreprocess:()=>Lm,ZodPromise:()=>xm,ZodReadonly:()=>Vm,ZodRealError:()=>hu,ZodRecord:()=>tm,ZodSet:()=>nm,ZodString:()=>rn,ZodStringFormat:()=>Tu,ZodSuccess:()=>wm,ZodSymbol:()=>Nd,ZodTemplateLiteral:()=>Um,ZodTransform:()=>pm,ZodTuple:()=>Qd,ZodType:()=>Pu,ZodULID:()=>Gu,ZodURL:()=>Au,ZodUUID:()=>Nu,ZodUndefined:()=>Od,ZodUnion:()=>Bd,ZodUnknown:()=>Ld,ZodVoid:()=>Ud,ZodXID:()=>Yu,ZodXor:()=>Yd,_ZodString:()=>wu,_default:()=>Rm,_function:()=>Gm,any:()=>un,array:()=>N,base64:()=>ud,base64url:()=>md,bigint:()=>Td,boolean:()=>W,catch:()=>qm,check:()=>Ym,cidrv4:()=>nd,cidrv6:()=>cd,clone:()=>Ii,codec:()=>Mm,coerce:()=>Fr,config:()=>jt,core:()=>xa,cuid:()=>xu,cuid2:()=>Ju,custom:()=>Wm,date:()=>Fd,decode:()=>_u,decodeAsync:()=>bu,describe:()=>Qm,discriminatedUnion:()=>Nt,e164:()=>hd,email:()=>ln,emoji:()=>Du,encode:()=>yu,encodeAsync:()=>vu,endsWith:()=>ou,enum:()=>ie,exactOptional:()=>Sm,file:()=>mm,flattenError:()=>ki,float32:()=>$d,float64:()=>Ed,formatError:()=>Mi,fromJSONSchema:()=>Ei,function:()=>Gm,getErrorMap:()=>Cl,globalRegistry:()=>Ka,gt:()=>Dl,gte:()=>Ul,guid:()=>ju,hash:()=>bd,hex:()=>vd,hostname:()=>_d,httpUrl:()=>Lu,includes:()=>ru,instanceof:()=>tp,int:()=>zd,int32:()=>Pd,int64:()=>qd,intersection:()=>Ze,invertCodec:()=>Am,ipv4:()=>ed,ipv6:()=>od,iso:()=>Je,json:()=>ap,jwt:()=>gd,keyof:()=>Kd,ksuid:()=>Xu,lazy:()=>Yt,length:()=>Xl,literal:()=>I,locales:()=>Ui,looseObject:()=>re,looseRecord:()=>am,lowercase:()=>eu,lt:()=>Ll,lte:()=>Vl,mac:()=>rd,map:()=>sm,maxLength:()=>Wl,maxSize:()=>Gl,meta:()=>ep,mime:()=>nu,minLength:()=>Zl,minSize:()=>Bl,multipleOf:()=>Jl,nan:()=>Nm,nanoid:()=>Hu,nativeEnum:()=>lm,negative:()=>Fl,never:()=>Dd,nonnegative:()=>Kl,nonoptional:()=>Pm,nonpositive:()=>xl,normalize:()=>cu,null:()=>nt,nullable:()=>_m,nullish:()=>vm,number:()=>F,object:()=>T,optional:()=>Q,overwrite:()=>iu,parse:()=>fu,parseAsync:()=>gu,partialRecord:()=>rm,pipe:()=>Om,positive:()=>Hl,prefault:()=>$m,preprocess:()=>it,prettifyError:()=>Li,promise:()=>Km,property:()=>su,readonly:()=>Dm,record:()=>G,refine:()=>Zm,regex:()=>Ql,regexes:()=>Vi,registry:()=>xi,safeDecode:()=>zu,safeDecodeAsync:()=>Eu,safeEncode:()=>Ru,safeEncodeAsync:()=>$u,safeParse:()=>cn,safeParseAsync:()=>Su,set:()=>im,setErrorMap:()=>Tl,size:()=>Yl,slugify:()=>mu,startsWith:()=>au,strictObject:()=>Gd,string:()=>i,stringFormat:()=>yd,stringbool:()=>rp,success:()=>Tm,superRefine:()=>Xm,symbol:()=>Id,templateLiteral:()=>Hm,toJSONSchema:()=>xr,toLowerCase:()=>uu,toUpperCase:()=>du,transform:()=>hm,treeifyError:()=>Ai,trim:()=>lu,tuple:()=>em,uint32:()=>wd,uint64:()=>jd,ulid:()=>Bu,undefined:()=>kd,union:()=>Z,unknown:()=>te,uppercase:()=>tu,url:()=>Kr,util:()=>Oi,uuid:()=>Iu,uuidv4:()=>Ou,uuidv6:()=>ku,uuidv7:()=>Mu,void:()=>Hd,xid:()=>Wu,xor:()=>Wd});var en={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"};function Tl(e){jt({customError:e})}function Cl(){return jt().customError}var Qs;(function(e){})(Qs||(Qs={}));var B={...tn,...zi,iso:Je},ql=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function jl(e,t){let r=e.$schema;if(r==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(r==="http://json-schema.org/draft-07/schema#")return"draft-7";if(r==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function Nl(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let a=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===a){let o=r[1];if(!o||!t.defs[o])throw Error(`Reference not found: ${e}`);return t.defs[o]}throw Error(`Reference not found: ${e}`)}function $i(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return B.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return B.lazy(()=>{if(!t.refs.has(o))throw Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let s=Nl(o,t),n=Oe(s,t);return t.refs.set(o,n),t.processing.delete(o),n}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return B.null();if(o.length===0)return B.never();if(o.length===1)return B.literal(o[0]);if(o.every((n)=>typeof n==="string"))return B.enum(o);let s=o.map((n)=>B.literal(n));if(s.length<2)return s[0];return B.union([s[0],s[1],...s.slice(2)])}if(e.const!==void 0)return B.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map((s)=>{let n={...e,type:s};return $i(n,t)});if(o.length===0)return B.never();if(o.length===1)return o[0];return B.union(o)}if(!r)return B.any();let a;switch(r){case"string":{let o=B.string();if(e.format){let s=e.format;if(s==="email")o=o.check(B.email());else if(s==="uri"||s==="uri-reference")o=o.check(B.url());else if(s==="uuid"||s==="guid")o=o.check(B.uuid());else if(s==="date-time")o=o.check(B.iso.datetime());else if(s==="date")o=o.check(B.iso.date());else if(s==="time")o=o.check(B.iso.time());else if(s==="duration")o=o.check(B.iso.duration());else if(s==="ipv4")o=o.check(B.ipv4());else if(s==="ipv6")o=o.check(B.ipv6());else if(s==="mac")o=o.check(B.mac());else if(s==="cidr")o=o.check(B.cidrv4());else if(s==="cidr-v6")o=o.check(B.cidrv6());else if(s==="base64")o=o.check(B.base64());else if(s==="base64url")o=o.check(B.base64url());else if(s==="e164")o=o.check(B.e164());else if(s==="jwt")o=o.check(B.jwt());else if(s==="emoji")o=o.check(B.emoji());else if(s==="nanoid")o=o.check(B.nanoid());else if(s==="cuid")o=o.check(B.cuid());else if(s==="cuid2")o=o.check(B.cuid2());else if(s==="ulid")o=o.check(B.ulid());else if(s==="xid")o=o.check(B.xid());else if(s==="ksuid")o=o.check(B.ksuid())}if(typeof e.minLength==="number")o=o.min(e.minLength);if(typeof e.maxLength==="number")o=o.max(e.maxLength);if(e.pattern)o=o.regex(new RegExp(e.pattern));a=o;break}case"number":case"integer":{let o=r==="integer"?B.number().int():B.number();if(typeof e.minimum==="number")o=o.min(e.minimum);if(typeof e.maximum==="number")o=o.max(e.maximum);if(typeof e.exclusiveMinimum==="number")o=o.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")o=o.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")o=o.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")o=o.lt(e.maximum);if(typeof e.multipleOf==="number")o=o.multipleOf(e.multipleOf);a=o;break}case"boolean":{a=B.boolean();break}case"null":{a=B.null();break}case"object":{let o={},s=e.properties||{},n=new Set(e.required||[]);for(let[c,u]of Object.entries(s)){let h=Oe(u,t);o[c]=n.has(c)?h:h.optional()}if(e.propertyNames){let c=Oe(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?Oe(e.additionalProperties,t):B.any();if(Object.keys(o).length===0){a=B.record(c,u);break}let h=B.object(o).passthrough(),f=B.looseRecord(c,u);a=B.intersection(h,f);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),h=[];for(let z of u){let E=Oe(c[z],t),_=B.string().regex(new RegExp(z));h.push(B.looseRecord(_,E))}let f=[];if(Object.keys(o).length>0)f.push(B.object(o).passthrough());if(f.push(...h),f.length===0)a=B.object({}).passthrough();else if(f.length===1)a=f[0];else{let z=B.intersection(f[0],f[1]);for(let E=2;E<f.length;E++)z=B.intersection(z,f[E]);a=z}break}let l=B.object(o);if(e.additionalProperties===!1)a=l.strict();else if(typeof e.additionalProperties==="object")a=l.catchall(Oe(e.additionalProperties,t));else a=l.passthrough();break}case"array":{let{prefixItems:o,items:s}=e;if(o&&Array.isArray(o)){let n=o.map((c)=>Oe(c,t)),l=s&&typeof s==="object"&&!Array.isArray(s)?Oe(s,t):void 0;if(l)a=B.tuple(n).rest(l);else a=B.tuple(n);if(typeof e.minItems==="number")a=a.check(B.minLength(e.minItems));if(typeof e.maxItems==="number")a=a.check(B.maxLength(e.maxItems))}else if(Array.isArray(s)){let n=s.map((c)=>Oe(c,t)),l=e.additionalItems&&typeof e.additionalItems==="object"?Oe(e.additionalItems,t):void 0;if(l)a=B.tuple(n).rest(l);else a=B.tuple(n);if(typeof e.minItems==="number")a=a.check(B.minLength(e.minItems));if(typeof e.maxItems==="number")a=a.check(B.maxLength(e.maxItems))}else if(s!==void 0){let n=Oe(s,t),l=B.array(n);if(typeof e.minItems==="number")l=l.min(e.minItems);if(typeof e.maxItems==="number")l=l.max(e.maxItems);a=l}else a=B.array(B.any());break}default:throw Error(`Unsupported type: ${r}`)}return a}function Oe(e,t){if(typeof e==="boolean")return e?B.any():B.never();let r=$i(e,t),a=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let l=e.anyOf.map((u)=>Oe(u,t)),c=B.union(l);r=a?B.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let l=e.oneOf.map((u)=>Oe(u,t)),c=B.xor(l);r=a?B.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=a?r:B.any();else{let l=a?r:Oe(e.allOf[0],t),c=a?0:1;for(let u=c;u<e.allOf.length;u++)l=B.intersection(l,Oe(e.allOf[u],t));r=l}if(e.nullable===!0&&t.version==="openapi-3.0")r=B.nullable(r);if(e.readOnly===!0)r=B.readonly(r);if(e.default!==void 0)r=r.default(e.default);let o={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let l of s)if(l in e)o[l]=e[l];let n=["contentEncoding","contentMediaType","contentSchema"];for(let l of n)if(l in e)o[l]=e[l];for(let l of Object.keys(e))if(!ql.has(l))o[l]=e[l];if(Object.keys(o).length>0)t.registry.add(r,o);if(e.description)r=r.describe(e.description);return r}function Ei(e,t){if(typeof e==="boolean")return e?B.any():B.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let a=jl(r,t?.defaultTarget),o=r.$defs||r.definitions||{},s={version:a,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Ka};return Oe(r,s)}var Fr={};Pi(Fr,{bigint:()=>Ml,boolean:()=>kl,date:()=>Al,number:()=>Ol,string:()=>Il});function Il(e){return wi(rn,e)}function Ol(e){return Ti(an,e)}function kl(e){return Ci(on,e)}function Ml(e){return qi(sn,e)}function Al(e){return ji(nn,e)}jt(Di());var{create:sp,defineProperty:Ga,getOwnPropertyDescriptor:np,getOwnPropertyNames:ip,getPrototypeOf:cp}=Object,lp=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wi=(e,t)=>{let r={};for(var a in e)Ga(r,a,{get:e[a],enumerable:!0});if(t)Ga(r,Symbol.toStringTag,{value:"Module"});return r},up=(e,t,r,a)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var o=ip(t),s=0,n=o.length,l;s<n;s++)if(l=o[s],!lp.call(e,l)&&l!==r)Ga(e,l,{get:((c)=>t[c]).bind(null,l),enumerable:!(a=np(t,l))||a.enumerable})}return e},Ba=(e,t,r)=>(r=e!=null?sp(cp(e)):{},up(t||!e||!e.__esModule?Ga(r,"default",{value:e,enumerable:!0}):r,e));var dp=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Zi=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),mp=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),pp=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Xi(e){return typeof e==="string"&&Zi.has(e.replace(/#$/,""))}function Qi(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(dp.has(r))return"2020-12";if(Zi.has(r))return"2019-09";if(mp.has(r)||pp.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Wt="2025-11-25";var mn=[Wt,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],pn="io.modelcontextprotocol/related-task",lt="io.modelcontextprotocol/protocolVersion",Jr="io.modelcontextprotocol/clientInfo",Qe="io.modelcontextprotocol/serverInfo",ut="io.modelcontextprotocol/clientCapabilities",Zt="io.modelcontextprotocol/subscriptionId",Ot="io.modelcontextprotocol/logLevel";var Xt="2.0";var ct=Yt(()=>Z([i(),F(),W(),nt(),G(i(),ct),N(ct)])),ve=G(i(),ct),hn=N(ct),Gr=Z([i(),F().int()]),Br=i(),Ya=T({ttl:F().optional()}),Wa=T({taskId:i()}),Yr=re({progressToken:Gr.optional(),[pn]:Wa.optional()}),qe=T({_meta:Yr.optional()}),kt=qe.extend({task:Ya.optional()}),be=T({method:i(),params:qe.loose().optional()}),ke=T({_meta:Yr.optional()}),Me=T({method:i(),params:ke.loose().optional()}),Wr=re({get[Qe](){return tr.optional().catch(void 0)}}),Re=re({_meta:Wr.optional()}),dt=Z([i(),F().int()]),Zr=T({jsonrpc:I(Xt),id:dt,...be.shape}).strict(),Xr=T({jsonrpc:I(Xt),...Me.shape}).strict(),Qt=T({jsonrpc:I(Xt),id:dt,result:Re}).strict(),er=T({jsonrpc:I(Xt),id:dt.optional(),error:T({code:F().int(),message:i(),data:te().optional()})}).strict(),Za=Z([Zr,Xr,Qt,er]),fn=Z([Qt,er]),Qr=Re.strict(),Xa=ke.extend({requestId:dt.optional(),reason:i().optional()}),ea=Me.extend({method:I("notifications/cancelled"),params:Xa}),Qa=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),mt=T({icons:N(Qa).optional()}),Xe=T({name:i(),title:i().optional()}),tr=Xe.extend({...Xe.shape,...mt.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),fp=Ze(T({applyDefaults:W().optional()}),ve),gp=it((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Ze(T({form:fp.optional(),url:ve.optional()}),ve.optional())),eo=re({list:ve.optional(),cancel:ve.optional(),requests:re({sampling:re({createMessage:ve.optional()}).optional(),elicitation:re({create:ve.optional()}).optional()}).optional()}),to=re({list:ve.optional(),cancel:ve.optional(),requests:re({tools:re({call:ve.optional()}).optional()}).optional()}),ro=T({experimental:G(i(),ve).optional(),sampling:T({context:ve.optional(),tools:ve.optional()}).optional(),elicitation:gp.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:eo.optional(),extensions:G(i(),ve).optional()}),ao=qe.extend({protocolVersion:i(),capabilities:ro,clientInfo:tr}),oo=be.extend({method:I("initialize"),params:ao}),ta=T({experimental:G(i(),ve).optional(),logging:ve.optional(),completions:ve.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:to.optional(),extensions:G(i(),ve).optional()}),so=Re.extend({protocolVersion:i(),capabilities:ta,serverInfo:tr,instructions:i().optional()}),no=Me.extend({method:I("notifications/initialized"),params:ke.optional()}),io=be.extend({method:I("server/discover"),params:qe.optional()}),co=Re.extend({supportedVersions:N(i()),capabilities:ta,instructions:i().optional()}),ra=be.extend({method:I("ping"),params:qe.optional()}),lo=T({progress:F(),total:Q(F()),message:Q(i())}),uo=T({...ke.shape,...lo.shape,progressToken:Gr}),aa=Me.extend({method:I("notifications/progress"),params:uo}),mo=qe.extend({cursor:Br.optional()}),pt=be.extend({params:mo.optional()}),ht=Re.extend({nextCursor:Br.optional()}),oa=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),sa=oa.extend({text:i()}),gn=i().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),na=oa.extend({blob:gn}),ft=ie(["user","assistant"]),et=T({audience:N(ft).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),ia=T({...Xe.shape,...mt.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:et.optional(),_meta:Q(re({}))}),po=T({...Xe.shape,...mt.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:et.optional(),_meta:Q(re({}))}),ho=pt.extend({method:I("resources/list")}),fo=ht.extend({resources:N(ia)}),go=pt.extend({method:I("resources/templates/list")}),So=ht.extend({resourceTemplates:N(po)}),rr=qe.extend({uri:i()}),yo=rr,_o=be.extend({method:I("resources/read"),params:yo}),vo=Re.extend({contents:N(Z([sa,na]))}),bo=Me.extend({method:I("notifications/resources/list_changed"),params:ke.optional()}),Ro=rr,zo=be.extend({method:I("resources/subscribe"),params:Ro}),$o=rr,Eo=be.extend({method:I("resources/unsubscribe"),params:$o}),ca=T({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:N(i()).optional()}),Po=qe.extend({notifications:ca}),wo=be.extend({method:I("subscriptions/listen"),params:Po}),To=ke.extend({notifications:ca}),Co=Me.extend({method:I("notifications/subscriptions/acknowledged"),params:To}),qo=Wr.extend({[Zt]:dt}),jo=Re.extend({_meta:qo}),No=ke.extend({uri:i()}),Io=Me.extend({method:I("notifications/resources/updated"),params:No}),Oo=T({name:i(),description:Q(i()),required:Q(W())}),ko=T({...Xe.shape,...mt.shape,description:Q(i()),arguments:Q(N(Oo)),_meta:Q(re({}))}),Mo=pt.extend({method:I("prompts/list")}),Ao=ht.extend({prompts:N(ko)}),Lo=qe.extend({name:i(),arguments:G(i(),i()).optional()}),Vo=be.extend({method:I("prompts/get"),params:Lo}),ar=T({type:I("text"),text:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),or=T({type:I("image"),data:gn,mimeType:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),sr=T({type:I("audio"),data:gn,mimeType:i(),annotations:et.optional(),_meta:G(i(),te()).optional()}),Do=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),Uo=T({type:I("resource"),resource:Z([sa,na]),annotations:et.optional(),_meta:G(i(),te()).optional()}),Ho=ia.extend({type:I("resource_link")}),nr=Z([ar,or,sr,Ho,Uo]),Fo=T({role:ft,content:nr}),xo=Re.extend({description:i().optional(),messages:N(Fo)}),Ko=Me.extend({method:I("notifications/prompts/list_changed"),params:ke.optional()}),Jo=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),Go=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),la=T({...Xe.shape,...mt.shape,description:i().optional(),inputSchema:T({type:I("object"),properties:G(i(),ct).optional(),required:N(i()).optional()}).catchall(te()),outputSchema:re({$schema:i().optional()}).optional(),annotations:Jo.optional(),execution:Go.optional(),_meta:G(i(),te()).optional()}),Bo=pt.extend({method:I("tools/list")}),Yo=ht.extend({tools:N(la)}),ua=Re.extend({content:N(nr).default([]),structuredContent:te().optional(),isError:W().optional()}),Sn=ua.or(Re.extend({toolResult:te()})),Wo=kt.extend({name:i(),arguments:G(i(),te()).optional()}),Zo=be.extend({method:I("tools/call"),params:Wo}),Xo=Me.extend({method:I("notifications/tools/list_changed"),params:ke.optional()}),yn=T({autoRefresh:W().default(!0),debounceMs:F().int().nonnegative().default(300)}),gt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),Qo=qe.extend({level:gt}),es=be.extend({method:I("logging/setLevel"),params:Qo}),ts=ke.extend({level:gt,logger:i().optional(),data:te()}),rs=Me.extend({method:I("notifications/message"),params:ts}),as=T({name:i().optional()}),os=T({hints:N(as).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),ss=T({mode:ie(["auto","required","none"]).optional()}),ns=T({type:I("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:N(nr),structuredContent:te().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),is=Nt("type",[ar,or,sr]),It=Nt("type",[ar,or,sr,Do,ns]),cs=T({role:ft,content:Z([It,N(It)]),_meta:G(i(),te()).optional()}),ls=kt.extend({messages:N(cs),modelPreferences:os.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:ve.optional(),tools:N(la).optional(),toolChoice:ss.optional()}),us=be.extend({method:I("sampling/createMessage"),params:ls}),ds=Re.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(i())),role:ft,content:is}),ms=Re.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:ft,content:Z([It,N(It)])}),da=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),ir=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),cr=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),ma=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),pa=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),ha=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),ps=Z([ma,pa]),fa=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),ga=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),hs=Z([fa,ga]),fs=Z([ha,ps,hs]),Sa=Z([fs,da,ir,cr]),lr=kt.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),Sa),required:N(i()).optional()}).catchall(te())}),gs=kt.extend({mode:I("url"),message:i(),elicitationId:i(),url:i().url()}),Ss=Z([lr,gs]),ys=be.extend({method:I("elicitation/create"),params:Ss}),_s=ke.extend({elicitationId:i()}),vs=Me.extend({method:I("notifications/elicitation/complete"),params:_s}),bs=Re.extend({action:ie(["accept","decline","cancel"]),content:it((e)=>e===null?void 0:e,G(i(),Z([i(),F(),W(),N(i())])).optional())}),Rs=T({type:I("ref/resource"),uri:i()}),zs=T({type:I("ref/prompt"),name:i()}),$s=qe.extend({ref:Z([zs,Rs]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()}),Es=be.extend({method:I("completion/complete"),params:$s}),Ps=Re.extend({completion:re({values:N(i()).max(100),total:Q(F().int()),hasMore:Q(W())})}),ws=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),Ts=be.extend({method:I("roots/list"),params:qe.optional()}),Cs=Re.extend({roots:N(ws)}),qs=Me.extend({method:I("notifications/roots/list_changed"),params:ke.optional()}),_n=re({ttl:F().optional(),pollInterval:F().optional()}),js=ie(["working","input_required","completed","failed","cancelled"]),St=T({taskId:i(),status:js,ttl:Z([F(),nt()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:Q(F()),statusMessage:Q(i())}),vn=Re.extend({task:St}),Ns=ke.merge(St),bn=Me.extend({method:I("notifications/tasks/status"),params:Ns}),Rn=be.extend({method:I("tasks/get"),params:qe.extend({taskId:i()})}),zn=Re.merge(St),$n=be.extend({method:I("tasks/result"),params:qe.extend({taskId:i()})}),En=Re.loose(),Pn=pt.extend({method:I("tasks/list")}),wn=ht.extend({tasks:N(St)}),Tn=be.extend({method:I("tasks/cancel"),params:qe.extend({taskId:i()})}),Cn=Re.merge(St),qn=Z([ra,oo,io,Es,es,Vo,Mo,ho,go,_o,zo,Eo,wo,Zo,Bo]),jn=Z([ea,aa,no,qs]),Nn=Z([Qr,ds,ms,bs,Cs]),In=Z([ra,us,ys,Ts]),On=Z([ea,aa,rs,Io,bo,Xo,Ko,Co,vs]),kn=Z([Qr,so,co,Ps,xo,Ao,fo,So,vo,ua,Yo,jo]),Ce=Kr().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:en.custom,message:"URL must be parseable",fatal:!0}),Ja}).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"}),Mn=re({resource:i().url(),authorization_servers:N(Ce).optional(),jwks_uri:i().url().optional(),scopes_supported:N(i()).optional(),bearer_methods_supported:N(i()).optional(),resource_signing_alg_values_supported:N(i()).optional(),resource_name:i().optional(),resource_documentation:i().optional(),resource_policy_uri:i().url().optional(),resource_tos_uri:i().url().optional(),tls_client_certificate_bound_access_tokens:W().optional(),authorization_details_types_supported:N(i()).optional(),dpop_signing_alg_values_supported:N(i()).optional(),dpop_bound_access_tokens_required:W().optional()}),Is=re({issuer:i(),authorization_endpoint:Ce,token_endpoint:Ce,registration_endpoint:Ce.optional(),scopes_supported:N(i()).optional(),response_types_supported:N(i()),response_modes_supported:N(i()).optional(),grant_types_supported:N(i()).optional(),token_endpoint_auth_methods_supported:N(i()).optional(),token_endpoint_auth_signing_alg_values_supported:N(i()).optional(),service_documentation:Ce.optional(),revocation_endpoint:Ce.optional(),revocation_endpoint_auth_methods_supported:N(i()).optional(),revocation_endpoint_auth_signing_alg_values_supported:N(i()).optional(),introspection_endpoint:i().optional(),introspection_endpoint_auth_methods_supported:N(i()).optional(),introspection_endpoint_auth_signing_alg_values_supported:N(i()).optional(),code_challenge_methods_supported:N(i()).optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),Os=re({issuer:i(),authorization_endpoint:Ce,token_endpoint:Ce,userinfo_endpoint:Ce.optional(),jwks_uri:Ce,registration_endpoint:Ce.optional(),scopes_supported:N(i()).optional(),response_types_supported:N(i()),response_modes_supported:N(i()).optional(),grant_types_supported:N(i()).optional(),acr_values_supported:N(i()).optional(),subject_types_supported:N(i()),id_token_signing_alg_values_supported:N(i()),id_token_encryption_alg_values_supported:N(i()).optional(),id_token_encryption_enc_values_supported:N(i()).optional(),userinfo_signing_alg_values_supported:N(i()).optional(),userinfo_encryption_alg_values_supported:N(i()).optional(),userinfo_encryption_enc_values_supported:N(i()).optional(),request_object_signing_alg_values_supported:N(i()).optional(),request_object_encryption_alg_values_supported:N(i()).optional(),request_object_encryption_enc_values_supported:N(i()).optional(),token_endpoint_auth_methods_supported:N(i()).optional(),token_endpoint_auth_signing_alg_values_supported:N(i()).optional(),display_values_supported:N(i()).optional(),claim_types_supported:N(i()).optional(),claims_supported:N(i()).optional(),service_documentation:i().optional(),claims_locales_supported:N(i()).optional(),ui_locales_supported:N(i()).optional(),claims_parameter_supported:W().optional(),request_parameter_supported:W().optional(),request_uri_parameter_supported:W().optional(),require_request_uri_registration:W().optional(),op_policy_uri:Ce.optional(),op_tos_uri:Ce.optional(),client_id_metadata_document_supported:W().optional(),authorization_response_iss_parameter_supported:W().optional().catch(void 0)}),An=T({...Os.shape,...Is.pick({code_challenge_methods_supported:!0}).shape}),Ln=T({access_token:i(),id_token:i().optional(),token_type:i(),expires_in:Fr.number().optional(),scope:i().optional(),refresh_token:i().optional()}).strip(),Vn=T({issued_token_type:I("urn:ietf:params:oauth:token-type:id-jag"),access_token:i(),token_type:i().optional(),expires_in:F().optional(),scope:i().optional()}).strip(),Dn=T({error:i(),error_description:i().optional(),error_uri:i().optional()}),dn=Ce.optional().or(I("").transform(()=>{return})),ks=T({redirect_uris:N(Ce),token_endpoint_auth_method:i().optional(),grant_types:N(i()).optional(),response_types:N(i()).optional(),application_type:i().optional(),client_name:i().optional(),client_uri:Ce.optional(),logo_uri:dn,scope:i().optional(),contacts:N(i()).optional(),tos_uri:dn,policy_uri:i().optional(),jwks_uri:Ce.optional(),jwks:un().optional(),software_id:i().optional(),software_version:i().optional(),software_statement:i().optional()}).strip(),Ms=T({client_id:i(),client_secret:i().optional(),client_id_issued_at:F().optional(),client_secret_expires_at:F().optional()}).strip(),Un=ks.merge(Ms),Hn=T({error:i(),error_description:i().optional()}).strip(),Fn=T({token:i(),token_type_hint:i().optional()}).strip();var Gn=Symbol.for("mcp.sdk.errorBrands");function Zn(e,t){let r=new Set,a=t;while(typeof a==="function"){let o=a.mcpBrand;if(Object.prototype.hasOwnProperty.call(a,"mcpBrand")&&typeof o==="string")r.add(o);a=Object.getPrototypeOf(a)}if(r.size===0)return;Object.defineProperty(e,Gn,{value:r,enumerable:!1,configurable:!0})}function dr(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,Gn)){let r=t[Gn];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var tS=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return dr(this,t)}static isInstance(t){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 dr(this,t)}constructor(t,r,a){super(r);this.code=t,this.errorUri=a,this.name="OAuthError",Zn(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},pe=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}({}),ue=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return dr(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 dr(this,e)}constructor(e,t,r){super(t);this.code=e,this.data=r,this.name="SdkError",Zn(this,new.target)}},rS=class extends ue{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r){super(e,t,r);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ec(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Pp(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function hc(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function Xn(e,t){let r={};for(let[a,o]of Object.entries(e)){if(o===void 0)continue;let s=t===void 0?void 0:t[a];if(s===void 0){r[a]=o;continue}if(ec(o)&&ec(s)){let n={};for(let[l,c]of Object.entries(o))if(c!==void 0&&s[l]===void 0&&!Pp(a,l,s))n[l]=c;if(Object.keys(n).length>0)r[a]=n}}return Object.keys(r).length>0?r:void 0}var fc="2026-07-28",aS=[fc];function pr(e){return e>=fc}function gc(e){return e.filter((t)=>!pr(t))}function Qn(e){return e.filter((t)=>pr(t))}function Sc(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var yc=["task","inputRequests","requestState"];function ei(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||yc.some((t)=>(t in e)))return e;return{...e,content:[]}}function wp(){let e=Yt(()=>Z([i(),F(),W(),nt(),G(i(),e),N(e)])),t=G(i(),e),r=Z([i(),F().int()]),a=i(),o=T({ttl:F().optional()}),s=T({taskId:i()}),n=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),l=T({_meta:n.optional()}),c=l.extend({task:o.optional()}),u=T({method:i(),params:l.loose().optional()}),h=T({_meta:n.optional()}),f=T({method:i(),params:h.loose().optional()}),z=re({_meta:n.optional()}),E=Z([i(),F().int()]),_=z.strict(),v=h.extend({requestId:E.optional(),reason:i().optional()}),g=f.extend({method:I("notifications/cancelled"),params:v}),d=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),y=T({icons:N(d).optional()}),m=T({name:i(),title:i().optional()}),b=m.extend({...m.shape,...y.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),P=Ze(T({applyDefaults:W().optional()}),t),S=it((Ie)=>{if(Ie&&typeof Ie==="object"&&!Array.isArray(Ie)&&Object.keys(Ie).length===0)return{form:{}};return Ie},Ze(T({form:P.optional(),url:t.optional()}),t.optional())),p=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),w=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),A=T({experimental:G(i(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:S.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:p.optional(),extensions:G(i(),t).optional()}),x=l.extend({protocolVersion:i(),capabilities:A,clientInfo:b}),L=u.extend({method:I("initialize"),params:x}),U=T({experimental:G(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:w.optional(),extensions:G(i(),t).optional()}),X=z.extend({protocolVersion:i(),capabilities:U,serverInfo:b,instructions:i().optional()}),Y=f.extend({method:I("notifications/initialized"),params:h.optional()}),me=u.extend({method:I("ping"),params:l.optional()}),ye=T({progress:F(),total:Q(F()),message:Q(i())}),ge=T({...h.shape,...ye.shape,progressToken:r}),Ee=f.extend({method:I("notifications/progress"),params:ge}),he=l.extend({cursor:a.optional()}),j=u.extend({params:he.optional()}),k=z.extend({nextCursor:a.optional()}),H=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),R=H.extend({text:i()}),q=i().refine((Ie)=>{try{return atob(Ie),!0}catch{return!1}},{message:"Invalid Base64 string"}),O=H.extend({blob:q}),K=ie(["user","assistant"]),ee=T({audience:N(K).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),de=T({...m.shape,...y.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:ee.optional(),_meta:Q(re({}))}),ne=T({...m.shape,...y.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:ee.optional(),_meta:Q(re({}))}),Se=j.extend({method:I("resources/list")}),Ae=k.extend({resources:N(de)}),C=j.extend({method:I("resources/templates/list")}),M=k.extend({resourceTemplates:N(ne)}),V=l.extend({uri:i()}),oe=V,se=u.extend({method:I("resources/read"),params:oe}),le=z.extend({contents:N(Z([R,O]))}),ze=f.extend({method:I("notifications/resources/list_changed"),params:h.optional()}),we=V,je=u.extend({method:I("resources/subscribe"),params:we}),Pe=V,_e=u.extend({method:I("resources/unsubscribe"),params:Pe}),He=h.extend({uri:i()}),Te=f.extend({method:I("notifications/resources/updated"),params:He}),Ye=T({name:i(),description:Q(i()),required:Q(W())}),xe=T({...m.shape,...y.shape,description:Q(i()),arguments:Q(N(Ye)),_meta:Q(re({}))}),We=j.extend({method:I("prompts/list")}),tt=k.extend({prompts:N(xe)}),rt=l.extend({name:i(),arguments:G(i(),i()).optional()}),bt=u.extend({method:I("prompts/get"),params:rt}),Rt=T({type:I("text"),text:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),zt=T({type:I("image"),data:q,mimeType:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),$t=T({type:I("audio"),data:q,mimeType:i(),annotations:ee.optional(),_meta:G(i(),te()).optional()}),gr=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),at=T({type:I("resource"),resource:Z([R,O]),annotations:ee.optional(),_meta:G(i(),te()).optional()}),Sr=de.extend({type:I("resource_link")}),Fe=Z([Rt,zt,$t,Sr,at]),Lt=T({role:K,content:Fe}),Vt=z.extend({description:i().optional(),messages:N(Lt)}),Et=f.extend({method:I("notifications/prompts/list_changed"),params:h.optional()}),yr=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),Dt=T({taskSupport:ie(["required","optional","forbidden"]).optional()}),Pt=T({...m.shape,...y.shape,description:i().optional(),inputSchema:T({type:I("object"),properties:G(i(),e).optional(),required:N(i()).optional()}).catchall(te()),outputSchema:T({type:I("object"),properties:G(i(),e).optional(),required:N(i()).optional()}).catchall(te()).optional(),annotations:yr.optional(),execution:Dt.optional(),_meta:G(i(),te()).optional()}),Ut=j.extend({method:I("tools/list")}),Ht=k.extend({tools:N(Pt)}),Ft=z.extend({content:N(Fe),structuredContent:G(i(),te()).optional(),isError:W().optional()}),Ne=c.extend({name:i(),arguments:G(i(),te()).optional()}),_r=u.extend({method:I("tools/call"),params:Ne}),wa=f.extend({method:I("notifications/tools/list_changed"),params:h.optional()}),xt=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),vr=l.extend({level:xt}),br=u.extend({method:I("logging/setLevel"),params:vr}),Rr=h.extend({level:xt,logger:i().optional(),data:te()}),zr=f.extend({method:I("notifications/message"),params:Rr}),$r=T({name:i().optional()}),Er=T({hints:N($r).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),Pr=T({mode:ie(["auto","required","none"]).optional()}),Ta=T({type:I("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:N(Fe),structuredContent:T({}).loose().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),wr=Nt("type",[Rt,zt,$t]),ot=Nt("type",[Rt,zt,$t,gr,Ta]),Tr=T({role:K,content:Z([ot,N(ot)]),_meta:G(i(),te()).optional()}),Cr=c.extend({messages:N(Tr),modelPreferences:Er.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:t.optional(),tools:N(Pt).optional(),toolChoice:Pr.optional()}),qr=u.extend({method:I("sampling/createMessage"),params:Cr}),jr=z.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens"]).or(i())),role:K,content:wr}),Nr=z.extend({model:i(),stopReason:Q(ie(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:K,content:Z([ot,N(ot)])}),Ir=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),Or=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),kr=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),Mr=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),Ar=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),Lr=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),Vr=Z([Mr,Ar]),wt=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),Tt=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),Ca=Z([wt,Tt]),qa=Z([Lr,Vr,Ca]),De=Z([qa,Ir,Or,kr]),Ue=c.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),De),required:N(i()).optional()}).catchall(te())}),Dr=c.extend({mode:I("url"),message:i(),elicitationId:i(),url:i().url()}),Ke=Z([Ue,Dr]),ja=u.extend({method:I("elicitation/create"),params:Ke}),Na=h.extend({elicitationId:i()}),Ia=f.extend({method:I("notifications/elicitation/complete"),params:Na}),Oa=z.extend({action:ie(["accept","decline","cancel"]),content:it((Ie)=>Ie===null?void 0:Ie,G(i(),Z([i(),F(),W(),N(i())])).optional())}),ka=T({type:I("ref/resource"),uri:i()}),Ma=T({type:I("ref/prompt"),name:i()}),Aa=l.extend({ref:Z([Ma,ka]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()}),Ur=u.extend({method:I("completion/complete"),params:Aa}),La=z.extend({completion:re({values:N(i()).max(100),total:Q(F().int()),hasMore:Q(W())})}),Va=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),Kt=u.extend({method:I("roots/list"),params:l.optional()}),Hr=z.extend({roots:N(Va)}),Da=f.extend({method:I("notifications/roots/list_changed"),params:h.optional()}),Ua=re({ttl:F().optional(),pollInterval:F().optional()}),Ha=ie(["working","input_required","completed","failed","cancelled"]),st=T({taskId:i(),status:Ha,ttl:Z([F(),nt()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:Q(F()),statusMessage:Q(i())}),Le=z.extend({task:st}),Fa=h.merge(st),Ct=f.extend({method:I("notifications/tasks/status"),params:Fa}),Jt=u.extend({method:I("tasks/get"),params:l.extend({taskId:i()})}),Gt=z.merge(st),Bt=u.extend({method:I("tasks/result"),params:l.extend({taskId:i()})}),Xs=z.loose(),Ve=j.extend({method:I("tasks/list")}),$e=k.extend({tasks:N(st)}),qt=u.extend({method:I("tasks/cancel"),params:l.extend({taskId:i()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:a,TaskMetadataSchema:o,RelatedTaskMetadataSchema:s,RequestMetaSchema:n,BaseRequestParamsSchema:l,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:h,NotificationSchema:f,ResultSchema:z,RequestIdSchema:E,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:g,IconSchema:d,IconsSchema:y,BaseMetadataSchema:m,ImplementationSchema:b,ClientTasksCapabilitySchema:p,ServerTasksCapabilitySchema:w,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:x,InitializeRequestSchema:L,ServerCapabilitiesSchema:U,InitializeResultSchema:X,InitializedNotificationSchema:Y,PingRequestSchema:me,ProgressSchema:ye,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:Ee,PaginatedRequestParamsSchema:he,PaginatedRequestSchema:j,PaginatedResultSchema:k,ResourceContentsSchema:H,TextResourceContentsSchema:R,BlobResourceContentsSchema:O,RoleSchema:K,AnnotationsSchema:ee,ResourceSchema:de,ResourceTemplateSchema:ne,ListResourcesRequestSchema:Se,ListResourcesResultSchema:Ae,ListResourceTemplatesRequestSchema:C,ListResourceTemplatesResultSchema:M,ResourceRequestParamsSchema:V,ReadResourceRequestParamsSchema:oe,ReadResourceRequestSchema:se,ReadResourceResultSchema:le,ResourceListChangedNotificationSchema:ze,SubscribeRequestParamsSchema:we,SubscribeRequestSchema:je,UnsubscribeRequestParamsSchema:Pe,UnsubscribeRequestSchema:_e,ResourceUpdatedNotificationParamsSchema:He,ResourceUpdatedNotificationSchema:Te,PromptArgumentSchema:Ye,PromptSchema:xe,ListPromptsRequestSchema:We,ListPromptsResultSchema:tt,GetPromptRequestParamsSchema:rt,GetPromptRequestSchema:bt,TextContentSchema:Rt,ImageContentSchema:zt,AudioContentSchema:$t,ToolUseContentSchema:gr,EmbeddedResourceSchema:at,ResourceLinkSchema:Sr,ContentBlockSchema:Fe,PromptMessageSchema:Lt,GetPromptResultSchema:Vt,PromptListChangedNotificationSchema:Et,ToolAnnotationsSchema:yr,ToolExecutionSchema:Dt,ToolSchema:Pt,ListToolsRequestSchema:Ut,ListToolsResultSchema:Ht,CallToolResultSchema:Ft,CallToolRequestParamsSchema:Ne,CallToolRequestSchema:_r,ToolListChangedNotificationSchema:wa,LoggingLevelSchema:xt,SetLevelRequestParamsSchema:vr,SetLevelRequestSchema:br,LoggingMessageNotificationParamsSchema:Rr,LoggingMessageNotificationSchema:zr,ModelHintSchema:$r,ModelPreferencesSchema:Er,ToolChoiceSchema:Pr,ToolResultContentSchema:Ta,SamplingContentSchema:wr,SamplingMessageContentBlockSchema:ot,SamplingMessageSchema:Tr,CreateMessageRequestParamsSchema:Cr,CreateMessageRequestSchema:qr,CreateMessageResultSchema:jr,CreateMessageResultWithToolsSchema:Nr,BooleanSchemaSchema:Ir,StringSchemaSchema:Or,NumberSchemaSchema:kr,UntitledSingleSelectEnumSchemaSchema:Mr,TitledSingleSelectEnumSchemaSchema:Ar,LegacyTitledEnumSchemaSchema:Lr,SingleSelectEnumSchemaSchema:Vr,UntitledMultiSelectEnumSchemaSchema:wt,TitledMultiSelectEnumSchemaSchema:Tt,MultiSelectEnumSchemaSchema:Ca,EnumSchemaSchema:qa,PrimitiveSchemaDefinitionSchema:De,ElicitRequestFormParamsSchema:Ue,ElicitRequestURLParamsSchema:Dr,ElicitRequestParamsSchema:Ke,ElicitRequestSchema:ja,ElicitationCompleteNotificationParamsSchema:Na,ElicitationCompleteNotificationSchema:Ia,ElicitResultSchema:Oa,ResourceTemplateReferenceSchema:ka,PromptReferenceSchema:Ma,CompleteRequestParamsSchema:Aa,CompleteRequestSchema:Ur,CompleteResultSchema:La,RootSchema:Va,ListRootsRequestSchema:Kt,ListRootsResultSchema:Hr,RootsListChangedNotificationSchema:Da,TaskCreationParamsSchema:Ua,TaskStatusSchema:Ha,TaskSchema:st,CreateTaskResultSchema:Le,TaskStatusNotificationParamsSchema:Fa,TaskStatusNotificationSchema:Ct,GetTaskRequestSchema:Jt,GetTaskResultSchema:Gt,GetTaskPayloadRequestSchema:Bt,GetTaskPayloadResultSchema:Xs,ListTasksRequestSchema:Ve,ListTasksResultSchema:$e,CancelTaskRequestSchema:qt,CancelTaskResultSchema:z.merge(st),ClientRequestSchema:Z([me,L,Ur,br,bt,We,Se,C,se,je,_e,_r,Ut,Jt,Bt,Ve,qt]),ClientNotificationSchema:Z([g,Ee,Y,Da,Ct]),ClientResultSchema:Z([_,jr,Nr,Oa,Hr,Gt,$e,Le]),ServerRequestSchema:Z([me,qr,ja,Kt,Jt,Bt,Ve,qt]),ServerNotificationSchema:Z([g,Ee,zr,Te,ze,wa,Et,Ct,Ia]),ServerResultSchema:Z([_,X,La,Vt,tt,Ae,M,le,Ft,Ht,Gt,$e,Le]),CallToolResultWireSchema:te().superRefine((Ie,wl)=>{if(typeof Ie!=="object"||Ie===null||Array.isArray(Ie)||Ie.content!==void 0)return;for(let Ri of yc)if(Ri in Ie){wl.addIssue({code:"custom",message:`content is required when the body carries '${Ri}' — another result family cannot default into an empty tools/call success`});return}}).transform(ei).pipe(Ft)}}var Tp;function _c(){return Tp??=wp()}function vc(e){return e.type!=="object"}var Cp=new Set(["const","enum","default","examples"]),qp=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function tc(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function jp(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(tc(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Xi(e.$schema)&&e.$recursiveAnchor!==!0,a=(o,s)=>{if(Array.isArray(o))return o.map((c)=>a(c,!1));if(o===null||typeof o!=="object")return o;if(!s&&tc(o.$id))return o;let n={},l=!1;for(let[c,u]of Object.entries(o))if(s)n[c]=a(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")n[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)l=!0;else if(Cp.has(c))n[c]=u;else if(qp.has(c))n[c]=a(u,!0);else n[c]=a(u,!1);if(l)if("$ref"in n)n.allOf=[...Array.isArray(n.allOf)?n.allOf:[],{$ref:"#/properties/result"}];else n.$ref="#/properties/result";return n};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:a(e,!1)},required:["result"]}}var bc={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},Rc={"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},Np={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},As;function ti(){if(As)return As;let e=_c();return As={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}},As}function zc(e){return Object.prototype.hasOwnProperty.call(bc,e)}function $c(e){return Object.prototype.hasOwnProperty.call(Rc,e)}function Ip(e){return Object.prototype.hasOwnProperty.call(Np,e)}function Op(e){return Ip(e)?ti().resultSchemas[e]:void 0}function kp(e){return zc(e)?ti().requestSchemas[e]:void 0}function Mp(e){return $c(e)?ti().notificationSchemas[e]:void 0}var oS=Object.keys(bc),sS=Object.keys(Rc);function Bn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Ls(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var rc={ok:!1,reason:"not-in-era"};function ac(e){return Bn(e)&&Bn(e.outputSchema)&&vc(e.outputSchema)}function oc(e){return e}var ri={era:"2025-11-25",hasRequestMethod:zc,hasNotificationMethod:$c,validateRequest:(e,t)=>Ls(kp(e),t),validateResult:(e,t)=>Ls(Op(e),t),validateNotification:(e,t)=>Ls(Mp(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>rc,validateInputResponse:()=>rc,samplingResultVariant:(e,t)=>{let r=_c();return Ls(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=Sc(e),a=r.structuredContent;if(a===void 0)return r;let o=typeof a!=="object"||a===null||Array.isArray(a),s=t!==void 0&&vc(t);if(!o&&!s)return r;return{...r,structuredContent:{result:a}}},decodeResult(e,t){if(Bn(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:oc(r)}}return{kind:"complete",result:oc(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((a)=>ac(a)))return t;return{...t,tools:r.map((a)=>ac(a)?{...a,outputSchema:jp(a.outputSchema)}:a)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function Ap(){let e=Yt(()=>Z([i(),F(),W(),nt(),G(i(),e),N(e)])),t=G(i(),e),r=Z([i(),F().int()]),a=i(),o=Z([i(),F().int()]),s=ie(["user","assistant"]),n=ie(["debug","info","notice","warning","error","critical","alert","emergency"]),l=i().refine(($e)=>{try{return atob($e),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=T({ttl:F().optional()}),u=T({taskId:i()}),h=re({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),f=T({_meta:h.optional()}),z=f.extend({task:c.optional()}),E=T({_meta:h.optional()}),_=T({method:i(),params:E.loose().optional()}),v=T({src:i(),mimeType:i().optional(),sizes:N(i()).optional(),theme:ie(["light","dark"]).optional()}),g=T({icons:N(v).optional()}),d=T({name:i(),title:i().optional()}),y=d.extend({...d.shape,...g.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),m=Ze(T({applyDefaults:W().optional()}),t),b=it(($e)=>{if($e&&typeof $e==="object"&&!Array.isArray($e)&&Object.keys($e).length===0)return{form:{}};return $e},Ze(T({form:m.optional(),url:t.optional()}),t.optional())),P=re({list:t.optional(),cancel:t.optional(),requests:re({sampling:re({createMessage:t.optional()}).optional(),elicitation:re({create:t.optional()}).optional()}).optional()}),S=re({list:t.optional(),cancel:t.optional(),requests:re({tools:re({call:t.optional()}).optional()}).optional()}),p=T({experimental:G(i(),t).optional(),sampling:T({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:T({listChanged:W().optional()}).optional(),tasks:P.optional(),extensions:G(i(),t).optional()}),w=T({experimental:G(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:T({listChanged:W().optional()}).optional(),resources:T({subscribe:W().optional(),listChanged:W().optional()}).optional(),tools:T({listChanged:W().optional()}).optional(),tasks:S.optional(),extensions:G(i(),t).optional()}),A=T({progress:F(),total:Q(F()),message:Q(i())}),x=T({...E.shape,...A.shape,progressToken:r}),L=_.extend({method:I("notifications/progress"),params:x}),U=E.extend({level:n,logger:i().optional(),data:te()}),X=_.extend({method:I("notifications/message"),params:U}),Y=T({uri:i(),mimeType:Q(i()),_meta:G(i(),te()).optional()}),me=Y.extend({text:i()}),ye=Y.extend({blob:l}),ge=T({audience:N(s).optional(),priority:F().min(0).max(1).optional(),lastModified:Je.datetime({offset:!0}).optional()}),Ee=T({...d.shape,...g.shape,uri:i(),description:Q(i()),mimeType:Q(i()),size:Q(F()),annotations:ge.optional(),_meta:Q(re({}))}),he=T({...d.shape,...g.shape,uriTemplate:i(),description:Q(i()),mimeType:Q(i()),annotations:ge.optional(),_meta:Q(re({}))}),j=_.extend({method:I("notifications/resources/list_changed"),params:E.optional()}),k=E.extend({uri:i()}),H=_.extend({method:I("notifications/resources/updated"),params:k}),R=T({name:i(),description:Q(i()),required:Q(W())}),q=T({...d.shape,...g.shape,description:Q(i()),arguments:Q(N(R)),_meta:Q(re({}))}),O=_.extend({method:I("notifications/prompts/list_changed"),params:E.optional()}),K=T({type:I("text"),text:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),ee=T({type:I("image"),data:l,mimeType:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),de=T({type:I("audio"),data:l,mimeType:i(),annotations:ge.optional(),_meta:G(i(),te()).optional()}),ne=T({type:I("tool_use"),name:i(),id:i(),input:G(i(),te()),_meta:G(i(),te()).optional()}),Se=T({type:I("resource"),resource:Z([me,ye]),annotations:ge.optional(),_meta:G(i(),te()).optional()}),Ae=Ee.extend({type:I("resource_link")}),C=Z([K,ee,de,Ae,Se]),M=T({role:s,content:C}),V=T({title:i().optional(),readOnlyHint:W().optional(),destructiveHint:W().optional(),idempotentHint:W().optional(),openWorldHint:W().optional()}),oe=_.extend({method:I("notifications/tools/list_changed"),params:E.optional()}),se=T({name:i().optional()}),le=T({hints:N(se).optional(),costPriority:F().min(0).max(1).optional(),speedPriority:F().min(0).max(1).optional(),intelligencePriority:F().min(0).max(1).optional()}),ze=T({mode:ie(["auto","required","none"]).optional()}),we=T({type:I("boolean"),title:i().optional(),description:i().optional(),default:W().optional()}),je=T({type:I("string"),title:i().optional(),description:i().optional(),minLength:F().optional(),maxLength:F().optional(),format:ie(["email","uri","date","date-time"]).optional(),default:i().optional()}),Pe=T({type:ie(["number","integer"]),title:i().optional(),description:i().optional(),minimum:F().optional(),maximum:F().optional(),default:F().optional()}),_e=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),default:i().optional()}),He=T({type:I("string"),title:i().optional(),description:i().optional(),oneOf:N(T({const:i(),title:i()})),default:i().optional()}),Te=T({type:I("string"),title:i().optional(),description:i().optional(),enum:N(i()),enumNames:N(i()).optional(),default:i().optional()}),Ye=Z([_e,He]),xe=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({type:I("string"),enum:N(i())}),default:N(i()).optional()}),We=T({type:I("array"),title:i().optional(),description:i().optional(),minItems:F().optional(),maxItems:F().optional(),items:T({anyOf:N(T({const:i(),title:i()}))}),default:N(i()).optional()}),tt=Z([xe,We]),rt=Z([Te,Ye,tt]),bt=Z([rt,we,je,Pe]),Rt=z.extend({mode:I("form").optional(),message:i(),requestedSchema:T({type:I("object"),properties:G(i(),bt),required:N(i()).optional()}).catchall(te())}),zt=T({type:I("ref/resource"),uri:i()}),$t=T({type:I("ref/prompt"),name:i()}),gr=T({uri:i().startsWith("file://"),name:i().optional(),_meta:G(i(),te()).optional()}),at=p.shape,Sr=T({experimental:at.experimental,sampling:at.sampling,elicitation:at.elicitation,roots:at.roots,extensions:at.extensions}),Fe=w.shape,Lt=T({experimental:Fe.experimental,logging:Fe.logging,completions:Fe.completions,prompts:Fe.prompts,resources:Fe.resources,tools:Fe.tools,extensions:Fe.extensions}),Vt=re({progressToken:r.optional(),[lt]:i(),[Jr]:y.optional(),[ut]:Sr,[Ot]:n.optional()}),Et=T({...d.shape,...g.shape,description:i().optional(),inputSchema:re({$schema:i().optional(),type:I("object")}),outputSchema:re({$schema:i().optional()}).optional(),annotations:V.optional(),_meta:G(i(),te()).optional()}),yr=T({type:I("tool_result"),toolUseId:i(),content:N(C),structuredContent:te().optional(),isError:W().optional(),_meta:G(i(),te()).optional()}),Dt=Z([K,ee,de,ne,yr]),Pt=T({role:s,content:Z([Dt,N(Dt)]),_meta:G(i(),te()).optional()}),Ut=i(),Ht=re({[Qe]:y.optional().catch(void 0)}),Ft=Ht.optional();function Ne($e){return re({_meta:Ft,resultType:Ut.default("complete"),...$e})}let _r=Ne({}),wa=Ne({nextCursor:a.optional()}),xt=Ne({content:N(C),structuredContent:te().optional(),isError:W().optional()}),vr=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:N(Et),nextCursor:a.optional()}),br=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:N(q),nextCursor:a.optional()}),Rr=Ne({description:i().optional(),messages:N(M)}),zr=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:N(Ee),nextCursor:a.optional()}),$r=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:N(he),nextCursor:a.optional()}),Er=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:N(Z([me,ye]))}),Pr=Ne({completion:T({values:N(i()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),Ta=Ne({ttlMs:F().int().min(0),cacheScope:ie(["public","private"])}),wr=Ne({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:N(i()),capabilities:Lt,instructions:i().optional()}),ot=T({messages:N(Pt),modelPreferences:le.optional(),systemPrompt:i().optional(),includeContext:ie(["none","thisServer","allServers"]).optional(),temperature:F().optional(),maxTokens:F().int(),stopSequences:N(i()).optional(),metadata:t.optional(),tools:N(Et).optional(),toolChoice:ze.optional()}),Tr=T({method:I("sampling/createMessage"),params:ot}),Cr=T({method:I("roots/list"),params:T({_meta:G(i(),te()).optional()}).optional()}),qr=T({...Pt.shape,model:i(),stopReason:i().optional()}),jr=T({roots:N(gr)}),Nr=T({action:ie(["accept","decline","cancel"]),content:G(i(),Z([i(),F(),W(),N(i())])).optional()}),Ir=T({mode:I("url"),message:i(),url:i().url()}),Or=Z([Rt,Ir]),kr=T({method:I("elicitation/create"),params:Or}),Mr=Z([Tr,Cr,kr]),Ar=Z([qr,jr,Nr]),Lr=G(i(),Mr),Vr=G(i(),Ar),wt=Ne({inputRequests:Lr.optional(),requestState:i().optional()}),Tt={inputResponses:Vr.optional(),requestState:i().optional()},Ca=T({_meta:Vt,...Tt}),qa=re({progressToken:r.optional()});function De($e,qt){return T({method:I($e),params:T({_meta:Vt,...qt})})}function Ue($e,qt){return T({method:I($e),params:T({_meta:qa.optional(),...qt}).optional()})}let Dr={name:i(),arguments:G(i(),te()).optional(),...Tt},Ke={cursor:a.optional()},ja=De("tools/call",Dr),Na=De("tools/list",Ke),Ia=De("prompts/list",Ke),Oa=De("prompts/get",{name:i(),arguments:G(i(),i()).optional(),...Tt}),ka=De("resources/list",Ke),Ma=De("resources/templates/list",Ke),Aa=De("resources/read",{uri:i(),...Tt}),Ur={ref:Z([$t,zt]),argument:T({name:i(),value:i()}),context:T({arguments:G(i(),i()).optional()}).optional()},La=De("completion/complete",Ur),Va=De("server/discover",{}),Kt=T({toolsListChanged:W().optional(),promptsListChanged:W().optional(),resourcesListChanged:W().optional(),resourceSubscriptions:N(i()).optional()}),Hr={notifications:Kt},Da=De("subscriptions/listen",Hr),Ua=Ht.extend({"io.modelcontextprotocol/subscriptionId":o}),Ha=re({_meta:Ua,resultType:Ut.default("complete")}),st={"tools/call":Ue("tools/call",Dr),"tools/list":Ue("tools/list",Ke),"prompts/get":Ue("prompts/get",{name:i(),arguments:G(i(),i()).optional()}),"prompts/list":Ue("prompts/list",Ke),"resources/list":Ue("resources/list",Ke),"resources/templates/list":Ue("resources/templates/list",Ke),"resources/read":Ue("resources/read",{uri:i()}),"completion/complete":Ue("completion/complete",Ur),"server/discover":Ue("server/discover",{}),"subscriptions/listen":Ue("subscriptions/listen",Hr)};function Le($e){return re({_meta:Ft,...$e})}let Fa={"tools/call":Le({content:N(C),structuredContent:te().optional(),isError:W().optional()}),"tools/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),tools:N(Et),nextCursor:a.optional()}),"prompts/get":Le({description:i().optional(),messages:N(M)}),"prompts/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),prompts:N(q),nextCursor:a.optional()}),"resources/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resources:N(Ee),nextCursor:a.optional()}),"resources/templates/list":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),resourceTemplates:N(he),nextCursor:a.optional()}),"resources/read":Le({ttlMs:F().int().min(0),cacheScope:ie(["public","private"]),contents:N(Z([me,ye]))}),"completion/complete":Le({completion:T({values:N(i()).max(100),total:F().int().optional(),hasMore:W().optional()}).loose()}),"server/discover":Le({ttlMs:F().int().min(0).catch(0),cacheScope:ie(["public","private"]).catch("private"),supportedVersions:N(i()),capabilities:Lt,instructions:i().optional()}),"subscriptions/listen":Le({})},Ct=re({"io.modelcontextprotocol/subscriptionId":o.optional()}),Jt=T({method:I("notifications/subscriptions/acknowledged"),params:T({_meta:Ct.optional(),notifications:Kt})}),Gt=T({_meta:Ct.optional(),requestId:o,reason:i().optional()}),Bt=T({method:I("notifications/cancelled"),params:Gt}),Xs={"notifications/cancelled":Bt,"notifications/progress":L,"notifications/message":X,"notifications/resources/updated":H,"notifications/resources/list_changed":j,"notifications/tools/list_changed":oe,"notifications/prompts/list_changed":O,"notifications/subscriptions/acknowledged":Jt},Ve=($e)=>T({jsonrpc:I("2.0"),id:Z([i(),F().int()]),result:$e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:a,RequestIdSchema:o,RoleSchema:s,LoggingLevelSchema:n,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:h,BaseRequestParamsSchema:f,TaskAugmentedRequestParamsSchema:z,NotificationsParamsSchema:E,NotificationSchema:_,IconSchema:v,IconsSchema:g,BaseMetadataSchema:d,ImplementationSchema:y,ClientTasksCapabilitySchema:P,ServerTasksCapabilitySchema:S,ClientCapabilitiesSchema:p,ServerCapabilitiesSchema:w,ProgressSchema:A,ProgressNotificationParamsSchema:x,ProgressNotificationSchema:L,LoggingMessageNotificationParamsSchema:U,LoggingMessageNotificationSchema:X,ResourceContentsSchema:Y,TextResourceContentsSchema:me,BlobResourceContentsSchema:ye,AnnotationsSchema:ge,ResourceSchema:Ee,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:j,ResourceUpdatedNotificationParamsSchema:k,ResourceUpdatedNotificationSchema:H,PromptArgumentSchema:R,PromptSchema:q,PromptListChangedNotificationSchema:O,TextContentSchema:K,ImageContentSchema:ee,AudioContentSchema:de,ToolUseContentSchema:ne,EmbeddedResourceSchema:Se,ResourceLinkSchema:Ae,ContentBlockSchema:C,PromptMessageSchema:M,ToolAnnotationsSchema:V,ToolListChangedNotificationSchema:oe,ModelHintSchema:se,ModelPreferencesSchema:le,ToolChoiceSchema:ze,BooleanSchemaSchema:we,StringSchemaSchema:je,NumberSchemaSchema:Pe,UntitledSingleSelectEnumSchemaSchema:_e,TitledSingleSelectEnumSchemaSchema:He,LegacyTitledEnumSchemaSchema:Te,SingleSelectEnumSchemaSchema:Ye,UntitledMultiSelectEnumSchemaSchema:xe,TitledMultiSelectEnumSchemaSchema:We,MultiSelectEnumSchemaSchema:tt,EnumSchemaSchema:rt,PrimitiveSchemaDefinitionSchema:bt,ElicitRequestFormParamsSchema:Rt,ResourceTemplateReferenceSchema:zt,PromptReferenceSchema:$t,RootSchema:gr,ClientCapabilities2026Schema:Sr,ServerCapabilities2026Schema:Lt,RequestMetaEnvelopeSchema:Vt,ToolSchema:Et,ToolResultContentSchema:yr,SamplingMessageContentBlockSchema:Dt,SamplingMessageSchema:Pt,ResultTypeSchema:Ut,ResultMetaSchema:Ht,ResultSchema:_r,PaginatedResultSchema:wa,CallToolResultSchema:xt,ListToolsResultSchema:vr,ListPromptsResultSchema:br,GetPromptResultSchema:Rr,ListResourcesResultSchema:zr,ListResourceTemplatesResultSchema:$r,ReadResourceResultSchema:Er,CompleteResultSchema:Pr,CacheableResultSchema:Ta,DiscoverResultSchema:wr,CreateMessageRequestParamsSchema:ot,CreateMessageRequestSchema:Tr,ListRootsRequestSchema:Cr,CreateMessageResultSchema:qr,ListRootsResultSchema:jr,ElicitResultSchema:Nr,ElicitRequestURLParamsSchema:Ir,ElicitRequestParamsSchema:Or,ElicitRequestSchema:kr,InputRequestSchema:Mr,InputResponseSchema:Ar,InputRequestsSchema:Lr,InputResponsesSchema:Vr,InputRequiredResultSchema:wt,InputResponseRequestParamsSchema:Ca,CallToolRequestSchema:ja,ListToolsRequestSchema:Na,ListPromptsRequestSchema:Ia,GetPromptRequestSchema:Oa,ListResourcesRequestSchema:ka,ListResourceTemplatesRequestSchema:Ma,ReadResourceRequestSchema:Aa,CompleteRequestSchema:La,DiscoverRequestSchema:Va,SubscriptionFilterSchema:Kt,SubscriptionsListenRequestSchema:Da,SubscriptionsListenResultMetaSchema:Ua,SubscriptionsListenResultSchema:Ha,dispatchRequestSchemas:st,dispatchResultSchemas:Fa,NotificationMetaSchema:Ct,SubscriptionsAcknowledgedNotificationSchema:Jt,CancelledNotificationParamsSchema:Gt,CancelledNotificationSchema:Bt,notificationSchemas2026:Xs,JSONRPCResultResponseSchema:Ve(_r),CallToolResultResponseSchema:Ve(Z([xt,wt])),ListToolsResultResponseSchema:Ve(vr),ListPromptsResultResponseSchema:Ve(br),GetPromptResultResponseSchema:Ve(Z([Rr,wt])),ListResourcesResultResponseSchema:Ve(zr),ListResourceTemplatesResultResponseSchema:Ve($r),ReadResourceResultResponseSchema:Ve(Z([Er,wt])),CompleteResultResponseSchema:Ve(Pr),DiscoverResultResponseSchema:Ve(wr)}}var Lp;function At(){return Lp??=Ap()}var Vp=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Dp(e){return Vp.includes(e)}var ur=Symbol("modelcontextprotocol.resultCacheHintFallback");function xs(e,t){if(t===void 0)return e;let r=e[ur];if(r===void 0)return{...e,[ur]:t};let a={},o=r.ttlMs??t.ttlMs;if(o!==void 0)a.ttlMs=o;let s=r.cacheScope??t.cacheScope;if(s!==void 0)a.cacheScope=s;return{...e,[ur]:a}}function Up(e){return e[ur]}function ai(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function oi(e){return e==="public"||e==="private"}function si(e,t){if(e.ttlMs!==void 0&&!ai(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!oi(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var J=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}({}),ae=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return dr(this,t)}static isInstance(t){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 dr(this,t)}constructor(t,r,a){super(r);this.code=t,this.data=a,this.name="ProtocolError",Zn(this,new.target)}static fromError(t,r,a){if(t===J.UrlElicitationRequired&&a){let o=a;if(o.elicitations)return new Hp(o.elicitations,r)}if(t===J.UnsupportedProtocolVersion&&a){let o=a;if(Array.isArray(o.supported)&&typeof o.requested==="string")return new Ec({supported:o.supported,requested:o.requested},r)}if(t===J.InvalidParams||t===J.ResourceNotFound){let o=a;if(typeof o?.uri==="string"&&(t===J.ResourceNotFound||Object.keys(o).length===1))return new ni(o.uri,r)}if(t===J.MissingRequiredClientCapability&&a){let o=a;if(o.requiredCapabilities!==null&&typeof o.requiredCapabilities==="object"&&!Array.isArray(o.requiredCapabilities))return new ii({requiredCapabilities:o.requiredCapabilities},r)}return new e(t,r,a)}},ni=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(J.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Hp=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(J.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ec=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(J.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},ii=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(J.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Fp=0,xp="private",Kp=["tools/call","prompts/get","resources/read"];function Jp(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(Kp.includes(e))return t;throw new ae(J.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Gp(e,t){let r=Up(t);if(t.resultType!=="complete"||!Dp(e))return r===void 0?t:Xp(t);let a=t,o=ai(a.ttlMs)?a.ttlMs:Wp(r),s=oi(a.cacheScope)?a.cacheScope:Zp(r),n={...a,ttlMs:o,cacheScope:s};return delete n[ur],n}function Bp(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Yp(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[Qe]:t}};if(!Bp(r))return e;if(r[Qe]!==void 0)return e;return{...e,_meta:{...r,[Qe]:t}}}function Wp(e){return e!==void 0&&ai(e.ttlMs)?e.ttlMs:Fp}function Zp(e){return e!==void 0&&oi(e.cacheScope)?e.cacheScope:xp}function Xp(e){let t={...e};return delete t[ur],t}var Qp=["elicitation/create","sampling/createMessage","roots/list"],Vs;function Pc(){if(Vs)return Vs;let e=At();return Vs={request:{"elicitation/create":T({method:I("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":T({method:I("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":T({method:I("roots/list"),params:re({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},Vs}function wc(e){return Qp.includes(e)}function xn(e){return wc(e)?Pc().request[e]:void 0}function eh(e){return wc(e)?Pc().response[e]:void 0}var ci={"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},Tc={"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 Cc(e){return Object.prototype.hasOwnProperty.call(ci,e)}function qc(e){return Object.prototype.hasOwnProperty.call(Tc,e)}function th(e){return Object.prototype.hasOwnProperty.call(ci,e)}function rh(e){return Cc(e)?At().dispatchRequestSchemas[e]:void 0}function ah(e){return th(e)?At().dispatchResultSchemas[e]:void 0}function oh(e){return qc(e)?At().notificationSchemas2026[e]:void 0}var nS=Object.keys(ci),iS=Object.keys(Tc);function va(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ya(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var sh={ok:!1,reason:"not-in-era"},nh=[lt,ut];function ih(e,t){let r=t,a=!1,o=()=>{if(!a)r={...r},a=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((l)=>va(l)&&("execution"in l)))o().tools=s.map((l)=>{if(!va(l)||!("execution"in l))return l;let c={...l};return delete c.execution,c});let n=t.capabilities;if(va(n)&&"tasks"in n){let l={...n};delete l.tasks,o().capabilities=l}return r}var li={era:"2026-07-28",hasRequestMethod:Cc,hasNotificationMethod:qc,hasInputRequestMethod:(e)=>xn(e)!==void 0,validateRequest:(e,t)=>ya(rh(e),t),validateResult:(e,t)=>ya(ah(e),t),validateNotification:(e,t)=>ya(oh(e),t),validateInputRequest:(e,t)=>ya(xn(e),t),validateInputResponse:(e,t)=>ya(eh(e),t),samplingResultVariant:()=>sh,outboundEnvelope(e){return{[lt]:e.protocolVersion,[Jr]:e.clientInfo,[ut]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ot]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let a of nh)if(!(a in e))t.push({key:a,problem:"missing"});let r=At().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let a of r.error.issues){let o=a.path.map(String),s=o.length>0?o.join("."):"_meta";if(o.length===1&&t.some((n)=>n.key===s&&n.problem==="missing"))continue;t.push({key:s,problem:a.message})}return t},projectCallToolResult:(e)=>Sc(e),inputRequestSchema:xn,decodeResult(e,t){if(!va(t))return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new ue(pe.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 r!=="string")return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let n=t.inputRequests,l=va(n)?n:{},c=t.requestState;if(Object.keys(l).length===0&&typeof c!=="string")return{kind:"invalid",error:new ue(pe.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"})};return{kind:"input_required",inputRequests:l,...typeof c==="string"&&{requestState:c}}}if(r!=="complete")return{kind:"invalid",error:new ue(pe.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let a=ch(),o=Object.hasOwn(a,e)?a[e]:void 0;if(o!==void 0){let n=o.safeParse(t);if(!n.success)return{kind:"invalid",error:new ue(pe.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return Yp(Gp(e,Jp(e,ih(e,t))),r)},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=At().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((r)=>r.message).join("; ")}`}},Ds;function ch(){if(Ds)return Ds;let e=At();return Ds={"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},Ds}var za="2026-07-28";function yt(e){return e!==void 0&&pr(e)?li:ri}function sc(e){if(e.revision!==void 0)return yt(e.revision).era;return e.era==="modern"?li.era:ri.era}function Kn(e){return jc.some((t)=>t.hasRequestMethod(e))}function Jn(e){return jc.some((t)=>t.hasNotificationMethod(e))}var jc=[ri,li];function nc(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function ui(e){if(!nc(e))return;let t=e._meta;return nc(t)?t:void 0}function lh(e){let t=ui(e);return t!==void 0&&lt in t}function uh(e){let t=ui(e)?.[lt];return typeof t==="string"?t:void 0}function dh(e){return yt(za).validateEnvelopeMeta(e)}var mh=Wi({AnnotationsSchema:()=>et,AudioContentSchema:()=>sr,BaseMetadataSchema:()=>Xe,BaseRequestParamsSchema:()=>qe,BlobResourceContentsSchema:()=>na,BooleanSchemaSchema:()=>da,CallToolRequestParamsSchema:()=>Wo,CallToolRequestSchema:()=>Zo,CallToolResultSchema:()=>ua,CancelTaskRequestSchema:()=>Tn,CancelTaskResultSchema:()=>Cn,CancelledNotificationParamsSchema:()=>Xa,CancelledNotificationSchema:()=>ea,ClientCapabilitiesSchema:()=>ro,ClientNotificationSchema:()=>jn,ClientRequestSchema:()=>qn,ClientResultSchema:()=>Nn,ClientTasksCapabilitySchema:()=>eo,CompatibilityCallToolResultSchema:()=>Sn,CompleteRequestParamsSchema:()=>$s,CompleteRequestSchema:()=>Es,CompleteResultSchema:()=>Ps,ContentBlockSchema:()=>nr,CreateMessageRequestParamsSchema:()=>ls,CreateMessageRequestSchema:()=>us,CreateMessageResultSchema:()=>ds,CreateMessageResultWithToolsSchema:()=>ms,CreateTaskResultSchema:()=>vn,CursorSchema:()=>Br,DiscoverRequestSchema:()=>io,DiscoverResultSchema:()=>co,ElicitRequestFormParamsSchema:()=>lr,ElicitRequestParamsSchema:()=>Ss,ElicitRequestSchema:()=>ys,ElicitRequestURLParamsSchema:()=>gs,ElicitResultSchema:()=>bs,ElicitationCompleteNotificationParamsSchema:()=>_s,ElicitationCompleteNotificationSchema:()=>vs,EmbeddedResourceSchema:()=>Uo,EmptyResultSchema:()=>Qr,EnumSchemaSchema:()=>fs,GetPromptRequestParamsSchema:()=>Lo,GetPromptRequestSchema:()=>Vo,GetPromptResultSchema:()=>xo,GetTaskPayloadRequestSchema:()=>$n,GetTaskPayloadResultSchema:()=>En,GetTaskRequestSchema:()=>Rn,GetTaskResultSchema:()=>zn,IconSchema:()=>Qa,IconsSchema:()=>mt,ImageContentSchema:()=>or,ImplementationSchema:()=>tr,InitializeRequestParamsSchema:()=>ao,InitializeRequestSchema:()=>oo,InitializeResultSchema:()=>so,InitializedNotificationSchema:()=>no,JSONArraySchema:()=>hn,JSONObjectSchema:()=>ve,JSONRPCErrorResponseSchema:()=>er,JSONRPCMessageSchema:()=>Za,JSONRPCNotificationSchema:()=>Xr,JSONRPCRequestSchema:()=>Zr,JSONRPCResponseSchema:()=>fn,JSONRPCResultResponseSchema:()=>Qt,JSONValueSchema:()=>ct,LegacyTitledEnumSchemaSchema:()=>ha,ListChangedOptionsBaseSchema:()=>yn,ListPromptsRequestSchema:()=>Mo,ListPromptsResultSchema:()=>Ao,ListResourceTemplatesRequestSchema:()=>go,ListResourceTemplatesResultSchema:()=>So,ListResourcesRequestSchema:()=>ho,ListResourcesResultSchema:()=>fo,ListRootsRequestSchema:()=>Ts,ListRootsResultSchema:()=>Cs,ListTasksRequestSchema:()=>Pn,ListTasksResultSchema:()=>wn,ListToolsRequestSchema:()=>Bo,ListToolsResultSchema:()=>Yo,LoggingLevelSchema:()=>gt,LoggingMessageNotificationParamsSchema:()=>ts,LoggingMessageNotificationSchema:()=>rs,ModelHintSchema:()=>as,ModelPreferencesSchema:()=>os,MultiSelectEnumSchemaSchema:()=>hs,NotificationSchema:()=>Me,NotificationsParamsSchema:()=>ke,NumberSchemaSchema:()=>cr,PaginatedRequestParamsSchema:()=>mo,PaginatedRequestSchema:()=>pt,PaginatedResultSchema:()=>ht,PingRequestSchema:()=>ra,PrimitiveSchemaDefinitionSchema:()=>Sa,ProgressNotificationParamsSchema:()=>uo,ProgressNotificationSchema:()=>aa,ProgressSchema:()=>lo,ProgressTokenSchema:()=>Gr,PromptArgumentSchema:()=>Oo,PromptListChangedNotificationSchema:()=>Ko,PromptMessageSchema:()=>Fo,PromptReferenceSchema:()=>zs,PromptSchema:()=>ko,ReadResourceRequestParamsSchema:()=>yo,ReadResourceRequestSchema:()=>_o,ReadResourceResultSchema:()=>vo,RelatedTaskMetadataSchema:()=>Wa,RequestIdSchema:()=>dt,RequestMetaSchema:()=>Yr,RequestSchema:()=>be,ResourceContentsSchema:()=>oa,ResourceLinkSchema:()=>Ho,ResourceListChangedNotificationSchema:()=>bo,ResourceRequestParamsSchema:()=>rr,ResourceSchema:()=>ia,ResourceTemplateReferenceSchema:()=>Rs,ResourceTemplateSchema:()=>po,ResourceUpdatedNotificationParamsSchema:()=>No,ResourceUpdatedNotificationSchema:()=>Io,ResultMetaObjectSchema:()=>Wr,ResultSchema:()=>Re,RoleSchema:()=>ft,RootSchema:()=>ws,RootsListChangedNotificationSchema:()=>qs,SamplingContentSchema:()=>is,SamplingMessageContentBlockSchema:()=>It,SamplingMessageSchema:()=>cs,ServerCapabilitiesSchema:()=>ta,ServerNotificationSchema:()=>On,ServerRequestSchema:()=>In,ServerResultSchema:()=>kn,ServerTasksCapabilitySchema:()=>to,SetLevelRequestParamsSchema:()=>Qo,SetLevelRequestSchema:()=>es,SingleSelectEnumSchemaSchema:()=>ps,StringSchemaSchema:()=>ir,SubscribeRequestParamsSchema:()=>Ro,SubscribeRequestSchema:()=>zo,SubscriptionFilterSchema:()=>ca,SubscriptionsAcknowledgedNotificationParamsSchema:()=>To,SubscriptionsAcknowledgedNotificationSchema:()=>Co,SubscriptionsListenRequestParamsSchema:()=>Po,SubscriptionsListenRequestSchema:()=>wo,SubscriptionsListenResultMetaSchema:()=>qo,SubscriptionsListenResultSchema:()=>jo,TaskAugmentedRequestParamsSchema:()=>kt,TaskCreationParamsSchema:()=>_n,TaskMetadataSchema:()=>Ya,TaskSchema:()=>St,TaskStatusNotificationParamsSchema:()=>Ns,TaskStatusNotificationSchema:()=>bn,TaskStatusSchema:()=>js,TextContentSchema:()=>ar,TextResourceContentsSchema:()=>sa,TitledMultiSelectEnumSchemaSchema:()=>ga,TitledSingleSelectEnumSchemaSchema:()=>pa,ToolAnnotationsSchema:()=>Jo,ToolChoiceSchema:()=>ss,ToolExecutionSchema:()=>Go,ToolListChangedNotificationSchema:()=>Xo,ToolResultContentSchema:()=>ns,ToolSchema:()=>la,ToolUseContentSchema:()=>Do,UnsubscribeRequestParamsSchema:()=>$o,UnsubscribeRequestSchema:()=>Eo,UntitledMultiSelectEnumSchemaSchema:()=>fa,UntitledSingleSelectEnumSchemaSchema:()=>ma});var ph=(e)=>Zr.safeParse(e).success,hh=(e)=>Xr.safeParse(e).success,ic=(e)=>Qt.safeParse(e).success,fh=(e)=>er.safeParse(e).success;var _t=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";function Nc(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Ic(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var cc="x-mcp-header",gh=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Sh=new Set(["string","integer","boolean","number"]);function Oc(e){let t=[],r=new Map,a=(s,n,l)=>{if(s===null||typeof s!=="object")return;let c=s;if(cc in c){if(!l||n.length===0)return`${Us(n)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let h=c[cc];if(typeof h!=="string"||h.length===0)return`${Us(n)}: x-mcp-header MUST be a non-empty string`;if(!gh.test(h))return`${Us(n)}: x-mcp-header '${h}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let f=typeof c.type==="string"?c.type:void 0;if(f===void 0||!Sh.has(f))return`${Us(n)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${f??"<none>"}`;let z=h.toLowerCase(),E=r.get(z);if(E!==void 0)return`x-mcp-header '${h}' is not case-insensitively unique (also declared as '${E}')`;r.set(z,h),t.push({path:n,headerName:h,type:f})}let u=c.properties;if(u!==null&&typeof u==="object")for(let[h,f]of Object.entries(u)){let z=a(f,[...n,h],l);if(z!==void 0)return z}for(let h of yh){let f=c[h];if(f===void 0)continue;let z=Array.isArray(f)?f:f!==null&&typeof f==="object"&&_h.has(h)?Object.values(f):[f];for(let E of z){let _=a(E,[...n,`<${h}>`],!1);if(_!==void 0)return _}}},o=a(e,[],!0);return o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o}}var yh=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],_h=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Us(e){return e.length===0?"<root>":e.join(".")}var Fs=-32020,cS=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[J.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[Fs,J.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[J.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope — and a missing envelope on a request whose protocol-version header names a modern revision — is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[J.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision’s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[J.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[Fs],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers — presence, sentinel decoding, and `Mcp-Name` ↔ body cross-check — are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier’s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5–6) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[J.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced — pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[Fs],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool’s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],lS={[J.ParseError]:400,[J.InvalidRequest]:400,[J.MethodNotFound]:404,[J.UnsupportedProtocolVersion]:400,[J.MissingRequiredClientCapability]:400,[Fs]:400};function Hs(e,t,r,a,o){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:a.code,message:a.message,...a.data!==void 0&&{data:a.data},settled:o}}function uS(e){if(!lh(e))return!1;let t=uh(e);if(t===void 0||!pr(t))return!1;let r=ui(e);return r!==void 0&&dh(r).length===0}function dS(e,t){switch(e.reason){case"http-method":return Hs("http-method","modern-only-method-not-allowed",405,new ae(-32000,"Method not allowed."),!0);case"batch":return Hs("jsonrpc-shape","modern-only-batch-not-supported",400,new ae(J.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return Hs("jsonrpc-shape","modern-only-response-post",400,new ae(J.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return Hs("era-classification","modern-only-missing-envelope",400,r===void 0?new ae(J.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new Ec({supported:[...t],requested:r}),!0)}}}function Ks(e,t){return cn(e,t)}function _a(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function mr(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var lc=!1,Yn="draft-2020-12";function vt(e,t="input"){let r=e["~standard"],a;if(r.jsonSchema)a=r.jsonSchema[t]({target:Yn});else if(r.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().");if(!lc)lc=!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.");a=xr(e,{target:Yn,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(a.type!==void 0)return a;return kc(a)?{type:"object",...a}:a}if(a.type!==void 0&&a.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(a.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...a}}function kc(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(let t of["oneOf","anyOf","allOf"]){let r=e[t];if(Array.isArray(r)&&r.length>0)return r.every((a)=>a!==null&&typeof a==="object"&&(a.type==="object"||kc(a)))}return!1}function vh(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Mt(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((a)=>vh(a)).join(", ")};return{success:!0,data:r.value}}function bh(e){let t=xr(e,{target:Yn,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var Rh=/\\\.\\d\{(\d+)\}/;function zh(e){let t=Rh.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((a)=>[!1,!0].flatMap((o)=>r.map((s)=>Je.datetime({local:a,offset:o,precision:s}))))}function $h(e,t){let r;switch(e){case"email":r=[ln()];break;case"uri":r=[Kr()];break;case"date":r=[Je.date()];break;case"date-time":r=zh(t);break}return new Set(r.map((a)=>bh(a)).filter((a)=>a!==void 0))}function Eh(e,t,r){if(r!=="zod")return!0;return $h(e,t).has(t)}function Mc(e){let t=vt(e,"input"),r=t.properties||{},a=t.required||[];return Object.entries(r).map(([o,s])=>({name:o,description:s?.description,required:a.includes(o)}))}function Ra(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ph(e){try{return vt(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new ae(J.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var wh=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function di(e){return wh.has(e)||e.startsWith("x-")}var Th=new Set(["$schema",...Object.keys(lr.shape.requestedSchema.shape)]),uc={string:_a([ir,ma,pa,ha]),number:_a([cr]),integer:_a([cr]),boolean:_a([da]),array:_a([fa,ga])},Ch=new Set(ir.shape.format.unwrap().options);function qh(e,t,r,a){if(!Ra(e))return e;let o=typeof e.type==="string"&&Object.hasOwn(uc,e.type)?uc[e.type]:void 0;if(o===void 0)return e;let s={};for(let[n,l]of Object.entries(e))if(o.has(n)||di(n))s[n]=l;else if(n==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Ch.has(e.format))s[n]=l;else if(typeof l!=="string"||!Eh(e.format,l,r))a.push(`${t}.${n}`)}else a.push(`${t}.${n}`);return s}function jh(e,t){let r={},a=[];for(let[o,s]of Object.entries(e))if(o==="properties"&&Ra(s))r[o]=Object.fromEntries(Object.entries(s).map(([n,l])=>[n,qh(l,`properties.${n}`,t,a)]));else if(Th.has(o))r[o]=s;else if(!di(o))a.push(o);if(a.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${a.join(", ")}`);return r}function Nh(e,t){if(!Ra(e.properties))return t;let r=Object.entries(e.properties).filter(([,a])=>!Ks(Sa,a).success).map(([a])=>`properties.${a}`);return r.length>0?r.join(", "):t}function Wn(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((a,o)=>Wn(a,t[o],`${r}[${o}]`));if(!Ra(e)||!Ra(t))return[];return Object.entries(e).flatMap(([a,o])=>{let s=r?`${r}.${a}`:a;if(!Object.prototype.hasOwnProperty.call(t,a))return di(a)?[]:[s];return Wn(o,t[a],s)})}function Ih(e){if(!mr(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=jh(Ph(e.requestedSchema),t),a=Ks(lr.shape.requestedSchema,r);if(!a.success)throw new ae(J.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Nh(r,a.error.message)}`);let o=Wn(r,a.data);if(o.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);let s=(a.data.required??[]).filter((n)=>!Object.prototype.hasOwnProperty.call(a.data.properties,n));if(s.length>0)throw new ae(J.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:a.data}}function Oh(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)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}}}var mS=Object.assign(Oh,{elicit(e){try{return{method:"elicitation/create",params:Ih(e)}}catch(t){throw t instanceof ae?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});var Ac=250;function Lc(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Vc(e,t){return new Promise((r,a)=>{if(t?.aborted){a(t.reason instanceof ue?t.reason:new ue(pe.RequestTimeout,String(t.reason)));return}let o=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(o),a(t?.reason instanceof ue?t.reason:new ue(pe.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Dc(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(a)=>t.abort(a),dispose:()=>e?.removeEventListener("abort",r)}}var kh=["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"],Mh={IdJagTokenExchangeResponseSchema:Vn,OAuthClientInformationFullSchema:Un,OAuthClientInformationSchema:Ms,OAuthClientMetadataSchema:ks,OAuthClientRegistrationErrorSchema:Hn,OAuthErrorResponseSchema:Dn,OAuthMetadataSchema:Is,OAuthProtectedResourceMetadataSchema:Mn,OAuthTokenRevocationRequestSchema:Fn,OAuthTokensSchema:Ln,OpenIdProviderDiscoveryMetadataSchema:An,OpenIdProviderMetadataSchema:Os},Uc={},Hc={};function Fc(e,t){let r=e.slice(0,-6);Uc[r]=t,Hc[r]=(a)=>t.safeParse(a).success}for(let e of kh)Fc(e,mh[e]);for(let[e,t]of Object.entries(Mh))Fc(e,t);var pS=Object.freeze(Uc),hS=Object.freeze(Hc);function Ah(e){switch(e){case"initialize":case"notifications/initialized":return yt(void 0);case"server/discover":return yt(za);default:return}}var Lh=60000,Vh=[lt,Jr,ut,Ot],Dh=["inputResponses","requestState"];function dc(e,t){let r=e.params;if(!ba(r))return{message:e,lifted:{}};let a=r._meta,o=ba(a)?Vh.filter((c)=>(c in a)):[],s=t==="request"?Dh.filter((c)=>(c in r)):[];if(o.length===0&&s.length===0)return{message:e,lifted:{}};let n={},l={...r};if(o.length>0&&ba(a)){let c={},u={...a};for(let h of o)c[h]=a[h],delete u[h];if(n.envelope=c,Object.keys(u).length>0)l._meta=u;else delete l._meta}for(let c of s){if(c==="inputResponses")n.inputResponses=l[c];if(c==="requestState")n.requestState=l[c];delete l[c]}return{message:{...e,params:l},lifted:n}}function mc(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(a){let o=e.validateResult(t,a);if(o.ok)return{value:o.value};return{issues:[{message:o.reason==="invalid"?o.message:`not-in-era: ${t}`}]}}}}}function $a(e){return()=>e}var Uh=$a(void 0);function mi(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:$a(t)}}}var xc;function fS(e,t){xc(e,t)}var Kc=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;static{xc=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??mn,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ue(pe.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){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,a,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(a,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:a})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ue(pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(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 r=this.transport?.onerror;this._transport.onerror=(o)=>{r?.(o),this._onerror(o)};let a=this._transport?.onmessage;this._transport.onmessage=(o,s)=>{if(a?.(o,s),ic(o)||fh(o))this._onresponse(o);else if(ph(o))this._onrequest(o,s);else if(hh(o))this._onnotification(o,s);else this._onerror(Error(`Unknown message type: ${JSON.stringify(o)}`))},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 a of this._timeoutInfo.values())clearTimeout(a.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new ue(pe.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let a of e.values())a(r);for(let a of t.values())a.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=dc(e,"notification"),a=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let n=sc(t.classification);if(n!==a.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${n} but this instance serves ${a.era}`));return}}if(Jn(r.method)&&!a.hasNotificationMethod(r.method))return;let o=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(o===void 0&&s===void 0)return;Promise.resolve().then(()=>o===void 0?s(r):o(r,a)).catch((n)=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,t){let{message:r,lifted:a}=dc(e,"request"),o=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 s=this._transport,n=(v,g,d)=>{let y={jsonrpc:"2.0",id:r.id,error:{code:v,message:g,...d!==void 0&&{data:d}}};s?.send(y).catch((m)=>this._onerror(Error(`Failed to send an error response: ${m}`)))};if(t?.classification!==void 0){let v=sc(t.classification);if(v!==o.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${o.era}`));let g=t.classification.revision??v;n(J.UnsupportedProtocolVersion,`Unsupported protocol version: ${g}`,{supported:this._supportedProtocolVersions,requested:g});return}}if(Kn(r.method)&&!o.hasRequestMethod(r.method)){n(J.MethodNotFound,"Method not found");return}let l=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(l===void 0){n(J.MethodNotFound,"Method not found");return}let c=o.checkInboundEnvelope(a);if(c!==void 0){n(J.InvalidParams,c);return}let u=(v,g)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...g,relatedRequestId:r.id}),h=(v,g,d)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,g,{...d,relatedRequestId:r.id}),f=new AbortController;this._requestHandlerAbortControllers.set(r.id,f);let z=a.inputResponses===void 0?void 0:Hh(a.inputResponses),E={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...a.envelope!==void 0&&{envelope:a.envelope},...z!==void 0&&{inputResponses:z.accepted},...z!==void 0&&z.droppedKeys.length>0&&{droppedInputResponseKeys:z.droppedKeys},requestState:a.requestState===void 0?Uh:$a(a.requestState),signal:f.signal,send:(v,g,d)=>{let y=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(y,v.method),mr(g))return h(v,g,d);let m=mc(y,v.method);if(m===void 0)throw TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(v,m,g)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},_=this.buildContext(E,t);Promise.resolve().then(()=>l(r,_)).then(async(v)=>{if(f.signal.aborted)return;let g;try{g=o.encodeResult(r.method,v,this._outboundServerInfo())}catch(y){this._onerror(Error(`Failed to encode result for ${r.method}: ${y}`)),n(J.InternalError,"Internal error");return}let d={result:g,jsonrpc:"2.0",id:r.id};await s?.send(d)},async(v)=>{if(f.signal.aborted)return;let g=Number.isSafeInteger(v.code)?v.code:J.InternalError,d={jsonrpc:"2.0",id:r.id,error:{code:o.encodeErrorCode(g),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(d)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===f)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,a=Number(t),o=this._progressHandlers.get(a);if(!o){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(a),n=this._timeoutInfo.get(a);if(n&&s&&n.resetTimeoutOnProgress)try{this._resetTimeout(a)}catch(l){this._responseHandlers.delete(a),this._progressHandlers.delete(a),this._cleanupTimeout(a),s(l);return}o(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),ic(e))r(e);else r(ae.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let a=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(a,e.method),mr(t))return this._requestWithSchemaViaCodec(a,e,t,r);let o=mc(a,e.method);if(o===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(a,e,o,t)}_negotiatedWireCodec(){return yt(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Ah(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Kn(t)&&!e.hasRequestMethod(t))throw new ue(pe.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let a=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(a,e.method),this._requestWithSchemaViaCodec(a,e,t,r)}_requestWithSchemaViaCodec(e,t,r,a){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n,headers:l}=a??{},c=Date.now(),u,h;return new Promise((f,z)=>{let E=(S)=>{z(S)};if(!this._transport){E(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(S){E(S);return}if(a?.signal?.aborted){let S=a.signal.reason;throw S instanceof ue?S:new ue(pe.RequestTimeout,String(S))}let _=e.era===za&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;h=v;let g={...t,jsonrpc:"2.0",id:v};if(a?.onprogress)this._progressHandlers.set(v,a.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:v}};let d=this._envelopeOutbound(g),y=!1,m=(S)=>{if(y)return;if(this._progressHandlers.delete(v),_===void 0)this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(S)}}),{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n}).catch((p)=>this._onerror(Error(`Failed to send cancellation: ${p}`)));else _.abort();z(S instanceof ue?S:new ue(pe.RequestTimeout,String(S)))};this._responseHandlers.set(v,(S)=>{if(a?.signal?.aborted)return;if(y=!0,S instanceof Error)return z(S);let p;try{p=e.decodeResult(t.method,S.result)}catch(A){return z(A instanceof Error?A:Error(String(A)))}if(p.kind==="invalid")return z(p.error);if(p.kind==="input_required"){if(a?.allowInputRequired===!0)return f(Fh(p));let A={codec:e,request:t,resultSchema:r,options:a,flowStartedAt:c,retry:(x,L)=>this._requestWithSchemaViaCodec(e,x===void 0?{method:t.method}:{method:t.method,params:x},r,L)};return f(this._resolveNonCompleteResult(p,A))}let w=p.result;Mt(r,w).then((A)=>{if(A.success)f(A.data);else z(new ue(pe.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},z)}),u=()=>m(a?.signal?.reason),a?.signal?.addEventListener("abort",u,{once:!0});let b=a?.timeout??Lh,P=()=>m(new ue(pe.RequestTimeout,"Request timed out",{timeout:b}));this._setupTimeout(v,b,a?.maxTotalTimeout,P,a?.resetTimeoutOnProgress??!1),this._transport.send(d,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:n,headers:l,requestSignal:_?.signal}).catch((S)=>{this._progressHandlers.delete(v),z(S)})}).finally(()=>{if(u)a?.signal?.removeEventListener("abort",u);if(h!==void 0)this._responseHandlers.delete(h),this._cleanupTimeout(h)})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new ue(pe.NotConnected,"Not connected");if(Jn(t.method)&&!e.hasNotificationMethod(t.method))throw new ue(pe.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 a=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(a,r).catch((o)=>this._onerror(o))});return}await this._transport.send(a,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let a;if(typeof t==="function"){if(!Kn(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);a=(o,s)=>{let n=this._negotiatedWireCodec(),l=n.validateRequest(e,o);if(!l.ok&&l.reason==="not-in-era")l=n.validateInputRequest(e,o);if(!l.ok){if(l.reason==="not-in-era")throw new ae(J.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(l.message)}return Promise.resolve(t(l.value,s))}}else if(r)a=async(o,s)=>{let n=await Mt(t.params,{...o.params});if(!n.success)throw new ae(J.InvalidParams,`Invalid params for ${e}: ${n.error}`);return r(n.data,s)};else throw TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,a))}_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,r){if(typeof t==="function"){if(!Jn(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(a,o)=>{let s=o.validateNotification(e,a);if(!s.ok){if(s.reason==="not-in-era")throw new ae(J.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(a)=>{let o=await Mt(t.params,{...a.params});if(!o.success)throw new ae(J.InvalidParams,`Invalid params for notification ${e}: ${o.error}`);await r(o.data,a)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ba(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Jc(e,t){let r={...e};for(let a in t){let o=a,s=t[o];if(s===void 0)continue;let n=r[o];r[o]=ba(n)&&ba(s)?{...n,...s}:s}return r}function pc(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Hh(e){let t={},r=[];if(!pc(e))return{accepted:t,droppedKeys:r};for(let[a,o]of Object.entries(e)){if(!pc(o)||"method"in o||"result"in o){r.push(a);continue}t[a]=o}return{accepted:t,droppedKeys:r}}function Fh(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*!
2
2
  * content-type
3
3
  * Copyright(c) 2015 Douglas Christopher Wilson
4
4
  * MIT Licensed
@@ -12,4 +12,4 @@ import{$a as Ql,$b as Du,$c as kd,$d as bm,Aa as Di,Ab as Su,Ac as pd,Ad as Ze,A
12
12
  missingProperty: ${f},
13
13
  depsCount: ${u},
14
14
  deps: ${h}}`};let o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,h]=s(c);n(c,u),l(c,h)}};function s({schema:c}){let u={},h={};for(let f in c){if(f==="__proto__")continue;let z=Array.isArray(c[f])?u:h;z[f]=c[f]}return[u,h]}function n(c,u=c.schema){let{gen:h,data:f,it:z}=c;if(Object.keys(u).length===0)return;let E=h.let("missing");for(let _ in u){let v=u[_];if(v.length===0)continue;let g=(0,a.propertyInData)(h,f,_,z.opts.ownProperties);if(c.setParams({property:_,depsCount:v.length,deps:v.join(", ")}),z.allErrors)h.if(g,()=>{for(let d of v)(0,a.checkReportMissingProp)(c,d)});else h.if(t._`${g} && (${(0,a.checkMissingProp)(c,v,E)})`),(0,a.reportMissingProp)(c,E),h.else()}}e.validatePropertyDeps=n;function l(c,u=c.schema){let{gen:h,data:f,keyword:z,it:E}=c,_=h.name("valid");for(let v in u){if((0,r.alwaysValidSchema)(E,u[v]))continue;h.if((0,a.propertyInData)(h,f,v,E.opts.ownProperties),()=>{let g=c.subschema({keyword:z,schemaProp:v},_);c.mergeValidEvaluated(g,_)},()=>h.var(_,!0)),c.ok(_)}}e.validateSchemaDeps=l,e.default=o}),$f=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=fe(),a={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:o})=>t._`{propertyName: ${o.propertyName}}`},code(o){let{gen:s,schema:n,data:l,it:c}=o;if((0,r.alwaysValidSchema)(c,n))return;let u=s.name("valid");s.forIn("key",l,(h)=>{o.setParams({propertyName:h}),o.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},u),s.if((0,t.not)(u),()=>{if(o.error(!0),!c.allErrors)s.break()})}),o.ok(u)}};e.default=a}),rl=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Be(),r=ce(),a=Ge(),o=fe(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:n})=>r._`{additionalProperty: ${n.additionalProperty}}`},code(n){let{gen:l,schema:c,parentSchema:u,data:h,errsCount:f,it:z}=n;if(!f)throw Error("ajv implementation error");let{allErrors:E,opts:_}=z;if(z.props=!0,_.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(z,c))return;let v=(0,t.allSchemaProperties)(u.properties),g=(0,t.allSchemaProperties)(u.patternProperties);d(),n.ok(r._`${f} === ${a.default.errors}`);function d(){l.forIn("key",h,(S)=>{if(!v.length&&!g.length)b(S);else l.if(y(S),()=>b(S))})}function y(S){let p;if(v.length>8){let w=(0,o.schemaRefOrVal)(z,u.properties,"properties");p=(0,t.isOwnProperty)(l,w,S)}else if(v.length)p=(0,r.or)(...v.map((w)=>r._`${S} === ${w}`));else p=r.nil;if(g.length)p=(0,r.or)(p,...g.map((w)=>r._`${(0,t.usePattern)(n,w)}.test(${S})`));return(0,r.not)(p)}function m(S){l.code(r._`delete ${h}[${S}]`)}function b(S){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){m(S);return}if(c===!1){if(n.setParams({additionalProperty:S}),n.error(),!E)l.break();return}if(typeof c=="object"&&!(0,o.alwaysValidSchema)(z,c)){let p=l.name("valid");if(_.removeAdditional==="failing")P(S,p,!1),l.if((0,r.not)(p),()=>{n.reset(),m(S)});else if(P(S,p),!E)l.if((0,r.not)(p),()=>l.break())}}function P(S,p,w){let A={keyword:"additionalProperties",dataProp:S,dataPropType:o.Type.Str};if(w===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});n.subschema(A,p)}}};e.default=s}),Ef=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hr(),r=Be(),a=fe(),o=rl(),s={keyword:"properties",type:"object",schemaType:"object",code(n){let{gen:l,schema:c,parentSchema:u,data:h,it:f}=n;if(f.opts.removeAdditional==="all"&&u.additionalProperties===void 0)o.default.code(new t.KeywordCxt(f,o.default,"additionalProperties"));let z=(0,r.allSchemaProperties)(c);for(let d of z)f.definedProperties.add(d);if(f.opts.unevaluated&&z.length&&f.props!==!0)f.props=a.mergeEvaluated.props(l,(0,a.toHash)(z),f.props);let E=z.filter((d)=>!(0,a.alwaysValidSchema)(f,c[d]));if(E.length===0)return;let _=l.name("valid");for(let d of E){if(v(d))g(d);else{if(l.if((0,r.propertyInData)(l,h,d,f.opts.ownProperties)),g(d),!f.allErrors)l.else().var(_,!0);l.endIf()}n.it.definedProperties.add(d),n.ok(_)}function v(d){return f.opts.useDefaults&&!f.compositeRule&&c[d].default!==void 0}function g(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};e.default=s}),Pf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Be(),r=ce(),a=fe(),o=fe(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(n){let{gen:l,schema:c,data:u,parentSchema:h,it:f}=n,{opts:z}=f,E=(0,t.allSchemaProperties)(c),_=E.filter((P)=>(0,a.alwaysValidSchema)(f,c[P]));if(E.length===0||_.length===E.length&&(!f.opts.unevaluated||f.props===!0))return;let v=z.strictSchema&&!z.allowMatchingProperties&&h.properties,g=l.name("valid");if(f.props!==!0&&!(f.props instanceof r.Name))f.props=(0,o.evaluatedPropsToName)(l,f.props);let{props:d}=f;y();function y(){for(let P of E){if(v)m(P);if(f.allErrors)b(P);else l.var(g,!0),b(P),l.if(g)}}function m(P){for(let S in v)if(new RegExp(P).test(S))(0,a.checkStrictMode)(f,`property ${S} matches pattern ${P} (use allowMatchingProperties)`)}function b(P){l.forIn("key",u,(S)=>{l.if(r._`${(0,t.usePattern)(n,P)}.test(${S})`,()=>{let p=_.includes(P);if(!p)n.subschema({keyword:"patternProperties",schemaProp:P,dataProp:S,dataPropType:o.Type.Str},g);if(f.opts.unevaluated&&d!==!0)l.assign(r._`${d}[${S}]`,!0);else if(!p&&!f.allErrors)l.if((0,r.not)(g),()=>l.break())})})}}};e.default=s}),wf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(a){let{gen:o,schema:s,it:n}=a;if((0,t.alwaysValidSchema)(n,s)){a.fail();return}let l=o.name("valid");a.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),a.failResult(l,()=>a.reset(),()=>a.error())},error:{message:"must NOT be valid"}};e.default=r}),Tf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Be().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),Cf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=fe(),a={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:o})=>t._`{passingSchemas: ${o.passing}}`},code(o){let{gen:s,schema:n,parentSchema:l,it:c}=o;if(!Array.isArray(n))throw Error("ajv implementation error");if(c.opts.discriminator&&l.discriminator)return;let u=n,h=s.let("valid",!1),f=s.let("passing",null),z=s.name("_valid");o.setParams({passing:f}),s.block(E),o.result(h,()=>o.reset(),()=>o.error(!0));function E(){u.forEach((_,v)=>{let g;if((0,r.alwaysValidSchema)(c,_))s.var(z,!0);else g=o.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},z);if(v>0)s.if(t._`${z} && ${h}`).assign(h,!1).assign(f,t._`[${f}, ${v}]`).else();s.if(z,()=>{if(s.assign(h,!0),s.assign(f,v),g)o.mergeEvaluated(g,t.Name)})})}}};e.default=a}),qf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:"allOf",schemaType:"array",code(a){let{gen:o,schema:s,it:n}=a;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(n,c))return;let h=a.subschema({keyword:"allOf",schemaProp:u},l);a.ok(l),a.mergeEvaluated(h)})}};e.default=r}),jf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=fe(),a={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:n,parentSchema:l,it:c}=s;if(l.then===void 0&&l.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=o(c,"then"),h=o(c,"else");if(!u&&!h)return;let f=n.let("valid",!0),z=n.name("_valid");if(E(),s.reset(),u&&h){let v=n.let("ifClause");s.setParams({ifClause:v}),n.if(z,_("then",v),_("else",v))}else if(u)n.if(z,_("then"));else n.if((0,t.not)(z),_("else"));s.pass(f,()=>s.error(!0));function E(){let v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},z);s.mergeEvaluated(v)}function _(v,g){return()=>{let d=s.subschema({keyword:v},z);if(n.assign(f,z),s.mergeValidEvaluated(d,f),g)n.assign(g,t._`${v}`);else s.setParams({ifClause:v})}}}};function o(s,n){let l=s.schema[n];return l!==void 0&&!(0,r.alwaysValidSchema)(s,l)}e.default=a}),Nf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:a,parentSchema:o,it:s}){if(o.if===void 0)(0,t.checkStrictMode)(s,`"${a}" without "if" is ignored`)}};e.default=r}),al=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=el(),r=bf(),a=tl(),o=Rf(),s=zf(),n=yi(),l=$f(),c=rl(),u=Ef(),h=Pf(),f=wf(),z=Tf(),E=Cf(),_=qf(),v=jf(),g=Nf();function d(y=!1){let m=[f.default,z.default,E.default,_.default,v.default,g.default,l.default,c.default,n.default,u.default,h.default];if(y)m.push(r.default,o.default);else m.push(t.default,a.default);return m.push(s.default),m}e.default=d}),If=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>t.str`must match format "${a}"`,params:({schemaCode:a})=>t._`{format: ${a}}`},code(a,o){let{gen:s,data:n,$data:l,schema:c,schemaCode:u,it:h}=a,{opts:f,errSchemaPath:z,schemaEnv:E,self:_}=h;if(!f.validateFormats)return;if(l)v();else g();function v(){let d=s.scopeValue("formats",{ref:_.formats,code:f.code.formats}),y=s.const("fDef",t._`${d}[${u}]`),m=s.let("fType"),b=s.let("format");s.if(t._`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>s.assign(m,t._`${y}.type || "string"`).assign(b,t._`${y}.validate`),()=>s.assign(m,t._`"string"`).assign(b,y)),a.fail$data((0,t.or)(P(),S()));function P(){if(f.strictSchema===!1)return t.nil;return t._`${u} && !${b}`}function S(){let p=E.$async?t._`(${y}.async ? await ${b}(${n}) : ${b}(${n}))`:t._`${b}(${n})`,w=t._`(typeof ${b} == "function" ? ${p} : ${b}.test(${n}))`;return t._`${b} && ${b} !== true && ${m} === ${o} && !${w}`}}function g(){let d=_.formats[c];if(!d){P();return}if(d===!0)return;let[y,m,b]=S(d);if(y===o)a.pass(p());function P(){if(f.strictSchema===!1){_.logger.warn(w());return}throw Error(w());function w(){return`unknown format "${c}" ignored in schema at path "${z}"`}}function S(w){let A=w instanceof RegExp?(0,t.regexpCode)(w):f.code.formats?t._`${f.code.formats}${(0,t.getProperty)(c)}`:void 0,x=s.scopeValue("formats",{key:c,ref:w,code:A});if(typeof w=="object"&&!(w instanceof RegExp))return[w.type||"string",w.validate,t._`${x}.validate`];return["string",w,x]}function p(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!E.$async)throw Error("async format in sync schema");return t._`await ${b}(${n})`}return typeof m=="function"?t._`${b}(${n})`:t._`${b}.test(${n})`}}}};e.default=r}),ol=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[If().default];e.default=t}),sl=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),nl=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Xc(),r=Qc(),a=al(),o=ol(),s=sl(),n=[t.default,r.default,(0,a.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];e.default=n}),Of=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),_i=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=Of(),a=Zs(),o=fr(),s=fe(),n={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:c}})=>l===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:l,tag:c,tagName:u}})=>t._`{error: ${l}, tag: ${u}, tagValue: ${c}}`},code(l){let{gen:c,data:u,schema:h,parentSchema:f,it:z}=l,{oneOf:E}=f;if(!z.opts.discriminator)throw Error("discriminator: requires discriminator option");let _=h.propertyName;if(typeof _!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!E)throw Error("discriminator: requires oneOf keyword");let v=c.let("valid",!1),g=c.const("tag",t._`${u}${(0,t.getProperty)(_)}`);c.if(t._`typeof ${g} == "string"`,()=>d(),()=>l.error(!1,{discrError:r.DiscrError.Tag,tag:g,tagName:_})),l.ok(v);function d(){let b=m();c.if(!1);for(let P in b)c.elseIf(t._`${g} === ${P}`),c.assign(v,y(b[P]));c.else(),l.error(!1,{discrError:r.DiscrError.Mapping,tag:g,tagName:_}),c.endIf()}function y(b){let P=c.name("valid"),S=l.subschema({keyword:"oneOf",schemaProp:b},P);return l.mergeEvaluated(S,t.Name),P}function m(){var b;let P={},S=w(f),p=!0;for(let L=0;L<E.length;L++){let U=E[L];if((U===null||U===void 0?void 0:U.$ref)&&!(0,s.schemaHasRulesButRef)(U,z.self.RULES)){let Y=U.$ref;if(U=a.resolveRef.call(z.self,z.schemaEnv.root,z.baseId,Y),U instanceof a.SchemaEnv)U=U.schema;if(U===void 0)throw new o.default(z.opts.uriResolver,z.baseId,Y)}let X=(b=U===null||U===void 0?void 0:U.properties)===null||b===void 0?void 0:b[_];if(typeof X!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);p=p&&(S||w(U)),A(X,L)}if(!p)throw Error(`discriminator: "${_}" must be required`);return P;function w({required:L}){return Array.isArray(L)&&L.includes(_)}function A(L,U){if(L.const)x(L.const,U);else if(L.enum)for(let X of L.enum)x(X,U);else throw Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function x(L,U){if(typeof L!="string"||L in P)throw Error(`discriminator: "${_}" values must be unique strings`);P[L]=U}}}};e.default=n}),kf=D((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),il=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=fi(),a=nl(),o=_i(),s=kf(),n=["/properties"],l="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),a.default.forEach((E)=>this.addVocabulary(E)),this.opts.discriminator)this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let E=this.opts.$data?this.$dataMetaSchema(s,n):s;this.addMetaSchema(E,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=hr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var f=Ea();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var z=fr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return z.default}})}),cl=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=ce(),r=Ge(),a=Zs(),o=gi(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>n(c,c.schema)};function n(c,u){let{gen:h,it:f}=c;f.schemaEnv.root.dynamicAnchors[u]=!0;let z=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,E=f.errSchemaPath==="#"?f.validateName:l(c);h.if(t._`!${z}`,()=>h.assign(z,E))}e.dynamicAnchor=n;function l(c){let{schemaEnv:u,schema:h,self:f}=c.it,{root:z,baseId:E,localRefs:_,meta:v}=u.root,{schemaId:g}=f.opts,d=new a.SchemaEnv({schema:h,schemaId:g,root:z,baseId:E,localRefs:_,meta:v});return a.compileSchema.call(f,d),(0,o.getValidate)(c,d)}e.default=s}),ll=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=ce(),r=Ge(),a=gi(),o={keyword:"$dynamicRef",schemaType:"string",code:(n)=>s(n,n.schema)};function s(n,l){let{gen:c,keyword:u,it:h}=n;if(l[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let f=l.slice(1);if(h.allErrors)z();else{let _=c.let("valid",!1);z(_),n.ok(_)}function z(_){if(h.schemaEnv.root.dynamicAnchors[f]){let v=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(f)}`);c.if(v,E(v,_),E(h.validateName,_))}else E(h.validateName,_)()}function E(_,v){return v?()=>c.block(()=>{(0,a.callRef)(n,_),c.let(v,!0)}):()=>(0,a.callRef)(n,_)}}e.dynamicRef=s,e.default=o}),Mf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cl(),r=fe(),a={keyword:"$recursiveAnchor",schemaType:"boolean",code(o){if(o.schema)(0,t.dynamicAnchor)(o,"");else(0,r.checkStrictMode)(o.it,"$recursiveAnchor: false is ignored")}};e.default=a}),Af=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ll(),r={keyword:"$recursiveRef",schemaType:"string",code:(a)=>(0,t.dynamicRef)(a,a.schema)};e.default=r}),ul=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cl(),r=ll(),a=Mf(),o=Af(),s=[t.default,r.default,a.default,o.default];e.default=s}),Lf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yi(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(a)=>(0,t.validatePropertyDeps)(a)};e.default=r}),Vf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=yi(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(a)=>(0,t.validateSchemaDeps)(a)};e.default=r}),Df=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fe(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:a,parentSchema:o,it:s}){if(o.contains===void 0)(0,t.checkStrictMode)(s,`"${a}" without "contains" is ignored`)}};e.default=r}),dl=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Lf(),r=Vf(),a=Df(),o=[t.default,r.default,a.default];e.default=o}),Uf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=fe(),a=Ge(),o={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:n,schema:l,data:c,errsCount:u,it:h}=s;if(!u)throw Error("ajv implementation error");let{allErrors:f,props:z}=h;if(z instanceof t.Name)n.if(t._`${z} !== true`,()=>n.forIn("key",c,(g)=>n.if(_(z,g),()=>E(g))));else if(z!==!0)n.forIn("key",c,(g)=>z===void 0?E(g):n.if(v(z,g),()=>E(g)));h.props=!0,s.ok(t._`${u} === ${a.default.errors}`);function E(g){if(l===!1){if(s.setParams({unevaluatedProperty:g}),s.error(),!f)n.break();return}if(!(0,r.alwaysValidSchema)(h,l)){let d=n.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:g,dataPropType:r.Type.Str},d),!f)n.if((0,t.not)(d),()=>n.break())}}function _(g,d){return t._`!${g} || !${g}[${d}]`}function v(g,d){let y=[];for(let m in g)if(g[m]===!0)y.push(t._`${d} !== ${m}`);return(0,t.and)(...y)}}};e.default=o}),Hf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ce(),r=fe(),a={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:o}})=>t.str`must NOT have more than ${o} items`,params:({params:{len:o}})=>t._`{limit: ${o}}`},code(o){let{gen:s,schema:n,data:l,it:c}=o,u=c.items||0;if(u===!0)return;let h=s.const("len",t._`${l}.length`);if(n===!1)o.setParams({len:u}),o.fail(t._`${h} > ${u}`);else if(typeof n=="object"&&!(0,r.alwaysValidSchema)(c,n)){let z=s.var("valid",t._`${h} <= ${u}`);s.if((0,t.not)(z),()=>f(z,u)),o.ok(z)}c.items=!0;function f(z,E){s.forRange("i",E,h,(_)=>{if(o.subschema({keyword:"unevaluatedItems",dataProp:_,dataPropType:r.Type.Num},z),!c.allErrors)s.if((0,t.not)(z),()=>s.break())})}}};e.default=a}),ml=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Uf(),r=Hf(),a=[t.default,r.default];e.default=a}),Ff=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),xf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),Kf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),Jf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),Gf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),Bf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),Yf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),Wf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ff(),r=xf(),a=Kf(),o=Jf(),s=Gf(),n=Bf(),l=Yf(),c=["/properties"];function u(h){return[t,r,a,o,f(this,s),n,f(this,l)].forEach((z)=>this.addMetaSchema(z,void 0,!1)),this;function f(z,E){return h?z.$dataMetaSchema(E,c):E}}e.default=u}),Zf=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=fi(),a=nl(),o=ul(),s=dl(),n=ml(),l=_i(),c=Wf(),u="https://json-schema.org/draft/2019-09/schema";var h=class extends r.default{constructor(v={}){super({...v,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(o.default),a.default.forEach((v)=>this.addVocabulary(v)),this.addVocabulary(s.default),this.addVocabulary(n.default),this.opts.discriminator)this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:v,meta:g}=this.opts;if(!g)return;c.default.call(this,v),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=h,t.exports=e=h,t.exports.Ajv2019=h,Object.defineProperty(e,"__esModule",{value:!0}),e.default=h;var f=hr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var z=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return z._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return z.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return z.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return z.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return z.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return z.CodeGen}});var E=Ea();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return E.default}});var _=fr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return _.default}})}),Xf=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Xc(),r=Qc(),a=al(),o=ul(),s=dl(),n=ml(),l=ol(),c=sl(),u=[o.default,t.default,r.default,(0,a.default)(!0),l.default,c.metadataVocabulary,c.contentVocabulary,s.default,n.default];e.default=u}),Qf=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),eg=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),tg=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),rg=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),ag=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),og=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),sg=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),ng=D((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),ig=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Qf(),r=eg(),a=tg(),o=rg(),s=ag(),n=og(),l=sg(),c=ng(),u=["/properties"];function h(f){return[t,r,a,o,s,z(this,n),l,z(this,c)].forEach((E)=>this.addMetaSchema(E,void 0,!1)),this;function z(E,_){return f?E.$dataMetaSchema(_,u):_}}e.default=h}),cg=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=fi(),a=Xf(),o=_i(),s=ig(),n="https://json-schema.org/draft/2020-12/schema";var l=class extends r.default{constructor(z={}){super({...z,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),a.default.forEach((z)=>this.addVocabulary(z)),this.opts.discriminator)this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:z,meta:E}=this.opts;if(!E)return;s.default.call(this,z),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}};e.Ajv2020=l,t.exports=e=l,t.exports.Ajv2020=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var c=hr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ce();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var h=Ea();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=fr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),lg=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(L,U){return{validate:L,compare:U}}e.fullFormats={date:t(s,n),time:t(c(!0),u),"date-time":t(z(!0),E),"iso-time":t(c(),h),"iso-date-time":t(z(),_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|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-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{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,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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,regex:x,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:m,int32:{type:"number",validate:S},int64:{type:"number",validate:p},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,n),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,E),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%400===0)}let a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(L){let U=a.exec(L);if(!U)return!1;let X=+U[1],Y=+U[2],me=+U[3];return Y>=1&&Y<=12&&me>=1&&me<=(Y===2&&r(X)?29:o[Y])}function n(L,U){if(!(L&&U))return;if(L>U)return 1;if(L<U)return-1;return 0}let l=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(L){return function(X){let Y=l.exec(X);if(!Y)return!1;let me=+Y[1],ye=+Y[2],ge=+Y[3],Ee=Y[4],he=Y[5]==="-"?-1:1,j=+(Y[6]||0),k=+(Y[7]||0);if(j>23||k>59||L&&!Ee)return!1;if(me<=23&&ye<=59&&ge<60)return!0;let H=ye-k*he,R=me-j*he-(H<0?1:0);return(R===23||R===-1)&&(H===59||H===-1)&&ge<61}}function u(L,U){if(!(L&&U))return;let X=new Date("2020-01-01T"+L).valueOf(),Y=new Date("2020-01-01T"+U).valueOf();if(!(X&&Y))return;return X-Y}function h(L,U){if(!(L&&U))return;let X=l.exec(L),Y=l.exec(U);if(!(X&&Y))return;if(L=X[1]+X[2]+X[3],U=Y[1]+Y[2]+Y[3],L>U)return 1;if(L<U)return-1;return 0}let f=/t|\s/i;function z(L){let U=c(L);return function(Y){let me=Y.split(f);return me.length===2&&s(me[0])&&U(me[1])}}function E(L,U){if(!(L&&U))return;let X=new Date(L).valueOf(),Y=new Date(U).valueOf();if(!(X&&Y))return;return X-Y}function _(L,U){if(!(L&&U))return;let[X,Y]=L.split(f),[me,ye]=U.split(f),ge=n(X,me);if(ge===void 0)return;return ge||u(Y,ye)}let v=/\/|:/,g=/^(?:[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;function d(L){return v.test(L)&&g.test(L)}let y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(L){return y.lastIndex=0,y.test(L)}let b=-2147483648,P=2147483647;function S(L){return Number.isInteger(L)&&L<=P&&L>=b}function p(L){return Number.isInteger(L)}function w(){return!0}let A=/[^\\]\\Z/;function x(L){if(A.test(L))return!1;try{return new RegExp(L),!0}catch(U){return!1}}}),ug=D((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=il(),r=ce(),a=r.operators,o={formatMaximum:{okStr:"<=",ok:a.LTE,fail:a.GT},formatMinimum:{okStr:">=",ok:a.GTE,fail:a.LT},formatExclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},formatExclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}},s={message:({keyword:l,schemaCode:c})=>r.str`should be ${o[l].okStr} ${c}`,params:({keyword:l,schemaCode:c})=>r._`{comparison: ${o[l].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:c,data:u,schemaCode:h,keyword:f,it:z}=l,{opts:E,self:_}=z;if(!E.validateFormats)return;let v=new t.KeywordCxt(z,_.RULES.all.format.definition,"format");if(v.$data)g();else d();function g(){let m=c.scopeValue("formats",{ref:_.formats,code:E.code.formats}),b=c.const("fmt",r._`${m}[${v.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${b} != "object"`,r._`${b} instanceof RegExp`,r._`typeof ${b}.compare != "function"`,y(b)))}function d(){let m=v.schema,b=_.formats[m];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw Error(`"${f}": format "${m}" does not define "compare" function`);let P=c.scopeValue("formats",{key:m,ref:b,code:E.code.formats?r._`${E.code.formats}${(0,r.getProperty)(m)}`:void 0});l.fail$data(y(P))}function y(m){return r._`${m}.compare(${u}, ${h}) ${o[f].fail} 0`}},dependencies:["format"]};let n=(l)=>(l.addKeyword(e.formatLimitDefinition),l);e.default=n}),dg=D((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=lg(),a=ug(),o=ce(),s=new o.Name("fullFormats"),n=new o.Name("fastFormats"),l=(u,h={keywords:!0})=>{if(Array.isArray(h))return c(u,h,r.fullFormats,s),u;let[f,z]=h.mode==="fast"?[r.fastFormats,n]:[r.fullFormats,s];if(c(u,h.formats||r.formatNames,f,z),h.keywords)(0,a.default)(u);return u};l.get=(u,h="full")=>{let f=(h==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw Error(`Unknown format "${u}"`);return f};function c(u,h,f,z){var E,_;(E=(_=u.opts.code).formats)!==null&&E!==void 0||(_.formats=o._`require("ajv-formats/dist/formats").${z}`);for(let v of h)u.addFormat(v,f[v])}t.exports=e=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l}),pl=il(),mg=Zf(),pg=cg(),hg=Ba(dg(),1),fg=hg.default;function hi(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return fg(t),t}var vi=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=hi(pg.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=Qi(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=hi(mg.Ajv2019);return this._ajvDraft7??=hi(pl.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id==="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return(a)=>r(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},qS=pl.Ajv;import yy from"node:process";var zl=Symbol.for("mcp.completable");function hl(e){return!!e&&typeof e==="object"&&zl in e}function gg(e){return e[zl]?.complete}function Sg(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function yg(e,t){let r={},a=(o)=>t===void 0||o===!0;if(e.toolsListChanged===!0&&a(t?.tools?.listChanged))r.toolsListChanged=!0;if(e.promptsListChanged===!0&&a(t?.prompts?.listChanged))r.promptsListChanged=!0;if(e.resourcesListChanged===!0&&a(t?.resources?.listChanged))r.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&a(t?.resources?.subscribe))r.resourceSubscriptions=[...e.resourceSubscriptions];return r}var _g=1024;function fl(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Zt]:t}}}}function vg(e){let t=yt(za).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}var bg=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),zy=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(e=_g,t,r){this._maxSubscriptions=e,this._serverCapabilities=t,this._serverInfo=r}setServerCapabilities(e,t){if(this._serverCapabilities=e,t!==void 0)this._serverInfo=t}has(e){return this._subs.has(e)}serve(e){if(this._serverCapabilities===void 0)throw Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:"Subscription limit reached"}};let t=vg(e);if(t===void 0)return{jsonrpc:"2.0",id:e.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=yg(t,this._serverCapabilities);return this._subs.set(e.id,r),fl({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},e.id)}cancel(e){return this._subs.delete(e)}routeOutbound(e){if(!bg.has(e.method))return"passthrough";let t=e.params?.uri,r=typeof t==="string"?t:void 0,a=Rg(e.method,r),o=[];for(let[s,n]of this._subs)if(Sg(n,a))o.push(fl({method:e.method,params:e.params??{}},s));return o}teardownAll(){let e=[];for(let t of this._subs.keys())e.push({jsonrpc:"2.0",id:t,result:{resultType:"complete",_meta:{[Zt]:t,...this._serverInfo!==void 0&&{[Qe]:this._serverInfo}}}});return this._subs.clear(),e}};function Rg(e,t){switch(e){case"notifications/tools/list_changed":return{kind:"tools_list_changed"};case"notifications/prompts/list_changed":return{kind:"prompts_list_changed"};case"notifications/resources/list_changed":return{kind:"resources_list_changed"};default:return{kind:"resource_updated",uri:t??""}}}var zg=8,$g=600000;function Eg(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??zg,roundTimeoutMs:e?.roundTimeoutMs??$g,legacyShim:e?.legacyShim??!0}}function $l(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new ae(J.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let a=r,o=hc(a);if(o===void 0)throw new ae(J.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${a.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:a,required:o}}function Pg(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map((a)=>a.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function bi(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new ae(J.InternalError,t)}var wg=class{constructor(e){this._host=e}async fulfill(e,t,r,a,o){let{maxRounds:s,roundTimeoutMs:n}=this._host,l=a.mcpReq.signal,c=o,u=0;while(!0){if(u+=1,u>s)return bi(e,Lc(e,s));let h=c.inputRequests,f=h!=null&&Object.keys(h).length>0,z=typeof c.requestState==="string"?c.requestState:void 0;if(!f&&z===void 0)throw new ae(J.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let E;if(f){let g=this._host.resolvedClientCapabilities(a),d=[];for(let[m,b]of Object.entries(h)){let{embedded:P,required:S}=$l(e,m,b);if(P.method!=="roots/list"&&P.params===void 0)throw new ae(J.InternalError,`Handler for ${e} returned an input request '${m}' of kind '${P.method}' without params`);if(Xn(S,g)!==void 0)return bi(e,`Cannot request input '${m}' (${P.method}): the client on this 2025-era connection did not declare the required capability${g===void 0?" (no client capabilities are available on this connection — per-request legacy serving cannot receive server-to-client requests)":""}`);d.push([m,P])}let y=Dc(l);try{let m={relatedRequestId:a.mcpReq.id,timeout:n,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:y.signal},b=await Promise.all(d.map(async([P,S])=>{try{return[P,await this._dispatchLeg(S,m)]}catch(p){throw y.abort(p),p}}));E=Object.fromEntries(b)}catch(m){if(l.aborted)throw m;return bi(e,`Fulfilling input required by '${e}' failed: ${m instanceof Error?m.message:String(m)}`)}finally{y.dispose()}}else await Vc(Ac,l);let _={...a,mcpReq:{...a.mcpReq,inputResponses:E,droppedInputResponseKeys:void 0,requestState:$a(z)}};if(z!==void 0){let g=await this._host.verifyRequestState(z,_,e);if(g!==void 0)_=mi(_,g)}let v=await t(r,_);if(!_t(v))return v;c=v}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:Pg()};return await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},Tg=new Set(["tools/call","prompts/get","resources/read"]),Cg,El,Pl;function $y(e,t){El(e,t)}function Ey(e){return Pl(e)}var qg=class extends Kc{_clientCapabilities;_clientVersion;static{Cg=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},El=(e,t)=>{let r=t.filter((a)=>!e._supportedProtocolVersions.includes(a));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},Pl=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new wg({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new vi,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=Eg(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,a]of Object.entries(t.cacheHints))if(a!==void 0)si(a,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Qn(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:a}=e.params,o=Ks(gt,a);if(o.success)this._loggingLevels.set(r,o.data);return{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(a,o,s)=>{if(!this._capabilities.logging)return Promise.resolve();let n;if(this._servedModernEra()){if(n=e.mcpReq.envelope?.[Ot],n===void 0)return Promise.resolve()}else n=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(n!==void 0&&this.LOG_LEVEL_SEVERITY.get(a)<this.LOG_LEVEL_SEVERITY.get(n))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:a,data:o,logger:s}})},elicitInput:(a,o)=>this.elicitInput(a,o),requestSampling:(a,o)=>this.createMessage(a,o)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(gt.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new ue(pe.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=Jc(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],a=Tg.has(e);if(r===void 0&&!a)return async(o,s)=>{let n=await t(o,s);if(_t(n))throw new ae(J.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return n};return async(o,s)=>{let n=a?await this._invokeInputRequiredCapableHandler(e,t,o,s):await t(o,s);if(_t(n)){if(!a)throw new ae(J.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return n}return r===void 0?n:xs(n,r)}}return async(r,a)=>{let o=yt(this._negotiatedProtocolVersion),s=o.validateRequest("tools/call",r);if(!s.ok)throw new ae(s.reason==="not-in-era"?J.InternalError:J.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let n=await this._invokeInputRequiredCapableHandler("tools/call",t,r,a);if(_t(n))return n;let l=ei(n),c=o.validateResult("tools/call",l);if(!c.ok)throw new ae(c.reason==="not-in-era"?J.InternalError:J.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&pr(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,a){let o=this._servedModernEra(),s=a.mcpReq.requestState();if(s!==void 0&&typeof s!=="string")throw new ae(J.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let n=a;if(typeof s==="string"){let f=await this._verifyRequestState(s,a,e);if(f!==void 0)n=mi(a,f)}let l;try{l=await t(r,n)}catch(f){if(f instanceof ae&&f.code===J.UrlElicitationRequired){if(!o)throw f;throw new ae(J.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { …: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw f}if(!_t(l))return l;if(!o){if(!this._inputRequiredServing.legacyShim)throw new ae(J.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Wt}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,n,l)}let c=l.inputRequests,u=c!=null&&Object.keys(c).length>0,h=typeof l.requestState==="string";if(!u&&!h)throw new ae(J.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let f=this._inputRequestCapabilityView(a);for(let[z,E]of Object.entries(c)){let{embedded:_,required:v}=$l(e,z,E),g=Xn(v,f);if(g!==void 0)throw new ii({requiredCapabilities:g},`Cannot request input '${z}' (${_.method}): the request's client capabilities do not declare the required capability`)}}return l}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(a){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${a instanceof Error?a.message:String(a)}`)),new ae(J.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[ut]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new ue(pe.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead — the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new ue(pe.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new ue(pe.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new ue(pe.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new ue(pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new ue(pe.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new ue(pe.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new ue(pe.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new ue(pe.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new ue(pe.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new ue(pe.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new ue(pe.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new ue(pe.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new ue(pe.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=gc(this._supportedProtocolVersions),a=r.includes(t)?t:r[0]??Wt;return this._negotiatedProtocolVersion=a,this.transport?.setProtocolVersion?.(a),{protocolVersion:a,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Qn(this._supportedProtocolVersions),capabilities:jg(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new ue(pe.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),n=Array.isArray(s.content)?s.content:[s.content],l=n.some((f)=>f.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],h=u.some((f)=>f.type==="tool_use");if(l){if(n.some((f)=>f.type!=="tool_result"))throw new ae(J.InvalidParams,"The last message must contain only tool_result content if any is present");if(!h)throw new ae(J.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(h){let f=new Set(u.filter((E)=>E.type==="tool_use").map((E)=>E.id)),z=new Set(n.filter((E)=>E.type==="tool_result").map((E)=>E.toolUseId));if(f.size!==z.size||![...f].every((E)=>z.has(E)))throw new ae(J.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(e.tools||e.toolChoice),a=await this.request({method:"sampling/createMessage",params:e},t),o=this._wireCodec().samplingResultVariant(r,a);if(!o.ok)throw new ue(pe.InvalidResult,`Invalid sampling/createMessage result: ${o.reason==="invalid"?o.message:o.reason}`);return o.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new ue(pe.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new ue(pe.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let a=e.mode??"form",o=r?.validateAcceptedContent??!0;switch(a){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},n=await this.request({method:"elicitation/create",params:s},t);if(o&&n.action==="accept"&&n.content&&s.requestedSchema)try{let l=this._jsonSchemaValidator.getValidator(s.requestedSchema)(n.content);if(!l.valid)throw new ae(J.InvalidParams,`Elicitation response content does not match requested schema: ${l.errorMessage}`)}catch(l){if(l instanceof ae)throw l;throw new ae(J.InternalError,`Error validating elicitation response: ${l instanceof Error?l.message:String(l)}`)}return n}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new ue(pe.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function jg(e){return{...e}}var Py=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Sl;try{let r=vt(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}constructor(e,t){if(this.server=new qg(e,t),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?vt(t.inputSchema,"input"):Sl,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)r.outputSchema=vt(t.outputSchema,"output");return r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new ae(J.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new ae(J.InvalidParams,`Tool ${e.params.name} disabled`);try{let a=await this.validateToolInput(r,e.params.arguments,e.params.name),o=await this.executeToolHandler(r,a,t);if(await this.validateToolOutput(r,o,e.params.name),_t(o))return o;return this.server.projectCallToolResult(o,r.outputSchemaJson)}catch(a){if(a instanceof ae&&a.code===J.UrlElicitationRequired)throw a;return this.createToolError(a instanceof Error?a.message:String(a))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(!e.inputSchema)return;let a=await Mt(e.inputSchema,t??{});if(!a.success)throw new ae(J.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${a.error}`);return a.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(_t(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new ae(J.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let a=await Mt(e.outputSchema,t.structuredContent);if(!a.success)throw new ae(J.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${a.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return Nc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Ic(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ae(J.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new ae(J.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new ae(J.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Pa;let a=Rl(bl(r.argsSchema)?.[e.params.argument.name]);if(!hl(a))return Pa;let o=gg(a);if(!o)return Pa;return vl(await o(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((o)=>o.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Pa;throw new ae(J.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let a=r.resourceTemplate.completeCallback(e.params.argument.name);if(!a)return Pa;return vl(await a(e.params.argument.value,e.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([o,s])=>s.enabled).map(([o,s])=>({uri:o,name:s.name,...s.metadata})),a=[];for(let o of Object.values(this._registeredResourceTemplates)){if(!o.resourceTemplate.listCallback)continue;let s=await o.resourceTemplate.listCallback(t);for(let n of s.resources)a.push({...o.metadata,...n})}return{resources:[...r,...a]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new ae(J.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let a=this._registeredResources[r.toString()];if(a){if(!a.enabled)throw new ae(J.InvalidParams,`Resource ${r} disabled`);return xs(await a.readCallback(r,t),a.cacheHint)}for(let o of Object.values(this._registeredResourceTemplates)){let s=o.resourceTemplate.uriTemplate.match(r.toString());if(s)return xs(await o.readCallback(r,s,t),o.cacheHint)}throw new ni(e.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Mc(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new ae(J.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new ae(J.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,r,a){let o=r.cacheHint,s=r;if(o!==void 0){si(o,`resource ${e}`);let n={...r};delete n.cacheHint,s=n}if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,r.title,t,s,a);if(o!==void 0)n.cacheHint=o;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,r.title,t,s,a);if(o!==void 0)n.cacheHint=o;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,r,a,o){let s={name:e,title:t,metadata:a,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({uri:null}),update:(n)=>{if(n.uri!==void 0&&n.uri!==r){if(delete this._registeredResources[r],n.uri)this._registeredResources[n.uri]=s}if(n.name!==void 0)s.name=n.name;if(n.title!==void 0)s.title=n.title;if(n.metadata!==void 0)s.metadata=n.metadata;if(n.callback!==void 0)s.readCallback=n.callback;if(n.enabled!==void 0)s.enabled=n.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(e,t,r,a,o){let s={resourceTemplate:r,title:t,metadata:a,readCallback:o,enabled:!0,disable:()=>s.update({enabled:!1}),enable:()=>s.update({enabled:!0}),remove:()=>s.update({name:null}),update:(l)=>{if(l.name!==void 0&&l.name!==e){if(delete this._registeredResourceTemplates[e],l.name)this._registeredResourceTemplates[l.name]=s}if(l.title!==void 0)s.title=l.title;if(l.template!==void 0)s.resourceTemplate=l.template;if(l.metadata!==void 0)s.metadata=l.metadata;if(l.callback!==void 0)s.readCallback=l.callback;if(l.enabled!==void 0)s.enabled=l.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=s;let n=r.uriTemplate.variableNames;if(Array.isArray(n)&&n.some((l)=>!!r.completeCallback(l)))this.setCompletionRequestHandler();return s}_createRegisteredPrompt(e,t,r,a,o,s,n){let l=a,c=o,u={title:t,description:r,argsSchema:a,icons:s,_meta:n,handler:_l(e,a,o),enabled:!0,disable:()=>u.update({enabled:!1}),enable:()=>u.update({enabled:!0}),remove:()=>u.update({name:null}),update:(h)=>{if(h.name!==void 0&&h.name!==e){if(delete this._registeredPrompts[e],h.name)this._registeredPrompts[h.name]=u}if(h.title!==void 0)u.title=h.title;if(h.description!==void 0)u.description=h.description;if(h.icons!==void 0)u.icons=h.icons;if(h._meta!==void 0)u._meta=h._meta;let f=!1;if(h.argsSchema!==void 0)u.argsSchema=h.argsSchema,l=h.argsSchema,f=!0;if(h.callback!==void 0)c=h.callback,f=!0;if(f)u.handler=_l(e,l,c);if(h.enabled!==void 0)u.enabled=h.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=u,a){let h=bl(a);if(h){if(Object.values(h).some((f)=>hl(Rl(f))))this.setCompletionRequestHandler()}}return u}_createRegisteredTool(e,t,r,a,o,s,n,l,c,u){if(pi(e),a!==void 0)try{let z=vt(a,"input");this._toolInputSchemaJson[e]=z;let E=Oc(z);if(!E.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${E.reason}`)}catch{}let h=u,f={title:t,description:r,inputSchema:a,outputSchema:o,outputSchemaJson:yl(o),annotations:s,icons:n,execution:l,_meta:c,handler:u,executor:gl(a,u),enabled:!0,disable:()=>f.update({enabled:!1}),enable:()=>f.update({enabled:!0}),remove:()=>f.update({name:null}),update:(z)=>{if(z.name!==void 0&&z.name!==e){if(typeof z.name==="string")pi(z.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],z.name)delete this._toolInputSchemaJson[z.name],this._registeredTools[z.name]=f,e=z.name}if(z.title!==void 0)f.title=z.title;if(z.description!==void 0)f.description=z.description;let E=!1;if(z.paramsSchema!==void 0)f.inputSchema=z.paramsSchema,delete this._toolInputSchemaJson[e],E=!0;if(z.callback!==void 0)f.handler=z.callback,h=z.callback,E=!0;if(E)f.executor=gl(f.inputSchema,h);if(z.outputSchema!==void 0)f.outputSchema=z.outputSchema,f.outputSchemaJson=yl(z.outputSchema);if(z.annotations!==void 0)f.annotations=z.annotations;if(z.icons!==void 0)f.icons=z.icons;if(z._meta!==void 0)f._meta=z._meta;if(z.enabled!==void 0)f.enabled=z.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:a,description:o,inputSchema:s,outputSchema:n,annotations:l,icons:c,_meta:u}=t;return this._createRegisteredTool(e,a,o,Js(s),Js(n),l,c,void 0,u,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:a,description:o,argsSchema:s,icons:n,_meta:l}=t,c=this._createRegisteredPrompt(e,a,o,Js(s),r,n,l);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}};function gl(e,t){if(e){let a=t;return async(o,s)=>a(o,s)}let r=t;return async(a,o)=>r(o)}var Sl={type:"object",properties:{}};function yl(e){if(e===void 0)return;try{return vt(e,"output")}catch{return}}function _l(e,t,r){if(t){let a=r;return async(o,s)=>{let n=await Mt(t,o);if(!n.success)throw new ae(J.InvalidParams,`Invalid arguments for prompt ${e}: ${n.error}`);return a(n.data,s)}}else{let a=r;return async(o,s)=>a(s)}}function vl(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Pa={completion:{values:[],hasMore:!1}};function bl(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function Ng(e){return e?.type==="optional"}function Rl(e){if(!Ng(e))return e;return e.def?.innerType??e}
15
- export{op as V,aS as W,J as X,Ec as Y,ui as Z,lh as _,uh as $,dh as aa,ph as ba,hh as ca,ic as da,fh as ea,uS as fa,dS as ga,fS as ha,SS as ia,yS as ja,yy as ka,_g as la,zy as ma,$y as na,Ey as oa,Py as pa};
15
+ export{op as $,aS as aa,J as ba,Ec as ca,ui as da,lh as ea,uh as fa,dh as ga,ph as ha,hh as ia,ic as ja,fh as ka,uS as la,dS as ma,fS as na,SS as oa,yS as pa,yy as qa,_g as ra,zy as sa,$y as ta,Ey as ua,Py as va};