Update to pen.dev
Snapshot Nov 3, 2026 · 00:15 UTC · version 0.1.3
Package or technical metadata updated
Package or technical metadata updated
Observed in package metadata. These changes alone do not establish a new customer-facing feature.
Up to 3 plugins free · no card required.
All fields and original values.
These are saved file metadata. Open a changed file to read its text edits.
Package file
Oct 24, 2026 · 13:31 UTC
Not present
Nov 3, 2026 · 00:15 UTC
{"sha256":"665acbc2f2aefd99fd9171ee307589e39a52f2a3ebf9366f3e93f7dfe01b34a4","size":2155}
Package file
Oct 24, 2026 · 13:31 UTC
a730f0c1df198931030fda13bdb9c60d574717a3abcf43a7fd9ac5cb98da4eef
Nov 3, 2026 · 00:15 UTC
c097a8007b79b8b4d425e2949d3880e1e84191cc06e3310e150ee3671693c245
Package file
Oct 24, 2026 · 13:31 UTC
265165
Nov 3, 2026 · 00:15 UTC
268805
Package file
Oct 24, 2026 · 13:31 UTC
be66dfd8f287951cf667db8da872a7e29f9a9a989189ea82b35bdee9e7590353
Nov 3, 2026 · 00:15 UTC
5c8c23f88ab5abd38857a892b74113ebfe712114807b9eebdae496143fae32e5
Compare saved observations
Download comparison JSONChanged files
Choose a file to see its text changes. Binary or large files show metadata only.
bin/pen-mcp-windows-arm64.exe →
skills/pen-dev/code-website.md →
skills/pen-dev/competitive-research.md →
skills/pen-dev/guide/add-stacked-animations.md →
skills/pen-dev/guide/make-website-responsive.md →
skills/pen-dev/guide/whiteboard-example.md →
skills/pen-dev/pen-schema.md →
skills/pen-dev/recruiting-profiles.md →
skills/pen-dev/scripts-and-shaders.md →
bin/editor.html
− removed · + added
--- before +++ after @@ -4,6 +4,8 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="pen-editor-url" content="__PEN_EDITOR_URL__" /> + <meta name="pen-install-id" content="__PEN_INSTALL_ID__" /> + <meta name="pen-analytics-consent" content="__PEN_ANALYTICS_CONSENT__" /> <title>pen.dev</title> <style> :root { @@ -121,6 +123,21 @@ line-height: 1.5; color: var(--color-text-secondary, var(--muted)); } + #take-over, + #retry { + padding: 6px 14px; + border: 1px solid var(--track); + border-radius: 8px; + background: transparent; + color: var(--color-text-primary, var(--fg)); + font: inherit; + font-size: 13px; + cursor: pointer; + } + #take-over[hidden], + #retry[hidden] { + display: none; + } @keyframes spin { to { transform: rotate(360deg); @@ -132,10 +149,10 @@ } } </style> - <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function o(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=o(s);fetch(s.href,a)}})();function Ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qn={exports:{}},bi;function zl(){return bi||(bi=1,(function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(o=!1));function s(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,S,b){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new s(h,S||u,b),R=o?o+d:d;return u._events[R]?u._events[R].fn?u._events[R]=[u._events[R],f]:u._events[R].push(f):(u._events[R]=f,u._eventsCount++),u}function r(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],h,S;if(this._eventsCount===0)return d;for(S in h=this._events)t.call(h,S)&&d.push(o?S.slice(1):S);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},c.prototype.listeners=function(d){var h=o?o+d:d,S=this._events[h];if(!S)return[];if(S.fn)return[S.fn];for(var b=0,f=S.length,R=new Array(f);b<f;b++)R[b]=S[b].fn;return R},c.prototype.listenerCount=function(d){var h=o?o+d:d,S=this._events[h];return S?S.fn?1:S.length:0},c.prototype.emit=function(d,h,S,b,f,R){var P=o?o+d:d;if(!this._events[P])return!1;var v=this._events[P],A=arguments.length,j,x;if(v.fn){switch(v.once&&this.removeListener(d,v.fn,void 0,!0),A){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,h),!0;case 3:return v.fn.call(v.context,h,S),!0;case 4:return v.fn.call(v.context,h,S,b),!0;case 5:return v.fn.call(v.context,h,S,b,f),!0;case 6:return v.fn.call(v.context,h,S,b,f,R),!0}for(x=1,j=new Array(A-1);x<A;x++)j[x-1]=arguments[x];v.fn.apply(v.context,j)}else{var N=v.length,$;for(x=0;x<N;x++)switch(v[x].once&&this.removeListener(d,v[x].fn,void 0,!0),A){case 1:v[x].fn.call(v[x].context);break;case 2:v[x].fn.call(v[x].context,h);break;case 3:v[x].fn.call(v[x].context,h,S);break;case 4:v[x].fn.call(v[x].context,h,S,b);break;default:if(!j)for($=1,j=new Array(A-1);$<A;$++)j[$-1]=arguments[$];v[x].fn.apply(v[x].context,j)}}return!0},c.prototype.on=function(d,h,S){return a(this,d,h,S,!1)},c.prototype.once=function(d,h,S){return a(this,d,h,S,!0)},c.prototype.removeListener=function(d,h,S,b){var f=o?o+d:d;if(!this._events[f])return this;if(!h)return r(this,f),this;var R=this._events[f];if(R.fn)R.fn===h&&(!b||R.once)&&(!S||R.context===S)&&r(this,f);else{for(var P=0,v=[],A=R.length;P<A;P++)(R[P].fn!==h||b&&!R[P].once||S&&R[P].context!==S)&&v.push(R[P]);v.length?this._events[f]=v.length===1?v[0]:v:r(this,f)}return this},c.prototype.removeAllListeners=function(d){var h;return d?(h=o?o+d:d,this._events[h]&&r(this,h)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,e.exports=c})(Qn)),Qn.exports}zl();var Xn={exports:{}},vi;function Ml(){return vi||(vi=1,(function(e){var t=(()=>{var o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(N,$,O)=>$ in N?o(N,$,{enumerable:!0,configurable:!0,writable:!0,value:O}):N[$]=O,d=(N,$)=>{for(var O in $||($={}))r.call($,O)&&u(N,O,$[O]);if(a)for(var O of a($))c.call($,O)&&u(N,O,$[O]);return N},h=(N,$)=>{for(var O in $)o(N,O,{get:$[O],enumerable:!0})},S=(N,$,O,G)=>{if($&&typeof $=="object"||typeof $=="function")for(let ne of s($))!r.call(N,ne)&&ne!==O&&o(N,ne,{get:()=>$[ne],enumerable:!(G=n($,ne))||G.enumerable});return N},b=N=>S(o({},"__esModule",{value:!0}),N),f=(N,$,O)=>u(N,typeof $!="symbol"?$+"":$,O),R={};h(R,{DEFAULT_OPTIONS:()=>A,DEFAULT_UUID_LENGTH:()=>v,default:()=>x});var P="5.3.2",v=6,A={dictionary:"alphanum",shuffle:!0,debug:!1,length:v,counter:0},j=class{constructor($={}){f(this,"counter"),f(this,"debug"),f(this,"dict"),f(this,"version"),f(this,"dictIndex",0),f(this,"dictRange",[]),f(this,"lowerBound",0),f(this,"upperBound",0),f(this,"dictLength",0),f(this,"uuidLength"),f(this,"_digit_first_ascii",48),f(this,"_digit_last_ascii",58),f(this,"_alpha_lower_first_ascii",97),f(this,"_alpha_lower_last_ascii",123),f(this,"_hex_last_ascii",103),f(this,"_alpha_upper_first_ascii",65),f(this,"_alpha_upper_last_ascii",91),f(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),f(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),f(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),f(this,"log",(...q)=>{const L=[...q];if(L[0]="[short-unique-id] ".concat(q[0]),this.debug===!0&&typeof console<"u"&&console!==null){console.log(...L);return}}),f(this,"_normalizeDictionary",(q,L)=>{let M;if(q&&Array.isArray(q)&&q.length>1)M=q;else{M=[],this.dictIndex=0;const F="_".concat(q,"_dict_ranges"),Z=this._dict_ranges[F];let H=0;for(const[,fe]of Object.entries(Z)){const[ae,ge]=fe;H+=Math.abs(ge-ae)}M=new Array(H);let Y=0;for(const[,fe]of Object.entries(Z)){this.dictRange=fe,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const ae=this.lowerBound<=this.upperBound,ge=this.lowerBound,Te=this.upperBound;if(ae)for(let ce=ge;ce<Te;ce++)M[Y++]=String.fromCharCode(ce),this.dictIndex=ce;else for(let ce=ge;ce>Te;ce--)M[Y++]=String.fromCharCode(ce),this.dictIndex=ce}M.length=Y}if(L){const F=M.length;for(let Z=F-1;Z>0;Z--){const H=Math.floor(Math.random()*(Z+1));[M[Z],M[H]]=[M[H],M[Z]]}}return M}),f(this,"setDictionary",(q,L)=>{this.dict=this._normalizeDictionary(q,L),this.dictLength=this.dict.length,this.setCounter(0)}),f(this,"seq",()=>this.sequentialUUID()),f(this,"sequentialUUID",()=>{const q=this.dictLength,L=this.dict;let M=this.counter;const F=[];do{const H=M%q;M=Math.trunc(M/q),F.push(L[H])}while(M!==0);const Z=F.join("");return this.counter+=1,Z}),f(this,"rnd",(q=this.uuidLength||v)=>this.randomUUID(q)),f(this,"randomUUID",(q=this.uuidLength||v)=>{if(q===null||typeof q>"u"||q<1)throw new Error("Invalid UUID Length Provided");const L=new Array(q),M=this.dictLength,F=this.dict;for(let Z=0;Z<q;Z++){const H=Math.floor(Math.random()*M);L[Z]=F[H]}return L.join("")}),f(this,"fmt",(q,L)=>this.formattedUUID(q,L)),f(this,"formattedUUID",(q,L)=>{const M={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return q.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H=Z.slice(0,2),Y=Number.parseInt(Z.slice(2),10);return H==="$s"?M[H]().padStart(Y,"0"):H==="$t"&&L?M[H](Y,L):M[H](Y)})}),f(this,"availableUUIDs",(q=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**q).toFixed(0))),f(this,"_collisionCache",new Map),f(this,"approxMaxBeforeCollision",(q=this.availableUUIDs(this.uuidLength))=>{const L=q,M=this._collisionCache.get(L);if(M!==void 0)return M;const F=Number.parseFloat(Math.sqrt(Math.PI/2*q).toFixed(20));return this._collisionCache.set(L,F),F}),f(this,"collisionProbability",(q=this.availableUUIDs(this.uuidLength),L=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(q)/this.availableUUIDs(L)).toFixed(20))),f(this,"uniqueness",(q=this.availableUUIDs(this.uuidLength))=>{const L=Number.parseFloat((1-this.approxMaxBeforeCollision(q)/q).toFixed(20));return L>1?1:L<0?0:L}),f(this,"getVersion",()=>this.version),f(this,"stamp",(q,L)=>{const M=Math.floor(+(L||new Date)/1e3).toString(16);if(typeof q=="number"&&q===0)return M;if(typeof q!="number"||q<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join(` -`));const F=q-9,Z=Math.round(Math.random()*(F>15?15:F)),H=this.randomUUID(F);return"".concat(H.substring(0,Z)).concat(M).concat(H.substring(Z)).concat(Z.toString(16))}),f(this,"parseStamp",(q,L)=>{if(L&&!/t0|t[1-9]\d{1,}/.test(L))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const M=L?L.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H={$r:ae=>[...Array(ae)].map(()=>"r").join(""),$s:ae=>[...Array(ae)].map(()=>"s").join(""),$t:ae=>[...Array(ae)].map(()=>"t").join("")},Y=Z.slice(0,2),fe=Number.parseInt(Z.slice(2),10);return H[Y](fe)}).replace(/^(.*?)(t{8,})(.*)$/g,(Z,H,Y)=>q.substring(H.length,H.length+Y.length)):q;if(M.length===8)return new Date(Number.parseInt(M,16)*1e3);if(M.length<10)throw new Error("Stamp length invalid");const F=Number.parseInt(M.substring(M.length-1),16);return new Date(Number.parseInt(M.substring(F,F+8),16)*1e3)}),f(this,"setCounter",q=>{this.counter=q}),f(this,"validate",(q,L)=>{const M=L?this._normalizeDictionary(L):this.dict;return q.split("").every(F=>M.includes(F))});const O=d(d({},A),$);this.counter=0,this.debug=!1,this.dict=[],this.version=P;const{dictionary:G,shuffle:ne,length:se,counter:$e}=O;this.uuidLength=se,this.setDictionary(G,ne),this.setCounter($e),this.debug=O.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};f(j,"default",j);var x=j;return b(R)})();e.exports=t.default,typeof window<"u"&&(t=t.default)})(Xn)),Xn.exports}var Ll=Ml();const ur=Ol(Ll),Al=[{fileName:"pencil-shadcn.pen",title:"shadcn/ui",description:"shadcn/ui component kit",thumbnail:"design-kit-shadcn"},{fileName:"pencil-heroui.pen",title:"HeroUI",description:"HeroUI component kit",thumbnail:"design-kit-heroui"},{fileName:"pencil-halo.pen",title:"Halo",description:"Halo design system",thumbnail:"design-kit-halo"},{fileName:"pencil-lunaris.pen",title:"Lunaris",description:"Lunaris design system",thumbnail:"design-kit-lunaris"},{fileName:"pencil-nitro.pen",title:"Nitro",description:"Nitro design system",thumbnail:"design-kit-nitro"}];function Ul(e){for(const t of Al)if(t.fileName===e)return t}let zo=(function(e){return e[e.Saved=0]="Saved",e[e.NothingToSave=1]="NothingToSave",e[e.Cancelled=2]="Cancelled",e[e.DiskFull=3]="DiskFull",e[e.NotPermitted=4]="NotPermitted",e[e.ReadOnlyDisk=5]="ReadOnlyDisk",e[e.FolderMissing=6]="FolderMissing",e[e.FileInUse=7]="FileInUse",e[e.DocumentUnreadable=8]="DocumentUnreadable",e[e.WriteFailed=9]="WriteFailed",e})({}),yi=(function(e){return e[e.File=0]="File",e[e.Managed=1]="Managed",e[e.Bundled=2]="Bundled",e})({}),jl=(function(e){return e[e.None=0]="None",e[e.Snapshot=1]="Snapshot",e[e.Artwork=2]="Artwork",e})({}),Zl=(function(e){return e[e.FromRecents=0]="FromRecents",e[e.Delete=1]="Delete",e})({});const Dl={3:{cause:"The disk is full.",advice:"Free up space and try again."},4:{cause:"You don't have permission to save here.",advice:"Use File > Save As to pick another location."},5:{cause:"This disk is read only.",advice:"Use File > Save As to pick another location."},6:{cause:"This folder no longer exists.",advice:"Use File > Save As to pick another location."},7:{cause:"Another program is using this file.",advice:"Close that program and try again."},8:{cause:"Something went wrong while preparing your document.",advice:"Try saving again."},9:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},0:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},2:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},1:{cause:"Something went wrong while writing the file.",advice:"Try saving again."}};function Hl(e){return Dl[e].cause}function Fl(e,t){switch(t){case 2:{const o=Ul(e);return o!=null?o.title:e}case 1:case 0:return e;default:throw new Error(`Unhandled document kind: ${t}`)}}function et(e){const t=`ftyp${e}`,o=new Uint8Array(12),n=new Uint8Array(12);for(let s=0;s<t.length;s++)o[s+4]=t.charCodeAt(s),n[s+4]=255;return{magic:o,mask:n}}new Uint8Array([137,80,78,71,13,10,26,10]),new Uint8Array([71,73,70,56,55,97]),new Uint8Array([71,73,70,56,57,97]),new Uint8Array([255,216,255]),new Uint8Array([82,73,70,70,0,0,0,0,87,69,66,80]),new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255]),{...et("avif")},{...et("avis")},{...et("heic")},{...et("heix")},{...et("hevc")},{...et("mif1")},{...et("msf1")},new Uint8Array([0,0,1,0]),new Uint8Array([66,77]);const{randomUUID:FS}=new ur({length:5}),{randomUUID:JS}=new ur({length:1,dictionary:"alpha"});var Jl=Object.create,ws=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,Bl=Object.getOwnPropertyNames,Wl=Object.getPrototypeOf,Gl=Object.prototype.hasOwnProperty,Kl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yl=(e,t)=>{let o={};for(var n in e)ws(o,n,{get:e[n],enumerable:!0});return o},Ql=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=Bl(t),a=0,r=s.length,c;a<r;a++)c=s[a],!Gl.call(e,c)&&c!==o&&ws(e,c,{get:(u=>t[u]).bind(null,c),enumerable:!(n=Vl(t,c))||n.enumerable});return e},Xl=(e,t,o)=>(o=e!=null?Jl(Wl(e)):{},Ql(ws(o,"default",{value:e,enumerable:!0}),e));const eu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function tu(e){return typeof e=="string"&&eu.has(e.replace(/#$/,""))}var Ri;const ou=Object.freeze({status:"aborted"});function g(e,t,o){function n(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:r,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);const d=r.prototype,h=Object.keys(d);for(let S=0;S<h.length;S++){const b=h[S];b in c||(c[b]=d[b].bind(c))}}const s=o?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function r(c){var u;const d=o?.Parent?new a:this;n(d,c),(u=d._zod).deferred??(u.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(r,"init",{value:n}),Object.defineProperty(r,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Tt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ri=globalThis).__zod_globalConfig??(Ri.__zod_globalConfig={});const _n=globalThis.__zod_globalConfig;function Ne(e){return e&&Object.assign(_n,e),_n}function dr(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function us(e,t){return typeof t=="bigint"?t.toString():t}function xn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ts(e){return e==null}function Ps(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function nu(e,t){const o=e/t,n=Math.round(o),s=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-n)<s?0:o-n}const wi=Symbol("evaluating");function D(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==wi)return n===void 0&&(n=wi,n=o()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function it(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function je(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function Ti(e){return JSON.stringify(e)}function su(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Mo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const iu=xn(()=>{if(_n.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pt(e){if(Mo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const o=t.prototype;return!(Mo(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function hr(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const ru=new Set(["string","number","symbol"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ze(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function au(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const cu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function lu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=je(e._zod.def,{get shape(){const r={};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(r[c]=o.shape[c])}return it(this,"shape",r),r},checks:[]});return Ze(e,a)}function uu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=je(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete r[c]}return it(this,"shape",r),r},checks:[]});return Ze(e,a)}function pu(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0){const a=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(a,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=je(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return it(this,"shape",a),a}});return Ze(e,s)}function du(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o=je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return it(this,"shape",n),n}});return Ze(e,o)}function mu(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const o=je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return it(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ze(e,o)}function hu(e,t,o){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=je(t._zod.def,{get shape(){const c=t._zod.def.shape,u={...c};if(o)for(const d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(u[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(const d in c)u[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return it(this,"shape",u),u},checks:[]});return Ze(t,r)}function fu(e,t,o){const n=je(t._zod.def,{get shape(){const s=t._zod.def.shape,a={...s};if(o)for(const r in o){if(!(r in a))throw new Error(`Unrecognized key: "${r}"`);o[r]&&(a[r]=new e({type:"nonoptional",innerType:s[r]}))}else for(const r in s)a[r]=new e({type:"nonoptional",innerType:s[r]});return it(this,"shape",a),a}});return Ze(t,n)}function Rt(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function gu(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function wt(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function un(e){return typeof e=="string"?e:e?.message}function xe(e,t,o){const n=e.message?e.message:un(e.inst?._zod.def?.error?.(e))??un(t?.error?.(e))??un(o.customError?.(e))??un(o.localeError?.(e))??"Invalid input",{inst:s,continue:a,input:r,...c}=e;return c.path??(c.path=[]),c.message=n,t?.reportInput&&(c.input=r),c}function Cs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Lo(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const fr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,us,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gr=g("$ZodError",fr),Sr=g("$ZodError",fr,{Parent:Error});function Su(e,t=o=>o.message){const o={},n=[];for(const s of e.issues)s.path.length>0?(o[s.path[0]]=o[s.path[0]]||[],o[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:o}}function _u(e,t=o=>o.message){const o={_errors:[]},n=(s,a=[])=>{for(const r of s.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(c=>n({issues:c},[...a,...r.path]));else if(r.code==="invalid_key")n({issues:r.issues},[...a,...r.path]);else if(r.code==="invalid_element")n({issues:r.issues},[...a,...r.path]);else{const c=[...a,...r.path];if(c.length===0)o._errors.push(t(r));else{let u=o,d=0;for(;d<c.length;){const h=c[d];d===c.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(r))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}}};return n(e),o}const Es=e=>(t,o,n,s)=>{const a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise)throw new Tt;if(r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>xe(u,a,Ne())));throw mr(c,s?.callee),c}return r.value},ks=e=>async(t,o,n,s)=>{const a=n?{...n,async:!0}:{async:!0};let r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise&&(r=await r),r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>xe(u,a,Ne())));throw mr(c,s?.callee),c}return r.value},On=e=>(t,o,n)=>{const s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},s);if(a instanceof Promise)throw new Tt;return a.issues.length?{success:!1,error:new(e??gr)(a.issues.map(r=>xe(r,s,Ne())))}:{success:!0,data:a.value}},bu=On(Sr),zn=e=>async(t,o,n)=>{const s=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:o,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(r=>xe(r,s,Ne())))}:{success:!0,data:a.value}},vu=zn(Sr),yu=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Es(e)(t,o,s)},Ru=e=>(t,o,n)=>Es(e)(t,o,n),wu=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return ks(e)(t,o,s)},Tu=e=>async(t,o,n)=>ks(e)(t,o,n),Pu=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return On(e)(t,o,s)},Cu=e=>(t,o,n)=>On(e)(t,o,n),Eu=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return zn(e)(t,o,s)},ku=e=>async(t,o,n)=>zn(e)(t,o,n),$u=/^[cC][0-9a-z]{6,}$/,qu=/^[0-9a-z]+$/,Iu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nu=/^[0-9a-vA-V]{20}$/,xu=/^[A-Za-z0-9]{27}$/,Ou=/^[a-zA-Z0-9_-]{21}$/,zu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Pi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Lu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Au="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Uu(){return new RegExp(Au,"u")}const ju=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Zu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Du=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hu=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_r=/^[A-Za-z0-9_-]*$/,Ju=/^https?$/,Vu=/^\+[1-9]\d{6,14}$/,br="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Bu=new RegExp(`^${br}$`);function vr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wu(e){return new RegExp(`^${vr(e)}$`)}function Gu(e){const t=vr({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${br}T(?:${n})$`)}const Ku=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Yu=/^-?\d+$/,yr=/^-?\d+(?:\.\d+)?$/,Qu=/^(?:true|false)$/i,Xu=/^null$/i,ep=/^undefined$/i,tp=/^[^A-Z]*$/,op=/^[^a-z]*$/,be=g("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Rr={number:"number",bigint:"bigint",object:"date"},wr=g("$ZodCheckLessThan",(e,t)=>{be.init(e,t);const o=Rr[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tr=g("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);const o=Rr[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),np=g("$ZodCheckMultipleOf",(e,t)=>{be.init(e,t),e._zod.onattach.push(o=>{var n;(n=o._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):nu(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),sp=g("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";const o=t.format?.includes("int"),n=o?"int":"number",[s,a]=cu[t.format];e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,c.minimum=s,c.maximum=a,o&&(c.pattern=Yu)}),e._zod.check=r=>{const c=r.value;if(o){if(!Number.isInteger(c)){r.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?r.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):r.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<s&&r.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),c>a&&r.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ip=g("$ZodCheckMaxLength",(e,t)=>{var o;be.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!Ts(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const r=Cs(s);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),rp=g("$ZodCheckMinLength",(e,t)=>{var o;be.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!Ts(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const r=Cs(s);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ap=g("$ZodCheckLengthEquals",(e,t)=>{var o;be.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!Ts(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,a=s.length;if(a===t.length)return;const r=Cs(s),c=a>t.length;n.issues.push({origin:r,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mn=g("$ZodCheckStringFormat",(e,t)=>{var o,n;be.init(e,t),e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),cp=g("$ZodCheckRegex",(e,t)=>{Mn.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lp=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tp),Mn.init(e,t)}),up=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=op),Mn.init(e,t)}),pp=g("$ZodCheckIncludes",(e,t)=>{be.init(e,t);const o=Ct(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),dp=g("$ZodCheckStartsWith",(e,t)=>{be.init(e,t);const o=new RegExp(`^${Ct(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mp=g("$ZodCheckEndsWith",(e,t)=>{be.init(e,t);const o=new RegExp(`.*${Ct(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),hp=g("$ZodCheckOverwrite",(e,t)=>{be.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class fp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(` + <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function o(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=o(s);fetch(s.href,a)}})();function Kl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ns={exports:{}},Pi;function Yl(){return Pi||(Pi=1,(function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(o=!1));function s(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,S,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new s(h,S||u,v),R=o?o+d:d;return u._events[R]?u._events[R].fn?u._events[R]=[u._events[R],f]:u._events[R].push(f):(u._events[R]=f,u._eventsCount++),u}function r(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],h,S;if(this._eventsCount===0)return d;for(S in h=this._events)t.call(h,S)&&d.push(o?S.slice(1):S);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},c.prototype.listeners=function(d){var h=o?o+d:d,S=this._events[h];if(!S)return[];if(S.fn)return[S.fn];for(var v=0,f=S.length,R=new Array(f);v<f;v++)R[v]=S[v].fn;return R},c.prototype.listenerCount=function(d){var h=o?o+d:d,S=this._events[h];return S?S.fn?1:S.length:0},c.prototype.emit=function(d,h,S,v,f,R){var P=o?o+d:d;if(!this._events[P])return!1;var b=this._events[P],A=arguments.length,j,x;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),A){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,S),!0;case 4:return b.fn.call(b.context,h,S,v),!0;case 5:return b.fn.call(b.context,h,S,v,f),!0;case 6:return b.fn.call(b.context,h,S,v,f,R),!0}for(x=1,j=new Array(A-1);x<A;x++)j[x-1]=arguments[x];b.fn.apply(b.context,j)}else{var N=b.length,$;for(x=0;x<N;x++)switch(b[x].once&&this.removeListener(d,b[x].fn,void 0,!0),A){case 1:b[x].fn.call(b[x].context);break;case 2:b[x].fn.call(b[x].context,h);break;case 3:b[x].fn.call(b[x].context,h,S);break;case 4:b[x].fn.call(b[x].context,h,S,v);break;default:if(!j)for($=1,j=new Array(A-1);$<A;$++)j[$-1]=arguments[$];b[x].fn.apply(b[x].context,j)}}return!0},c.prototype.on=function(d,h,S){return a(this,d,h,S,!1)},c.prototype.once=function(d,h,S){return a(this,d,h,S,!0)},c.prototype.removeListener=function(d,h,S,v){var f=o?o+d:d;if(!this._events[f])return this;if(!h)return r(this,f),this;var R=this._events[f];if(R.fn)R.fn===h&&(!v||R.once)&&(!S||R.context===S)&&r(this,f);else{for(var P=0,b=[],A=R.length;P<A;P++)(R[P].fn!==h||v&&!R[P].once||S&&R[P].context!==S)&&b.push(R[P]);b.length?this._events[f]=b.length===1?b[0]:b:r(this,f)}return this},c.prototype.removeAllListeners=function(d){var h;return d?(h=o?o+d:d,this._events[h]&&r(this,h)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=o,c.EventEmitter=c,e.exports=c})(ns)),ns.exports}Yl();var ss={exports:{}},Ci;function Ql(){return Ci||(Ci=1,(function(e){var t=(()=>{var o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(N,$,O)=>$ in N?o(N,$,{enumerable:!0,configurable:!0,writable:!0,value:O}):N[$]=O,d=(N,$)=>{for(var O in $||($={}))r.call($,O)&&u(N,O,$[O]);if(a)for(var O of a($))c.call($,O)&&u(N,O,$[O]);return N},h=(N,$)=>{for(var O in $)o(N,O,{get:$[O],enumerable:!0})},S=(N,$,O,G)=>{if($&&typeof $=="object"||typeof $=="function")for(let se of s($))!r.call(N,se)&&se!==O&&o(N,se,{get:()=>$[se],enumerable:!(G=n($,se))||G.enumerable});return N},v=N=>S(o({},"__esModule",{value:!0}),N),f=(N,$,O)=>u(N,typeof $!="symbol"?$+"":$,O),R={};h(R,{DEFAULT_OPTIONS:()=>A,DEFAULT_UUID_LENGTH:()=>b,default:()=>x});var P="5.3.2",b=6,A={dictionary:"alphanum",shuffle:!0,debug:!1,length:b,counter:0},j=class{constructor($={}){f(this,"counter"),f(this,"debug"),f(this,"dict"),f(this,"version"),f(this,"dictIndex",0),f(this,"dictRange",[]),f(this,"lowerBound",0),f(this,"upperBound",0),f(this,"dictLength",0),f(this,"uuidLength"),f(this,"_digit_first_ascii",48),f(this,"_digit_last_ascii",58),f(this,"_alpha_lower_first_ascii",97),f(this,"_alpha_lower_last_ascii",123),f(this,"_hex_last_ascii",103),f(this,"_alpha_upper_first_ascii",65),f(this,"_alpha_upper_last_ascii",91),f(this,"_number_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii]}),f(this,"_alpha_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alpha_lower_dict_ranges",{lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alpha_upper_dict_ranges",{upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_alphanum_lower_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],lowerCase:[this._alpha_lower_first_ascii,this._alpha_lower_last_ascii]}),f(this,"_alphanum_upper_dict_ranges",{digits:[this._digit_first_ascii,this._digit_last_ascii],upperCase:[this._alpha_upper_first_ascii,this._alpha_upper_last_ascii]}),f(this,"_hex_dict_ranges",{decDigits:[this._digit_first_ascii,this._digit_last_ascii],alphaDigits:[this._alpha_lower_first_ascii,this._hex_last_ascii]}),f(this,"_dict_ranges",{_number_dict_ranges:this._number_dict_ranges,_alpha_dict_ranges:this._alpha_dict_ranges,_alpha_lower_dict_ranges:this._alpha_lower_dict_ranges,_alpha_upper_dict_ranges:this._alpha_upper_dict_ranges,_alphanum_dict_ranges:this._alphanum_dict_ranges,_alphanum_lower_dict_ranges:this._alphanum_lower_dict_ranges,_alphanum_upper_dict_ranges:this._alphanum_upper_dict_ranges,_hex_dict_ranges:this._hex_dict_ranges}),f(this,"log",(...q)=>{const L=[...q];if(L[0]="[short-unique-id] ".concat(q[0]),this.debug===!0&&typeof console<"u"&&console!==null){console.log(...L);return}}),f(this,"_normalizeDictionary",(q,L)=>{let M;if(q&&Array.isArray(q)&&q.length>1)M=q;else{M=[],this.dictIndex=0;const F="_".concat(q,"_dict_ranges"),Z=this._dict_ranges[F];let H=0;for(const[,fe]of Object.entries(Z)){const[ce,ge]=fe;H+=Math.abs(ge-ce)}M=new Array(H);let Y=0;for(const[,fe]of Object.entries(Z)){this.dictRange=fe,this.lowerBound=this.dictRange[0],this.upperBound=this.dictRange[1];const ce=this.lowerBound<=this.upperBound,ge=this.lowerBound,Te=this.upperBound;if(ce)for(let le=ge;le<Te;le++)M[Y++]=String.fromCharCode(le),this.dictIndex=le;else for(let le=ge;le>Te;le--)M[Y++]=String.fromCharCode(le),this.dictIndex=le}M.length=Y}if(L){const F=M.length;for(let Z=F-1;Z>0;Z--){const H=Math.floor(Math.random()*(Z+1));[M[Z],M[H]]=[M[H],M[Z]]}}return M}),f(this,"setDictionary",(q,L)=>{this.dict=this._normalizeDictionary(q,L),this.dictLength=this.dict.length,this.setCounter(0)}),f(this,"seq",()=>this.sequentialUUID()),f(this,"sequentialUUID",()=>{const q=this.dictLength,L=this.dict;let M=this.counter;const F=[];do{const H=M%q;M=Math.trunc(M/q),F.push(L[H])}while(M!==0);const Z=F.join("");return this.counter+=1,Z}),f(this,"rnd",(q=this.uuidLength||b)=>this.randomUUID(q)),f(this,"randomUUID",(q=this.uuidLength||b)=>{if(q===null||typeof q>"u"||q<1)throw new Error("Invalid UUID Length Provided");const L=new Array(q),M=this.dictLength,F=this.dict;for(let Z=0;Z<q;Z++){const H=Math.floor(Math.random()*M);L[Z]=F[H]}return L.join("")}),f(this,"fmt",(q,L)=>this.formattedUUID(q,L)),f(this,"formattedUUID",(q,L)=>{const M={$r:this.randomUUID,$s:this.sequentialUUID,$t:this.stamp};return q.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H=Z.slice(0,2),Y=Number.parseInt(Z.slice(2),10);return H==="$s"?M[H]().padStart(Y,"0"):H==="$t"&&L?M[H](Y,L):M[H](Y)})}),f(this,"availableUUIDs",(q=this.uuidLength)=>Number.parseFloat(([...new Set(this.dict)].length**q).toFixed(0))),f(this,"_collisionCache",new Map),f(this,"approxMaxBeforeCollision",(q=this.availableUUIDs(this.uuidLength))=>{const L=q,M=this._collisionCache.get(L);if(M!==void 0)return M;const F=Number.parseFloat(Math.sqrt(Math.PI/2*q).toFixed(20));return this._collisionCache.set(L,F),F}),f(this,"collisionProbability",(q=this.availableUUIDs(this.uuidLength),L=this.uuidLength)=>Number.parseFloat((this.approxMaxBeforeCollision(q)/this.availableUUIDs(L)).toFixed(20))),f(this,"uniqueness",(q=this.availableUUIDs(this.uuidLength))=>{const L=Number.parseFloat((1-this.approxMaxBeforeCollision(q)/q).toFixed(20));return L>1?1:L<0?0:L}),f(this,"getVersion",()=>this.version),f(this,"stamp",(q,L)=>{const M=Math.floor(+(L||new Date)/1e3).toString(16);if(typeof q=="number"&&q===0)return M;if(typeof q!="number"||q<10)throw new Error(["Param finalLength must be a number greater than or equal to 10,","or 0 if you want the raw hexadecimal timestamp"].join(` +`));const F=q-9,Z=Math.round(Math.random()*(F>15?15:F)),H=this.randomUUID(F);return"".concat(H.substring(0,Z)).concat(M).concat(H.substring(Z)).concat(Z.toString(16))}),f(this,"parseStamp",(q,L)=>{if(L&&!/t0|t[1-9]\d{1,}/.test(L))throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");const M=L?L.replace(/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,Z=>{const H={$r:ce=>[...Array(ce)].map(()=>"r").join(""),$s:ce=>[...Array(ce)].map(()=>"s").join(""),$t:ce=>[...Array(ce)].map(()=>"t").join("")},Y=Z.slice(0,2),fe=Number.parseInt(Z.slice(2),10);return H[Y](fe)}).replace(/^(.*?)(t{8,})(.*)$/g,(Z,H,Y)=>q.substring(H.length,H.length+Y.length)):q;if(M.length===8)return new Date(Number.parseInt(M,16)*1e3);if(M.length<10)throw new Error("Stamp length invalid");const F=Number.parseInt(M.substring(M.length-1),16);return new Date(Number.parseInt(M.substring(F,F+8),16)*1e3)}),f(this,"setCounter",q=>{this.counter=q}),f(this,"validate",(q,L)=>{const M=L?this._normalizeDictionary(L):this.dict;return q.split("").every(F=>M.includes(F))});const O=d(d({},A),$);this.counter=0,this.debug=!1,this.dict=[],this.version=P;const{dictionary:G,shuffle:se,length:ie,counter:qe}=O;this.uuidLength=ie,this.setDictionary(G,se),this.setCounter(qe),this.debug=O.debug,this.log(this.dict),this.log("Generator instantiated with Dictionary Size ".concat(this.dictLength," and counter set to ").concat(this.counter)),this.log=this.log.bind(this),this.setDictionary=this.setDictionary.bind(this),this.setCounter=this.setCounter.bind(this),this.seq=this.seq.bind(this),this.sequentialUUID=this.sequentialUUID.bind(this),this.rnd=this.rnd.bind(this),this.randomUUID=this.randomUUID.bind(this),this.fmt=this.fmt.bind(this),this.formattedUUID=this.formattedUUID.bind(this),this.availableUUIDs=this.availableUUIDs.bind(this),this.approxMaxBeforeCollision=this.approxMaxBeforeCollision.bind(this),this.collisionProbability=this.collisionProbability.bind(this),this.uniqueness=this.uniqueness.bind(this),this.getVersion=this.getVersion.bind(this),this.stamp=this.stamp.bind(this),this.parseStamp=this.parseStamp.bind(this)}};f(j,"default",j);var x=j;return v(R)})();e.exports=t.default,typeof window<"u"&&(t=t.default)})(ss)),ss.exports}var Xl=Ql();const _r=Kl(Xl),eu=[{fileName:"pencil-shadcn.pen",title:"shadcn/ui",description:"shadcn/ui component kit",thumbnail:"design-kit-shadcn"},{fileName:"pencil-heroui.pen",title:"HeroUI",description:"HeroUI component kit",thumbnail:"design-kit-heroui"},{fileName:"pencil-halo.pen",title:"Halo",description:"Halo design system",thumbnail:"design-kit-halo"},{fileName:"pencil-lunaris.pen",title:"Lunaris",description:"Lunaris design system",thumbnail:"design-kit-lunaris"},{fileName:"pencil-nitro.pen",title:"Nitro",description:"Nitro design system",thumbnail:"design-kit-nitro"}];function tu(e){for(const t of eu)if(t.fileName===e)return t}function tt(e){const t=`ftyp${e}`,o=new Uint8Array(12),n=new Uint8Array(12);for(let s=0;s<t.length;s++)o[s+4]=t.charCodeAt(s),n[s+4]=255;return{magic:o,mask:n}}new Uint8Array([137,80,78,71,13,10,26,10]),new Uint8Array([71,73,70,56,55,97]),new Uint8Array([71,73,70,56,57,97]),new Uint8Array([255,216,255]),new Uint8Array([82,73,70,70,0,0,0,0,87,69,66,80]),new Uint8Array([255,255,255,255,0,0,0,0,255,255,255,255]),{...tt("avif")},{...tt("avis")},{...tt("heic")},{...tt("heix")},{...tt("hevc")},{...tt("mif1")},{...tt("msf1")},new Uint8Array([0,0,1,0]),new Uint8Array([37,80,68,70,45]),new Uint8Array([66,77]);let Ao=(function(e){return e[e.Saved=0]="Saved",e[e.NothingToSave=1]="NothingToSave",e[e.Cancelled=2]="Cancelled",e[e.DiskFull=3]="DiskFull",e[e.NotPermitted=4]="NotPermitted",e[e.ReadOnlyDisk=5]="ReadOnlyDisk",e[e.FolderMissing=6]="FolderMissing",e[e.FileInUse=7]="FileInUse",e[e.DocumentUnreadable=8]="DocumentUnreadable",e[e.WriteFailed=9]="WriteFailed",e})({}),Ei=(function(e){return e[e.File=0]="File",e[e.Managed=1]="Managed",e[e.Bundled=2]="Bundled",e})({}),ou=(function(e){return e[e.None=0]="None",e[e.Snapshot=1]="Snapshot",e[e.Artwork=2]="Artwork",e})({}),vr=(function(e){return e[e.FromRecents=0]="FromRecents",e[e.Delete=1]="Delete",e})({});const nu={3:{cause:"The disk is full.",advice:"Free up space and try again."},4:{cause:"You don't have permission to save here.",advice:"Use File > Save As to pick another location."},5:{cause:"This disk is read only.",advice:"Use File > Save As to pick another location."},6:{cause:"This folder no longer exists.",advice:"Use File > Save As to pick another location."},7:{cause:"Another program is using this file.",advice:"Close that program and try again."},8:{cause:"Something went wrong while preparing your document.",advice:"Try saving again."},9:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},0:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},2:{cause:"Something went wrong while writing the file.",advice:"Try saving again."},1:{cause:"Something went wrong while writing the file.",advice:"Try saving again."}};function su(e){return nu[e].cause}function iu(e,t){switch(t){case 2:{const o=tu(e);return o!=null?o.title:e}case 1:case 0:return e;default:throw new Error(`Unhandled document kind: ${t}`)}}const{randomUUID:p_}=new _r({length:5}),{randomUUID:d_}=new _r({length:1,dictionary:"alpha"});var ru=Object.create,$s=Object.defineProperty,au=Object.getOwnPropertyDescriptor,cu=Object.getOwnPropertyNames,lu=Object.getPrototypeOf,uu=Object.prototype.hasOwnProperty,pu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),du=(e,t)=>{let o={};for(var n in e)$s(o,n,{get:e[n],enumerable:!0});return o},mu=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=cu(t),a=0,r=s.length,c;a<r;a++)c=s[a],!uu.call(e,c)&&c!==o&&$s(e,c,{get:(u=>t[u]).bind(null,c),enumerable:!(n=au(t,c))||n.enumerable});return e},hu=(e,t,o)=>(o=e!=null?ru(lu(e)):{},mu($s(o,"default",{value:e,enumerable:!0}),e));const fu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]);function gu(e){return typeof e=="string"&&fu.has(e.replace(/#$/,""))}var ki;const Su=Object.freeze({status:"aborted"});function g(e,t,o){function n(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:r,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,u);const d=r.prototype,h=Object.keys(d);for(let S=0;S<h.length;S++){const v=h[S];v in c||(c[v]=d[v].bind(c))}}const s=o?.Parent??Object;class a extends s{}Object.defineProperty(a,"name",{value:e});function r(c){var u;const d=o?.Parent?new a:this;n(d,c),(u=d._zod).deferred??(u.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(r,"init",{value:n}),Object.defineProperty(r,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Tt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class br extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(ki=globalThis).__zod_globalConfig??(ki.__zod_globalConfig={});const Rn=globalThis.__zod_globalConfig;function xe(e){return e&&Object.assign(Rn,e),Rn}function yr(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function fs(e,t){return typeof t=="bigint"?t.toString():t}function Ln(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qs(e){return e==null}function Is(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function _u(e,t){const o=e/t,n=Math.round(o),s=Number.EPSILON*Math.max(Math.abs(o),1);return Math.abs(o-n)<s?0:o-n}const $i=Symbol("evaluating");function D(e,t,o){let n;Object.defineProperty(e,t,{get(){if(n!==$i)return n===void 0&&(n=$i,n=o()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function it(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Ze(...e){const t={};for(const o of e){const n=Object.getOwnPropertyDescriptors(o);Object.assign(t,n)}return Object.defineProperties({},t)}function qi(e){return JSON.stringify(e)}function vu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Uo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bu=Ln(()=>{if(Rn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Pt(e){if(Uo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const o=t.prototype;return!(Uo(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function wr(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const yu=new Set(["string","number","symbol"]);function Ct(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function De(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ru(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Tu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Ze(e._zod.def,{get shape(){const r={};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(r[c]=o.shape[c])}return it(this,"shape",r),r},checks:[]});return De(e,a)}function Pu(e,t){const o=e._zod.def,n=o.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Ze(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const c in t){if(!(c in o.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete r[c]}return it(this,"shape",r),r},checks:[]});return De(e,a)}function Cu(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");const o=e._zod.def.checks;if(o&&o.length>0){const a=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(a,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ze(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return it(this,"shape",a),a}});return De(e,s)}function Eu(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const o=Ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return it(this,"shape",n),n}});return De(e,o)}function ku(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const o=Ze(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return it(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return De(e,o)}function $u(e,t,o){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Ze(t._zod.def,{get shape(){const c=t._zod.def.shape,u={...c};if(o)for(const d in o){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);o[d]&&(u[d]=e?new e({type:"optional",innerType:c[d]}):c[d])}else for(const d in c)u[d]=e?new e({type:"optional",innerType:c[d]}):c[d];return it(this,"shape",u),u},checks:[]});return De(t,r)}function qu(e,t,o){const n=Ze(t._zod.def,{get shape(){const s=t._zod.def.shape,a={...s};if(o)for(const r in o){if(!(r in a))throw new Error(`Unrecognized key: "${r}"`);o[r]&&(a[r]=new e({type:"nonoptional",innerType:s[r]}))}else for(const r in s)a[r]=new e({type:"nonoptional",innerType:s[r]});return it(this,"shape",a),a}});return De(t,n)}function Rt(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function Iu(e,t=0){if(e.aborted===!0)return!0;for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue===!1)return!0;return!1}function wt(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function fn(e){return typeof e=="string"?e:e?.message}function Oe(e,t,o){const n=e.message?e.message:fn(e.inst?._zod.def?.error?.(e))??fn(t?.error?.(e))??fn(o.customError?.(e))??fn(o.localeError?.(e))??"Invalid input",{inst:s,continue:a,input:r,...c}=e;return c.path??(c.path=[]),c.message=n,t?.reportInput&&(c.input=r),c}function Ns(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function jo(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const Tr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,fs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pr=g("$ZodError",Tr),Cr=g("$ZodError",Tr,{Parent:Error});function Nu(e,t=o=>o.message){const o={},n=[];for(const s of e.issues)s.path.length>0?(o[s.path[0]]=o[s.path[0]]||[],o[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:o}}function xu(e,t=o=>o.message){const o={_errors:[]},n=(s,a=[])=>{for(const r of s.issues)if(r.code==="invalid_union"&&r.errors.length)r.errors.map(c=>n({issues:c},[...a,...r.path]));else if(r.code==="invalid_key")n({issues:r.issues},[...a,...r.path]);else if(r.code==="invalid_element")n({issues:r.issues},[...a,...r.path]);else{const c=[...a,...r.path];if(c.length===0)o._errors.push(t(r));else{let u=o,d=0;for(;d<c.length;){const h=c[d];d===c.length-1?(u[h]=u[h]||{_errors:[]},u[h]._errors.push(t(r))):u[h]=u[h]||{_errors:[]},u=u[h],d++}}}};return n(e),o}const xs=e=>(t,o,n,s)=>{const a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise)throw new Tt;if(r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>Oe(u,a,xe())));throw Rr(c,s?.callee),c}return r.value},Os=e=>async(t,o,n,s)=>{const a=n?{...n,async:!0}:{async:!0};let r=t._zod.run({value:o,issues:[]},a);if(r instanceof Promise&&(r=await r),r.issues.length){const c=new(s?.Err??e)(r.issues.map(u=>Oe(u,a,xe())));throw Rr(c,s?.callee),c}return r.value},An=e=>(t,o,n)=>{const s=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:o,issues:[]},s);if(a instanceof Promise)throw new Tt;return a.issues.length?{success:!1,error:new(e??Pr)(a.issues.map(r=>Oe(r,s,xe())))}:{success:!0,data:a.value}},Ou=An(Cr),Un=e=>async(t,o,n)=>{const s=n?{...n,async:!0}:{async:!0};let a=t._zod.run({value:o,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(r=>Oe(r,s,xe())))}:{success:!0,data:a.value}},zu=Un(Cr),Mu=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return xs(e)(t,o,s)},Lu=e=>(t,o,n)=>xs(e)(t,o,n),Au=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Os(e)(t,o,s)},Uu=e=>async(t,o,n)=>Os(e)(t,o,n),ju=e=>(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return An(e)(t,o,s)},Zu=e=>(t,o,n)=>An(e)(t,o,n),Du=e=>async(t,o,n)=>{const s=n?{...n,direction:"backward"}:{direction:"backward"};return Un(e)(t,o,s)},Hu=e=>async(t,o,n)=>Un(e)(t,o,n),Fu=/^[cC][0-9a-z]{6,}$/,Ju=/^[0-9a-z]+$/,Vu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Bu=/^[0-9a-vA-V]{20}$/,Wu=/^[A-Za-z0-9]{27}$/,Gu=/^[a-zA-Z0-9_-]{21}$/,Ku=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Yu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ii=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ep(){return new RegExp(Xu,"u")}const tp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,op=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,np=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ip=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Er=/^[A-Za-z0-9_-]*$/,rp=/^https?$/,ap=/^\+[1-9]\d{6,14}$/,kr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",cp=new RegExp(`^${kr}$`);function $r(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lp(e){return new RegExp(`^${$r(e)}$`)}function up(e){const t=$r({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${kr}T(?:${n})$`)}const pp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},dp=/^-?\d+$/,qr=/^-?\d+(?:\.\d+)?$/,mp=/^(?:true|false)$/i,hp=/^null$/i,fp=/^undefined$/i,gp=/^[^A-Z]*$/,Sp=/^[^a-z]*$/,ve=g("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),Ir={number:"number",bigint:"bigint",object:"date"},Nr=g("$ZodCheckLessThan",(e,t)=>{ve.init(e,t);const o=Ir[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:o,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xr=g("$ZodCheckGreaterThan",(e,t)=>{ve.init(e,t);const o=Ir[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,a=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:o,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_p=g("$ZodCheckMultipleOf",(e,t)=>{ve.init(e,t),e._zod.onattach.push(o=>{var n;(n=o._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):_u(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),vp=g("$ZodCheckNumberFormat",(e,t)=>{ve.init(e,t),t.format=t.format||"float64";const o=t.format?.includes("int"),n=o?"int":"number",[s,a]=wu[t.format];e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,c.minimum=s,c.maximum=a,o&&(c.pattern=dp)}),e._zod.check=r=>{const c=r.value;if(o){if(!Number.isInteger(c)){r.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?r.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):r.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<s&&r.issues.push({origin:"number",input:c,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),c>a&&r.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bp=g("$ZodCheckMaxLength",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const r=Ns(s);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),yp=g("$ZodCheckMinLength",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const r=Ns(s);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Rp=g("$ZodCheckLengthEquals",(e,t)=>{var o;ve.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!qs(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,a=s.length;if(a===t.length)return;const r=Ns(s),c=a>t.length;n.issues.push({origin:r,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),jn=g("$ZodCheckStringFormat",(e,t)=>{var o,n;ve.init(e,t),e._zod.onattach.push(s=>{const a=s._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),wp=g("$ZodCheckRegex",(e,t)=>{jn.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Tp=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=gp),jn.init(e,t)}),Pp=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sp),jn.init(e,t)}),Cp=g("$ZodCheckIncludes",(e,t)=>{ve.init(e,t);const o=Ct(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Ep=g("$ZodCheckStartsWith",(e,t)=>{ve.init(e,t);const o=new RegExp(`^${Ct(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kp=g("$ZodCheckEndsWith",(e,t)=>{ve.init(e,t);const o=new RegExp(`.*${Ct(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(o)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),$p=g("$ZodCheckOverwrite",(e,t)=>{ve.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class qp{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(` `).filter(r=>r),s=Math.min(...n.map(r=>r.length-r.trimStart().length)),a=n.map(r=>r.slice(s)).map(r=>" ".repeat(this.indent*2)+r);for(const r of a)this.content.push(r)}compile(){const t=Function,o=this?.args,s=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...o,s.join(` -`))}}const gp={major:4,minor:4,patch:3},J=g("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gp;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(r,c,u)=>{let d=Rt(r),h;for(const S of c){if(S._zod.def.when){if(gu(r)||!S._zod.def.when(r))continue}else if(d)continue;const b=r.issues.length,f=S._zod.check(r);if(f instanceof Promise&&u?.async===!1)throw new Tt;if(h||f instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await f,r.issues.length!==b&&(d||(d=Rt(r,b)))});else{if(r.issues.length===b)continue;d||(d=Rt(r,b))}}return h?h.then(()=>r):r},a=(r,c,u)=>{if(Rt(r))return r.aborted=!0,r;const d=s(c,n,u);if(d instanceof Promise){if(u.async===!1)throw new Tt;return d.then(h=>e._zod.parse(h,u))}return e._zod.parse(d,u)};e._zod.run=(r,c)=>{if(c.skipChecks)return e._zod.parse(r,c);if(c.direction==="backward"){const d=e._zod.parse({value:r.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(h=>a(h,r,c)):a(d,r,c)}const u=e._zod.parse(r,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(d=>s(d,n,c))}return s(u,n,c)}}D(e,"~standard",()=>({validate:s=>{try{const a=bu(e,s);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return vu(e,s).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),$s=g("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ku(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),W=g("$ZodStringFormat",(e,t)=>{Mn.init(e,t),$s.init(e,t)}),Sp=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Mu),W.init(e,t)}),_p=g("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Pi(n))}else t.pattern??(t.pattern=Pi());W.init(e,t)}),bp=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Lu),W.init(e,t)}),vp=g("$ZodURL",(e,t)=>{W.init(e,t),e._zod.check=o=>{try{const n=o.value.trim();if(!t.normalize&&t.protocol?.source===Ju.source&&!/^https?:\/\//i.test(n)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}const s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=s.href:o.value=n;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),yp=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Uu()),W.init(e,t)}),Rp=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ou),W.init(e,t)}),wp=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$u),W.init(e,t)}),Tp=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=qu),W.init(e,t)}),Pp=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Iu),W.init(e,t)}),Cp=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Nu),W.init(e,t)}),Ep=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=xu),W.init(e,t)}),kp=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Gu(t)),W.init(e,t)}),$p=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Bu),W.init(e,t)}),qp=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Wu(t)),W.init(e,t)}),Ip=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=zu),W.init(e,t)}),Np=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ju),W.init(e,t),e._zod.bag.format="ipv4"}),xp=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zu),W.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Op=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Du),W.init(e,t)}),zp=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hu),W.init(e,t),e._zod.check=o=>{const n=o.value.split("/");try{if(n.length!==2)throw new Error;const[s,a]=n;if(!a)throw new Error;const r=Number(a);if(`${r}`!==a)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${s}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Pr(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Mp=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Fu),W.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Pr(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Lp(e){if(!_r.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Pr(o)}const Ap=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_r),W.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{Lp(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Up=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Vu),W.init(e,t)});function jp(e,t=null){try{const o=e.split(".");if(o.length!==3)return!1;const[n]=o;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Zp=g("$ZodJWT",(e,t)=>{W.init(e,t),e._zod.check=o=>{jp(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Cr=g("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??yr,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}const s=o.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return o;const a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),o}}),Dp=g("$ZodNumberFormat",(e,t)=>{sp.init(e,t),Cr.init(e,t)}),Hp=g("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=Qu,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=!!o.value}catch{}const s=o.value;return typeof s=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),o}}),Fp=g("$ZodUndefined",(e,t)=>{J.init(e,t),e._zod.pattern=ep,e._zod.values=new Set([void 0]),e._zod.parse=(o,n)=>{const s=o.value;return typeof s>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),o}}),Jp=g("$ZodNull",(e,t)=>{J.init(e,t),e._zod.pattern=Xu,e._zod.values=new Set([null]),e._zod.parse=(o,n)=>{const s=o.value;return s===null||o.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),o}}),Vp=g("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),Bp=g("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),Wp=g("$ZodNever",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)});function Ci(e,t,o){e.issues.length&&t.issues.push(...wt(o,e.issues)),t.value[o]=e.value}const Gp=g("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=Array(s.length);const a=[];for(let r=0;r<s.length;r++){const c=s[r],u=t.element._zod.run({value:c,issues:[]},n);u instanceof Promise?a.push(u.then(d=>Ci(d,o,r))):Ci(u,o,r)}return a.length?Promise.all(a).then(()=>o):o}});function bn(e,t,o,n,s,a){const r=o in n;if(e.issues.length){if(s&&a&&!r)return;t.issues.push(...wt(o,e.issues))}if(!r&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?r&&(t.value[o]=void 0):t.value[o]=e.value}function Er(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const o=au(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function kr(e,t,o,n,s,a){const r=[],c=s.keySet,u=s.catchall._zod,d=u.def.type,h=u.optin==="optional",S=u.optout==="optional";for(const b in t){if(b==="__proto__"||c.has(b))continue;if(d==="never"){r.push(b);continue}const f=u.run({value:t[b],issues:[]},n);f instanceof Promise?e.push(f.then(R=>bn(R,o,b,t,h,S))):bn(f,o,b,t,h,S)}return r.length&&o.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:a}),e.length?Promise.all(e).then(()=>o):o}const Kp=g("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}const n=xn(()=>Er(t));D(e._zod,"propValues",()=>{const c=t.shape,u={};for(const d in c){const h=c[d]._zod;if(h.values){u[d]??(u[d]=new Set);for(const S of h.values)u[d].add(S)}}return u});const s=Mo,a=t.catchall;let r;e._zod.parse=(c,u)=>{r??(r=n.value);const d=c.value;if(!s(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};const h=[],S=r.shape;for(const b of r.keys){const f=S[b],R=f._zod.optin==="optional",P=f._zod.optout==="optional",v=f._zod.run({value:d[b],issues:[]},u);v instanceof Promise?h.push(v.then(A=>bn(A,c,b,d,R,P))):bn(v,c,b,d,R,P)}return a?kr(h,d,c,u,n.value,e):h.length?Promise.all(h).then(()=>c):c}}),Yp=g("$ZodObjectJIT",(e,t)=>{Kp.init(e,t);const o=e._zod.parse,n=xn(()=>Er(t)),s=b=>{const f=new fp(["shape","payload","ctx"]),R=n.value,P=x=>{const N=Ti(x);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};f.write("const input = payload.value;");const v=Object.create(null);let A=0;for(const x of R.keys)v[x]=`key_${A++}`;f.write("const newResult = {};");for(const x of R.keys){const N=v[x],$=Ti(x),O=b[x],G=O?._zod?.optin==="optional",ne=O?._zod?.optout==="optional";f.write(`const ${N} = ${P(x)};`),G&&ne?f.write(` +`))}}const Ip={major:4,minor:4,patch:3},J=g("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ip;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(r,c,u)=>{let d=Rt(r),h;for(const S of c){if(S._zod.def.when){if(Iu(r)||!S._zod.def.when(r))continue}else if(d)continue;const v=r.issues.length,f=S._zod.check(r);if(f instanceof Promise&&u?.async===!1)throw new Tt;if(h||f instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await f,r.issues.length!==v&&(d||(d=Rt(r,v)))});else{if(r.issues.length===v)continue;d||(d=Rt(r,v))}}return h?h.then(()=>r):r},a=(r,c,u)=>{if(Rt(r))return r.aborted=!0,r;const d=s(c,n,u);if(d instanceof Promise){if(u.async===!1)throw new Tt;return d.then(h=>e._zod.parse(h,u))}return e._zod.parse(d,u)};e._zod.run=(r,c)=>{if(c.skipChecks)return e._zod.parse(r,c);if(c.direction==="backward"){const d=e._zod.parse({value:r.value,issues:[]},{...c,skipChecks:!0});return d instanceof Promise?d.then(h=>a(h,r,c)):a(d,r,c)}const u=e._zod.parse(r,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(d=>s(d,n,c))}return s(u,n,c)}}D(e,"~standard",()=>({validate:s=>{try{const a=Ou(e,s);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return zu(e,s).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),zs=g("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pp(e._zod.bag),e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),W=g("$ZodStringFormat",(e,t)=>{jn.init(e,t),zs.init(e,t)}),Np=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Yu),W.init(e,t)}),xp=g("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ii(n))}else t.pattern??(t.pattern=Ii());W.init(e,t)}),Op=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Qu),W.init(e,t)}),zp=g("$ZodURL",(e,t)=>{W.init(e,t),e._zod.check=o=>{try{const n=o.value.trim();if(!t.normalize&&t.protocol?.source===rp.source&&!/^https?:\/\//i.test(n)){o.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:o.value,inst:e,continue:!t.abort});return}const s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),t.normalize?o.value=s.href:o.value=n;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Mp=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ep()),W.init(e,t)}),Lp=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Gu),W.init(e,t)}),Ap=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fu),W.init(e,t)}),Up=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ju),W.init(e,t)}),jp=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Vu),W.init(e,t)}),Zp=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Bu),W.init(e,t)}),Dp=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Wu),W.init(e,t)}),Hp=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=up(t)),W.init(e,t)}),Fp=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=cp),W.init(e,t)}),Jp=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=lp(t)),W.init(e,t)}),Vp=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ku),W.init(e,t)}),Bp=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=tp),W.init(e,t),e._zod.bag.format="ipv4"}),Wp=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=op),W.init(e,t),e._zod.bag.format="ipv6",e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),Gp=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=np),W.init(e,t)}),Kp=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=sp),W.init(e,t),e._zod.check=o=>{const n=o.value.split("/");try{if(n.length!==2)throw new Error;const[s,a]=n;if(!a)throw new Error;const r=Number(a);if(`${r}`!==a)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${s}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Or(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yp=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ip),W.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=o=>{Or(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Qp(e){if(!Er.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Or(o)}const Xp=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Er),W.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=o=>{Qp(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),ed=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ap),W.init(e,t)});function td(e,t=null){try{const o=e.split(".");if(o.length!==3)return!1;const[n]=o;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const od=g("$ZodJWT",(e,t)=>{W.init(e,t),e._zod.check=o=>{td(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),zr=g("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??qr,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}const s=o.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return o;const a=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),o}}),nd=g("$ZodNumberFormat",(e,t)=>{vp.init(e,t),zr.init(e,t)}),sd=g("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=mp,e._zod.parse=(o,n)=>{if(t.coerce)try{o.value=!!o.value}catch{}const s=o.value;return typeof s=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),o}}),id=g("$ZodUndefined",(e,t)=>{J.init(e,t),e._zod.pattern=fp,e._zod.values=new Set([void 0]),e._zod.parse=(o,n)=>{const s=o.value;return typeof s>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),o}}),rd=g("$ZodNull",(e,t)=>{J.init(e,t),e._zod.pattern=hp,e._zod.values=new Set([null]),e._zod.parse=(o,n)=>{const s=o.value;return s===null||o.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),o}}),ad=g("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),cd=g("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=o=>o}),ld=g("$ZodNever",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)});function Ni(e,t,o){e.issues.length&&t.issues.push(...wt(o,e.issues)),t.value[o]=e.value}const ud=g("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=Array(s.length);const a=[];for(let r=0;r<s.length;r++){const c=s[r],u=t.element._zod.run({value:c,issues:[]},n);u instanceof Promise?a.push(u.then(d=>Ni(d,o,r))):Ni(u,o,r)}return a.length?Promise.all(a).then(()=>o):o}});function wn(e,t,o,n,s,a){const r=o in n;if(e.issues.length){if(s&&a&&!r)return;t.issues.push(...wt(o,e.issues))}if(!r&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[o]});return}e.value===void 0?r&&(t.value[o]=void 0):t.value[o]=e.value}function Mr(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const o=Ru(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(o)}}function Lr(e,t,o,n,s,a){const r=[],c=s.keySet,u=s.catchall._zod,d=u.def.type,h=u.optin==="optional",S=u.optout==="optional";for(const v in t){if(v==="__proto__"||c.has(v))continue;if(d==="never"){r.push(v);continue}const f=u.run({value:t[v],issues:[]},n);f instanceof Promise?e.push(f.then(R=>wn(R,o,v,t,h,S))):wn(f,o,v,t,h,S)}return r.length&&o.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:a}),e.length?Promise.all(e).then(()=>o):o}const pd=g("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...c};return Object.defineProperty(t,"shape",{value:u}),u}})}const n=Ln(()=>Mr(t));D(e._zod,"propValues",()=>{const c=t.shape,u={};for(const d in c){const h=c[d]._zod;if(h.values){u[d]??(u[d]=new Set);for(const S of h.values)u[d].add(S)}}return u});const s=Uo,a=t.catchall;let r;e._zod.parse=(c,u)=>{r??(r=n.value);const d=c.value;if(!s(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value={};const h=[],S=r.shape;for(const v of r.keys){const f=S[v],R=f._zod.optin==="optional",P=f._zod.optout==="optional",b=f._zod.run({value:d[v],issues:[]},u);b instanceof Promise?h.push(b.then(A=>wn(A,c,v,d,R,P))):wn(b,c,v,d,R,P)}return a?Lr(h,d,c,u,n.value,e):h.length?Promise.all(h).then(()=>c):c}}),dd=g("$ZodObjectJIT",(e,t)=>{pd.init(e,t);const o=e._zod.parse,n=Ln(()=>Mr(t)),s=v=>{const f=new qp(["shape","payload","ctx"]),R=n.value,P=x=>{const N=qi(x);return`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`};f.write("const input = payload.value;");const b=Object.create(null);let A=0;for(const x of R.keys)b[x]=`key_${A++}`;f.write("const newResult = {};");for(const x of R.keys){const N=b[x],$=qi(x),O=v[x],G=O?._zod?.optin==="optional",se=O?._zod?.optout==="optional";f.write(`const ${N} = ${P(x)};`),G&&se?f.write(` if (${N}.issues.length) { if (${$} in input) { payload.issues = payload.issues.concat(${N}.issues.map(iss => ({ @@ -194,19 +211,19 @@ } } - `)}f.write("payload.value = newResult;"),f.write("return payload;");const j=f.compile();return(x,N)=>j(b,x,N)};let a;const r=Mo,c=!_n.jitless,d=c&&iu.value,h=t.catchall;let S;e._zod.parse=(b,f)=>{S??(S=n.value);const R=b.value;return r(R)?c&&d&&f?.async===!1&&f.jitless!==!0?(a||(a=s(t.shape)),b=a(b,f),h?kr([],R,b,f,S,e):b):o(b,f):(b.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),b)}});function Ei(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const s=e.filter(a=>!Rt(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(r=>xe(r,n,Ne())))}),t)}const $r=g("$ZodUnion",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),D(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),D(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),D(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Ps(s.source)).join("|")})$`)}});const o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(o)return o(n,s);let a=!1;const r=[];for(const c of t.options){const u=c._zod.run({value:n.value,issues:[]},s);if(u instanceof Promise)r.push(u),a=!0;else{if(u.issues.length===0)return u;r.push(u)}}return a?Promise.all(r).then(c=>Ei(c,n,e,s)):Ei(r,n,e,s)}}),Qp=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$r.init(e,t);const o=e._zod.parse;D(e._zod,"propValues",()=>{const s={};for(const a of t.options){const r=a._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[c,u]of Object.entries(r)){s[c]||(s[c]=new Set);for(const d of u)s[c].add(d)}}return s});const n=xn(()=>{const s=t.options,a=new Map;for(const r of s){const c=r._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const u of c){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,r)}}return a});e._zod.parse=(s,a)=>{const r=s.value;if(!Mo(r))return s.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),s;const c=n.value.get(r?.[t.discriminator]);return c?c._zod.run(s,a):t.unionFallback||a.direction==="backward"?o(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:r,path:[t.discriminator],inst:e}),s)}}),Xp=g("$ZodIntersection",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value,a=t.left._zod.run({value:s,issues:[]},n),r=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||r instanceof Promise?Promise.all([a,r]).then(([u,d])=>ki(o,u,d)):ki(o,a,r)}});function ps(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pt(e)&&Pt(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of n){const r=ps(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};s[a]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const s=e[n],a=t[n],r=ps(s,a);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o.push(r.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function ki(e,t,o){const n=new Map;let s;for(const c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(c);for(const c of o.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(c);const a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),Rt(e))return e;const r=ps(t.value,o.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const ed=g("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Pt(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;const a=[],r=t.keyType._zod.values;if(r){o.value={};const c=new Set;for(const d of r)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);const h=t.keyType._zod.run({value:d,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(f=>xe(f,n,Ne())),input:d,path:[d],inst:e});continue}const S=h.value,b=t.valueType._zod.run({value:s[d],issues:[]},n);b instanceof Promise?a.push(b.then(f=>{f.issues.length&&o.issues.push(...wt(d,f.issues)),o.value[S]=f.value})):(b.issues.length&&o.issues.push(...wt(d,b.issues)),o.value[S]=b.value)}let u;for(const d in s)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{o.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&yr.test(c)&&u.issues.length){const S=t.keyType._zod.run({value:Number(c),issues:[]},n);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(u=S)}if(u.issues.length){t.mode==="loose"?o.value[c]=s[c]:o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(S=>xe(S,n,Ne())),input:c,path:[c],inst:e});continue}const h=t.valueType._zod.run({value:s[c],issues:[]},n);h instanceof Promise?a.push(h.then(S=>{S.issues.length&&o.issues.push(...wt(c,S.issues)),o.value[u.value]=S.value})):(h.issues.length&&o.issues.push(...wt(c,h.issues)),o.value[u.value]=h.value)}}return a.length?Promise.all(a).then(()=>o):o}}),td=g("$ZodEnum",(e,t)=>{J.init(e,t);const o=dr(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(s=>ru.has(typeof s)).map(s=>typeof s=="string"?Ct(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{const r=s.value;return n.has(r)||s.issues.push({code:"invalid_value",values:o,input:r,inst:e}),s}}),od=g("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ct(n):n?Ct(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),nd=g("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new pr(e.constructor.name);const s=t.transform(o.value,o);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(r=>(o.value=r,o.fallback=!0,o));if(s instanceof Promise)throw new Tt;return o.value=s,o.fallback=!0,o}});function $i(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const qr=g("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ps(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const s=o.value,a=t.innerType._zod.run(o,n);return a instanceof Promise?a.then(r=>$i(r,s)):$i(a,s)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),sd=g("$ZodExactOptional",(e,t)=>{qr.init(e,t),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,n)=>t.innerType._zod.run(o,n)}),id=g("$ZodNullable",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.innerType._zod.optin),D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Ps(o.source)}|null)$`):void 0}),D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),rd=g("$ZodDefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>qi(a,t)):qi(s,t)}});function qi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ad=g("$ZodPrefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),cd=g("$ZodNonOptional",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>Ii(a,e)):Ii(s,e)}});function Ii(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ld=g("$ZodCatch",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(r=>xe(r,n,Ne()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(a=>xe(a,n,Ne()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),Ir=g("$ZodPipe",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>t.in._zod.values),D(e._zod,"optin",()=>t.in._zod.optin),D(e._zod,"optout",()=>t.out._zod.optout),D(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(r=>pn(r,t.in,n)):pn(a,t.in,n)}const s=t.in._zod.run(o,n);return s instanceof Promise?s.then(a=>pn(a,t.out,n)):pn(s,t.out,n)}});function pn(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}const ud=g("$ZodPreprocess",(e,t)=>{Ir.init(e,t)}),pd=g("$ZodReadonly",(e,t)=>{J.init(e,t),D(e._zod,"propValues",()=>t.innerType._zod.propValues),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"optin",()=>t.innerType?._zod?.optin),D(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(Ni):Ni(s)}});function Ni(e){return e.value=Object.freeze(e.value),e}const dd=g("$ZodLazy",(e,t)=>{J.init(e,t),D(e._zod,"innerType",()=>{const o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),D(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),D(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),D(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),D(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,n)=>e._zod.innerType._zod.run(o,n)}),md=g("$ZodCustom",(e,t)=>{be.init(e,t),J.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>xi(a,o,n,e));xi(s,o,n,e)}});function xi(e,t,o,n){if(!e){const s={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Lo(s))}}var Oi;class hd{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fd(){return new hd}(Oi=globalThis).__zod_globalRegistry??(Oi.__zod_globalRegistry=fd());const Io=globalThis.__zod_globalRegistry;function gd(e,t){return new e({type:"string",...E(t)})}function Nr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}function zi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function Sd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function _d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}function bd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}function vd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}function xr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function yd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}function Rd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}function wd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}function Td(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}function Pd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}function Cd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}function Ed(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}function kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function $d(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function qd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}function Id(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}function Nd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}function xd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}function Od(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}function zd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}function Md(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}function Ld(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}function Ad(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}function Ud(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}function jd(e,t){return new e({type:"number",checks:[],...E(t)})}function Zd(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}function Dd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}function Hd(e,t){return new e({type:"boolean",...E(t)})}function Fd(e,t){return new e({type:"undefined",...E(t)})}function Jd(e,t){return new e({type:"null",...E(t)})}function Vd(e){return new e({type:"any"})}function Bd(e){return new e({type:"unknown"})}function Wd(e,t){return new e({type:"never",...E(t)})}function Mi(e,t){return new wr({check:"less_than",...E(t),value:e,inclusive:!1})}function es(e,t){return new wr({check:"less_than",...E(t),value:e,inclusive:!0})}function Li(e,t){return new Tr({check:"greater_than",...E(t),value:e,inclusive:!1})}function ts(e,t){return new Tr({check:"greater_than",...E(t),value:e,inclusive:!0})}function Ai(e,t){return new np({check:"multiple_of",...E(t),value:e})}function Or(e,t){return new ip({check:"max_length",...E(t),maximum:e})}function vn(e,t){return new rp({check:"min_length",...E(t),minimum:e})}function zr(e,t){return new ap({check:"length_equals",...E(t),length:e})}function Gd(e,t){return new cp({check:"string_format",format:"regex",...E(t),pattern:e})}function Kd(e){return new lp({check:"string_format",format:"lowercase",...E(e)})}function Yd(e){return new up({check:"string_format",format:"uppercase",...E(e)})}function Qd(e,t){return new pp({check:"string_format",format:"includes",...E(t),includes:e})}function Xd(e,t){return new dp({check:"string_format",format:"starts_with",...E(t),prefix:e})}function em(e,t){return new mp({check:"string_format",format:"ends_with",...E(t),suffix:e})}function kt(e){return new hp({check:"overwrite",tx:e})}function tm(e){return kt(t=>t.normalize(e))}function om(){return kt(e=>e.trim())}function nm(){return kt(e=>e.toLowerCase())}function sm(){return kt(e=>e.toUpperCase())}function im(){return kt(e=>su(e))}function rm(e,t,o){return new e({type:"array",element:t,...E(o)})}function am(e,t,o){return new e({type:"custom",check:"custom",fn:t,...E(o)})}function cm(e,t){const o=lm(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(Lo(s,n.value,o._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=o),a.continue??(a.continue=!o._zod.def.abort),n.issues.push(Lo(a))}},e(n.value,n)),t);return o}function lm(e,t){const o=new be({check:"custom",...E(t)});return o._zod.check=e,o}function yn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Io,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function B(e,t,o={path:[],schemaPath:[]}){var n;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,o.schemaPath.includes(e)&&(a.cycle=o.path),a.schema;const r={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,r);const c=e._zod.toJSONSchema?.();if(c)r.schema=c;else{const h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,h);else{const b=r.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,b,h)}const S=e._zod.parent;S&&(r.ref||(r.ref=S),B(S,t,h),t.seen.get(S).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(r.schema,u),t.io==="input"&&he(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&"_prefault"in r.schema&&((n=r.schema).default??(n.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function Rn(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const r of e.seen.entries()){const c=e.metadataRegistry.get(r[0])?.id;if(c){const u=n.get(c);if(u&&u!==r[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,r[0])}}const s=r=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=e.external.registry.get(r[0])?.id,b=e.external.uri??(R=>R);if(S)return{ref:b(S)};const f=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=f,{defId:f,ref:`${b("__shared")}#/${c}/${f}`}}if(r[1]===o)return{ref:"#"};const d=`#/${c}/`,h=r[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:d+h}},a=r=>{if(r[1].schema.$ref)return;const c=r[1],{ref:u,defId:d}=s(r);c.def={...c.schema},d&&(c.defId=d);const h=c.schema;for(const S in h)delete h[S];h.$ref=u};if(e.cycles==="throw")for(const r of e.seen.entries()){const c=r[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root> + `)}f.write("payload.value = newResult;"),f.write("return payload;");const j=f.compile();return(x,N)=>j(v,x,N)};let a;const r=Uo,c=!Rn.jitless,d=c&&bu.value,h=t.catchall;let S;e._zod.parse=(v,f)=>{S??(S=n.value);const R=v.value;return r(R)?c&&d&&f?.async===!1&&f.jitless!==!0?(a||(a=s(t.shape)),v=a(v,f),h?Lr([],R,v,f,S,e):v):o(v,f):(v.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),v)}});function xi(e,t,o,n){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const s=e.filter(a=>!Rt(a));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(a=>a.issues.map(r=>Oe(r,n,xe())))}),t)}const Ar=g("$ZodUnion",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),D(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),D(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),D(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Is(s.source)).join("|")})$`)}});const o=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,s)=>{if(o)return o(n,s);let a=!1;const r=[];for(const c of t.options){const u=c._zod.run({value:n.value,issues:[]},s);if(u instanceof Promise)r.push(u),a=!0;else{if(u.issues.length===0)return u;r.push(u)}}return a?Promise.all(r).then(c=>xi(c,n,e,s)):xi(r,n,e,s)}}),md=g("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ar.init(e,t);const o=e._zod.parse;D(e._zod,"propValues",()=>{const s={};for(const a of t.options){const r=a._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[c,u]of Object.entries(r)){s[c]||(s[c]=new Set);for(const d of u)s[c].add(d)}}return s});const n=Ln(()=>{const s=t.options,a=new Map;for(const r of s){const c=r._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const u of c){if(a.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);a.set(u,r)}}return a});e._zod.parse=(s,a)=>{const r=s.value;if(!Uo(r))return s.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),s;const c=n.value.get(r?.[t.discriminator]);return c?c._zod.run(s,a):t.unionFallback||a.direction==="backward"?o(s,a):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()),input:r,path:[t.discriminator],inst:e}),s)}}),hd=g("$ZodIntersection",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value,a=t.left._zod.run({value:s,issues:[]},n),r=t.right._zod.run({value:s,issues:[]},n);return a instanceof Promise||r instanceof Promise?Promise.all([a,r]).then(([u,d])=>Oi(o,u,d)):Oi(o,a,r)}});function gs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Pt(e)&&Pt(t)){const o=Object.keys(t),n=Object.keys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(const a of n){const r=gs(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};s[a]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const o=[];for(let n=0;n<e.length;n++){const s=e[n],a=t[n],r=gs(s,a);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o.push(r.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Oi(e,t,o){const n=new Map;let s;for(const c of t.issues)if(c.code==="unrecognized_keys"){s??(s=c);for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(c);for(const c of o.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(c);const a=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&s&&e.issues.push({...s,keys:a}),Rt(e))return e;const r=gs(t.value,o.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const fd=g("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!Pt(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;const a=[],r=t.keyType._zod.values;if(r){o.value={};const c=new Set;for(const d of r)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){c.add(typeof d=="number"?d.toString():d);const h=t.keyType._zod.run({value:d,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(h.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(f=>Oe(f,n,xe())),input:d,path:[d],inst:e});continue}const S=h.value,v=t.valueType._zod.run({value:s[d],issues:[]},n);v instanceof Promise?a.push(v.then(f=>{f.issues.length&&o.issues.push(...wt(d,f.issues)),o.value[S]=f.value})):(v.issues.length&&o.issues.push(...wt(d,v.issues)),o.value[S]=v.value)}let u;for(const d in s)c.has(d)||(u=u??[],u.push(d));u&&u.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{o.value={};for(const c of Reflect.ownKeys(s)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,c))continue;let u=t.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&qr.test(c)&&u.issues.length){const S=t.keyType._zod.run({value:Number(c),issues:[]},n);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");S.issues.length===0&&(u=S)}if(u.issues.length){t.mode==="loose"?o.value[c]=s[c]:o.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(S=>Oe(S,n,xe())),input:c,path:[c],inst:e});continue}const h=t.valueType._zod.run({value:s[c],issues:[]},n);h instanceof Promise?a.push(h.then(S=>{S.issues.length&&o.issues.push(...wt(c,S.issues)),o.value[u.value]=S.value})):(h.issues.length&&o.issues.push(...wt(c,h.issues)),o.value[u.value]=h.value)}}return a.length?Promise.all(a).then(()=>o):o}}),gd=g("$ZodEnum",(e,t)=>{J.init(e,t);const o=yr(t.entries),n=new Set(o);e._zod.values=n,e._zod.pattern=new RegExp(`^(${o.filter(s=>yu.has(typeof s)).map(s=>typeof s=="string"?Ct(s):s.toString()).join("|")})$`),e._zod.parse=(s,a)=>{const r=s.value;return n.has(r)||s.issues.push({code:"invalid_value",values:o,input:r,inst:e}),s}}),Sd=g("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const o=new Set(t.values);e._zod.values=o,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ct(n):n?Ct(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const a=n.value;return o.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}}),_d=g("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new br(e.constructor.name);const s=t.transform(o.value,o);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(r=>(o.value=r,o.fallback=!0,o));if(s instanceof Promise)throw new Tt;return o.value=s,o.fallback=!0,o}});function zi(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ur=g("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Is(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>{if(t.innerType._zod.optin==="optional"){const s=o.value,a=t.innerType._zod.run(o,n);return a instanceof Promise?a.then(r=>zi(r,s)):zi(a,s)}return o.value===void 0?o:t.innerType._zod.run(o,n)}}),vd=g("$ZodExactOptional",(e,t)=>{Ur.init(e,t),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(o,n)=>t.innerType._zod.run(o,n)}),bd=g("$ZodNullable",(e,t)=>{J.init(e,t),D(e._zod,"optin",()=>t.innerType._zod.optin),D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${Is(o.source)}|null)$`):void 0}),D(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,n)=>o.value===null?o:t.innerType._zod.run(o,n)}),yd=g("$ZodDefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);if(o.value===void 0)return o.value=t.defaultValue,o;const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>Mi(a,t)):Mi(s,t)}});function Mi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Rd=g("$ZodPrefault",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(n.direction==="backward"||o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),wd=g("$ZodNonOptional",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>{const o=t.innerType._zod.values;return o?new Set([...o].filter(n=>n!==void 0)):void 0}),e._zod.parse=(o,n)=>{const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>Li(a,e)):Li(s,e)}});function Li(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Td=g("$ZodCatch",(e,t)=>{J.init(e,t),e._zod.optin="optional",D(e._zod,"optout",()=>t.innerType._zod.optout),D(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(a=>(o.value=a.value,a.issues.length&&(o.value=t.catchValue({...o,error:{issues:a.issues.map(r=>Oe(r,n,xe()))},input:o.value}),o.issues=[],o.fallback=!0),o)):(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(a=>Oe(a,n,xe()))},input:o.value}),o.issues=[],o.fallback=!0),o)}}),jr=g("$ZodPipe",(e,t)=>{J.init(e,t),D(e._zod,"values",()=>t.in._zod.values),D(e._zod,"optin",()=>t.in._zod.optin),D(e._zod,"optout",()=>t.out._zod.optout),D(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(o,n)=>{if(n.direction==="backward"){const a=t.out._zod.run(o,n);return a instanceof Promise?a.then(r=>gn(r,t.in,n)):gn(a,t.in,n)}const s=t.in._zod.run(o,n);return s instanceof Promise?s.then(a=>gn(a,t.out,n)):gn(s,t.out,n)}});function gn(e,t,o){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},o)}const Pd=g("$ZodPreprocess",(e,t)=>{jr.init(e,t)}),Cd=g("$ZodReadonly",(e,t)=>{J.init(e,t),D(e._zod,"propValues",()=>t.innerType._zod.propValues),D(e._zod,"values",()=>t.innerType._zod.values),D(e._zod,"optin",()=>t.innerType?._zod?.optin),D(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(o,n)=>{if(n.direction==="backward")return t.innerType._zod.run(o,n);const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(Ai):Ai(s)}});function Ai(e){return e.value=Object.freeze(e.value),e}const Ed=g("$ZodLazy",(e,t)=>{J.init(e,t),D(e._zod,"innerType",()=>{const o=t;return o._cachedInner||(o._cachedInner=t.getter()),o._cachedInner}),D(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),D(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),D(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),D(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(o,n)=>e._zod.innerType._zod.run(o,n)}),kd=g("$ZodCustom",(e,t)=>{ve.init(e,t),J.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,s=t.fn(n);if(s instanceof Promise)return s.then(a=>Ui(a,o,n,e));Ui(s,o,n,e)}});function Ui(e,t,o,n){if(!e){const s={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(jo(s))}}var ji;class $d{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...o){const n=o[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){const o=t._zod.parent;if(o){const n={...this.get(o)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qd(){return new $d}(ji=globalThis).__zod_globalRegistry??(ji.__zod_globalRegistry=qd());const xo=globalThis.__zod_globalRegistry;function Id(e,t){return new e({type:"string",...E(t)})}function Zr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...E(t)})}function Zi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function Nd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}function xd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}function Od(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}function zd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}function Dr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}function Md(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}function Ld(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}function Ad(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}function Ud(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}function jd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}function Zd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}function Dd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}function Hd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}function Fd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}function Jd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}function Vd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}function Bd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}function Wd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}function Gd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}function Kd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}function Yd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}function Qd(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}function Xd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}function em(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}function tm(e,t){return new e({type:"number",checks:[],...E(t)})}function om(e,t){return new e({type:"number",coerce:!0,checks:[],...E(t)})}function nm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}function sm(e,t){return new e({type:"boolean",...E(t)})}function im(e,t){return new e({type:"undefined",...E(t)})}function rm(e,t){return new e({type:"null",...E(t)})}function am(e){return new e({type:"any"})}function cm(e){return new e({type:"unknown"})}function lm(e,t){return new e({type:"never",...E(t)})}function Di(e,t){return new Nr({check:"less_than",...E(t),value:e,inclusive:!1})}function is(e,t){return new Nr({check:"less_than",...E(t),value:e,inclusive:!0})}function Hi(e,t){return new xr({check:"greater_than",...E(t),value:e,inclusive:!1})}function rs(e,t){return new xr({check:"greater_than",...E(t),value:e,inclusive:!0})}function Fi(e,t){return new _p({check:"multiple_of",...E(t),value:e})}function Hr(e,t){return new bp({check:"max_length",...E(t),maximum:e})}function Tn(e,t){return new yp({check:"min_length",...E(t),minimum:e})}function Fr(e,t){return new Rp({check:"length_equals",...E(t),length:e})}function um(e,t){return new wp({check:"string_format",format:"regex",...E(t),pattern:e})}function pm(e){return new Tp({check:"string_format",format:"lowercase",...E(e)})}function dm(e){return new Pp({check:"string_format",format:"uppercase",...E(e)})}function mm(e,t){return new Cp({check:"string_format",format:"includes",...E(t),includes:e})}function hm(e,t){return new Ep({check:"string_format",format:"starts_with",...E(t),prefix:e})}function fm(e,t){return new kp({check:"string_format",format:"ends_with",...E(t),suffix:e})}function qt(e){return new $p({check:"overwrite",tx:e})}function gm(e){return qt(t=>t.normalize(e))}function Sm(){return qt(e=>e.trim())}function _m(){return qt(e=>e.toLowerCase())}function vm(){return qt(e=>e.toUpperCase())}function bm(){return qt(e=>vu(e))}function ym(e,t,o){return new e({type:"array",element:t,...E(o)})}function Rm(e,t,o){return new e({type:"custom",check:"custom",fn:t,...E(o)})}function wm(e,t){const o=Tm(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(jo(s,n.value,o._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=o),a.continue??(a.continue=!o._zod.def.abort),n.issues.push(jo(a))}},e(n.value,n)),t);return o}function Tm(e,t){const o=new ve({check:"custom",...E(t)});return o._zod.check=e,o}function Pn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??xo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function B(e,t,o={path:[],schemaPath:[]}){var n;const s=e._zod.def,a=t.seen.get(e);if(a)return a.count++,o.schemaPath.includes(e)&&(a.cycle=o.path),a.schema;const r={schema:{},count:1,cycle:void 0,path:o.path};t.seen.set(e,r);const c=e._zod.toJSONSchema?.();if(c)r.schema=c;else{const h={...o,schemaPath:[...o.schemaPath,e],path:o.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,h);else{const v=r.schema,f=t.processors[s.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);f(e,t,v,h)}const S=e._zod.parent;S&&(r.ref||(r.ref=S),B(S,t,h),t.seen.get(S).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(r.schema,u),t.io==="input"&&he(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&"_prefault"in r.schema&&((n=r.schema).default??(n.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function Cn(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const r of e.seen.entries()){const c=e.metadataRegistry.get(r[0])?.id;if(c){const u=n.get(c);if(u&&u!==r[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,r[0])}}const s=r=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const S=e.external.registry.get(r[0])?.id,v=e.external.uri??(R=>R);if(S)return{ref:v(S)};const f=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=f,{defId:f,ref:`${v("__shared")}#/${c}/${f}`}}if(r[1]===o)return{ref:"#"};const d=`#/${c}/`,h=r[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:d+h}},a=r=>{if(r[1].schema.$ref)return;const c=r[1],{ref:u,defId:d}=s(r);c.def={...c.schema},d&&(c.defId=d);const h=c.schema;for(const S in h)delete h[S];h.$ref=u};if(e.cycles==="throw")for(const r of e.seen.entries()){const c=r[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root> -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const c=r[1];if(t===r[0]){a(r);continue}if(e.external){const d=e.external.registry.get(r[0])?.id;if(t!==r[0]&&d){a(r);continue}}if(e.metadataRegistry.get(r[0])?.id){a(r);continue}if(c.cycle){a(r);continue}if(c.count>1&&e.reused==="ref"){a(r);continue}}}function wn(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,h={...d},S=u.ref;if(u.ref=null,S){n(S);const f=e.seen.get(S),R=f.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(R)):Object.assign(d,R),Object.assign(d,h),c._zod.parent===S)for(const v in d)v==="$ref"||v==="allOf"||v in h||delete d[v];if(R.$ref&&f.def)for(const v in d)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(d[v])===JSON.stringify(f.def[v])&&delete d[v]}const b=c._zod.parent;if(b&&b!==S){n(b);const f=e.seen.get(b);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(const R in d)R==="$ref"||R==="allOf"||R in f.def&&JSON.stringify(d[R])===JSON.stringify(f.def[R])&&delete d[R]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())n(c[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(c)}Object.assign(s,o.def??o.schema);const a=e.metadataRegistry.get(t)?.id;a!==void 0&&s.id===a&&delete s.id;const r=e.external?.defs??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,r[u.defId]=u.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{const c=JSON.parse(JSON.stringify(s));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Tn(t,"input",e.processors),output:Tn(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function he(e,t){const o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return he(n.element,o);if(n.type==="set")return he(n.valueType,o);if(n.type==="lazy")return he(n.getter(),o);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return he(n.innerType,o);if(n.type==="intersection")return he(n.left,o)||he(n.right,o);if(n.type==="record"||n.type==="map")return he(n.keyType,o)||he(n.valueType,o);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:he(n.in,o)||he(n.out,o);if(n.type==="object"){for(const s in n.shape)if(he(n.shape[s],o))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(he(s,o))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(he(s,o))return!0;return!!(n.rest&&he(n.rest,o))}return!1}const um=(e,t={})=>o=>{const n=yn({...o,processors:t});return B(e,n),Rn(n,e),wn(n,e)},Tn=(e,t,o={})=>n=>{const{libraryOptions:s,target:a}=n??{},r=yn({...s??{},target:a,io:t,processors:o});return B(e,r),Rn(r,e),wn(r,e)},pm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mr=(e,t,o,n)=>{const s=o;s.type="string";const{minimum:a,maximum:r,format:c,patterns:u,contentEncoding:d}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof r=="number"&&(s.maxLength=r),c&&(s.format=pm[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const h=[...u];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Lr=(e,t,o,n)=>{const s=o,{minimum:a,maximum:r,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number";const S=typeof h=="number"&&h>=(a??Number.NEGATIVE_INFINITY),b=typeof d=="number"&&d<=(r??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";S?f?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h:typeof a=="number"&&(s.minimum=a),b?f?(s.maximum=d,s.exclusiveMaximum=!0):s.exclusiveMaximum=d:typeof r=="number"&&(s.maximum=r),typeof u=="number"&&(s.multipleOf=u)},Ar=(e,t,o,n)=>{o.type="boolean"},dm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},mm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ur=(e,t,o,n)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},jr=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},hm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Zr=(e,t,o,n)=>{o.not={}},Dr=(e,t,o,n)=>{},Hr=(e,t,o,n)=>{},fm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Fr=(e,t,o,n)=>{const s=e._zod.def,a=dr(s.entries);a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),o.enum=a},Jr=(e,t,o,n)=>{const s=e._zod.def,a=[];for(const r of s.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(r))}else a.push(r);if(a.length!==0)if(a.length===1){const r=a[0];o.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[r]:o.const=r}else a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),a.every(r=>typeof r=="boolean")&&(o.type="boolean"),a.every(r=>r===null)&&(o.type="null"),o.enum=a},gm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Sm=(e,t,o,n)=>{const s=o,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},_m=(e,t,o,n)=>{const s=o,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:c,mime:u}=e._zod.bag;r!==void 0&&(a.minLength=r),c!==void 0&&(a.maxLength=c),u?u.length===1?(a.contentMediaType=u[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(s,a)},bm=(e,t,o,n)=>{o.type="boolean"},Vr=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},vm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Br=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ym=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Wr=(e,t,o,n)=>{const s=o,a=e._zod.def,{minimum:r,maximum:c}=e._zod.bag;typeof r=="number"&&(s.minItems=r),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=B(a.element,t,{...n,path:[...n.path,"items"]})},Gr=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object",s.properties={};const r=a.shape;for(const d in r)s.properties[d]=B(r[d],t,{...n,path:[...n.path,"properties",d]});const c=new Set(Object.keys(r)),u=new Set([...c].filter(d=>{const h=a.shape[d]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));u.size>0&&(s.required=Array.from(u)),a.catchall?._zod.def.type==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=B(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Kr=(e,t,o,n)=>{const s=e._zod.def,a=s.inclusive===!1,r=s.options.map((c,u)=>B(c,t,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?o.oneOf=r:o.anyOf=r},Yr=(e,t,o,n)=>{const s=e._zod.def,a=B(s.left,t,{...n,path:[...n.path,"allOf",0]}),r=B(s.right,t,{...n,path:[...n.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(a)?a.allOf:[a],...c(r)?r.allOf:[r]];o.allOf=u},wm=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="array";const r=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((b,f)=>B(b,t,{...n,path:[...n.path,r,f]})),d=a.rest?B(a.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=u,d&&(s.items=d)):t.target==="openapi-3.0"?(s.items={anyOf:u},d&&s.items.anyOf.push(d),s.minItems=u.length,d||(s.maxItems=u.length)):(s.items=u,d&&(s.additionalItems=d));const{minimum:h,maximum:S}=e._zod.bag;typeof h=="number"&&(s.minItems=h),typeof S=="number"&&(s.maxItems=S)},Qr=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object";const r=a.keyType,u=r._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){const h=B(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const S of u)s.patternProperties[S.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=B(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=B(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const d=r._zod.values;if(d){const h=[...d].filter(S=>typeof S=="string"||typeof S=="number");h.length>0&&(s.required=h)}},Xr=(e,t,o,n)=>{const s=e._zod.def,a=B(s.innerType,t,n),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=s.innerType,o.nullable=!0):o.anyOf=[a,{type:"null"}]},ea=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},ta=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.default=JSON.parse(JSON.stringify(s.defaultValue))},oa=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},na=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType;let r;try{r=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=r},sa=(e,t,o,n)=>{const s=e._zod.def,a=s.in._zod.traits.has("$ZodTransform"),r=t.io==="input"?a?s.out:s.in:s.out;B(r,t,n);const c=t.seen.get(e);c.ref=r},ia=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.readOnly=!0},Tm=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},qs=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},ra=(e,t,o,n)=>{const s=e._zod.innerType;B(s,t,n);const a=t.seen.get(e);a.ref=s},Ui={string:Mr,number:Lr,boolean:Ar,bigint:dm,symbol:mm,null:Ur,undefined:jr,void:hm,never:Zr,any:Dr,unknown:Hr,date:fm,enum:Fr,literal:Jr,nan:gm,template_literal:Sm,file:_m,success:bm,custom:Vr,function:vm,transform:Br,map:ym,set:Rm,array:Wr,object:Gr,union:Kr,intersection:Yr,tuple:wm,record:Qr,nullable:Xr,nonoptional:ea,default:ta,prefault:oa,catch:na,pipe:sa,readonly:ia,promise:Tm,optional:qs,lazy:ra};function aa(e,t){if("_idmap"in e){const n=e,s=yn({...t,processors:Ui}),a={};for(const u of n._idmap.entries()){const[d,h]=u;B(h,s)}const r={},c={registry:n,uri:t?.uri,defs:a};s.external=c;for(const u of n._idmap.entries()){const[d,h]=u;Rn(s,h),r[d]=wn(s,h)}if(Object.keys(a).length>0){const u=s.target==="draft-2020-12"?"$defs":"definitions";r.__shared={[u]:a}}return{schemas:r}}const o=yn({...t,processors:Ui});return B(e,o),Rn(o,e),wn(o,e)}const Pm=g("ZodISODateTime",(e,t)=>{kp.init(e,t),K.init(e,t)});function Ho(e){return Md(Pm,e)}const Cm=g("ZodISODate",(e,t)=>{$p.init(e,t),K.init(e,t)});function ca(e){return Ld(Cm,e)}const Em=g("ZodISOTime",(e,t)=>{qp.init(e,t),K.init(e,t)});function km(e){return Ad(Em,e)}const $m=g("ZodISODuration",(e,t)=>{Ip.init(e,t),K.init(e,t)});function qm(e){return Ud($m,e)}const Im=(e,t)=>{gr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>_u(e,o)},flatten:{value:o=>Su(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,us,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,us,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ce=g("ZodError",Im,{Parent:Error}),Nm=Es(Ce),xm=ks(Ce),la=On(Ce),Om=zn(Ce),zm=yu(Ce),Mm=Ru(Ce),Lm=wu(Ce),Am=Tu(Ce),Um=Pu(Ce),jm=Cu(Ce),Zm=Eu(Ce),Dm=ku(Ce),ji=new WeakMap;function Fo(e,t,o){const n=Object.getPrototypeOf(e);let s=ji.get(n);if(s||(s=new Set,ji.set(n,s)),!s.has(t)){s.add(t);for(const a in o){const r=o[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const c=r.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}const V=g("ZodType",(e,t)=>(J.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Tn(e,"input"),output:Tn(e,"output")}}),e.toJSONSchema=um(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,n)=>Nm(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>la(e,o,n),e.parseAsync=async(o,n)=>xm(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>Om(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>zm(e,o,n),e.decode=(o,n)=>Mm(e,o,n),e.encodeAsync=async(o,n)=>Lm(e,o,n),e.decodeAsync=async(o,n)=>Am(e,o,n),e.safeEncode=(o,n)=>Um(e,o,n),e.safeDecode=(o,n)=>jm(e,o,n),e.safeEncodeAsync=async(o,n)=>Zm(e,o,n),e.safeDecodeAsync=async(o,n)=>Dm(e,o,n),Fo(e,"ZodType",{check(...o){const n=this.def;return this.clone(je(n,{checks:[...n.checks??[],...o.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,n){return Ze(this,o,n)},brand(){return this},register(o,n){return o.add(this,n),this},refine(o,n){return this.check(xh(o,n))},superRefine(o,n){return this.check(Oh(o,n))},overwrite(o){return this.check(kt(o))},optional(){return k(this)},exactOptional(){return bh(this)},nullable(){return Fi(this)},nullish(){return k(Fi(this))},nonoptional(o){return Ph(this,o)},array(){return m(this)},or(o){return w([this,o])},and(o){return tt(this,o)},transform(o){return Ji(this,ga(o))},default(o){return Rh(this,o)},prefault(o){return Th(this,o)},catch(o){return Eh(this,o)},pipe(o){return Ji(this,o)},readonly(){return qh(this)},describe(o){const n=this.clone();return Io.add(n,{description:o}),n},meta(...o){if(o.length===0)return Io.get(this);const n=this.clone();return Io.add(n,o[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return Io.get(e)?.description},configurable:!0}),e)),ua=g("_ZodString",(e,t)=>{$s.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Mr(e,n,s);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Fo(e,"_ZodString",{regex(...n){return this.check(Gd(...n))},includes(...n){return this.check(Qd(...n))},startsWith(...n){return this.check(Xd(...n))},endsWith(...n){return this.check(em(...n))},min(...n){return this.check(vn(...n))},max(...n){return this.check(Or(...n))},length(...n){return this.check(zr(...n))},nonempty(...n){return this.check(vn(1,...n))},lowercase(n){return this.check(Kd(n))},uppercase(n){return this.check(Yd(n))},trim(){return this.check(om())},normalize(...n){return this.check(tm(...n))},toLowerCase(){return this.check(nm())},toUpperCase(){return this.check(sm())},slugify(){return this.check(im())}})}),Hm=g("ZodString",(e,t)=>{$s.init(e,t),ua.init(e,t),e.email=o=>e.check(Nr(pa,o)),e.url=o=>e.check(xr(da,o)),e.jwt=o=>e.check(zd(ih,o)),e.emoji=o=>e.check(yd(Jm,o)),e.guid=o=>e.check(zi(Zi,o)),e.uuid=o=>e.check(Sd(dn,o)),e.uuidv4=o=>e.check(_d(dn,o)),e.uuidv6=o=>e.check(bd(dn,o)),e.uuidv7=o=>e.check(vd(dn,o)),e.nanoid=o=>e.check(Rd(Vm,o)),e.guid=o=>e.check(zi(Zi,o)),e.cuid=o=>e.check(wd(Bm,o)),e.cuid2=o=>e.check(Td(Wm,o)),e.ulid=o=>e.check(Pd(Gm,o)),e.base64=o=>e.check(Nd(oh,o)),e.base64url=o=>e.check(xd(nh,o)),e.xid=o=>e.check(Cd(Km,o)),e.ksuid=o=>e.check(Ed(Ym,o)),e.ipv4=o=>e.check(kd(Qm,o)),e.ipv6=o=>e.check($d(Xm,o)),e.cidrv4=o=>e.check(qd(eh,o)),e.cidrv6=o=>e.check(Id(th,o)),e.e164=o=>e.check(Od(sh,o)),e.datetime=o=>e.check(Ho(o)),e.date=o=>e.check(ca(o)),e.time=o=>e.check(km(o)),e.duration=o=>e.check(qm(o))});function i(e){return gd(Hm,e)}const K=g("ZodStringFormat",(e,t)=>{W.init(e,t),ua.init(e,t)}),pa=g("ZodEmail",(e,t)=>{bp.init(e,t),K.init(e,t)});function Fm(e){return Nr(pa,e)}const Zi=g("ZodGUID",(e,t)=>{Sp.init(e,t),K.init(e,t)}),dn=g("ZodUUID",(e,t)=>{_p.init(e,t),K.init(e,t)}),da=g("ZodURL",(e,t)=>{vp.init(e,t),K.init(e,t)});function ma(e){return xr(da,e)}const Jm=g("ZodEmoji",(e,t)=>{yp.init(e,t),K.init(e,t)}),Vm=g("ZodNanoID",(e,t)=>{Rp.init(e,t),K.init(e,t)}),Bm=g("ZodCUID",(e,t)=>{wp.init(e,t),K.init(e,t)}),Wm=g("ZodCUID2",(e,t)=>{Tp.init(e,t),K.init(e,t)}),Gm=g("ZodULID",(e,t)=>{Pp.init(e,t),K.init(e,t)}),Km=g("ZodXID",(e,t)=>{Cp.init(e,t),K.init(e,t)}),Ym=g("ZodKSUID",(e,t)=>{Ep.init(e,t),K.init(e,t)}),Qm=g("ZodIPv4",(e,t)=>{Np.init(e,t),K.init(e,t)}),Xm=g("ZodIPv6",(e,t)=>{xp.init(e,t),K.init(e,t)}),eh=g("ZodCIDRv4",(e,t)=>{Op.init(e,t),K.init(e,t)}),th=g("ZodCIDRv6",(e,t)=>{zp.init(e,t),K.init(e,t)}),oh=g("ZodBase64",(e,t)=>{Mp.init(e,t),K.init(e,t)}),nh=g("ZodBase64URL",(e,t)=>{Ap.init(e,t),K.init(e,t)}),sh=g("ZodE164",(e,t)=>{Up.init(e,t),K.init(e,t)}),ih=g("ZodJWT",(e,t)=>{Zp.init(e,t),K.init(e,t)}),Is=g("ZodNumber",(e,t)=>{Cr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Lr(e,n,s),Fo(e,"ZodNumber",{gt(n,s){return this.check(Li(n,s))},gte(n,s){return this.check(ts(n,s))},min(n,s){return this.check(ts(n,s))},lt(n,s){return this.check(Mi(n,s))},lte(n,s){return this.check(es(n,s))},max(n,s){return this.check(es(n,s))},int(n){return this.check(Di(n))},safe(n){return this.check(Di(n))},positive(n){return this.check(Li(0,n))},nonnegative(n){return this.check(ts(0,n))},negative(n){return this.check(Mi(0,n))},nonpositive(n){return this.check(es(0,n))},multipleOf(n,s){return this.check(Ai(n,s))},step(n,s){return this.check(Ai(n,s))},finite(){return this}});const o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function _(e){return jd(Is,e)}const rh=g("ZodNumberFormat",(e,t)=>{Dp.init(e,t),Is.init(e,t)});function Di(e){return Dd(rh,e)}const ah=g("ZodBoolean",(e,t)=>{Hp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ar(e,o,n)});function T(e){return Hd(ah,e)}const ch=g("ZodUndefined",(e,t)=>{Fp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>jr(e,o)});function ds(e){return Fd(ch,e)}const lh=g("ZodNull",(e,t)=>{Jp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ur(e,o,n)});function Ao(e){return Jd(lh,e)}const uh=g("ZodAny",(e,t)=>{Vp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Dr()});function Ns(){return Vd(uh)}const ph=g("ZodUnknown",(e,t)=>{Bp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Hr()});function C(){return Bd(ph)}const dh=g("ZodNever",(e,t)=>{Wp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Zr(e,o,n)});function ms(e){return Wd(dh,e)}const mh=g("ZodArray",(e,t)=>{Gp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Wr(e,o,n,s),e.element=t.element,Fo(e,"ZodArray",{min(o,n){return this.check(vn(o,n))},nonempty(o){return this.check(vn(1,o))},max(o,n){return this.check(Or(o,n))},length(o,n){return this.check(zr(o,n))},unwrap(){return this.element}})});function m(e,t){return rm(mh,e,t)}const ha=g("ZodObject",(e,t)=>{Yp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Gr(e,o,n,s),D(e,"shape",()=>t.shape),Fo(e,"ZodObject",{keyof(){return z(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:C()})},loose(){return this.clone({...this._zod.def,catchall:C()})},strict(){return this.clone({...this._zod.def,catchall:ms()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return pu(this,o)},safeExtend(o){return du(this,o)},merge(o){return mu(this,o)},pick(o){return lu(this,o)},omit(o){return uu(this,o)},partial(...o){return hu(Sa,this,o[0])},required(...o){return fu(_a,this,o[0])}})});function l(e,t){const o={type:"object",shape:e??{},...E(t)};return new ha(o)}function I(e,t){return new ha({type:"object",shape:e,catchall:C(),...E(t)})}const fa=g("ZodUnion",(e,t)=>{$r.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kr(e,o,n,s),e.options=t.options});function w(e,t){return new fa({type:"union",options:e,...E(t)})}const hh=g("ZodDiscriminatedUnion",(e,t)=>{fa.init(e,t),Qp.init(e,t)});function Pn(e,t,o){return new hh({type:"union",options:t,discriminator:e,...E(o)})}const fh=g("ZodIntersection",(e,t)=>{Xp.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Yr(e,o,n,s)});function tt(e,t){return new fh({type:"intersection",left:e,right:t})}const Hi=g("ZodRecord",(e,t)=>{ed.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Qr(e,o,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function y(e,t,o){return!t||!t._zod?new Hi({type:"record",keyType:i(),valueType:e,...E(t)}):new Hi({type:"record",keyType:e,valueType:t,...E(o)})}const hs=g("ZodEnum",(e,t)=>{td.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Fr(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const a={};for(const r of n)if(o.has(r))a[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new hs({...t,checks:[],...E(s),entries:a})},e.exclude=(n,s)=>{const a={...t.entries};for(const r of n)if(o.has(r))delete a[r];else throw new Error(`Key ${r} not found in enum`);return new hs({...t,checks:[],...E(s),entries:a})}});function z(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new hs({type:"enum",entries:o,...E(t)})}const gh=g("ZodLiteral",(e,t)=>{od.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Jr(e,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function p(e,t){return new gh({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Sh=g("ZodTransform",(e,t)=>{nd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Br(e,o),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new pr(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(Lo(a,o.value,t));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=e),o.issues.push(Lo(r))}};const s=t.transform(o.value,o);return s instanceof Promise?s.then(a=>(o.value=a,o.fallback=!0,o)):(o.value=s,o.fallback=!0,o)}});function ga(e){return new Sh({type:"transform",transform:e})}const Sa=g("ZodOptional",(e,t)=>{qr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>qs(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function k(e){return new Sa({type:"optional",innerType:e})}const _h=g("ZodExactOptional",(e,t)=>{sd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>qs(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function bh(e){return new _h({type:"optional",innerType:e})}const vh=g("ZodNullable",(e,t)=>{id.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Xr(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new vh({type:"nullable",innerType:e})}const yh=g("ZodDefault",(e,t)=>{rd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ta(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rh(e,t){return new yh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():hr(t)}})}const wh=g("ZodPrefault",(e,t)=>{ad.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>oa(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Th(e,t){return new wh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():hr(t)}})}const _a=g("ZodNonOptional",(e,t)=>{cd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ea(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Ph(e,t){return new _a({type:"nonoptional",innerType:e,...E(t)})}const Ch=g("ZodCatch",(e,t)=>{ld.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>na(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Eh(e,t){return new Ch({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ba=g("ZodPipe",(e,t)=>{Ir.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>sa(e,o,n,s),e.in=t.in,e.out=t.out});function Ji(e,t){return new ba({type:"pipe",in:e,out:t})}const kh=g("ZodPreprocess",(e,t)=>{ba.init(e,t),ud.init(e,t)}),$h=g("ZodReadonly",(e,t)=>{pd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ia(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function qh(e){return new $h({type:"readonly",innerType:e})}const Ih=g("ZodLazy",(e,t)=>{dd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ra(e,o,n,s),e.unwrap=()=>e._zod.def.getter()});function xs(e){return new Ih({type:"lazy",getter:e})}const Nh=g("ZodCustom",(e,t)=>{md.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Vr(e,o)});function xh(e,t={}){return am(Nh,e,t)}function Oh(e,t){return cm(e,t)}function Uo(e,t){return new kh({type:"pipe",in:ga(e),out:t})}const zh={custom:"custom"};function Mh(e){return Zd(Is,e)}const Lh="2025-11-25",Ah=[Lh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Uh="io.modelcontextprotocol/related-task",Ln="io.modelcontextprotocol/protocolVersion",Os="io.modelcontextprotocol/clientInfo",No="io.modelcontextprotocol/serverInfo",An="io.modelcontextprotocol/clientCapabilities",jh="io.modelcontextprotocol/subscriptionId",zs="io.modelcontextprotocol/logLevel",Un="2.0",Zh=-32600,Et=xs(()=>w([i(),_(),T(),Ao(),y(i(),Et),m(Et)])),X=y(i(),Et),Dh=m(Et),Ms=w([i(),_().int()]),Ls=i(),va=l({ttl:_().optional()}),ya=l({taskId:i()}),As=I({progressToken:Ms.optional(),[Uh]:ya.optional()}),me=l({_meta:As.optional()}),Jo=me.extend({task:va.optional()}),ee=l({method:i(),params:me.loose().optional()}),ve=l({_meta:As.optional()}),ye=l({method:i(),params:ve.loose().optional()}),Us=I({get[No](){return qt.optional().catch(void 0)}}),te=I({_meta:Us.optional()}),rt=w([i(),_().int()]),js=l({jsonrpc:p(Un),id:rt,...ee.shape}).strict(),Zs=l({jsonrpc:p(Un),...ye.shape}).strict(),jn=l({jsonrpc:p(Un),id:rt,result:te}).strict(),Zn=l({jsonrpc:p(Un),id:rt.optional(),error:l({code:_().int(),message:i(),data:C().optional()})}).strict(),Ra=w([js,Zs,jn,Zn]),Hh=w([jn,Zn]),Dn=te.strict(),wa=ve.extend({requestId:rt.optional(),reason:i().optional()}),Ds=ye.extend({method:p("notifications/cancelled"),params:wa}),Ta=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),$t=l({icons:m(Ta).optional()}),ot=l({name:i(),title:i().optional()}),qt=ot.extend({...ot.shape,...$t.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),Fh=tt(l({applyDefaults:T().optional()}),X),Jh=Uo(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,tt(l({form:Fh.optional(),url:X.optional()}),X.optional())),Pa=I({list:X.optional(),cancel:X.optional(),requests:I({sampling:I({createMessage:X.optional()}).optional(),elicitation:I({create:X.optional()}).optional()}).optional()}),Ca=I({list:X.optional(),cancel:X.optional(),requests:I({tools:I({call:X.optional()}).optional()}).optional()}),Ea=l({experimental:y(i(),X).optional(),sampling:l({context:X.optional(),tools:X.optional()}).optional(),elicitation:Jh.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:Pa.optional(),extensions:y(i(),X).optional()}),ka=me.extend({protocolVersion:i(),capabilities:Ea,clientInfo:qt}),$a=ee.extend({method:p("initialize"),params:ka}),Hs=l({experimental:y(i(),X).optional(),logging:X.optional(),completions:X.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:Ca.optional(),extensions:y(i(),X).optional()}),qa=te.extend({protocolVersion:i(),capabilities:Hs,serverInfo:qt,instructions:i().optional()}),Ia=ye.extend({method:p("notifications/initialized"),params:ve.optional()}),Na=ee.extend({method:p("server/discover"),params:me.optional()}),xa=te.extend({supportedVersions:m(i()),capabilities:Hs,instructions:i().optional()}),Fs=ee.extend({method:p("ping"),params:me.optional()}),Oa=l({progress:_(),total:k(_()),message:k(i())}),za=l({...ve.shape,...Oa.shape,progressToken:Ms}),Js=ye.extend({method:p("notifications/progress"),params:za}),Ma=me.extend({cursor:Ls.optional()}),It=ee.extend({params:Ma.optional()}),Nt=te.extend({nextCursor:Ls.optional()}),Vs=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),Bs=Vs.extend({text:i()}),Ws=i().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Gs=Vs.extend({blob:Ws}),xt=z(["user","assistant"]),at=l({audience:m(xt).optional(),priority:_().min(0).max(1).optional(),lastModified:Ho({offset:!0}).optional()}),Ks=l({...ot.shape,...$t.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:at.optional(),_meta:k(I({}))}),La=l({...ot.shape,...$t.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:at.optional(),_meta:k(I({}))}),Aa=It.extend({method:p("resources/list")}),Ua=Nt.extend({resources:m(Ks)}),ja=It.extend({method:p("resources/templates/list")}),Za=Nt.extend({resourceTemplates:m(La)}),Hn=me.extend({uri:i()}),Da=Hn,Ha=ee.extend({method:p("resources/read"),params:Da}),Fa=te.extend({contents:m(w([Bs,Gs]))}),Ja=ye.extend({method:p("notifications/resources/list_changed"),params:ve.optional()}),Va=Hn,Ba=ee.extend({method:p("resources/subscribe"),params:Va}),Wa=Hn,Ga=ee.extend({method:p("resources/unsubscribe"),params:Wa}),Ys=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),Ka=me.extend({notifications:Ys}),Ya=ee.extend({method:p("subscriptions/listen"),params:Ka}),Qa=ve.extend({notifications:Ys}),Xa=ye.extend({method:p("notifications/subscriptions/acknowledged"),params:Qa}),ec=Us.extend({[jh]:rt}),tc=te.extend({_meta:ec}),oc=ve.extend({uri:i()}),nc=ye.extend({method:p("notifications/resources/updated"),params:oc}),sc=l({name:i(),description:k(i()),required:k(T())}),ic=l({...ot.shape,...$t.shape,description:k(i()),arguments:k(m(sc)),_meta:k(I({}))}),rc=It.extend({method:p("prompts/list")}),ac=Nt.extend({prompts:m(ic)}),cc=me.extend({name:i(),arguments:y(i(),i()).optional()}),lc=ee.extend({method:p("prompts/get"),params:cc}),Fn=l({type:p("text"),text:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Jn=l({type:p("image"),data:Ws,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Vn=l({type:p("audio"),data:Ws,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),uc=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Qs=l({type:p("resource"),resource:w([Bs,Gs]),annotations:at.optional(),_meta:y(i(),C()).optional()}),Xs=Ks.extend({type:p("resource_link")}),Ot=w([Fn,Jn,Vn,Xs,Qs]),pc=l({role:xt,content:Ot}),dc=te.extend({description:i().optional(),messages:m(pc)}),mc=ye.extend({method:p("notifications/prompts/list_changed"),params:ve.optional()}),hc=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),fc=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Bn=l({...ot.shape,...$t.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),Et).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:I({$schema:i().optional()}).optional(),annotations:hc.optional(),execution:fc.optional(),_meta:y(i(),C()).optional()}),gc=It.extend({method:p("tools/list")}),Sc=Nt.extend({tools:m(Bn)}),Wn=te.extend({content:m(Ot).default([]),structuredContent:C().optional(),isError:T().optional()}),Vh=Wn.or(te.extend({toolResult:C()})),_c=Jo.extend({name:i(),arguments:y(i(),C()).optional()}),bc=ee.extend({method:p("tools/call"),params:_c}),vc=ye.extend({method:p("notifications/tools/list_changed"),params:ve.optional()}),Bh=l({autoRefresh:T().default(!0),debounceMs:_().int().nonnegative().default(300)}),ei=z(["debug","info","notice","warning","error","critical","alert","emergency"]),yc=me.extend({level:ei}),Rc=ee.extend({method:p("logging/setLevel"),params:yc}),wc=ve.extend({level:ei,logger:i().optional(),data:C()}),Tc=ye.extend({method:p("notifications/message"),params:wc}),Pc=l({name:i().optional()}),Cc=l({hints:m(Pc).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),Ec=l({mode:z(["auto","required","none"]).optional()}),kc=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Ot),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),$c=Pn("type",[Fn,Jn,Vn]),jo=Pn("type",[Fn,Jn,Vn,uc,kc]),qc=l({role:xt,content:w([jo,m(jo)]),_meta:y(i(),C()).optional()}),Ic=Jo.extend({messages:m(qc),modelPreferences:Cc.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:X.optional(),tools:m(Bn).optional(),toolChoice:Ec.optional()}),Nc=ee.extend({method:p("sampling/createMessage"),params:Ic}),xc=te.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:xt,content:$c}),Oc=te.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:xt,content:w([jo,m(jo)])}),ti=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Gn=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),Cn=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),oi=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),ni=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),si=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),zc=w([oi,ni]),ii=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),ri=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Mc=w([ii,ri]),Lc=w([si,zc,Mc]),ai=w([Lc,ti,Gn,Cn]),Kn=Jo.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),ai),required:m(i()).optional()}).catchall(C())}),Ac=Jo.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),Uc=w([Kn,Ac]),jc=ee.extend({method:p("elicitation/create"),params:Uc}),Zc=ve.extend({elicitationId:i()}),Dc=ye.extend({method:p("notifications/elicitation/complete"),params:Zc}),Hc=te.extend({action:z(["accept","decline","cancel"]),content:Uo(e=>e===null?void 0:e,y(i(),w([i(),_(),T(),m(i())])).optional())}),Fc=l({type:p("ref/resource"),uri:i()}),Jc=l({type:p("ref/prompt"),name:i()}),Vc=me.extend({ref:w([Jc,Fc]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),Bc=ee.extend({method:p("completion/complete"),params:Vc}),Wc=te.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),Gc=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),Kc=ee.extend({method:p("roots/list"),params:me.optional()}),Yc=te.extend({roots:m(Gc)}),Qc=ye.extend({method:p("notifications/roots/list_changed"),params:ve.optional()}),Wh=I({ttl:_().optional(),pollInterval:_().optional()}),Xc=z(["working","input_required","completed","failed","cancelled"]),zt=l({taskId:i(),status:Xc,ttl:w([_(),Ao()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),Gh=te.extend({task:zt}),el=ve.merge(zt),Kh=ye.extend({method:p("notifications/tasks/status"),params:el}),Yh=ee.extend({method:p("tasks/get"),params:me.extend({taskId:i()})}),Qh=te.merge(zt),Xh=ee.extend({method:p("tasks/result"),params:me.extend({taskId:i()})}),ef=te.loose(),tf=It.extend({method:p("tasks/list")}),of=Nt.extend({tasks:m(zt)}),nf=ee.extend({method:p("tasks/cancel"),params:me.extend({taskId:i()})}),sf=te.merge(zt),rf=w([Fs,$a,Na,Bc,Rc,lc,rc,Aa,ja,Ha,Ba,Ga,Ya,bc,gc]),af=w([Ds,Js,Ia,Qc]),cf=w([Dn,xc,Oc,Hc,Yc]),lf=w([Fs,Nc,jc,Kc]),uf=w([Ds,Js,Tc,nc,Ja,vc,mc,Xa,Dc]),pf=w([Dn,qa,xa,Wc,dc,ac,Ua,Za,Fa,Wn,Sc,tc]),ie=ma().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:zh.custom,message:"URL must be parseable",fatal:!0}),ou}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),df=I({resource:i().url(),authorization_servers:m(ie).optional(),jwks_uri:i().url().optional(),scopes_supported:m(i()).optional(),bearer_methods_supported:m(i()).optional(),resource_signing_alg_values_supported:m(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:T().optional(),authorization_details_types_supported:m(i()).optional(),dpop_signing_alg_values_supported:m(i()).optional(),dpop_bound_access_tokens_required:T().optional()}),tl=I({issuer:i(),authorization_endpoint:ie,token_endpoint:ie,registration_endpoint:ie.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),service_documentation:ie.optional(),revocation_endpoint:ie.optional(),revocation_endpoint_auth_methods_supported:m(i()).optional(),revocation_endpoint_auth_signing_alg_values_supported:m(i()).optional(),introspection_endpoint:i().optional(),introspection_endpoint_auth_methods_supported:m(i()).optional(),introspection_endpoint_auth_signing_alg_values_supported:m(i()).optional(),code_challenge_methods_supported:m(i()).optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0),dpop_signing_alg_values_supported:m(i()).optional()}),ol=I({issuer:i(),authorization_endpoint:ie,token_endpoint:ie,userinfo_endpoint:ie.optional(),jwks_uri:ie,registration_endpoint:ie.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),acr_values_supported:m(i()).optional(),subject_types_supported:m(i()),id_token_signing_alg_values_supported:m(i()),id_token_encryption_alg_values_supported:m(i()).optional(),id_token_encryption_enc_values_supported:m(i()).optional(),userinfo_signing_alg_values_supported:m(i()).optional(),userinfo_encryption_alg_values_supported:m(i()).optional(),userinfo_encryption_enc_values_supported:m(i()).optional(),request_object_signing_alg_values_supported:m(i()).optional(),request_object_encryption_alg_values_supported:m(i()).optional(),request_object_encryption_enc_values_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),display_values_supported:m(i()).optional(),claim_types_supported:m(i()).optional(),claims_supported:m(i()).optional(),service_documentation:i().optional(),claims_locales_supported:m(i()).optional(),ui_locales_supported:m(i()).optional(),claims_parameter_supported:T().optional(),request_parameter_supported:T().optional(),request_uri_parameter_supported:T().optional(),require_request_uri_registration:T().optional(),op_policy_uri:ie.optional(),op_tos_uri:ie.optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0)}),mf=l({...ol.shape,...tl.pick({code_challenge_methods_supported:!0}).shape}),hf=l({access_token:i(),id_token:i().optional(),token_type:i(),expires_in:Mh().optional(),scope:i().optional(),refresh_token:i().optional()}).strip(),ff=l({issued_token_type:p("urn:ietf:params:oauth:token-type:id-jag"),access_token:i(),token_type:i().optional(),expires_in:_().optional(),scope:i().optional()}).strip(),gf=l({error:i(),error_description:i().optional(),error_uri:i().optional()}),Vi=ie.optional().or(p("").transform(()=>{})),nl=l({redirect_uris:m(ie),token_endpoint_auth_method:i().optional(),grant_types:m(i()).optional(),response_types:m(i()).optional(),application_type:i().optional(),client_name:i().optional(),client_uri:ie.optional(),logo_uri:Vi,scope:i().optional(),contacts:m(i()).optional(),tos_uri:Vi,policy_uri:i().optional(),jwks_uri:ie.optional(),jwks:Ns().optional(),software_id:i().optional(),software_version:i().optional(),software_statement:i().optional()}).strip(),sl=l({client_id:i(),client_secret:i().optional(),client_id_issued_at:_().optional(),client_secret_expires_at:_().optional()}).strip(),Sf=nl.merge(sl),_f=l({error:i(),error_description:i().optional()}).strip(),bf=l({token:i(),token_type_hint:i().optional()}).strip(),fs=Symbol.for("mcp.sdk.errorBrands");function il(e,t){const o=new Set;let n=t;for(;typeof n=="function";){const s=n.mcpBrand;Object.prototype.hasOwnProperty.call(n,"mcpBrand")&&typeof s=="string"&&o.add(s),n=Object.getPrototypeOf(n)}o.size!==0&&Object.defineProperty(e,fs,{value:o,enumerable:!1,configurable:!0})}function En(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,fs)){const o=t[fs];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let 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})({});var oe=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return En(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return En(this,e)}constructor(e,t,o,n){super(t,n),this.code=e,this.data=o,this.name="SdkError",il(this,new.target)}};const vf="2026-07-28";function yf(e){return e>=vf}function rl(e){const t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}const al=["task","inputRequests","requestState"];function Rf(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||al.some(t=>t in e)?e:{...e,content:[]}}function wf(){const e=xs(()=>w([i(),_(),T(),Ao(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=l({ttl:_().optional()}),a=l({taskId:i()}),r=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":a.optional()}),c=l({_meta:r.optional()}),u=c.extend({task:s.optional()}),d=l({method:i(),params:c.loose().optional()}),h=l({_meta:r.optional()}),S=l({method:i(),params:h.loose().optional()}),b=I({_meta:r.optional()}),f=w([i(),_().int()]),R=b.strict(),P=h.extend({requestId:f.optional(),reason:i().optional()}),v=S.extend({method:p("notifications/cancelled"),params:P}),A=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),j=l({icons:m(A).optional()}),x=l({name:i(),title:i().optional()}),N=x.extend({...x.shape,...j.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),$=tt(l({applyDefaults:T().optional()}),t),O=Uo(ue=>ue&&typeof ue=="object"&&!Array.isArray(ue)&&Object.keys(ue).length===0?{form:{}}:ue,tt(l({form:$.optional(),url:t.optional()}),t.optional())),G=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),ne=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),se=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:O.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:G.optional(),extensions:y(i(),t).optional()}),$e=c.extend({protocolVersion:i(),capabilities:se,clientInfo:N}),q=d.extend({method:p("initialize"),params:$e}),L=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:ne.optional(),extensions:y(i(),t).optional()}),M=b.extend({protocolVersion:i(),capabilities:L,serverInfo:N,instructions:i().optional()}),F=S.extend({method:p("notifications/initialized"),params:h.optional()}),Z=d.extend({method:p("ping"),params:c.optional()}),H=l({progress:_(),total:k(_()),message:k(i())}),Y=l({...h.shape,...H.shape,progressToken:o}),fe=S.extend({method:p("notifications/progress"),params:Y}),ae=c.extend({cursor:n.optional()}),ge=d.extend({params:ae.optional()}),Te=b.extend({nextCursor:n.optional()}),ce=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),ct=ce.extend({text:i()}),De=i().refine(ue=>{try{return atob(ue),!0}catch{return!1}},{message:"Invalid Base64 string"}),lt=ce.extend({blob:De}),qe=z(["user","assistant"]),Ee=l({audience:m(qe).optional(),priority:_().min(0).max(1).optional(),lastModified:Ho({offset:!0}).optional()}),He=l({...x.shape,...j.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Ee.optional(),_meta:k(I({}))}),Mt=l({...x.shape,...j.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Ee.optional(),_meta:k(I({}))}),Lt=ge.extend({method:p("resources/list")}),At=Te.extend({resources:m(He)}),Oe=ge.extend({method:p("resources/templates/list")}),ut=Te.extend({resourceTemplates:m(Mt)}),Fe=c.extend({uri:i()}),Ut=Fe,jt=d.extend({method:p("resources/read"),params:Ut}),Zt=b.extend({contents:m(w([ct,lt]))}),Dt=S.extend({method:p("notifications/resources/list_changed"),params:h.optional()}),Ht=Fe,Ft=d.extend({method:p("resources/subscribe"),params:Ht}),Jt=Fe,Vt=d.extend({method:p("resources/unsubscribe"),params:Jt}),Bt=h.extend({uri:i()}),Wt=S.extend({method:p("notifications/resources/updated"),params:Bt}),Gt=l({name:i(),description:k(i()),required:k(T())}),Kt=l({...x.shape,...j.shape,description:k(i()),arguments:k(m(Gt)),_meta:k(I({}))}),Yt=ge.extend({method:p("prompts/list")}),Qt=Te.extend({prompts:m(Kt)}),Xt=c.extend({name:i(),arguments:y(i(),i()).optional()}),eo=d.extend({method:p("prompts/get"),params:Xt}),Je=l({type:p("text"),text:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),Ve=l({type:p("image"),data:De,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),Be=l({type:p("audio"),data:De,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),to=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),ze=l({type:p("resource"),resource:w([ct,lt]),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),oo=He.extend({type:p("resource_link")}),Pe=w([Je,Ve,Be,oo,ze]),pt=l({role:qe,content:Pe}),dt=b.extend({description:i().optional(),messages:m(pt)}),We=S.extend({method:p("notifications/prompts/list_changed"),params:h.optional()}),no=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),mt=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Ge=l({...x.shape,...j.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()).optional(),annotations:no.optional(),execution:mt.optional(),_meta:y(i(),C()).optional()}),ht=ge.extend({method:p("tools/list")}),ft=Te.extend({tools:m(Ge)}),gt=b.extend({content:m(Pe),structuredContent:y(i(),C()).optional(),isError:T().optional()}),le=u.extend({name:i(),arguments:y(i(),C()).optional()}),so=d.extend({method:p("tools/call"),params:le}),Vo=S.extend({method:p("notifications/tools/list_changed"),params:h.optional()}),St=z(["debug","info","notice","warning","error","critical","alert","emergency"]),io=c.extend({level:St}),ro=d.extend({method:p("logging/setLevel"),params:io}),ao=h.extend({level:St,logger:i().optional(),data:C()}),co=S.extend({method:p("notifications/message"),params:ao}),lo=l({name:i().optional()}),uo=l({hints:m(lo).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),po=l({mode:z(["auto","required","none"]).optional()}),Bo=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Pe),structuredContent:l({}).loose().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),mo=Pn("type",[Je,Ve,Be]),Me=Pn("type",[Je,Ve,Be,to,Bo]),ho=l({role:qe,content:w([Me,m(Me)]),_meta:y(i(),C()).optional()}),fo=u.extend({messages:m(ho),modelPreferences:uo.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(Ge).optional(),toolChoice:po.optional()}),go=d.extend({method:p("sampling/createMessage"),params:fo}),So=b.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:qe,content:mo}),_o=b.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:qe,content:w([Me,m(Me)])}),bo=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),vo=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),yo=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),Ro=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),wo=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),To=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Po=w([Ro,wo]),Ke=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Ye=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Wo=w([Ke,Ye]),Go=w([To,Po,Wo]),Re=w([Go,bo,vo,yo]),we=u.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),Re),required:m(i()).optional()}).catchall(C())}),Co=u.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),ke=w([we,Co]),Ko=d.extend({method:p("elicitation/create"),params:ke}),Yo=h.extend({elicitationId:i()}),Qo=S.extend({method:p("notifications/elicitation/complete"),params:Yo}),Xo=b.extend({action:z(["accept","decline","cancel"]),content:Uo(ue=>ue===null?void 0:ue,y(i(),w([i(),_(),T(),m(i())])).optional())}),en=l({type:p("ref/resource"),uri:i()}),tn=l({type:p("ref/prompt"),name:i()}),on=c.extend({ref:w([tn,en]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),Eo=d.extend({method:p("completion/complete"),params:on}),nn=b.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),sn=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),_t=d.extend({method:p("roots/list"),params:c.optional()}),ko=b.extend({roots:m(sn)}),rn=S.extend({method:p("notifications/roots/list_changed"),params:h.optional()}),an=I({ttl:_().optional(),pollInterval:_().optional()}),cn=z(["working","input_required","completed","failed","cancelled"]),Le=l({taskId:i(),status:cn,ttl:w([_(),Ao()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),Se=b.extend({task:Le}),ln=h.merge(Le),Qe=S.extend({method:p("notifications/tasks/status"),params:ln}),bt=d.extend({method:p("tasks/get"),params:c.extend({taskId:i()})}),vt=b.merge(Le),yt=d.extend({method:p("tasks/result"),params:c.extend({taskId:i()})}),Yn=b.loose(),_e=ge.extend({method:p("tasks/list")}),Q=Te.extend({tasks:m(Le)}),Xe=d.extend({method:p("tasks/cancel"),params:c.extend({taskId:i()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,TaskMetadataSchema:s,RelatedTaskMetadataSchema:a,RequestMetaSchema:r,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:u,RequestSchema:d,NotificationsParamsSchema:h,NotificationSchema:S,ResultSchema:b,RequestIdSchema:f,EmptyResultSchema:R,CancelledNotificationParamsSchema:P,CancelledNotificationSchema:v,IconSchema:A,IconsSchema:j,BaseMetadataSchema:x,ImplementationSchema:N,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:ne,ClientCapabilitiesSchema:se,InitializeRequestParamsSchema:$e,InitializeRequestSchema:q,ServerCapabilitiesSchema:L,InitializeResultSchema:M,InitializedNotificationSchema:F,PingRequestSchema:Z,ProgressSchema:H,ProgressNotificationParamsSchema:Y,ProgressNotificationSchema:fe,PaginatedRequestParamsSchema:ae,PaginatedRequestSchema:ge,PaginatedResultSchema:Te,ResourceContentsSchema:ce,TextResourceContentsSchema:ct,BlobResourceContentsSchema:lt,RoleSchema:qe,AnnotationsSchema:Ee,ResourceSchema:He,ResourceTemplateSchema:Mt,ListResourcesRequestSchema:Lt,ListResourcesResultSchema:At,ListResourceTemplatesRequestSchema:Oe,ListResourceTemplatesResultSchema:ut,ResourceRequestParamsSchema:Fe,ReadResourceRequestParamsSchema:Ut,ReadResourceRequestSchema:jt,ReadResourceResultSchema:Zt,ResourceListChangedNotificationSchema:Dt,SubscribeRequestParamsSchema:Ht,SubscribeRequestSchema:Ft,UnsubscribeRequestParamsSchema:Jt,UnsubscribeRequestSchema:Vt,ResourceUpdatedNotificationParamsSchema:Bt,ResourceUpdatedNotificationSchema:Wt,PromptArgumentSchema:Gt,PromptSchema:Kt,ListPromptsRequestSchema:Yt,ListPromptsResultSchema:Qt,GetPromptRequestParamsSchema:Xt,GetPromptRequestSchema:eo,TextContentSchema:Je,ImageContentSchema:Ve,AudioContentSchema:Be,ToolUseContentSchema:to,EmbeddedResourceSchema:ze,ResourceLinkSchema:oo,ContentBlockSchema:Pe,PromptMessageSchema:pt,GetPromptResultSchema:dt,PromptListChangedNotificationSchema:We,ToolAnnotationsSchema:no,ToolExecutionSchema:mt,ToolSchema:Ge,ListToolsRequestSchema:ht,ListToolsResultSchema:ft,CallToolResultSchema:gt,CallToolRequestParamsSchema:le,CallToolRequestSchema:so,ToolListChangedNotificationSchema:Vo,LoggingLevelSchema:St,SetLevelRequestParamsSchema:io,SetLevelRequestSchema:ro,LoggingMessageNotificationParamsSchema:ao,LoggingMessageNotificationSchema:co,ModelHintSchema:lo,ModelPreferencesSchema:uo,ToolChoiceSchema:po,ToolResultContentSchema:Bo,SamplingContentSchema:mo,SamplingMessageContentBlockSchema:Me,SamplingMessageSchema:ho,CreateMessageRequestParamsSchema:fo,CreateMessageRequestSchema:go,CreateMessageResultSchema:So,CreateMessageResultWithToolsSchema:_o,BooleanSchemaSchema:bo,StringSchemaSchema:vo,NumberSchemaSchema:yo,UntitledSingleSelectEnumSchemaSchema:Ro,TitledSingleSelectEnumSchemaSchema:wo,LegacyTitledEnumSchemaSchema:To,SingleSelectEnumSchemaSchema:Po,UntitledMultiSelectEnumSchemaSchema:Ke,TitledMultiSelectEnumSchemaSchema:Ye,MultiSelectEnumSchemaSchema:Wo,EnumSchemaSchema:Go,PrimitiveSchemaDefinitionSchema:Re,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:Co,ElicitRequestParamsSchema:ke,ElicitRequestSchema:Ko,ElicitationCompleteNotificationParamsSchema:Yo,ElicitationCompleteNotificationSchema:Qo,ElicitResultSchema:Xo,ResourceTemplateReferenceSchema:en,PromptReferenceSchema:tn,CompleteRequestParamsSchema:on,CompleteRequestSchema:Eo,CompleteResultSchema:nn,RootSchema:sn,ListRootsRequestSchema:_t,ListRootsResultSchema:ko,RootsListChangedNotificationSchema:rn,TaskCreationParamsSchema:an,TaskStatusSchema:cn,TaskSchema:Le,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:ln,TaskStatusNotificationSchema:Qe,GetTaskRequestSchema:bt,GetTaskResultSchema:vt,GetTaskPayloadRequestSchema:yt,GetTaskPayloadResultSchema:Yn,ListTasksRequestSchema:_e,ListTasksResultSchema:Q,CancelTaskRequestSchema:Xe,CancelTaskResultSchema:b.merge(Le),ClientRequestSchema:w([Z,q,Eo,ro,eo,Yt,Lt,Oe,jt,Ft,Vt,so,ht,bt,yt,_e,Xe]),ClientNotificationSchema:w([v,fe,F,rn,Qe]),ClientResultSchema:w([R,So,_o,Xo,ko,vt,Q,Se]),ServerRequestSchema:w([Z,go,Ko,_t,bt,yt,_e,Xe]),ServerNotificationSchema:w([v,fe,co,Wt,Dt,Vo,We,Qe,Qo]),ServerResultSchema:w([R,M,nn,dt,Qt,At,ut,Zt,gt,ft,vt,Q,Se]),CallToolResultWireSchema:C().superRefine((ue,xl)=>{if(!(typeof ue!="object"||ue===null||Array.isArray(ue)||ue.content!==void 0)){for(const _i of al)if(_i in ue){xl.addIssue({code:"custom",message:`content is required when the body carries '${_i}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Rf).pipe(gt)}}let Tf;function cl(){return Tf??=wf()}function ll(e){return e.type!=="object"}const Pf=new Set(["const","enum","default","examples"]),Cf=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Bi(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Ef(e){const t=typeof e.$schema=="string"?e.$schema:void 0;if(Bi(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};const o=tu(e.$schema)&&e.$recursiveAnchor!==!0,n=(s,a)=>{if(Array.isArray(s))return s.map(u=>n(u,!1));if(s===null||typeof s!="object"||!a&&Bi(s.$id))return s;const r={};let c=!1;for(const[u,d]of Object.entries(s))a?r[u]=n(d,!1):(u==="$ref"||u==="$dynamicRef")&&typeof d=="string"?r[u]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:u==="$recursiveRef"&&d==="#"&&o?c=!0:Pf.has(u)?r[u]=d:Cf.has(u)?r[u]=n(d,!0):r[u]=n(d,!1);return c&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:n(e,!1)},required:["result"]}}const kf={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},$f={"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},qf={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};let mn;function ci(){if(mn)return mn;const e=cl();return mn={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}},mn}function ul(e){return Object.prototype.hasOwnProperty.call(kf,e)}function pl(e){return Object.prototype.hasOwnProperty.call($f,e)}function If(e){return Object.prototype.hasOwnProperty.call(qf,e)}function Nf(e){return If(e)?ci().resultSchemas[e]:void 0}function xf(e){return ul(e)?ci().requestSchemas[e]:void 0}function Of(e){return pl(e)?ci().notificationSchemas[e]:void 0}function gs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function hn(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const Wi={ok:!1,reason:"not-in-era"};function Gi(e){return gs(e)&&gs(e.outputSchema)&&ll(e.outputSchema)}const li={era:"2025-11-25",hasRequestMethod:ul,hasNotificationMethod:pl,validateRequest:(e,t)=>hn(xf(e),t),validateResult:(e,t)=>hn(Nf(e),t),validateNotification:(e,t)=>hn(Of(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Wi,validateInputResponse:()=>Wi,samplingResultVariant:((e,t)=>{const o=cl();return hn(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){const o=rl(e),n=o.structuredContent;if(n===void 0)return o;const s=typeof n!="object"||n===null||Array.isArray(n),a=t!==void 0&&ll(t);return!s&&!a?o:{...o,structuredContent:{result:n}}},decodeResult(e,t){if(gs(t)&&"resultType"in t){const o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;const o=t.tools;return!Array.isArray(o)||!o.some(n=>Gi(n))?t:{...t,tools:o.map(n=>Gi(n)?{...n,outputSchema:Ef(n.outputSchema)}:n)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function zf(){const e=xs(()=>w([i(),_(),T(),Ao(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=w([i(),_().int()]),a=z(["user","assistant"]),r=z(["debug","info","notice","warning","error","critical","alert","emergency"]),c=i().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),u=l({ttl:_().optional()}),d=l({taskId:i()}),h=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=l({_meta:h.optional()}),b=S.extend({task:u.optional()}),f=l({_meta:h.optional()}),R=l({method:i(),params:f.loose().optional()}),P=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),v=l({icons:m(P).optional()}),A=l({name:i(),title:i().optional()}),j=A.extend({...A.shape,...v.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),x=tt(l({applyDefaults:T().optional()}),t),N=Uo(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,tt(l({form:x.optional(),url:t.optional()}),t.optional())),$=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),O=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),G=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:N.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:$.optional(),extensions:y(i(),t).optional()}),ne=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:O.optional(),extensions:y(i(),t).optional()}),se=l({progress:_(),total:k(_()),message:k(i())}),$e=l({...f.shape,...se.shape,progressToken:o}),q=R.extend({method:p("notifications/progress"),params:$e}),L=f.extend({level:r,logger:i().optional(),data:C()}),M=R.extend({method:p("notifications/message"),params:L}),F=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),Z=F.extend({text:i()}),H=F.extend({blob:c}),Y=l({audience:m(a).optional(),priority:_().min(0).max(1).optional(),lastModified:Ho({offset:!0}).optional()}),fe=l({...A.shape,...v.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Y.optional(),_meta:k(I({}))}),ae=l({...A.shape,...v.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Y.optional(),_meta:k(I({}))}),ge=R.extend({method:p("notifications/resources/list_changed"),params:f.optional()}),Te=f.extend({uri:i()}),ce=R.extend({method:p("notifications/resources/updated"),params:Te}),ct=l({name:i(),description:k(i()),required:k(T())}),De=l({...A.shape,...v.shape,description:k(i()),arguments:k(m(ct)),_meta:k(I({}))}),lt=R.extend({method:p("notifications/prompts/list_changed"),params:f.optional()}),qe=l({type:p("text"),text:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Ee=l({type:p("image"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),He=l({type:p("audio"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Mt=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Lt=l({type:p("resource"),resource:w([Z,H]),annotations:Y.optional(),_meta:y(i(),C()).optional()}),At=fe.extend({type:p("resource_link")}),Oe=w([qe,Ee,He,At,Lt]),ut=l({role:a,content:Oe}),Fe=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),Ut=R.extend({method:p("notifications/tools/list_changed"),params:f.optional()}),jt=l({name:i().optional()}),Zt=l({hints:m(jt).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),Dt=l({mode:z(["auto","required","none"]).optional()}),Ht=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Ft=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),Jt=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),Vt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),Bt=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),Wt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Gt=w([Vt,Bt]),Kt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Yt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Qt=w([Kt,Yt]),Xt=w([Wt,Gt,Qt]),eo=w([Xt,Ht,Ft,Jt]),Je=b.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),eo),required:m(i()).optional()}).catchall(C())}),Ve=l({type:p("ref/resource"),uri:i()}),Be=l({type:p("ref/prompt"),name:i()}),to=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),ze=G.shape,oo=l({experimental:ze.experimental,sampling:ze.sampling,elicitation:ze.elicitation,roots:ze.roots,extensions:ze.extensions}),Pe=ne.shape,pt=l({experimental:Pe.experimental,logging:Pe.logging,completions:Pe.completions,prompts:Pe.prompts,resources:Pe.resources,tools:Pe.tools,extensions:Pe.extensions}),dt=I({progressToken:o.optional(),[Ln]:i(),[Os]:j.optional(),[An]:oo,[zs]:r.optional()}),We=l({...A.shape,...v.shape,description:i().optional(),inputSchema:I({$schema:i().optional(),type:p("object")}),outputSchema:I({$schema:i().optional()}).optional(),annotations:Fe.optional(),_meta:y(i(),C()).optional()}),no=l({type:p("tool_result"),toolUseId:i(),content:m(Oe),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),mt=w([qe,Ee,He,Mt,no]),Ge=l({role:a,content:w([mt,m(mt)]),_meta:y(i(),C()).optional()}),ht=i(),ft=I({[No]:j.optional().catch(void 0)}),gt=ft.optional();function le(Q){return I({_meta:gt,resultType:ht.default("complete"),...Q})}const so=le({}),Vo=le({nextCursor:n.optional()}),St=le({content:m(Oe),structuredContent:C().optional(),isError:T().optional()}),io=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(We),nextCursor:n.optional()}),ro=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(De),nextCursor:n.optional()}),ao=le({description:i().optional(),messages:m(ut)}),co=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),lo=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ae),nextCursor:n.optional()}),uo=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),po=le({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),Bo=le({ttlMs:_().int().min(0),cacheScope:z(["public","private"])}),mo=le({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),Me=l({messages:m(Ge),modelPreferences:Zt.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(We).optional(),toolChoice:Dt.optional()}),ho=l({method:p("sampling/createMessage"),params:Me}),fo=l({method:p("roots/list"),params:l({_meta:y(i(),C()).optional()}).optional()}),go=l({...Ge.shape,model:i(),stopReason:i().optional()}),So=l({roots:m(to)}),_o=l({action:z(["accept","decline","cancel"]),content:y(i(),w([i(),_(),T(),m(i())])).optional()}),bo=l({mode:p("url"),message:i(),url:i().url()}),vo=w([Je,bo]),yo=l({method:p("elicitation/create"),params:vo}),Ro=w([ho,fo,yo]),wo=w([go,So,_o]),To=y(i(),Ro),Po=y(i(),wo),Ke=le({inputRequests:To.optional(),requestState:i().optional()}),Ye={inputResponses:Po.optional(),requestState:i().optional()},Wo=l({_meta:dt,...Ye}),Go=I({progressToken:o.optional()});function Re(Q,Xe){return l({method:p(Q),params:l({_meta:dt,...Xe})})}function we(Q,Xe){return l({method:p(Q),params:l({_meta:Go.optional(),...Xe}).optional()})}const Co={name:i(),arguments:y(i(),C()).optional(),...Ye},ke={cursor:n.optional()},Ko=Re("tools/call",Co),Yo=Re("tools/list",ke),Qo=Re("prompts/list",ke),Xo=Re("prompts/get",{name:i(),arguments:y(i(),i()).optional(),...Ye}),en=Re("resources/list",ke),tn=Re("resources/templates/list",ke),on=Re("resources/read",{uri:i(),...Ye}),Eo={ref:w([Be,Ve]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()},nn=Re("completion/complete",Eo),sn=Re("server/discover",{}),_t=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),ko={notifications:_t},rn=Re("subscriptions/listen",ko),an=ft.extend({"io.modelcontextprotocol/subscriptionId":s}),cn=I({_meta:an,resultType:ht.default("complete")}),Le={"tools/call":we("tools/call",Co),"tools/list":we("tools/list",ke),"prompts/get":we("prompts/get",{name:i(),arguments:y(i(),i()).optional()}),"prompts/list":we("prompts/list",ke),"resources/list":we("resources/list",ke),"resources/templates/list":we("resources/templates/list",ke),"resources/read":we("resources/read",{uri:i()}),"completion/complete":we("completion/complete",Eo),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",ko)};function Se(Q){return I({_meta:gt,...Q})}const ln={"tools/call":Se({content:m(Oe),structuredContent:C().optional(),isError:T().optional()}),"tools/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(We),nextCursor:n.optional()}),"prompts/get":Se({description:i().optional(),messages:m(ut)}),"prompts/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(De),nextCursor:n.optional()}),"resources/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),"resources/templates/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ae),nextCursor:n.optional()}),"resources/read":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),"completion/complete":Se({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),"server/discover":Se({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),"subscriptions/listen":Se({})},Qe=I({"io.modelcontextprotocol/subscriptionId":s.optional()}),bt=l({method:p("notifications/subscriptions/acknowledged"),params:l({_meta:Qe.optional(),notifications:_t})}),vt=l({_meta:Qe.optional(),requestId:s,reason:i().optional()}),yt=l({method:p("notifications/cancelled"),params:vt}),Yn={"notifications/cancelled":yt,"notifications/progress":q,"notifications/message":M,"notifications/resources/updated":ce,"notifications/resources/list_changed":ge,"notifications/tools/list_changed":Ut,"notifications/prompts/list_changed":lt,"notifications/subscriptions/acknowledged":bt},_e=Q=>l({jsonrpc:p("2.0"),id:w([i(),_().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,RequestIdSchema:s,RoleSchema:a,LoggingLevelSchema:r,TaskMetadataSchema:u,RelatedTaskMetadataSchema:d,RequestMetaSchema:h,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:b,NotificationsParamsSchema:f,NotificationSchema:R,IconSchema:P,IconsSchema:v,BaseMetadataSchema:A,ImplementationSchema:j,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:O,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:ne,ProgressSchema:se,ProgressNotificationParamsSchema:$e,ProgressNotificationSchema:q,LoggingMessageNotificationParamsSchema:L,LoggingMessageNotificationSchema:M,ResourceContentsSchema:F,TextResourceContentsSchema:Z,BlobResourceContentsSchema:H,AnnotationsSchema:Y,ResourceSchema:fe,ResourceTemplateSchema:ae,ResourceListChangedNotificationSchema:ge,ResourceUpdatedNotificationParamsSchema:Te,ResourceUpdatedNotificationSchema:ce,PromptArgumentSchema:ct,PromptSchema:De,PromptListChangedNotificationSchema:lt,TextContentSchema:qe,ImageContentSchema:Ee,AudioContentSchema:He,ToolUseContentSchema:Mt,EmbeddedResourceSchema:Lt,ResourceLinkSchema:At,ContentBlockSchema:Oe,PromptMessageSchema:ut,ToolAnnotationsSchema:Fe,ToolListChangedNotificationSchema:Ut,ModelHintSchema:jt,ModelPreferencesSchema:Zt,ToolChoiceSchema:Dt,BooleanSchemaSchema:Ht,StringSchemaSchema:Ft,NumberSchemaSchema:Jt,UntitledSingleSelectEnumSchemaSchema:Vt,TitledSingleSelectEnumSchemaSchema:Bt,LegacyTitledEnumSchemaSchema:Wt,SingleSelectEnumSchemaSchema:Gt,UntitledMultiSelectEnumSchemaSchema:Kt,TitledMultiSelectEnumSchemaSchema:Yt,MultiSelectEnumSchemaSchema:Qt,EnumSchemaSchema:Xt,PrimitiveSchemaDefinitionSchema:eo,ElicitRequestFormParamsSchema:Je,ResourceTemplateReferenceSchema:Ve,PromptReferenceSchema:Be,RootSchema:to,ClientCapabilities2026Schema:oo,ServerCapabilities2026Schema:pt,RequestMetaEnvelopeSchema:dt,ToolSchema:We,ToolResultContentSchema:no,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:Ge,ResultTypeSchema:ht,ResultMetaSchema:ft,ResultSchema:so,PaginatedResultSchema:Vo,CallToolResultSchema:St,ListToolsResultSchema:io,ListPromptsResultSchema:ro,GetPromptResultSchema:ao,ListResourcesResultSchema:co,ListResourceTemplatesResultSchema:lo,ReadResourceResultSchema:uo,CompleteResultSchema:po,CacheableResultSchema:Bo,DiscoverResultSchema:mo,CreateMessageRequestParamsSchema:Me,CreateMessageRequestSchema:ho,ListRootsRequestSchema:fo,CreateMessageResultSchema:go,ListRootsResultSchema:So,ElicitResultSchema:_o,ElicitRequestURLParamsSchema:bo,ElicitRequestParamsSchema:vo,ElicitRequestSchema:yo,InputRequestSchema:Ro,InputResponseSchema:wo,InputRequestsSchema:To,InputResponsesSchema:Po,InputRequiredResultSchema:Ke,InputResponseRequestParamsSchema:Wo,CallToolRequestSchema:Ko,ListToolsRequestSchema:Yo,ListPromptsRequestSchema:Qo,GetPromptRequestSchema:Xo,ListResourcesRequestSchema:en,ListResourceTemplatesRequestSchema:tn,ReadResourceRequestSchema:on,CompleteRequestSchema:nn,DiscoverRequestSchema:sn,SubscriptionFilterSchema:_t,SubscriptionsListenRequestSchema:rn,SubscriptionsListenResultMetaSchema:an,SubscriptionsListenResultSchema:cn,dispatchRequestSchemas:Le,dispatchResultSchemas:ln,NotificationMetaSchema:Qe,SubscriptionsAcknowledgedNotificationSchema:bt,CancelledNotificationParamsSchema:vt,CancelledNotificationSchema:yt,notificationSchemas2026:Yn,JSONRPCResultResponseSchema:_e(so),CallToolResultResponseSchema:_e(w([St,Ke])),ListToolsResultResponseSchema:_e(io),ListPromptsResultResponseSchema:_e(ro),GetPromptResultResponseSchema:_e(w([ao,Ke])),ListResourcesResultResponseSchema:_e(co),ListResourceTemplatesResultResponseSchema:_e(lo),ReadResourceResultResponseSchema:_e(w([uo,Ke])),CompleteResultResponseSchema:_e(po),DiscoverResultResponseSchema:_e(mo)}}let Mf;function nt(){return Mf??=zf()}const Lf=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Af(e){return Lf.includes(e)}const ui=Symbol("modelcontextprotocol.resultCacheHintFallback");function Uf(e){return e[ui]}function dl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function ml(e){return e==="public"||e==="private"}let U=(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})({});var re=class hl extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return En(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return En(this,t)}constructor(t,o,n){super(o),this.code=t,this.data=n,this.name="ProtocolError",il(this,new.target)}static fromError(t,o,n){if(t===U.UrlElicitationRequired&&n){const s=n;if(s.elicitations)return new Zf(s.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&n){const s=n;if(Array.isArray(s.supported)&&typeof s.requested=="string")return new Df({supported:s.supported,requested:s.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){const s=n;if(typeof s?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(s).length===1))return new jf(s.uri,o)}if(t===U.MissingRequiredClientCapability&&n){const s=n;if(s.requiredCapabilities!==null&&typeof s.requiredCapabilities=="object"&&!Array.isArray(s.requiredCapabilities))return new Hf({requiredCapabilities:s.requiredCapabilities},o)}return new hl(t,o,n)}},jf=class extends re{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Zf=class extends re{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Df=class extends re{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Hf=class extends re{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};const Ff=0,Jf="private",Vf=["tools/call","prompts/get","resources/read"];function Bf(e,t){const o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||Vf.includes(e))return t;throw new re(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Wf(e,t){const o=Uf(t);if(t.resultType!=="complete"||!Af(e))return o===void 0?t:Xf(t);const n=t,s=dl(n.ttlMs)?n.ttlMs:Yf(o),a=ml(n.cacheScope)?n.cacheScope:Qf(o),r={...n,ttlMs:s,cacheScope:a};return delete r[ui],r}function Gf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Kf(e,t){if(t===void 0)return e;const o=e._meta;return o===void 0?{...e,_meta:{[No]:t}}:!Gf(o)||o[No]!==void 0?e:{...e,_meta:{...o,[No]:t}}}function Yf(e){return e!==void 0&&dl(e.ttlMs)?e.ttlMs:Ff}function Qf(e){return e!==void 0&&ml(e.cacheScope)?e.cacheScope:Jf}function Xf(e){const t={...e};return delete t[ui],t}const eg=["elicitation/create","sampling/createMessage","roots/list"];let fn;function fl(){if(fn)return fn;const e=nt();return fn={request:{"elicitation/create":l({method:p("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":l({method:p("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":l({method:p("roots/list"),params:I({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},fn}function gl(e){return eg.includes(e)}function os(e){return gl(e)?fl().request[e]:void 0}function tg(e){return gl(e)?fl().response[e]:void 0}const Sl={"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},og={"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 _l(e){return Object.prototype.hasOwnProperty.call(Sl,e)}function bl(e){return Object.prototype.hasOwnProperty.call(og,e)}function ng(e){return Object.prototype.hasOwnProperty.call(Sl,e)}function sg(e){return _l(e)?nt().dispatchRequestSchemas[e]:void 0}function ig(e){return ng(e)?nt().dispatchResultSchemas[e]:void 0}function rg(e){return bl(e)?nt().notificationSchemas2026[e]:void 0}function xo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function $o(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const ag={ok:!1,reason:"not-in-era"},cg=[Ln,An];function lg(e,t){let o=t,n=!1;const s=()=>(n||(o={...o},n=!0),o),a=t.tools;e==="tools/list"&&Array.isArray(a)&&a.some(c=>xo(c)&&"execution"in c)&&(s().tools=a.map(c=>{if(!xo(c)||!("execution"in c))return c;const u={...c};return delete u.execution,u}));const r=t.capabilities;if(xo(r)&&"tasks"in r){const c={...r};delete c.tasks,s().capabilities=c}return o}const pi={era:"2026-07-28",hasRequestMethod:_l,hasNotificationMethod:bl,hasInputRequestMethod:e=>os(e)!==void 0,validateRequest:(e,t)=>$o(sg(e),t),validateResult:(e,t)=>$o(ig(e),t),validateNotification:(e,t)=>$o(rg(e),t),validateInputRequest:(e,t)=>$o(os(e),t),validateInputResponse:(e,t)=>$o(tg(e),t),samplingResultVariant:()=>ag,outboundEnvelope(e){return{[Ln]:e.protocolVersion,[Os]:e.clientInfo,[An]:e.clientCapabilities,...e.logLevel!==void 0&&{[zs]:e.logLevel}}},validateEnvelopeMeta(e){const t=[];for(const n of cg)n in e||t.push({key:n,problem:"missing"});const o=nt().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(const n of o.error.issues){const s=n.path.map(String),a=s.length>0?s.join("."):"_meta";s.length===1&&t.some(r=>r.key===a&&r.problem==="missing")||t.push({key:a,problem:n.message})}return t},projectCallToolResult:e=>rl(e),inputRequestSchema:os,decodeResult(e,t){if(!xo(t))return{kind:"invalid",error:new oe(pe.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};const o=t.resultType;if(o===void 0)return{kind:"invalid",error:new oe(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 o!="string")return{kind:"invalid",error:new oe(pe.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){const r=t.inputRequests,c=xo(r)?r:{},u=t.requestState;return Object.keys(c).length===0&&typeof u!="string"?{kind:"invalid",error:new oe(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"})}:{kind:"input_required",inputRequests:c,...typeof u=="string"&&{requestState:u}}}if(o!=="complete")return{kind:"invalid",error:new oe(pe.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};const n=ug(),s=Object.hasOwn(n,e)?n[e]:void 0;if(s!==void 0){const r=s.safeParse(t);if(!r.success)return{kind:"invalid",error:new oe(pe.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}const a={...t};return delete a.resultType,{kind:"complete",result:a}},encodeResult(e,t,o){return Kf(Wf(e,Bf(e,lg(e,t))),o)},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)";const t=nt().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}};let gn;function ug(){if(gn)return gn;const e=nt();return gn={"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},gn}const vl="2026-07-28";function kn(e){return e!==void 0&&yf(e)?pi:li}function Ki(e){return e.revision!==void 0?kn(e.revision).era:e.era==="modern"?pi.era:li.era}function ns(e){return yl.some(t=>t.hasRequestMethod(e))}function ss(e){return yl.some(t=>t.hasNotificationMethod(e))}const yl=[li,pi];var pg=Yl({AnnotationsSchema:()=>at,AudioContentSchema:()=>Vn,BaseMetadataSchema:()=>ot,BaseRequestParamsSchema:()=>me,BlobResourceContentsSchema:()=>Gs,BooleanSchemaSchema:()=>ti,CallToolRequestParamsSchema:()=>_c,CallToolRequestSchema:()=>bc,CallToolResultSchema:()=>Wn,CancelTaskRequestSchema:()=>nf,CancelTaskResultSchema:()=>sf,CancelledNotificationParamsSchema:()=>wa,CancelledNotificationSchema:()=>Ds,ClientCapabilitiesSchema:()=>Ea,ClientNotificationSchema:()=>af,ClientRequestSchema:()=>rf,ClientResultSchema:()=>cf,ClientTasksCapabilitySchema:()=>Pa,CompatibilityCallToolResultSchema:()=>Vh,CompleteRequestParamsSchema:()=>Vc,CompleteRequestSchema:()=>Bc,CompleteResultSchema:()=>Wc,ContentBlockSchema:()=>Ot,CreateMessageRequestParamsSchema:()=>Ic,CreateMessageRequestSchema:()=>Nc,CreateMessageResultSchema:()=>xc,CreateMessageResultWithToolsSchema:()=>Oc,CreateTaskResultSchema:()=>Gh,CursorSchema:()=>Ls,DiscoverRequestSchema:()=>Na,DiscoverResultSchema:()=>xa,ElicitRequestFormParamsSchema:()=>Kn,ElicitRequestParamsSchema:()=>Uc,ElicitRequestSchema:()=>jc,ElicitRequestURLParamsSchema:()=>Ac,ElicitResultSchema:()=>Hc,ElicitationCompleteNotificationParamsSchema:()=>Zc,ElicitationCompleteNotificationSchema:()=>Dc,EmbeddedResourceSchema:()=>Qs,EmptyResultSchema:()=>Dn,EnumSchemaSchema:()=>Lc,GetPromptRequestParamsSchema:()=>cc,GetPromptRequestSchema:()=>lc,GetPromptResultSchema:()=>dc,GetTaskPayloadRequestSchema:()=>Xh,GetTaskPayloadResultSchema:()=>ef,GetTaskRequestSchema:()=>Yh,GetTaskResultSchema:()=>Qh,IconSchema:()=>Ta,IconsSchema:()=>$t,ImageContentSchema:()=>Jn,ImplementationSchema:()=>qt,InitializeRequestParamsSchema:()=>ka,InitializeRequestSchema:()=>$a,InitializeResultSchema:()=>qa,InitializedNotificationSchema:()=>Ia,JSONArraySchema:()=>Dh,JSONObjectSchema:()=>X,JSONRPCErrorResponseSchema:()=>Zn,JSONRPCMessageSchema:()=>Ra,JSONRPCNotificationSchema:()=>Zs,JSONRPCRequestSchema:()=>js,JSONRPCResponseSchema:()=>Hh,JSONRPCResultResponseSchema:()=>jn,JSONValueSchema:()=>Et,LegacyTitledEnumSchemaSchema:()=>si,ListChangedOptionsBaseSchema:()=>Bh,ListPromptsRequestSchema:()=>rc,ListPromptsResultSchema:()=>ac,ListResourceTemplatesRequestSchema:()=>ja,ListResourceTemplatesResultSchema:()=>Za,ListResourcesRequestSchema:()=>Aa,ListResourcesResultSchema:()=>Ua,ListRootsRequestSchema:()=>Kc,ListRootsResultSchema:()=>Yc,ListTasksRequestSchema:()=>tf,ListTasksResultSchema:()=>of,ListToolsRequestSchema:()=>gc,ListToolsResultSchema:()=>Sc,LoggingLevelSchema:()=>ei,LoggingMessageNotificationParamsSchema:()=>wc,LoggingMessageNotificationSchema:()=>Tc,ModelHintSchema:()=>Pc,ModelPreferencesSchema:()=>Cc,MultiSelectEnumSchemaSchema:()=>Mc,NotificationSchema:()=>ye,NotificationsParamsSchema:()=>ve,NumberSchemaSchema:()=>Cn,PaginatedRequestParamsSchema:()=>Ma,PaginatedRequestSchema:()=>It,PaginatedResultSchema:()=>Nt,PingRequestSchema:()=>Fs,PrimitiveSchemaDefinitionSchema:()=>ai,ProgressNotificationParamsSchema:()=>za,ProgressNotificationSchema:()=>Js,ProgressSchema:()=>Oa,ProgressTokenSchema:()=>Ms,PromptArgumentSchema:()=>sc,PromptListChangedNotificationSchema:()=>mc,PromptMessageSchema:()=>pc,PromptReferenceSchema:()=>Jc,PromptSchema:()=>ic,ReadResourceRequestParamsSchema:()=>Da,ReadResourceRequestSchema:()=>Ha,ReadResourceResultSchema:()=>Fa,RelatedTaskMetadataSchema:()=>ya,RequestIdSchema:()=>rt,RequestMetaSchema:()=>As,RequestSchema:()=>ee,ResourceContentsSchema:()=>Vs,ResourceLinkSchema:()=>Xs,ResourceListChangedNotificationSchema:()=>Ja,ResourceRequestParamsSchema:()=>Hn,ResourceSchema:()=>Ks,ResourceTemplateReferenceSchema:()=>Fc,ResourceTemplateSchema:()=>La,ResourceUpdatedNotificationParamsSchema:()=>oc,ResourceUpdatedNotificationSchema:()=>nc,ResultMetaObjectSchema:()=>Us,ResultSchema:()=>te,RoleSchema:()=>xt,RootSchema:()=>Gc,RootsListChangedNotificationSchema:()=>Qc,SamplingContentSchema:()=>$c,SamplingMessageContentBlockSchema:()=>jo,SamplingMessageSchema:()=>qc,ServerCapabilitiesSchema:()=>Hs,ServerNotificationSchema:()=>uf,ServerRequestSchema:()=>lf,ServerResultSchema:()=>pf,ServerTasksCapabilitySchema:()=>Ca,SetLevelRequestParamsSchema:()=>yc,SetLevelRequestSchema:()=>Rc,SingleSelectEnumSchemaSchema:()=>zc,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Va,SubscribeRequestSchema:()=>Ba,SubscriptionFilterSchema:()=>Ys,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Qa,SubscriptionsAcknowledgedNotificationSchema:()=>Xa,SubscriptionsListenRequestParamsSchema:()=>Ka,SubscriptionsListenRequestSchema:()=>Ya,SubscriptionsListenResultMetaSchema:()=>ec,SubscriptionsListenResultSchema:()=>tc,TaskAugmentedRequestParamsSchema:()=>Jo,TaskCreationParamsSchema:()=>Wh,TaskMetadataSchema:()=>va,TaskSchema:()=>zt,TaskStatusNotificationParamsSchema:()=>el,TaskStatusNotificationSchema:()=>Kh,TaskStatusSchema:()=>Xc,TextContentSchema:()=>Fn,TextResourceContentsSchema:()=>Bs,TitledMultiSelectEnumSchemaSchema:()=>ri,TitledSingleSelectEnumSchemaSchema:()=>ni,ToolAnnotationsSchema:()=>hc,ToolChoiceSchema:()=>Ec,ToolExecutionSchema:()=>fc,ToolListChangedNotificationSchema:()=>vc,ToolResultContentSchema:()=>kc,ToolSchema:()=>Bn,ToolUseContentSchema:()=>uc,UnsubscribeRequestParamsSchema:()=>Wa,UnsubscribeRequestSchema:()=>Ga,UntitledMultiSelectEnumSchemaSchema:()=>ii,UntitledSingleSelectEnumSchemaSchema:()=>oi});const dg=e=>js.safeParse(e).success,mg=e=>Zs.safeParse(e).success,Yi=e=>jn.safeParse(e).success,hg=e=>Zn.safeParse(e).success,is=-32020;U.InvalidRequest,U.UnsupportedProtocolVersion,U.InvalidParams,U.MethodNotFound,U.InvalidParams,U.MissingRequiredClientCapability;U.ParseError+"",U.InvalidRequest+"",U.MethodNotFound+"",U.UnsupportedProtocolVersion+"",U.MissingRequiredClientCapability+"";function Rl(e,t){return la(e,t)}function qo(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Ss(e){if(e==null)return!1;const t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}let Qi=!1;const _s="draft-2020-12";function fg(e,t="input"){const o=e["~standard"];let n;if(o.jsonSchema)n=o.jsonSchema[t]({target:_s});else if(o.vendor==="zod"){if(!("_zod"in e))throw new 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().");Qi||(Qi=!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.")),n=aa(e,{target:_s,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return n.type!==void 0?n:wl(n)?{type:"object",...n}:n;if(n.type!==void 0&&n.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(n.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...n}}function wl(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(const t of["oneOf","anyOf","allOf"]){const o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(n=>n!==null&&typeof n=="object"&&(n.type==="object"||wl(n)))}return!1}function gg(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function rs(e,t){const o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(n=>gg(n)).join(", ")}:{success:!0,data:o.value}}function Sg(e){const t=aa(e,{target:_s,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}const _g=/\\\.\\d\{(\d+)\}/;function bg(e){const t=_g.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(n=>[!1,!0].flatMap(s=>o.map(a=>Ho({local:n,offset:s,precision:a}))))}function vg(e,t){let o;switch(e){case"email":o=[Fm()];break;case"uri":o=[ma()];break;case"date":o=[ca()];break;case"date-time":o=bg(t);break}return new Set(o.map(n=>Sg(n)).filter(n=>n!==void 0))}function yg(e,t,o){return o!=="zod"?!0:vg(e,t).has(t)}function Zo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rg(e){try{return fg(e,"input")}catch(t){const o=t instanceof Error?t.message:String(t);throw new re(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}const wg=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function di(e){return wg.has(e)||e.startsWith("x-")}const Tg=new Set(["$schema",...Object.keys(Kn.shape.requestedSchema.shape)]),Xi={string:qo([Gn,oi,ni,si]),number:qo([Cn]),integer:qo([Cn]),boolean:qo([ti]),array:qo([ii,ri])},Pg=new Set(Gn.shape.format.unwrap().options);function Cg(e,t,o,n){if(!Zo(e))return e;const s=typeof e.type=="string"&&Object.hasOwn(Xi,e.type)?Xi[e.type]:void 0;if(s===void 0)return e;const a={};for(const[r,c]of Object.entries(e))s.has(r)||di(r)?a[r]=c:r==="pattern"&&e.type==="string"&&typeof e.format=="string"?Pg.has(e.format)?(typeof c!="string"||!yg(e.format,c,o))&&n.push(`${t}.${r}`):a[r]=c:n.push(`${t}.${r}`);return a}function Eg(e,t){const o={},n=[];for(const[s,a]of Object.entries(e))s==="properties"&&Zo(a)?o[s]=Object.fromEntries(Object.entries(a).map(([r,c])=>[r,Cg(c,`properties.${r}`,t,n)])):Tg.has(s)?o[s]=a:di(s)||n.push(s);if(n.length>0)throw new re(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);return o}function kg(e,t){if(!Zo(e.properties))return t;const o=Object.entries(e.properties).filter(([,n])=>!Rl(ai,n).success).map(([n])=>`properties.${n}`);return o.length>0?o.join(", "):t}function bs(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((n,s)=>bs(n,t[s],`${o}[${s}]`)):!Zo(e)||!Zo(t)?[]:Object.entries(e).flatMap(([n,s])=>{const a=o?`${o}.${n}`:n;return Object.prototype.hasOwnProperty.call(t,n)?bs(s,t[n],a):di(n)?[]:[a]})}function $g(e){if(!Ss(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};const t=e.requestedSchema["~standard"].vendor,o=Eg(Rg(e.requestedSchema),t),n=Rl(Kn.shape.requestedSchema,o);if(!n.success)throw new re(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${kg(o,n.error.message)}`);const s=bs(o,n.data);if(s.length>0)throw new re(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${s.join(", ")}`);const a=(n.data.required??[]).filter(r=>!Object.prototype.hasOwnProperty.call(n.data.properties,r));if(a.length>0)throw new re(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(", ")}`);return{...e,mode:"form",requestedSchema:n.data}}function qg(e){const t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(qg,{elicit(e){try{return{method:"elicitation/create",params:$g(e)}}catch(t){throw t instanceof re?new 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"}}});const Ig=["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"],Ng={IdJagTokenExchangeResponseSchema:ff,OAuthClientInformationFullSchema:Sf,OAuthClientInformationSchema:sl,OAuthClientMetadataSchema:nl,OAuthClientRegistrationErrorSchema:_f,OAuthErrorResponseSchema:gf,OAuthMetadataSchema:tl,OAuthProtectedResourceMetadataSchema:df,OAuthTokenRevocationRequestSchema:bf,OAuthTokensSchema:hf,OpenIdProviderDiscoveryMetadataSchema:mf,OpenIdProviderMetadataSchema:ol},Tl={},Pl={};function Cl(e,t){const o=e.slice(0,-6);Tl[o]=t,Pl[o]=n=>t.safeParse(n).success}for(const e of Ig)Cl(e,pg[e]);for(const[e,t]of Object.entries(Ng))Cl(e,t);Object.freeze(Tl);Object.freeze(Pl);function xg(e){switch(e){case"initialize":case"notifications/initialized":return kn(void 0);case"server/discover":return kn(vl);default:return}}const Og=6e4,zg=[Ln,Os,An,zs],Mg=["inputResponses","requestState"];function er(e,t){const o=e.params;if(!as(o))return{message:e,lifted:{}};const n=o._meta,s=as(n)?zg.filter(u=>u in n):[],a=t==="request"?Mg.filter(u=>u in o):[];if(s.length===0&&a.length===0)return{message:e,lifted:{}};const r={},c={...o};if(s.length>0&&as(n)){const u={},d={...n};for(const h of s)u[h]=n[h],delete d[h];r.envelope=u,Object.keys(d).length>0?c._meta=d:delete c._meta}for(const u of a)u==="inputResponses"&&(r.inputResponses=c[u]),u==="requestState"&&(r.requestState=c[u]),delete c[u];return{message:{...e,params:c},lifted:r}}function tr(e,t){const o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(n){const s=e.validateResult(t,n);return s.ok?{value:s.value}:{issues:[{message:s.reason==="invalid"?s.message:`not-in-era: ${t}`}]}}}}}function El(e){return()=>e}const Lg=El(void 0);var Ag=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ah,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){const t=this._outboundMetaEnvelope();if(t===void 0)return e;const o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new oe(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){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new oe(pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};const o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};const n=this._transport?.onmessage;this._transport.onmessage=(s,a)=>{n?.(s,a),Yi(s)||hg(s)?this._onresponse(s):dg(s)?this._onrequest(s,a):mg(s)?this._onnotification(s,a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();const t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;const o=new oe(pe.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(const n of e.values())n(o);for(const n of t.values())n.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){const{message:o}=er(e,"notification"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){const r=Ki(t.classification);if(r!==n.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${r} but this instance serves ${n.era}`));return}}if(ss(o.method)&&!n.hasNotificationMethod(o.method))return;const s=this._notificationHandlers.get(o.method),a=this.fallbackNotificationHandler;s===void 0&&a===void 0||Promise.resolve().then(()=>s===void 0?a(o):s(o,n)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const{message:o,lifted:n}=er(e,"request"),s=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}const a=this._transport,r=(P,v,A)=>{const j={jsonrpc:"2.0",id:o.id,error:{code:P,message:v,...A!==void 0&&{data:A}}};a?.send(j).catch(x=>this._onerror(new Error(`Failed to send an error response: ${x}`)))};if(t?.classification!==void 0){const P=Ki(t.classification);if(P!==s.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${P} but this instance serves ${s.era}`));const v=t.classification.revision??P;r(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${v}`,{supported:this._supportedProtocolVersions,requested:v});return}}if(ns(o.method)&&!s.hasRequestMethod(o.method)){r(U.MethodNotFound,"Method not found");return}const c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){r(U.MethodNotFound,"Method not found");return}const u=s.checkInboundEnvelope(n);if(u!==void 0){r(U.InvalidParams,u);return}const d=(P,v)=>this._notificationViaCodec(this._resolveOutboundCodec(P.method),P,{...v,relatedRequestId:o.id}),h=(P,v,A)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(P.method),P,v,{...A,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);const b=n.inputResponses===void 0?void 0:Ug(n.inputResponses),f={sessionId:a?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...n.envelope!==void 0&&{envelope:n.envelope},...b!==void 0&&{inputResponses:b.accepted},...b!==void 0&&b.droppedKeys.length>0&&{droppedInputResponseKeys:b.droppedKeys},requestState:n.requestState===void 0?Lg:El(n.requestState),signal:S.signal,send:((P,v,A)=>{const j=this._resolveOutboundCodec(P.method);if(this._assertOutboundRequestInEra(j,P.method),Ss(v))return h(P,v,A);const x=tr(j,P.method);if(x===void 0)throw new TypeError(`'${P.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(P,x,v)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},R=this.buildContext(f,t);Promise.resolve().then(()=>c(o,R)).then(async P=>{if(S.signal.aborted)return;let v;try{v=s.encodeResult(o.method,P,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),r(U.InternalError,"Internal error");return}const A={result:v,jsonrpc:"2.0",id:o.id};await a?.send(A)},async P=>{if(S.signal.aborted)return;const v=Number.isSafeInteger(P.code)?P.code:U.InternalError,A={jsonrpc:"2.0",id:o.id,error:{code:s.encodeErrorCode(v),message:P.message??"Internal error",...P.data!==void 0&&{data:P.data}}};await a?.send(A)}).catch(P=>this._onerror(new Error(`Failed to send response: ${P}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){const{progressToken:t,...o}=e.params,n=Number(t),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const a=this._responseHandlers.get(n),r=this._timeoutInfo.get(n);if(r&&a&&r.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(c);return}s(o)}_onresponse(e){const t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Yi(e)?o(e):o(re.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,o){const n=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(n,e.method),Ss(t))return this._requestWithSchemaViaCodec(n,e,t,o);const s=tr(n,e.method);if(s===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(n,e,s,t)}_negotiatedWireCodec(){return kn(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){const t=xg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(ns(t)&&!e.hasRequestMethod(t))throw new oe(pe.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){const n=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(n,e.method),this._requestWithSchemaViaCodec(n,e,t,o)}_requestWithSchemaViaCodec(e,t,o,n){const{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c}=n??{},u=Date.now();let d,h;return new Promise((S,b)=>{const f=O=>{b(O)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(O){f(O);return}if(n?.signal?.aborted){const O=n.signal.reason;throw O instanceof oe?O:new oe(pe.RequestTimeout,String(O))}const R=e.era===vl&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,P=this._requestMessageId++;h=P;const v={...t,jsonrpc:"2.0",id:P};n?.onprogress&&(this._progressHandlers.set(P,n.onprogress),v.params={...t.params,_meta:{...t.params?._meta,progressToken:P}});const A=this._envelopeOutbound(v);let j=!1;const x=O=>{j||(this._progressHandlers.delete(P),R===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:P,reason:String(O)}}),{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):R.abort(),b(O instanceof oe?O:new oe(pe.RequestTimeout,String(O))))};this._responseHandlers.set(P,O=>{if(n?.signal?.aborted)return;if(j=!0,O instanceof Error)return b(O);let G;try{G=e.decodeResult(t.method,O.result)}catch(se){return b(se instanceof Error?se:new Error(String(se)))}if(G.kind==="invalid")return b(G.error);if(G.kind==="input_required"){if(n?.allowInputRequired===!0)return S(jg(G));const se={codec:e,request:t,resultSchema:o,options:n,flowStartedAt:u,retry:($e,q)=>this._requestWithSchemaViaCodec(e,$e===void 0?{method:t.method}:{method:t.method,params:$e},o,q)};return S(this._resolveNonCompleteResult(G,se))}const ne=G.result;rs(o,ne).then(se=>{se.success?S(se.data):b(new oe(pe.InvalidResult,`Invalid result for ${t.method}: ${se.error}`))},b)}),d=()=>x(n?.signal?.reason),n?.signal?.addEventListener("abort",d,{once:!0});const N=n?.timeout??Og,$=()=>x(new oe(pe.RequestTimeout,"Request timed out",{timeout:N}));this._setupTimeout(P,N,n?.maxTotalTimeout,$,n?.resetTimeoutOnProgress??!1),this._transport.send(A,{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c,requestSignal:R?.signal}).catch(O=>{this._progressHandlers.delete(P),b(O)})}).finally(()=>{d&&n?.signal?.removeEventListener("abort",d),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,o){if(!this._transport)throw new oe(pe.NotConnected,"Not connected");if(ss(t.method)&&!e.hasNotificationMethod(t.method))throw new oe(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);const n=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(n,o).catch(s=>this._onerror(s))});return}await this._transport.send(n,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let n;if(typeof t=="function"){if(!ns(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);n=(s,a)=>{const r=this._negotiatedWireCodec();let c=r.validateRequest(e,s);if(!c.ok&&c.reason==="not-in-era"&&(c=r.validateInputRequest(e,s)),!c.ok)throw c.reason==="not-in-era"?new re(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,a))}}else if(o)n=async(s,a)=>{const r=await rs(t.params,{...s.params});if(!r.success)throw new re(U.InvalidParams,`Invalid params for ${e}: ${r.error}`);return o(r.data,a)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,n))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,o){if(typeof t=="function"){if(!ss(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,s)=>{const a=s.validateNotification(e,n);if(!a.ok)throw a.reason==="not-in-era"?new re(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(a.message);return Promise.resolve(t(a.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async n=>{const s=await rs(t.params,{...n.params});if(!s.success)throw new re(U.InvalidParams,`Invalid params for notification ${e}: ${s.error}`);await o(s.data,n)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function as(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function or(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ug(e){const t={},o=[];if(!or(e))return{accepted:t,droppedKeys:o};for(const[n,s]of Object.entries(e)){if(!or(s)||"method"in s||"result"in s){o.push(n);continue}t[n]=s}return{accepted:t,droppedKeys:o}}function jg(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*! +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const c=r[1];if(t===r[0]){a(r);continue}if(e.external){const d=e.external.registry.get(r[0])?.id;if(t!==r[0]&&d){a(r);continue}}if(e.metadataRegistry.get(r[0])?.id){a(r);continue}if(c.cycle){a(r);continue}if(c.count>1&&e.reused==="ref"){a(r);continue}}}function En(e,t){const o=e.seen.get(t);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,h={...d},S=u.ref;if(u.ref=null,S){n(S);const f=e.seen.get(S),R=f.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(R)):Object.assign(d,R),Object.assign(d,h),c._zod.parent===S)for(const b in d)b==="$ref"||b==="allOf"||b in h||delete d[b];if(R.$ref&&f.def)for(const b in d)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(d[b])===JSON.stringify(f.def[b])&&delete d[b]}const v=c._zod.parent;if(v&&v!==S){n(v);const f=e.seen.get(v);if(f?.schema.$ref&&(d.$ref=f.schema.$ref,f.def))for(const R in d)R==="$ref"||R==="allOf"||R in f.def&&JSON.stringify(d[R])===JSON.stringify(f.def[R])&&delete d[R]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())n(c[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(c)}Object.assign(s,o.def??o.schema);const a=e.metadataRegistry.get(t)?.id;a!==void 0&&s.id===a&&delete s.id;const r=e.external?.defs??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,r[u.defId]=u.def)}e.external||Object.keys(r).length>0&&(e.target==="draft-2020-12"?s.$defs=r:s.definitions=r);try{const c=JSON.parse(JSON.stringify(s));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:kn(t,"input",e.processors),output:kn(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function he(e,t){const o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return he(n.element,o);if(n.type==="set")return he(n.valueType,o);if(n.type==="lazy")return he(n.getter(),o);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return he(n.innerType,o);if(n.type==="intersection")return he(n.left,o)||he(n.right,o);if(n.type==="record"||n.type==="map")return he(n.keyType,o)||he(n.valueType,o);if(n.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:he(n.in,o)||he(n.out,o);if(n.type==="object"){for(const s in n.shape)if(he(n.shape[s],o))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(he(s,o))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(he(s,o))return!0;return!!(n.rest&&he(n.rest,o))}return!1}const Pm=(e,t={})=>o=>{const n=Pn({...o,processors:t});return B(e,n),Cn(n,e),En(n,e)},kn=(e,t,o={})=>n=>{const{libraryOptions:s,target:a}=n??{},r=Pn({...s??{},target:a,io:t,processors:o});return B(e,r),Cn(r,e),En(r,e)},Cm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jr=(e,t,o,n)=>{const s=o;s.type="string";const{minimum:a,maximum:r,format:c,patterns:u,contentEncoding:d}=e._zod.bag;if(typeof a=="number"&&(s.minLength=a),typeof r=="number"&&(s.maxLength=r),c&&(s.format=Cm[c]??c,s.format===""&&delete s.format,c==="time"&&delete s.format),d&&(s.contentEncoding=d),u&&u.size>0){const h=[...u];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(S=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Vr=(e,t,o,n)=>{const s=o,{minimum:a,maximum:r,format:c,multipleOf:u,exclusiveMaximum:d,exclusiveMinimum:h}=e._zod.bag;typeof c=="string"&&c.includes("int")?s.type="integer":s.type="number";const S=typeof h=="number"&&h>=(a??Number.NEGATIVE_INFINITY),v=typeof d=="number"&&d<=(r??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";S?f?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h:typeof a=="number"&&(s.minimum=a),v?f?(s.maximum=d,s.exclusiveMaximum=!0):s.exclusiveMaximum=d:typeof r=="number"&&(s.maximum=r),typeof u=="number"&&(s.multipleOf=u)},Br=(e,t,o,n)=>{o.type="boolean"},Em=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},km=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wr=(e,t,o,n)=>{t.target==="openapi-3.0"?(o.type="string",o.nullable=!0,o.enum=[null]):o.type="null"},Gr=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},$m=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Kr=(e,t,o,n)=>{o.not={}},Yr=(e,t,o,n)=>{},Qr=(e,t,o,n)=>{},qm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Xr=(e,t,o,n)=>{const s=e._zod.def,a=yr(s.entries);a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),o.enum=a},ea=(e,t,o,n)=>{const s=e._zod.def,a=[];for(const r of s.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(r))}else a.push(r);if(a.length!==0)if(a.length===1){const r=a[0];o.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?o.enum=[r]:o.const=r}else a.every(r=>typeof r=="number")&&(o.type="number"),a.every(r=>typeof r=="string")&&(o.type="string"),a.every(r=>typeof r=="boolean")&&(o.type="boolean"),a.every(r=>r===null)&&(o.type="null"),o.enum=a},Im=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Nm=(e,t,o,n)=>{const s=o,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=a.source},xm=(e,t,o,n)=>{const s=o,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:r,maximum:c,mime:u}=e._zod.bag;r!==void 0&&(a.minLength=r),c!==void 0&&(a.maxLength=c),u?u.length===1?(a.contentMediaType=u[0],Object.assign(s,a)):(Object.assign(s,a),s.anyOf=u.map(d=>({contentMediaType:d}))):Object.assign(s,a)},Om=(e,t,o,n)=>{o.type="boolean"},ta=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},oa=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Mm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Lm=(e,t,o,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},na=(e,t,o,n)=>{const s=o,a=e._zod.def,{minimum:r,maximum:c}=e._zod.bag;typeof r=="number"&&(s.minItems=r),typeof c=="number"&&(s.maxItems=c),s.type="array",s.items=B(a.element,t,{...n,path:[...n.path,"items"]})},sa=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object",s.properties={};const r=a.shape;for(const d in r)s.properties[d]=B(r[d],t,{...n,path:[...n.path,"properties",d]});const c=new Set(Object.keys(r)),u=new Set([...c].filter(d=>{const h=a.shape[d]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));u.size>0&&(s.required=Array.from(u)),a.catchall?._zod.def.type==="never"?s.additionalProperties=!1:a.catchall?a.catchall&&(s.additionalProperties=B(a.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ia=(e,t,o,n)=>{const s=e._zod.def,a=s.inclusive===!1,r=s.options.map((c,u)=>B(c,t,{...n,path:[...n.path,a?"oneOf":"anyOf",u]}));a?o.oneOf=r:o.anyOf=r},ra=(e,t,o,n)=>{const s=e._zod.def,a=B(s.left,t,{...n,path:[...n.path,"allOf",0]}),r=B(s.right,t,{...n,path:[...n.path,"allOf",1]}),c=d=>"allOf"in d&&Object.keys(d).length===1,u=[...c(a)?a.allOf:[a],...c(r)?r.allOf:[r]];o.allOf=u},Am=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="array";const r=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((v,f)=>B(v,t,{...n,path:[...n.path,r,f]})),d=a.rest?B(a.rest,t,{...n,path:[...n.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=u,d&&(s.items=d)):t.target==="openapi-3.0"?(s.items={anyOf:u},d&&s.items.anyOf.push(d),s.minItems=u.length,d||(s.maxItems=u.length)):(s.items=u,d&&(s.additionalItems=d));const{minimum:h,maximum:S}=e._zod.bag;typeof h=="number"&&(s.minItems=h),typeof S=="number"&&(s.maxItems=S)},aa=(e,t,o,n)=>{const s=o,a=e._zod.def;s.type="object";const r=a.keyType,u=r._zod.bag?.patterns;if(a.mode==="loose"&&u&&u.size>0){const h=B(a.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const S of u)s.patternProperties[S.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=B(a.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=B(a.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const d=r._zod.values;if(d){const h=[...d].filter(S=>typeof S=="string"||typeof S=="number");h.length>0&&(s.required=h)}},ca=(e,t,o,n)=>{const s=e._zod.def,a=B(s.innerType,t,n),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=s.innerType,o.nullable=!0):o.anyOf=[a,{type:"null"}]},la=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},ua=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.default=JSON.parse(JSON.stringify(s.defaultValue))},pa=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,t.io==="input"&&(o._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},da=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType;let r;try{r=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}o.default=r},ma=(e,t,o,n)=>{const s=e._zod.def,a=s.in._zod.traits.has("$ZodTransform"),r=t.io==="input"?a?s.out:s.in:s.out;B(r,t,n);const c=t.seen.get(e);c.ref=r},ha=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType,o.readOnly=!0},Um=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},Ms=(e,t,o,n)=>{const s=e._zod.def;B(s.innerType,t,n);const a=t.seen.get(e);a.ref=s.innerType},fa=(e,t,o,n)=>{const s=e._zod.innerType;B(s,t,n);const a=t.seen.get(e);a.ref=s},Ji={string:Jr,number:Vr,boolean:Br,bigint:Em,symbol:km,null:Wr,undefined:Gr,void:$m,never:Kr,any:Yr,unknown:Qr,date:qm,enum:Xr,literal:ea,nan:Im,template_literal:Nm,file:xm,success:Om,custom:ta,function:zm,transform:oa,map:Mm,set:Lm,array:na,object:sa,union:ia,intersection:ra,tuple:Am,record:aa,nullable:ca,nonoptional:la,default:ua,prefault:pa,catch:da,pipe:ma,readonly:ha,promise:Um,optional:Ms,lazy:fa};function ga(e,t){if("_idmap"in e){const n=e,s=Pn({...t,processors:Ji}),a={};for(const u of n._idmap.entries()){const[d,h]=u;B(h,s)}const r={},c={registry:n,uri:t?.uri,defs:a};s.external=c;for(const u of n._idmap.entries()){const[d,h]=u;Cn(s,h),r[d]=En(s,h)}if(Object.keys(a).length>0){const u=s.target==="draft-2020-12"?"$defs":"definitions";r.__shared={[u]:a}}return{schemas:r}}const o=Pn({...t,processors:Ji});return B(e,o),Cn(o,e),En(o,e)}const jm=g("ZodISODateTime",(e,t)=>{Hp.init(e,t),K.init(e,t)});function Bo(e){return Yd(jm,e)}const Zm=g("ZodISODate",(e,t)=>{Fp.init(e,t),K.init(e,t)});function Sa(e){return Qd(Zm,e)}const Dm=g("ZodISOTime",(e,t)=>{Jp.init(e,t),K.init(e,t)});function Hm(e){return Xd(Dm,e)}const Fm=g("ZodISODuration",(e,t)=>{Vp.init(e,t),K.init(e,t)});function Jm(e){return em(Fm,e)}const Vm=(e,t)=>{Pr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>xu(e,o)},flatten:{value:o=>Nu(e,o)},addIssue:{value:o=>{e.issues.push(o),e.message=JSON.stringify(e.issues,fs,2)}},addIssues:{value:o=>{e.issues.push(...o),e.message=JSON.stringify(e.issues,fs,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ce=g("ZodError",Vm,{Parent:Error}),Bm=xs(Ce),Wm=Os(Ce),_a=An(Ce),Gm=Un(Ce),Km=Mu(Ce),Ym=Lu(Ce),Qm=Au(Ce),Xm=Uu(Ce),eh=ju(Ce),th=Zu(Ce),oh=Du(Ce),nh=Hu(Ce),Vi=new WeakMap;function Wo(e,t,o){const n=Object.getPrototypeOf(e);let s=Vi.get(n);if(s||(s=new Set,Vi.set(n,s)),!s.has(t)){s.add(t);for(const a in o){const r=o[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){const c=r.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}const V=g("ZodType",(e,t)=>(J.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:kn(e,"input"),output:kn(e,"output")}}),e.toJSONSchema=Pm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(o,n)=>Bm(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>_a(e,o,n),e.parseAsync=async(o,n)=>Wm(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>Gm(e,o,n),e.spa=e.safeParseAsync,e.encode=(o,n)=>Km(e,o,n),e.decode=(o,n)=>Ym(e,o,n),e.encodeAsync=async(o,n)=>Qm(e,o,n),e.decodeAsync=async(o,n)=>Xm(e,o,n),e.safeEncode=(o,n)=>eh(e,o,n),e.safeDecode=(o,n)=>th(e,o,n),e.safeEncodeAsync=async(o,n)=>oh(e,o,n),e.safeDecodeAsync=async(o,n)=>nh(e,o,n),Wo(e,"ZodType",{check(...o){const n=this.def;return this.clone(Ze(n,{checks:[...n.checks??[],...o.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...o){return this.check(...o)},clone(o,n){return De(this,o,n)},brand(){return this},register(o,n){return o.add(this,n),this},refine(o,n){return this.check(Wh(o,n))},superRefine(o,n){return this.check(Gh(o,n))},overwrite(o){return this.check(qt(o))},optional(){return k(this)},exactOptional(){return Oh(this)},nullable(){return Ki(this)},nullish(){return k(Ki(this))},nonoptional(o){return jh(this,o)},array(){return m(this)},or(o){return w([this,o])},and(o){return ot(this,o)},transform(o){return Yi(this,Ta(o))},default(o){return Lh(this,o)},prefault(o){return Uh(this,o)},catch(o){return Dh(this,o)},pipe(o){return Yi(this,o)},readonly(){return Jh(this)},describe(o){const n=this.clone();return xo.add(n,{description:o}),n},meta(...o){if(o.length===0)return xo.get(this);const n=this.clone();return xo.add(n,o[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(o){return o(this)}}),Object.defineProperty(e,"description",{get(){return xo.get(e)?.description},configurable:!0}),e)),va=g("_ZodString",(e,t)=>{zs.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Jr(e,n,s);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,Wo(e,"_ZodString",{regex(...n){return this.check(um(...n))},includes(...n){return this.check(mm(...n))},startsWith(...n){return this.check(hm(...n))},endsWith(...n){return this.check(fm(...n))},min(...n){return this.check(Tn(...n))},max(...n){return this.check(Hr(...n))},length(...n){return this.check(Fr(...n))},nonempty(...n){return this.check(Tn(1,...n))},lowercase(n){return this.check(pm(n))},uppercase(n){return this.check(dm(n))},trim(){return this.check(Sm())},normalize(...n){return this.check(gm(...n))},toLowerCase(){return this.check(_m())},toUpperCase(){return this.check(vm())},slugify(){return this.check(bm())}})}),sh=g("ZodString",(e,t)=>{zs.init(e,t),va.init(e,t),e.email=o=>e.check(Zr(ba,o)),e.url=o=>e.check(Dr(ya,o)),e.jwt=o=>e.check(Kd(bh,o)),e.emoji=o=>e.check(Md(rh,o)),e.guid=o=>e.check(Zi(Bi,o)),e.uuid=o=>e.check(Nd(Sn,o)),e.uuidv4=o=>e.check(xd(Sn,o)),e.uuidv6=o=>e.check(Od(Sn,o)),e.uuidv7=o=>e.check(zd(Sn,o)),e.nanoid=o=>e.check(Ld(ah,o)),e.guid=o=>e.check(Zi(Bi,o)),e.cuid=o=>e.check(Ad(ch,o)),e.cuid2=o=>e.check(Ud(lh,o)),e.ulid=o=>e.check(jd(uh,o)),e.base64=o=>e.check(Bd(Sh,o)),e.base64url=o=>e.check(Wd(_h,o)),e.xid=o=>e.check(Zd(ph,o)),e.ksuid=o=>e.check(Dd(dh,o)),e.ipv4=o=>e.check(Hd(mh,o)),e.ipv6=o=>e.check(Fd(hh,o)),e.cidrv4=o=>e.check(Jd(fh,o)),e.cidrv6=o=>e.check(Vd(gh,o)),e.e164=o=>e.check(Gd(vh,o)),e.datetime=o=>e.check(Bo(o)),e.date=o=>e.check(Sa(o)),e.time=o=>e.check(Hm(o)),e.duration=o=>e.check(Jm(o))});function i(e){return Id(sh,e)}const K=g("ZodStringFormat",(e,t)=>{W.init(e,t),va.init(e,t)}),ba=g("ZodEmail",(e,t)=>{Op.init(e,t),K.init(e,t)});function ih(e){return Zr(ba,e)}const Bi=g("ZodGUID",(e,t)=>{Np.init(e,t),K.init(e,t)}),Sn=g("ZodUUID",(e,t)=>{xp.init(e,t),K.init(e,t)}),ya=g("ZodURL",(e,t)=>{zp.init(e,t),K.init(e,t)});function Ls(e){return Dr(ya,e)}const rh=g("ZodEmoji",(e,t)=>{Mp.init(e,t),K.init(e,t)}),ah=g("ZodNanoID",(e,t)=>{Lp.init(e,t),K.init(e,t)}),ch=g("ZodCUID",(e,t)=>{Ap.init(e,t),K.init(e,t)}),lh=g("ZodCUID2",(e,t)=>{Up.init(e,t),K.init(e,t)}),uh=g("ZodULID",(e,t)=>{jp.init(e,t),K.init(e,t)}),ph=g("ZodXID",(e,t)=>{Zp.init(e,t),K.init(e,t)}),dh=g("ZodKSUID",(e,t)=>{Dp.init(e,t),K.init(e,t)}),mh=g("ZodIPv4",(e,t)=>{Bp.init(e,t),K.init(e,t)}),hh=g("ZodIPv6",(e,t)=>{Wp.init(e,t),K.init(e,t)}),fh=g("ZodCIDRv4",(e,t)=>{Gp.init(e,t),K.init(e,t)}),gh=g("ZodCIDRv6",(e,t)=>{Kp.init(e,t),K.init(e,t)}),Sh=g("ZodBase64",(e,t)=>{Yp.init(e,t),K.init(e,t)}),_h=g("ZodBase64URL",(e,t)=>{Xp.init(e,t),K.init(e,t)}),vh=g("ZodE164",(e,t)=>{ed.init(e,t),K.init(e,t)}),bh=g("ZodJWT",(e,t)=>{od.init(e,t),K.init(e,t)}),As=g("ZodNumber",(e,t)=>{zr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Vr(e,n,s),Wo(e,"ZodNumber",{gt(n,s){return this.check(Hi(n,s))},gte(n,s){return this.check(rs(n,s))},min(n,s){return this.check(rs(n,s))},lt(n,s){return this.check(Di(n,s))},lte(n,s){return this.check(is(n,s))},max(n,s){return this.check(is(n,s))},int(n){return this.check(Wi(n))},safe(n){return this.check(Wi(n))},positive(n){return this.check(Hi(0,n))},nonnegative(n){return this.check(rs(0,n))},negative(n){return this.check(Di(0,n))},nonpositive(n){return this.check(is(0,n))},multipleOf(n,s){return this.check(Fi(n,s))},step(n,s){return this.check(Fi(n,s))},finite(){return this}});const o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function _(e){return tm(As,e)}const yh=g("ZodNumberFormat",(e,t)=>{nd.init(e,t),As.init(e,t)});function Wi(e){return nm(yh,e)}const Rh=g("ZodBoolean",(e,t)=>{sd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Br(e,o,n)});function T(e){return sm(Rh,e)}const wh=g("ZodUndefined",(e,t)=>{id.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Gr(e,o)});function Ss(e){return im(wh,e)}const Th=g("ZodNull",(e,t)=>{rd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Wr(e,o,n)});function Zo(e){return rm(Th,e)}const Ph=g("ZodAny",(e,t)=>{ad.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Yr()});function Us(){return am(Ph)}const Ch=g("ZodUnknown",(e,t)=>{cd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Qr()});function C(){return cm(Ch)}const Eh=g("ZodNever",(e,t)=>{ld.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kr(e,o,n)});function _s(e){return lm(Eh,e)}const kh=g("ZodArray",(e,t)=>{ud.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>na(e,o,n,s),e.element=t.element,Wo(e,"ZodArray",{min(o,n){return this.check(Tn(o,n))},nonempty(o){return this.check(Tn(1,o))},max(o,n){return this.check(Hr(o,n))},length(o,n){return this.check(Fr(o,n))},unwrap(){return this.element}})});function m(e,t){return ym(kh,e,t)}const Ra=g("ZodObject",(e,t)=>{dd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>sa(e,o,n,s),D(e,"shape",()=>t.shape),Wo(e,"ZodObject",{keyof(){return z(Object.keys(this._zod.def.shape))},catchall(o){return this.clone({...this._zod.def,catchall:o})},passthrough(){return this.clone({...this._zod.def,catchall:C()})},loose(){return this.clone({...this._zod.def,catchall:C()})},strict(){return this.clone({...this._zod.def,catchall:_s()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(o){return Cu(this,o)},safeExtend(o){return Eu(this,o)},merge(o){return ku(this,o)},pick(o){return Tu(this,o)},omit(o){return Pu(this,o)},partial(...o){return $u(Pa,this,o[0])},required(...o){return qu(Ca,this,o[0])}})});function l(e,t){const o={type:"object",shape:e??{},...E(t)};return new Ra(o)}function I(e,t){return new Ra({type:"object",shape:e,catchall:C(),...E(t)})}const wa=g("ZodUnion",(e,t)=>{Ar.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ia(e,o,n,s),e.options=t.options});function w(e,t){return new wa({type:"union",options:e,...E(t)})}const $h=g("ZodDiscriminatedUnion",(e,t)=>{wa.init(e,t),md.init(e,t)});function $n(e,t,o){return new $h({type:"union",options:t,discriminator:e,...E(o)})}const qh=g("ZodIntersection",(e,t)=>{hd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ra(e,o,n,s)});function ot(e,t){return new qh({type:"intersection",left:e,right:t})}const Gi=g("ZodRecord",(e,t)=>{fd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>aa(e,o,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function y(e,t,o){return!t||!t._zod?new Gi({type:"record",keyType:i(),valueType:e,...E(t)}):new Gi({type:"record",keyType:e,valueType:t,...E(o)})}const vs=g("ZodEnum",(e,t)=>{gd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,s,a)=>Xr(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const a={};for(const r of n)if(o.has(r))a[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new vs({...t,checks:[],...E(s),entries:a})},e.exclude=(n,s)=>{const a={...t.entries};for(const r of n)if(o.has(r))delete a[r];else throw new Error(`Key ${r} not found in enum`);return new vs({...t,checks:[],...E(s),entries:a})}});function z(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new vs({type:"enum",entries:o,...E(t)})}const Ih=g("ZodLiteral",(e,t)=>{Sd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ea(e,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function p(e,t){return new Ih({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Nh=g("ZodTransform",(e,t)=>{_d.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>oa(e,o),e._zod.parse=(o,n)=>{if(n.direction==="backward")throw new br(e.constructor.name);o.addIssue=a=>{if(typeof a=="string")o.issues.push(jo(a,o.value,t));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=e),o.issues.push(jo(r))}};const s=t.transform(o.value,o);return s instanceof Promise?s.then(a=>(o.value=a,o.fallback=!0,o)):(o.value=s,o.fallback=!0,o)}});function Ta(e){return new Nh({type:"transform",transform:e})}const Pa=g("ZodOptional",(e,t)=>{Ur.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ms(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function k(e){return new Pa({type:"optional",innerType:e})}const xh=g("ZodExactOptional",(e,t)=>{vd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Ms(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Oh(e){return new xh({type:"optional",innerType:e})}const zh=g("ZodNullable",(e,t)=>{bd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ca(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Ki(e){return new zh({type:"nullable",innerType:e})}const Mh=g("ZodDefault",(e,t)=>{yd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ua(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lh(e,t){return new Mh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wr(t)}})}const Ah=g("ZodPrefault",(e,t)=>{Rd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>pa(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Uh(e,t){return new Ah({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wr(t)}})}const Ca=g("ZodNonOptional",(e,t)=>{wd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>la(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function jh(e,t){return new Ca({type:"nonoptional",innerType:e,...E(t)})}const Zh=g("ZodCatch",(e,t)=>{Td.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>da(e,o,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Dh(e,t){return new Zh({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ea=g("ZodPipe",(e,t)=>{jr.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ma(e,o,n,s),e.in=t.in,e.out=t.out});function Yi(e,t){return new Ea({type:"pipe",in:e,out:t})}const Hh=g("ZodPreprocess",(e,t)=>{Ea.init(e,t),Pd.init(e,t)}),Fh=g("ZodReadonly",(e,t)=>{Cd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ha(e,o,n,s),e.unwrap=()=>e._zod.def.innerType});function Jh(e){return new Fh({type:"readonly",innerType:e})}const Vh=g("ZodLazy",(e,t)=>{Ed.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>fa(e,o,n,s),e.unwrap=()=>e._zod.def.getter()});function js(e){return new Vh({type:"lazy",getter:e})}const Bh=g("ZodCustom",(e,t)=>{kd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(o,n,s)=>ta(e,o)});function Wh(e,t={}){return Rm(Bh,e,t)}function Gh(e,t){return wm(e,t)}function Do(e,t){return new Hh({type:"pipe",in:Ta(e),out:t})}const Kh={custom:"custom"};function Yh(e){return om(As,e)}const Qh="2025-11-25",Xh=[Qh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ef="io.modelcontextprotocol/related-task",Zn="io.modelcontextprotocol/protocolVersion",Zs="io.modelcontextprotocol/clientInfo",Oo="io.modelcontextprotocol/serverInfo",Dn="io.modelcontextprotocol/clientCapabilities",tf="io.modelcontextprotocol/subscriptionId",Ds="io.modelcontextprotocol/logLevel",Hn="2.0",of=-32600,Et=js(()=>w([i(),_(),T(),Zo(),y(i(),Et),m(Et)])),ee=y(i(),Et),nf=m(Et),Hs=w([i(),_().int()]),Fs=i(),ka=l({ttl:_().optional()}),$a=l({taskId:i()}),Js=I({progressToken:Hs.optional(),[ef]:$a.optional()}),me=l({_meta:Js.optional()}),Go=me.extend({task:ka.optional()}),te=l({method:i(),params:me.loose().optional()}),be=l({_meta:Js.optional()}),ye=l({method:i(),params:be.loose().optional()}),Vs=I({get[Oo](){return Nt.optional().catch(void 0)}}),oe=I({_meta:Vs.optional()}),rt=w([i(),_().int()]),Bs=l({jsonrpc:p(Hn),id:rt,...te.shape}).strict(),Ws=l({jsonrpc:p(Hn),...ye.shape}).strict(),Fn=l({jsonrpc:p(Hn),id:rt,result:oe}).strict(),Jn=l({jsonrpc:p(Hn),id:rt.optional(),error:l({code:_().int(),message:i(),data:C().optional()})}).strict(),qa=w([Bs,Ws,Fn,Jn]),sf=w([Fn,Jn]),Vn=oe.strict(),Ia=be.extend({requestId:rt.optional(),reason:i().optional()}),Gs=ye.extend({method:p("notifications/cancelled"),params:Ia}),Na=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),It=l({icons:m(Na).optional()}),nt=l({name:i(),title:i().optional()}),Nt=nt.extend({...nt.shape,...It.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),rf=ot(l({applyDefaults:T().optional()}),ee),af=Do(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ot(l({form:rf.optional(),url:ee.optional()}),ee.optional())),xa=I({list:ee.optional(),cancel:ee.optional(),requests:I({sampling:I({createMessage:ee.optional()}).optional(),elicitation:I({create:ee.optional()}).optional()}).optional()}),Oa=I({list:ee.optional(),cancel:ee.optional(),requests:I({tools:I({call:ee.optional()}).optional()}).optional()}),za=l({experimental:y(i(),ee).optional(),sampling:l({context:ee.optional(),tools:ee.optional()}).optional(),elicitation:af.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:xa.optional(),extensions:y(i(),ee).optional()}),Ma=me.extend({protocolVersion:i(),capabilities:za,clientInfo:Nt}),La=te.extend({method:p("initialize"),params:Ma}),Ks=l({experimental:y(i(),ee).optional(),logging:ee.optional(),completions:ee.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:Oa.optional(),extensions:y(i(),ee).optional()}),Aa=oe.extend({protocolVersion:i(),capabilities:Ks,serverInfo:Nt,instructions:i().optional()}),Ua=ye.extend({method:p("notifications/initialized"),params:be.optional()}),ja=te.extend({method:p("server/discover"),params:me.optional()}),Za=oe.extend({supportedVersions:m(i()),capabilities:Ks,instructions:i().optional()}),Ys=te.extend({method:p("ping"),params:me.optional()}),Da=l({progress:_(),total:k(_()),message:k(i())}),Ha=l({...be.shape,...Da.shape,progressToken:Hs}),Qs=ye.extend({method:p("notifications/progress"),params:Ha}),Fa=me.extend({cursor:Fs.optional()}),xt=te.extend({params:Fa.optional()}),Ot=oe.extend({nextCursor:Fs.optional()}),Xs=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),ei=Xs.extend({text:i()}),ti=i().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),oi=Xs.extend({blob:ti}),zt=z(["user","assistant"]),at=l({audience:m(zt).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),ni=l({...nt.shape,...It.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:at.optional(),_meta:k(I({}))}),Ja=l({...nt.shape,...It.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:at.optional(),_meta:k(I({}))}),Va=xt.extend({method:p("resources/list")}),Ba=Ot.extend({resources:m(ni)}),Wa=xt.extend({method:p("resources/templates/list")}),Ga=Ot.extend({resourceTemplates:m(Ja)}),Bn=me.extend({uri:i()}),Ka=Bn,Ya=te.extend({method:p("resources/read"),params:Ka}),Qa=oe.extend({contents:m(w([ei,oi]))}),Xa=ye.extend({method:p("notifications/resources/list_changed"),params:be.optional()}),ec=Bn,tc=te.extend({method:p("resources/subscribe"),params:ec}),oc=Bn,nc=te.extend({method:p("resources/unsubscribe"),params:oc}),si=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),sc=me.extend({notifications:si}),ic=te.extend({method:p("subscriptions/listen"),params:sc}),rc=be.extend({notifications:si}),ac=ye.extend({method:p("notifications/subscriptions/acknowledged"),params:rc}),cc=Vs.extend({[tf]:rt}),lc=oe.extend({_meta:cc}),uc=be.extend({uri:i()}),pc=ye.extend({method:p("notifications/resources/updated"),params:uc}),dc=l({name:i(),description:k(i()),required:k(T())}),mc=l({...nt.shape,...It.shape,description:k(i()),arguments:k(m(dc)),_meta:k(I({}))}),hc=xt.extend({method:p("prompts/list")}),fc=Ot.extend({prompts:m(mc)}),gc=me.extend({name:i(),arguments:y(i(),i()).optional()}),Sc=te.extend({method:p("prompts/get"),params:gc}),Wn=l({type:p("text"),text:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Gn=l({type:p("image"),data:ti,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),Kn=l({type:p("audio"),data:ti,mimeType:i(),annotations:at.optional(),_meta:y(i(),C()).optional()}),_c=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),ii=l({type:p("resource"),resource:w([ei,oi]),annotations:at.optional(),_meta:y(i(),C()).optional()}),ri=ni.extend({type:p("resource_link")}),Mt=w([Wn,Gn,Kn,ri,ii]),vc=l({role:zt,content:Mt}),bc=oe.extend({description:i().optional(),messages:m(vc)}),yc=ye.extend({method:p("notifications/prompts/list_changed"),params:be.optional()}),Rc=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),wc=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Yn=l({...nt.shape,...It.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),Et).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:I({$schema:i().optional()}).optional(),annotations:Rc.optional(),execution:wc.optional(),_meta:y(i(),C()).optional()}),Tc=xt.extend({method:p("tools/list")}),Pc=Ot.extend({tools:m(Yn)}),Qn=oe.extend({content:m(Mt).default([]),structuredContent:C().optional(),isError:T().optional()}),cf=Qn.or(oe.extend({toolResult:C()})),Cc=Go.extend({name:i(),arguments:y(i(),C()).optional()}),Ec=te.extend({method:p("tools/call"),params:Cc}),kc=ye.extend({method:p("notifications/tools/list_changed"),params:be.optional()}),lf=l({autoRefresh:T().default(!0),debounceMs:_().int().nonnegative().default(300)}),ai=z(["debug","info","notice","warning","error","critical","alert","emergency"]),$c=me.extend({level:ai}),qc=te.extend({method:p("logging/setLevel"),params:$c}),Ic=be.extend({level:ai,logger:i().optional(),data:C()}),Nc=ye.extend({method:p("notifications/message"),params:Ic}),xc=l({name:i().optional()}),Oc=l({hints:m(xc).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),zc=l({mode:z(["auto","required","none"]).optional()}),Mc=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Mt),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),Lc=$n("type",[Wn,Gn,Kn]),Ho=$n("type",[Wn,Gn,Kn,_c,Mc]),Ac=l({role:zt,content:w([Ho,m(Ho)]),_meta:y(i(),C()).optional()}),Uc=Go.extend({messages:m(Ac),modelPreferences:Oc.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:ee.optional(),tools:m(Yn).optional(),toolChoice:zc.optional()}),jc=te.extend({method:p("sampling/createMessage"),params:Uc}),Zc=oe.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:zt,content:Lc}),Dc=oe.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:zt,content:w([Ho,m(Ho)])}),ci=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Xn=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),qn=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),li=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),ui=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),pi=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Hc=w([li,ui]),di=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),mi=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Fc=w([di,mi]),Jc=w([pi,Hc,Fc]),hi=w([Jc,ci,Xn,qn]),es=Go.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),hi),required:m(i()).optional()}).catchall(C())}),Vc=Go.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),Bc=w([es,Vc]),Wc=te.extend({method:p("elicitation/create"),params:Bc}),Gc=be.extend({elicitationId:i()}),Kc=ye.extend({method:p("notifications/elicitation/complete"),params:Gc}),Yc=oe.extend({action:z(["accept","decline","cancel"]),content:Do(e=>e===null?void 0:e,y(i(),w([i(),_(),T(),m(i())])).optional())}),Qc=l({type:p("ref/resource"),uri:i()}),Xc=l({type:p("ref/prompt"),name:i()}),el=me.extend({ref:w([Xc,Qc]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),tl=te.extend({method:p("completion/complete"),params:el}),ol=oe.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),nl=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),sl=te.extend({method:p("roots/list"),params:me.optional()}),il=oe.extend({roots:m(nl)}),rl=ye.extend({method:p("notifications/roots/list_changed"),params:be.optional()}),uf=I({ttl:_().optional(),pollInterval:_().optional()}),al=z(["working","input_required","completed","failed","cancelled"]),Lt=l({taskId:i(),status:al,ttl:w([_(),Zo()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),pf=oe.extend({task:Lt}),cl=be.merge(Lt),df=ye.extend({method:p("notifications/tasks/status"),params:cl}),mf=te.extend({method:p("tasks/get"),params:me.extend({taskId:i()})}),hf=oe.merge(Lt),ff=te.extend({method:p("tasks/result"),params:me.extend({taskId:i()})}),gf=oe.loose(),Sf=xt.extend({method:p("tasks/list")}),_f=Ot.extend({tasks:m(Lt)}),vf=te.extend({method:p("tasks/cancel"),params:me.extend({taskId:i()})}),bf=oe.merge(Lt),yf=w([Ys,La,ja,tl,qc,Sc,hc,Va,Wa,Ya,tc,nc,ic,Ec,Tc]),Rf=w([Gs,Qs,Ua,rl]),wf=w([Vn,Zc,Dc,Yc,il]),Tf=w([Ys,jc,Wc,sl]),Pf=w([Gs,Qs,Nc,pc,Xa,kc,yc,ac,Kc]),Cf=w([Vn,Aa,Za,ol,bc,fc,Ba,Ga,Qa,Qn,Pc,lc]),re=Ls().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Kh.custom,message:"URL must be parseable",fatal:!0}),Su}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Ef=I({resource:i().url(),authorization_servers:m(re).optional(),jwks_uri:i().url().optional(),scopes_supported:m(i()).optional(),bearer_methods_supported:m(i()).optional(),resource_signing_alg_values_supported:m(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:T().optional(),authorization_details_types_supported:m(i()).optional(),dpop_signing_alg_values_supported:m(i()).optional(),dpop_bound_access_tokens_required:T().optional()}),ll=I({issuer:i(),authorization_endpoint:re,token_endpoint:re,registration_endpoint:re.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),service_documentation:re.optional(),revocation_endpoint:re.optional(),revocation_endpoint_auth_methods_supported:m(i()).optional(),revocation_endpoint_auth_signing_alg_values_supported:m(i()).optional(),introspection_endpoint:i().optional(),introspection_endpoint_auth_methods_supported:m(i()).optional(),introspection_endpoint_auth_signing_alg_values_supported:m(i()).optional(),code_challenge_methods_supported:m(i()).optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0),dpop_signing_alg_values_supported:m(i()).optional()}),ul=I({issuer:i(),authorization_endpoint:re,token_endpoint:re,userinfo_endpoint:re.optional(),jwks_uri:re,registration_endpoint:re.optional(),scopes_supported:m(i()).optional(),response_types_supported:m(i()),response_modes_supported:m(i()).optional(),grant_types_supported:m(i()).optional(),acr_values_supported:m(i()).optional(),subject_types_supported:m(i()),id_token_signing_alg_values_supported:m(i()),id_token_encryption_alg_values_supported:m(i()).optional(),id_token_encryption_enc_values_supported:m(i()).optional(),userinfo_signing_alg_values_supported:m(i()).optional(),userinfo_encryption_alg_values_supported:m(i()).optional(),userinfo_encryption_enc_values_supported:m(i()).optional(),request_object_signing_alg_values_supported:m(i()).optional(),request_object_encryption_alg_values_supported:m(i()).optional(),request_object_encryption_enc_values_supported:m(i()).optional(),token_endpoint_auth_methods_supported:m(i()).optional(),token_endpoint_auth_signing_alg_values_supported:m(i()).optional(),display_values_supported:m(i()).optional(),claim_types_supported:m(i()).optional(),claims_supported:m(i()).optional(),service_documentation:i().optional(),claims_locales_supported:m(i()).optional(),ui_locales_supported:m(i()).optional(),claims_parameter_supported:T().optional(),request_parameter_supported:T().optional(),request_uri_parameter_supported:T().optional(),require_request_uri_registration:T().optional(),op_policy_uri:re.optional(),op_tos_uri:re.optional(),client_id_metadata_document_supported:T().optional(),authorization_response_iss_parameter_supported:T().optional().catch(void 0)}),kf=l({...ul.shape,...ll.pick({code_challenge_methods_supported:!0}).shape}),$f=l({access_token:i(),id_token:i().optional(),token_type:i(),expires_in:Yh().optional(),scope:i().optional(),refresh_token:i().optional()}).strip(),qf=l({issued_token_type:p("urn:ietf:params:oauth:token-type:id-jag"),access_token:i(),token_type:i().optional(),expires_in:_().optional(),scope:i().optional()}).strip(),If=l({error:i(),error_description:i().optional(),error_uri:i().optional()}),Qi=re.optional().or(p("").transform(()=>{})),pl=l({redirect_uris:m(re),token_endpoint_auth_method:i().optional(),grant_types:m(i()).optional(),response_types:m(i()).optional(),application_type:i().optional(),client_name:i().optional(),client_uri:re.optional(),logo_uri:Qi,scope:i().optional(),contacts:m(i()).optional(),tos_uri:Qi,policy_uri:i().optional(),jwks_uri:re.optional(),jwks:Us().optional(),software_id:i().optional(),software_version:i().optional(),software_statement:i().optional()}).strip(),dl=l({client_id:i(),client_secret:i().optional(),client_id_issued_at:_().optional(),client_secret_expires_at:_().optional()}).strip(),Nf=pl.merge(dl),xf=l({error:i(),error_description:i().optional()}).strip(),Of=l({token:i(),token_type_hint:i().optional()}).strip(),bs=Symbol.for("mcp.sdk.errorBrands");function ml(e,t){const o=new Set;let n=t;for(;typeof n=="function";){const s=n.mcpBrand;Object.prototype.hasOwnProperty.call(n,"mcpBrand")&&typeof s=="string"&&o.add(s),n=Object.getPrototypeOf(n)}o.size!==0&&Object.defineProperty(e,bs,{value:o,enumerable:!1,configurable:!0})}function In(e,t){try{if(typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(t,bs)){const o=t[bs];if(o&&typeof o.has=="function"&&o.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}let de=(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})({});var ne=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return In(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return In(this,e)}constructor(e,t,o,n){super(t,n),this.code=e,this.data=o,this.name="SdkError",ml(this,new.target)}};const zf="2026-07-28";function Mf(e){return e>=zf}function hl(e){const t=e.structuredContent;return t===void 0||!(typeof t!="object"||t===null||Array.isArray(t))||(e.content?.some(o=>o.type==="text")??!1)?e:{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}const fl=["task","inputRequests","requestState"];function Lf(e){return e===null||typeof e!="object"||Array.isArray(e)||e.content!==void 0||fl.some(t=>t in e)?e:{...e,content:[]}}function Af(){const e=js(()=>w([i(),_(),T(),Zo(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=l({ttl:_().optional()}),a=l({taskId:i()}),r=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":a.optional()}),c=l({_meta:r.optional()}),u=c.extend({task:s.optional()}),d=l({method:i(),params:c.loose().optional()}),h=l({_meta:r.optional()}),S=l({method:i(),params:h.loose().optional()}),v=I({_meta:r.optional()}),f=w([i(),_().int()]),R=v.strict(),P=h.extend({requestId:f.optional(),reason:i().optional()}),b=S.extend({method:p("notifications/cancelled"),params:P}),A=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),j=l({icons:m(A).optional()}),x=l({name:i(),title:i().optional()}),N=x.extend({...x.shape,...j.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),$=ot(l({applyDefaults:T().optional()}),t),O=Do(pe=>pe&&typeof pe=="object"&&!Array.isArray(pe)&&Object.keys(pe).length===0?{form:{}}:pe,ot(l({form:$.optional(),url:t.optional()}),t.optional())),G=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),se=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),ie=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:O.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:G.optional(),extensions:y(i(),t).optional()}),qe=c.extend({protocolVersion:i(),capabilities:ie,clientInfo:N}),q=d.extend({method:p("initialize"),params:qe}),L=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:se.optional(),extensions:y(i(),t).optional()}),M=v.extend({protocolVersion:i(),capabilities:L,serverInfo:N,instructions:i().optional()}),F=S.extend({method:p("notifications/initialized"),params:h.optional()}),Z=d.extend({method:p("ping"),params:c.optional()}),H=l({progress:_(),total:k(_()),message:k(i())}),Y=l({...h.shape,...H.shape,progressToken:o}),fe=S.extend({method:p("notifications/progress"),params:Y}),ce=c.extend({cursor:n.optional()}),ge=d.extend({params:ce.optional()}),Te=v.extend({nextCursor:n.optional()}),le=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),ct=le.extend({text:i()}),He=i().refine(pe=>{try{return atob(pe),!0}catch{return!1}},{message:"Invalid Base64 string"}),lt=le.extend({blob:He}),Ie=z(["user","assistant"]),Ee=l({audience:m(Ie).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),Fe=l({...x.shape,...j.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Ee.optional(),_meta:k(I({}))}),At=l({...x.shape,...j.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Ee.optional(),_meta:k(I({}))}),Ut=ge.extend({method:p("resources/list")}),jt=Te.extend({resources:m(Fe)}),ze=ge.extend({method:p("resources/templates/list")}),ut=Te.extend({resourceTemplates:m(At)}),Je=c.extend({uri:i()}),Zt=Je,Dt=d.extend({method:p("resources/read"),params:Zt}),Ht=v.extend({contents:m(w([ct,lt]))}),Ft=S.extend({method:p("notifications/resources/list_changed"),params:h.optional()}),Jt=Je,Vt=d.extend({method:p("resources/subscribe"),params:Jt}),Bt=Je,Wt=d.extend({method:p("resources/unsubscribe"),params:Bt}),Gt=h.extend({uri:i()}),Kt=S.extend({method:p("notifications/resources/updated"),params:Gt}),Yt=l({name:i(),description:k(i()),required:k(T())}),Qt=l({...x.shape,...j.shape,description:k(i()),arguments:k(m(Yt)),_meta:k(I({}))}),Xt=ge.extend({method:p("prompts/list")}),eo=Te.extend({prompts:m(Qt)}),to=c.extend({name:i(),arguments:y(i(),i()).optional()}),oo=d.extend({method:p("prompts/get"),params:to}),Ve=l({type:p("text"),text:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),Be=l({type:p("image"),data:He,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),We=l({type:p("audio"),data:He,mimeType:i(),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),no=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Me=l({type:p("resource"),resource:w([ct,lt]),annotations:Ee.optional(),_meta:y(i(),C()).optional()}),so=Fe.extend({type:p("resource_link")}),Pe=w([Ve,Be,We,so,Me]),pt=l({role:Ie,content:Pe}),dt=v.extend({description:i().optional(),messages:m(pt)}),Ge=S.extend({method:p("notifications/prompts/list_changed"),params:h.optional()}),io=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),mt=l({taskSupport:z(["required","optional","forbidden"]).optional()}),Ke=l({...x.shape,...j.shape,description:i().optional(),inputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()),outputSchema:l({type:p("object"),properties:y(i(),e).optional(),required:m(i()).optional()}).catchall(C()).optional(),annotations:io.optional(),execution:mt.optional(),_meta:y(i(),C()).optional()}),ht=ge.extend({method:p("tools/list")}),ft=Te.extend({tools:m(Ke)}),gt=v.extend({content:m(Pe),structuredContent:y(i(),C()).optional(),isError:T().optional()}),ue=u.extend({name:i(),arguments:y(i(),C()).optional()}),ro=d.extend({method:p("tools/call"),params:ue}),Yo=S.extend({method:p("notifications/tools/list_changed"),params:h.optional()}),St=z(["debug","info","notice","warning","error","critical","alert","emergency"]),ao=c.extend({level:St}),co=d.extend({method:p("logging/setLevel"),params:ao}),lo=h.extend({level:St,logger:i().optional(),data:C()}),uo=S.extend({method:p("notifications/message"),params:lo}),po=l({name:i().optional()}),mo=l({hints:m(po).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),ho=l({mode:z(["auto","required","none"]).optional()}),Qo=l({type:p("tool_result"),toolUseId:i().describe("The unique identifier for the corresponding tool call."),content:m(Pe),structuredContent:l({}).loose().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),fo=$n("type",[Ve,Be,We]),Le=$n("type",[Ve,Be,We,no,Qo]),go=l({role:Ie,content:w([Le,m(Le)]),_meta:y(i(),C()).optional()}),So=u.extend({messages:m(go),modelPreferences:mo.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(Ke).optional(),toolChoice:ho.optional()}),_o=d.extend({method:p("sampling/createMessage"),params:So}),vo=v.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens"]).or(i())),role:Ie,content:fo}),bo=v.extend({model:i(),stopReason:k(z(["endTurn","stopSequence","maxTokens","toolUse"]).or(i())),role:Ie,content:w([Le,m(Le)])}),yo=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Ro=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),wo=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),To=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),Po=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),Co=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Eo=w([To,Po]),Ye=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Qe=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),Xo=w([Ye,Qe]),en=w([Co,Eo,Xo]),Re=w([en,yo,Ro,wo]),we=u.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),Re),required:m(i()).optional()}).catchall(C())}),ko=u.extend({mode:p("url"),message:i(),elicitationId:i(),url:i().url()}),ke=w([we,ko]),tn=d.extend({method:p("elicitation/create"),params:ke}),on=h.extend({elicitationId:i()}),nn=S.extend({method:p("notifications/elicitation/complete"),params:on}),sn=v.extend({action:z(["accept","decline","cancel"]),content:Do(pe=>pe===null?void 0:pe,y(i(),w([i(),_(),T(),m(i())])).optional())}),rn=l({type:p("ref/resource"),uri:i()}),an=l({type:p("ref/prompt"),name:i()}),cn=c.extend({ref:w([an,rn]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()}),$o=d.extend({method:p("completion/complete"),params:cn}),ln=v.extend({completion:I({values:m(i()).max(100),total:k(_().int()),hasMore:k(T())})}),un=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),_t=d.extend({method:p("roots/list"),params:c.optional()}),qo=v.extend({roots:m(un)}),pn=S.extend({method:p("notifications/roots/list_changed"),params:h.optional()}),dn=I({ttl:_().optional(),pollInterval:_().optional()}),mn=z(["working","input_required","completed","failed","cancelled"]),Ae=l({taskId:i(),status:mn,ttl:w([_(),Zo()]),createdAt:i(),lastUpdatedAt:i(),pollInterval:k(_()),statusMessage:k(i())}),Se=v.extend({task:Ae}),hn=h.merge(Ae),Xe=S.extend({method:p("notifications/tasks/status"),params:hn}),vt=d.extend({method:p("tasks/get"),params:c.extend({taskId:i()})}),bt=v.merge(Ae),yt=d.extend({method:p("tasks/result"),params:c.extend({taskId:i()})}),os=v.loose(),_e=ge.extend({method:p("tasks/list")}),Q=Te.extend({tasks:m(Ae)}),et=d.extend({method:p("tasks/cancel"),params:c.extend({taskId:i()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,TaskMetadataSchema:s,RelatedTaskMetadataSchema:a,RequestMetaSchema:r,BaseRequestParamsSchema:c,TaskAugmentedRequestParamsSchema:u,RequestSchema:d,NotificationsParamsSchema:h,NotificationSchema:S,ResultSchema:v,RequestIdSchema:f,EmptyResultSchema:R,CancelledNotificationParamsSchema:P,CancelledNotificationSchema:b,IconSchema:A,IconsSchema:j,BaseMetadataSchema:x,ImplementationSchema:N,ClientTasksCapabilitySchema:G,ServerTasksCapabilitySchema:se,ClientCapabilitiesSchema:ie,InitializeRequestParamsSchema:qe,InitializeRequestSchema:q,ServerCapabilitiesSchema:L,InitializeResultSchema:M,InitializedNotificationSchema:F,PingRequestSchema:Z,ProgressSchema:H,ProgressNotificationParamsSchema:Y,ProgressNotificationSchema:fe,PaginatedRequestParamsSchema:ce,PaginatedRequestSchema:ge,PaginatedResultSchema:Te,ResourceContentsSchema:le,TextResourceContentsSchema:ct,BlobResourceContentsSchema:lt,RoleSchema:Ie,AnnotationsSchema:Ee,ResourceSchema:Fe,ResourceTemplateSchema:At,ListResourcesRequestSchema:Ut,ListResourcesResultSchema:jt,ListResourceTemplatesRequestSchema:ze,ListResourceTemplatesResultSchema:ut,ResourceRequestParamsSchema:Je,ReadResourceRequestParamsSchema:Zt,ReadResourceRequestSchema:Dt,ReadResourceResultSchema:Ht,ResourceListChangedNotificationSchema:Ft,SubscribeRequestParamsSchema:Jt,SubscribeRequestSchema:Vt,UnsubscribeRequestParamsSchema:Bt,UnsubscribeRequestSchema:Wt,ResourceUpdatedNotificationParamsSchema:Gt,ResourceUpdatedNotificationSchema:Kt,PromptArgumentSchema:Yt,PromptSchema:Qt,ListPromptsRequestSchema:Xt,ListPromptsResultSchema:eo,GetPromptRequestParamsSchema:to,GetPromptRequestSchema:oo,TextContentSchema:Ve,ImageContentSchema:Be,AudioContentSchema:We,ToolUseContentSchema:no,EmbeddedResourceSchema:Me,ResourceLinkSchema:so,ContentBlockSchema:Pe,PromptMessageSchema:pt,GetPromptResultSchema:dt,PromptListChangedNotificationSchema:Ge,ToolAnnotationsSchema:io,ToolExecutionSchema:mt,ToolSchema:Ke,ListToolsRequestSchema:ht,ListToolsResultSchema:ft,CallToolResultSchema:gt,CallToolRequestParamsSchema:ue,CallToolRequestSchema:ro,ToolListChangedNotificationSchema:Yo,LoggingLevelSchema:St,SetLevelRequestParamsSchema:ao,SetLevelRequestSchema:co,LoggingMessageNotificationParamsSchema:lo,LoggingMessageNotificationSchema:uo,ModelHintSchema:po,ModelPreferencesSchema:mo,ToolChoiceSchema:ho,ToolResultContentSchema:Qo,SamplingContentSchema:fo,SamplingMessageContentBlockSchema:Le,SamplingMessageSchema:go,CreateMessageRequestParamsSchema:So,CreateMessageRequestSchema:_o,CreateMessageResultSchema:vo,CreateMessageResultWithToolsSchema:bo,BooleanSchemaSchema:yo,StringSchemaSchema:Ro,NumberSchemaSchema:wo,UntitledSingleSelectEnumSchemaSchema:To,TitledSingleSelectEnumSchemaSchema:Po,LegacyTitledEnumSchemaSchema:Co,SingleSelectEnumSchemaSchema:Eo,UntitledMultiSelectEnumSchemaSchema:Ye,TitledMultiSelectEnumSchemaSchema:Qe,MultiSelectEnumSchemaSchema:Xo,EnumSchemaSchema:en,PrimitiveSchemaDefinitionSchema:Re,ElicitRequestFormParamsSchema:we,ElicitRequestURLParamsSchema:ko,ElicitRequestParamsSchema:ke,ElicitRequestSchema:tn,ElicitationCompleteNotificationParamsSchema:on,ElicitationCompleteNotificationSchema:nn,ElicitResultSchema:sn,ResourceTemplateReferenceSchema:rn,PromptReferenceSchema:an,CompleteRequestParamsSchema:cn,CompleteRequestSchema:$o,CompleteResultSchema:ln,RootSchema:un,ListRootsRequestSchema:_t,ListRootsResultSchema:qo,RootsListChangedNotificationSchema:pn,TaskCreationParamsSchema:dn,TaskStatusSchema:mn,TaskSchema:Ae,CreateTaskResultSchema:Se,TaskStatusNotificationParamsSchema:hn,TaskStatusNotificationSchema:Xe,GetTaskRequestSchema:vt,GetTaskResultSchema:bt,GetTaskPayloadRequestSchema:yt,GetTaskPayloadResultSchema:os,ListTasksRequestSchema:_e,ListTasksResultSchema:Q,CancelTaskRequestSchema:et,CancelTaskResultSchema:v.merge(Ae),ClientRequestSchema:w([Z,q,$o,co,oo,Xt,Ut,ze,Dt,Vt,Wt,ro,ht,vt,yt,_e,et]),ClientNotificationSchema:w([b,fe,F,pn,Xe]),ClientResultSchema:w([R,vo,bo,sn,qo,bt,Q,Se]),ServerRequestSchema:w([Z,_o,tn,_t,vt,yt,_e,et]),ServerNotificationSchema:w([b,fe,uo,Kt,Ft,Yo,Ge,Xe,nn]),ServerResultSchema:w([R,M,ln,dt,eo,jt,ut,Ht,gt,ft,bt,Q,Se]),CallToolResultWireSchema:C().superRefine((pe,Gl)=>{if(!(typeof pe!="object"||pe===null||Array.isArray(pe)||pe.content!==void 0)){for(const Ti of fl)if(Ti in pe){Gl.addIssue({code:"custom",message:`content is required when the body carries '${Ti}' — another result family cannot default into an empty tools/call success`});return}}}).transform(Lf).pipe(gt)}}let Uf;function gl(){return Uf??=Af()}function Sl(e){return e.type!=="object"}const jf=new Set(["const","enum","default","examples"]),Zf=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Xi(e){return e!==void 0&&!(typeof e=="string"&&e.startsWith("#"))}function Df(e){const t=typeof e.$schema=="string"?e.$schema:void 0;if(Xi(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};const o=gu(e.$schema)&&e.$recursiveAnchor!==!0,n=(s,a)=>{if(Array.isArray(s))return s.map(u=>n(u,!1));if(s===null||typeof s!="object"||!a&&Xi(s.$id))return s;const r={};let c=!1;for(const[u,d]of Object.entries(s))a?r[u]=n(d,!1):(u==="$ref"||u==="$dynamicRef")&&typeof d=="string"?r[u]=d==="#"?"#/properties/result":d.startsWith("#/")?`#/properties/result${d.slice(1)}`:d:u==="$recursiveRef"&&d==="#"&&o?c=!0:jf.has(u)?r[u]=d:Zf.has(u)?r[u]=n(d,!0):r[u]=n(d,!1);return c&&("$ref"in r?r.allOf=[...Array.isArray(r.allOf)?r.allOf:[],{$ref:"#/properties/result"}]:r.$ref="#/properties/result"),r};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:n(e,!1)},required:["result"]}}const Hf={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},Ff={"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},Jf={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};let _n;function fi(){if(_n)return _n;const e=gl();return _n={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}},_n}function _l(e){return Object.prototype.hasOwnProperty.call(Hf,e)}function vl(e){return Object.prototype.hasOwnProperty.call(Ff,e)}function Vf(e){return Object.prototype.hasOwnProperty.call(Jf,e)}function Bf(e){return Vf(e)?fi().resultSchemas[e]:void 0}function Wf(e){return _l(e)?fi().requestSchemas[e]:void 0}function Gf(e){return vl(e)?fi().notificationSchemas[e]:void 0}function ys(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function vn(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const er={ok:!1,reason:"not-in-era"};function tr(e){return ys(e)&&ys(e.outputSchema)&&Sl(e.outputSchema)}const gi={era:"2025-11-25",hasRequestMethod:_l,hasNotificationMethod:vl,validateRequest:(e,t)=>vn(Wf(e),t),validateResult:(e,t)=>vn(Bf(e),t),validateNotification:(e,t)=>vn(Gf(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>er,validateInputResponse:()=>er,samplingResultVariant:((e,t)=>{const o=gl();return vn(e?o.CreateMessageResultWithToolsSchema:o.CreateMessageResultSchema,t)}),outboundEnvelope:e=>{},validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){const o=hl(e),n=o.structuredContent;if(n===void 0)return o;const s=typeof n!="object"||n===null||Array.isArray(n),a=t!==void 0&&Sl(t);return!s&&!a?o:{...o,structuredContent:{result:n}}},decodeResult(e,t){if(ys(t)&&"resultType"in t){const o={...t};return delete o.resultType,{kind:"complete",result:o}}return{kind:"complete",result:t}},encodeResult(e,t){if(e!=="tools/list")return t;const o=t.tools;return!Array.isArray(o)||!o.some(n=>tr(n))?t:{...t,tools:o.map(n=>tr(n)?{...n,outputSchema:Df(n.outputSchema)}:n)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>{}};function Kf(){const e=js(()=>w([i(),_(),T(),Zo(),y(i(),e),m(e)])),t=y(i(),e),o=w([i(),_().int()]),n=i(),s=w([i(),_().int()]),a=z(["user","assistant"]),r=z(["debug","info","notice","warning","error","critical","alert","emergency"]),c=i().refine(Q=>{try{return atob(Q),!0}catch{return!1}},{message:"Invalid Base64 string"}),u=l({ttl:_().optional()}),d=l({taskId:i()}),h=I({progressToken:o.optional(),"io.modelcontextprotocol/related-task":d.optional()}),S=l({_meta:h.optional()}),v=S.extend({task:u.optional()}),f=l({_meta:h.optional()}),R=l({method:i(),params:f.loose().optional()}),P=l({src:i(),mimeType:i().optional(),sizes:m(i()).optional(),theme:z(["light","dark"]).optional()}),b=l({icons:m(P).optional()}),A=l({name:i(),title:i().optional()}),j=A.extend({...A.shape,...b.shape,version:i(),websiteUrl:i().optional(),description:i().optional()}),x=ot(l({applyDefaults:T().optional()}),t),N=Do(Q=>Q&&typeof Q=="object"&&!Array.isArray(Q)&&Object.keys(Q).length===0?{form:{}}:Q,ot(l({form:x.optional(),url:t.optional()}),t.optional())),$=I({list:t.optional(),cancel:t.optional(),requests:I({sampling:I({createMessage:t.optional()}).optional(),elicitation:I({create:t.optional()}).optional()}).optional()}),O=I({list:t.optional(),cancel:t.optional(),requests:I({tools:I({call:t.optional()}).optional()}).optional()}),G=l({experimental:y(i(),t).optional(),sampling:l({context:t.optional(),tools:t.optional()}).optional(),elicitation:N.optional(),roots:l({listChanged:T().optional()}).optional(),tasks:$.optional(),extensions:y(i(),t).optional()}),se=l({experimental:y(i(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:l({listChanged:T().optional()}).optional(),resources:l({subscribe:T().optional(),listChanged:T().optional()}).optional(),tools:l({listChanged:T().optional()}).optional(),tasks:O.optional(),extensions:y(i(),t).optional()}),ie=l({progress:_(),total:k(_()),message:k(i())}),qe=l({...f.shape,...ie.shape,progressToken:o}),q=R.extend({method:p("notifications/progress"),params:qe}),L=f.extend({level:r,logger:i().optional(),data:C()}),M=R.extend({method:p("notifications/message"),params:L}),F=l({uri:i(),mimeType:k(i()),_meta:y(i(),C()).optional()}),Z=F.extend({text:i()}),H=F.extend({blob:c}),Y=l({audience:m(a).optional(),priority:_().min(0).max(1).optional(),lastModified:Bo({offset:!0}).optional()}),fe=l({...A.shape,...b.shape,uri:i(),description:k(i()),mimeType:k(i()),size:k(_()),annotations:Y.optional(),_meta:k(I({}))}),ce=l({...A.shape,...b.shape,uriTemplate:i(),description:k(i()),mimeType:k(i()),annotations:Y.optional(),_meta:k(I({}))}),ge=R.extend({method:p("notifications/resources/list_changed"),params:f.optional()}),Te=f.extend({uri:i()}),le=R.extend({method:p("notifications/resources/updated"),params:Te}),ct=l({name:i(),description:k(i()),required:k(T())}),He=l({...A.shape,...b.shape,description:k(i()),arguments:k(m(ct)),_meta:k(I({}))}),lt=R.extend({method:p("notifications/prompts/list_changed"),params:f.optional()}),Ie=l({type:p("text"),text:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Ee=l({type:p("image"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),Fe=l({type:p("audio"),data:c,mimeType:i(),annotations:Y.optional(),_meta:y(i(),C()).optional()}),At=l({type:p("tool_use"),name:i(),id:i(),input:y(i(),C()),_meta:y(i(),C()).optional()}),Ut=l({type:p("resource"),resource:w([Z,H]),annotations:Y.optional(),_meta:y(i(),C()).optional()}),jt=fe.extend({type:p("resource_link")}),ze=w([Ie,Ee,Fe,jt,Ut]),ut=l({role:a,content:ze}),Je=l({title:i().optional(),readOnlyHint:T().optional(),destructiveHint:T().optional(),idempotentHint:T().optional(),openWorldHint:T().optional()}),Zt=R.extend({method:p("notifications/tools/list_changed"),params:f.optional()}),Dt=l({name:i().optional()}),Ht=l({hints:m(Dt).optional(),costPriority:_().min(0).max(1).optional(),speedPriority:_().min(0).max(1).optional(),intelligencePriority:_().min(0).max(1).optional()}),Ft=l({mode:z(["auto","required","none"]).optional()}),Jt=l({type:p("boolean"),title:i().optional(),description:i().optional(),default:T().optional()}),Vt=l({type:p("string"),title:i().optional(),description:i().optional(),minLength:_().optional(),maxLength:_().optional(),format:z(["email","uri","date","date-time"]).optional(),default:i().optional()}),Bt=l({type:z(["number","integer"]),title:i().optional(),description:i().optional(),minimum:_().optional(),maximum:_().optional(),default:_().optional()}),Wt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),default:i().optional()}),Gt=l({type:p("string"),title:i().optional(),description:i().optional(),oneOf:m(l({const:i(),title:i()})),default:i().optional()}),Kt=l({type:p("string"),title:i().optional(),description:i().optional(),enum:m(i()),enumNames:m(i()).optional(),default:i().optional()}),Yt=w([Wt,Gt]),Qt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({type:p("string"),enum:m(i())}),default:m(i()).optional()}),Xt=l({type:p("array"),title:i().optional(),description:i().optional(),minItems:_().optional(),maxItems:_().optional(),items:l({anyOf:m(l({const:i(),title:i()}))}),default:m(i()).optional()}),eo=w([Qt,Xt]),to=w([Kt,Yt,eo]),oo=w([to,Jt,Vt,Bt]),Ve=v.extend({mode:p("form").optional(),message:i(),requestedSchema:l({type:p("object"),properties:y(i(),oo),required:m(i()).optional()}).catchall(C())}),Be=l({type:p("ref/resource"),uri:i()}),We=l({type:p("ref/prompt"),name:i()}),no=l({uri:i().startsWith("file://"),name:i().optional(),_meta:y(i(),C()).optional()}),Me=G.shape,so=l({experimental:Me.experimental,sampling:Me.sampling,elicitation:Me.elicitation,roots:Me.roots,extensions:Me.extensions}),Pe=se.shape,pt=l({experimental:Pe.experimental,logging:Pe.logging,completions:Pe.completions,prompts:Pe.prompts,resources:Pe.resources,tools:Pe.tools,extensions:Pe.extensions}),dt=I({progressToken:o.optional(),[Zn]:i(),[Zs]:j.optional(),[Dn]:so,[Ds]:r.optional()}),Ge=l({...A.shape,...b.shape,description:i().optional(),inputSchema:I({$schema:i().optional(),type:p("object")}),outputSchema:I({$schema:i().optional()}).optional(),annotations:Je.optional(),_meta:y(i(),C()).optional()}),io=l({type:p("tool_result"),toolUseId:i(),content:m(ze),structuredContent:C().optional(),isError:T().optional(),_meta:y(i(),C()).optional()}),mt=w([Ie,Ee,Fe,At,io]),Ke=l({role:a,content:w([mt,m(mt)]),_meta:y(i(),C()).optional()}),ht=i(),ft=I({[Oo]:j.optional().catch(void 0)}),gt=ft.optional();function ue(Q){return I({_meta:gt,resultType:ht.default("complete"),...Q})}const ro=ue({}),Yo=ue({nextCursor:n.optional()}),St=ue({content:m(ze),structuredContent:C().optional(),isError:T().optional()}),ao=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(Ge),nextCursor:n.optional()}),co=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(He),nextCursor:n.optional()}),lo=ue({description:i().optional(),messages:m(ut)}),uo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),po=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ce),nextCursor:n.optional()}),mo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),ho=ue({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),Qo=ue({ttlMs:_().int().min(0),cacheScope:z(["public","private"])}),fo=ue({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),Le=l({messages:m(Ke),modelPreferences:Ht.optional(),systemPrompt:i().optional(),includeContext:z(["none","thisServer","allServers"]).optional(),temperature:_().optional(),maxTokens:_().int(),stopSequences:m(i()).optional(),metadata:t.optional(),tools:m(Ge).optional(),toolChoice:Ft.optional()}),go=l({method:p("sampling/createMessage"),params:Le}),So=l({method:p("roots/list"),params:l({_meta:y(i(),C()).optional()}).optional()}),_o=l({...Ke.shape,model:i(),stopReason:i().optional()}),vo=l({roots:m(no)}),bo=l({action:z(["accept","decline","cancel"]),content:y(i(),w([i(),_(),T(),m(i())])).optional()}),yo=l({mode:p("url"),message:i(),url:i().url()}),Ro=w([Ve,yo]),wo=l({method:p("elicitation/create"),params:Ro}),To=w([go,So,wo]),Po=w([_o,vo,bo]),Co=y(i(),To),Eo=y(i(),Po),Ye=ue({inputRequests:Co.optional(),requestState:i().optional()}),Qe={inputResponses:Eo.optional(),requestState:i().optional()},Xo=l({_meta:dt,...Qe}),en=I({progressToken:o.optional()});function Re(Q,et){return l({method:p(Q),params:l({_meta:dt,...et})})}function we(Q,et){return l({method:p(Q),params:l({_meta:en.optional(),...et}).optional()})}const ko={name:i(),arguments:y(i(),C()).optional(),...Qe},ke={cursor:n.optional()},tn=Re("tools/call",ko),on=Re("tools/list",ke),nn=Re("prompts/list",ke),sn=Re("prompts/get",{name:i(),arguments:y(i(),i()).optional(),...Qe}),rn=Re("resources/list",ke),an=Re("resources/templates/list",ke),cn=Re("resources/read",{uri:i(),...Qe}),$o={ref:w([We,Be]),argument:l({name:i(),value:i()}),context:l({arguments:y(i(),i()).optional()}).optional()},ln=Re("completion/complete",$o),un=Re("server/discover",{}),_t=l({toolsListChanged:T().optional(),promptsListChanged:T().optional(),resourcesListChanged:T().optional(),resourceSubscriptions:m(i()).optional()}),qo={notifications:_t},pn=Re("subscriptions/listen",qo),dn=ft.extend({"io.modelcontextprotocol/subscriptionId":s}),mn=I({_meta:dn,resultType:ht.default("complete")}),Ae={"tools/call":we("tools/call",ko),"tools/list":we("tools/list",ke),"prompts/get":we("prompts/get",{name:i(),arguments:y(i(),i()).optional()}),"prompts/list":we("prompts/list",ke),"resources/list":we("resources/list",ke),"resources/templates/list":we("resources/templates/list",ke),"resources/read":we("resources/read",{uri:i()}),"completion/complete":we("completion/complete",$o),"server/discover":we("server/discover",{}),"subscriptions/listen":we("subscriptions/listen",qo)};function Se(Q){return I({_meta:gt,...Q})}const hn={"tools/call":Se({content:m(ze),structuredContent:C().optional(),isError:T().optional()}),"tools/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),tools:m(Ge),nextCursor:n.optional()}),"prompts/get":Se({description:i().optional(),messages:m(ut)}),"prompts/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),prompts:m(He),nextCursor:n.optional()}),"resources/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resources:m(fe),nextCursor:n.optional()}),"resources/templates/list":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),resourceTemplates:m(ce),nextCursor:n.optional()}),"resources/read":Se({ttlMs:_().int().min(0),cacheScope:z(["public","private"]),contents:m(w([Z,H]))}),"completion/complete":Se({completion:l({values:m(i()).max(100),total:_().int().optional(),hasMore:T().optional()}).loose()}),"server/discover":Se({ttlMs:_().int().min(0).catch(0),cacheScope:z(["public","private"]).catch("private"),supportedVersions:m(i()),capabilities:pt,instructions:i().optional()}),"subscriptions/listen":Se({})},Xe=I({"io.modelcontextprotocol/subscriptionId":s.optional()}),vt=l({method:p("notifications/subscriptions/acknowledged"),params:l({_meta:Xe.optional(),notifications:_t})}),bt=l({_meta:Xe.optional(),requestId:s,reason:i().optional()}),yt=l({method:p("notifications/cancelled"),params:bt}),os={"notifications/cancelled":yt,"notifications/progress":q,"notifications/message":M,"notifications/resources/updated":le,"notifications/resources/list_changed":ge,"notifications/tools/list_changed":Zt,"notifications/prompts/list_changed":lt,"notifications/subscriptions/acknowledged":vt},_e=Q=>l({jsonrpc:p("2.0"),id:w([i(),_().int()]),result:Q}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:o,CursorSchema:n,RequestIdSchema:s,RoleSchema:a,LoggingLevelSchema:r,TaskMetadataSchema:u,RelatedTaskMetadataSchema:d,RequestMetaSchema:h,BaseRequestParamsSchema:S,TaskAugmentedRequestParamsSchema:v,NotificationsParamsSchema:f,NotificationSchema:R,IconSchema:P,IconsSchema:b,BaseMetadataSchema:A,ImplementationSchema:j,ClientTasksCapabilitySchema:$,ServerTasksCapabilitySchema:O,ClientCapabilitiesSchema:G,ServerCapabilitiesSchema:se,ProgressSchema:ie,ProgressNotificationParamsSchema:qe,ProgressNotificationSchema:q,LoggingMessageNotificationParamsSchema:L,LoggingMessageNotificationSchema:M,ResourceContentsSchema:F,TextResourceContentsSchema:Z,BlobResourceContentsSchema:H,AnnotationsSchema:Y,ResourceSchema:fe,ResourceTemplateSchema:ce,ResourceListChangedNotificationSchema:ge,ResourceUpdatedNotificationParamsSchema:Te,ResourceUpdatedNotificationSchema:le,PromptArgumentSchema:ct,PromptSchema:He,PromptListChangedNotificationSchema:lt,TextContentSchema:Ie,ImageContentSchema:Ee,AudioContentSchema:Fe,ToolUseContentSchema:At,EmbeddedResourceSchema:Ut,ResourceLinkSchema:jt,ContentBlockSchema:ze,PromptMessageSchema:ut,ToolAnnotationsSchema:Je,ToolListChangedNotificationSchema:Zt,ModelHintSchema:Dt,ModelPreferencesSchema:Ht,ToolChoiceSchema:Ft,BooleanSchemaSchema:Jt,StringSchemaSchema:Vt,NumberSchemaSchema:Bt,UntitledSingleSelectEnumSchemaSchema:Wt,TitledSingleSelectEnumSchemaSchema:Gt,LegacyTitledEnumSchemaSchema:Kt,SingleSelectEnumSchemaSchema:Yt,UntitledMultiSelectEnumSchemaSchema:Qt,TitledMultiSelectEnumSchemaSchema:Xt,MultiSelectEnumSchemaSchema:eo,EnumSchemaSchema:to,PrimitiveSchemaDefinitionSchema:oo,ElicitRequestFormParamsSchema:Ve,ResourceTemplateReferenceSchema:Be,PromptReferenceSchema:We,RootSchema:no,ClientCapabilities2026Schema:so,ServerCapabilities2026Schema:pt,RequestMetaEnvelopeSchema:dt,ToolSchema:Ge,ToolResultContentSchema:io,SamplingMessageContentBlockSchema:mt,SamplingMessageSchema:Ke,ResultTypeSchema:ht,ResultMetaSchema:ft,ResultSchema:ro,PaginatedResultSchema:Yo,CallToolResultSchema:St,ListToolsResultSchema:ao,ListPromptsResultSchema:co,GetPromptResultSchema:lo,ListResourcesResultSchema:uo,ListResourceTemplatesResultSchema:po,ReadResourceResultSchema:mo,CompleteResultSchema:ho,CacheableResultSchema:Qo,DiscoverResultSchema:fo,CreateMessageRequestParamsSchema:Le,CreateMessageRequestSchema:go,ListRootsRequestSchema:So,CreateMessageResultSchema:_o,ListRootsResultSchema:vo,ElicitResultSchema:bo,ElicitRequestURLParamsSchema:yo,ElicitRequestParamsSchema:Ro,ElicitRequestSchema:wo,InputRequestSchema:To,InputResponseSchema:Po,InputRequestsSchema:Co,InputResponsesSchema:Eo,InputRequiredResultSchema:Ye,InputResponseRequestParamsSchema:Xo,CallToolRequestSchema:tn,ListToolsRequestSchema:on,ListPromptsRequestSchema:nn,GetPromptRequestSchema:sn,ListResourcesRequestSchema:rn,ListResourceTemplatesRequestSchema:an,ReadResourceRequestSchema:cn,CompleteRequestSchema:ln,DiscoverRequestSchema:un,SubscriptionFilterSchema:_t,SubscriptionsListenRequestSchema:pn,SubscriptionsListenResultMetaSchema:dn,SubscriptionsListenResultSchema:mn,dispatchRequestSchemas:Ae,dispatchResultSchemas:hn,NotificationMetaSchema:Xe,SubscriptionsAcknowledgedNotificationSchema:vt,CancelledNotificationParamsSchema:bt,CancelledNotificationSchema:yt,notificationSchemas2026:os,JSONRPCResultResponseSchema:_e(ro),CallToolResultResponseSchema:_e(w([St,Ye])),ListToolsResultResponseSchema:_e(ao),ListPromptsResultResponseSchema:_e(co),GetPromptResultResponseSchema:_e(w([lo,Ye])),ListResourcesResultResponseSchema:_e(uo),ListResourceTemplatesResultResponseSchema:_e(po),ReadResourceResultResponseSchema:_e(w([mo,Ye])),CompleteResultResponseSchema:_e(ho),DiscoverResultResponseSchema:_e(fo)}}let Yf;function st(){return Yf??=Kf()}const Qf=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function Xf(e){return Qf.includes(e)}const Si=Symbol("modelcontextprotocol.resultCacheHintFallback");function eg(e){return e[Si]}function bl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function yl(e){return e==="public"||e==="private"}let U=(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})({});var ae=class Rl extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return In(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return In(this,t)}constructor(t,o,n){super(o),this.code=t,this.data=n,this.name="ProtocolError",ml(this,new.target)}static fromError(t,o,n){if(t===U.UrlElicitationRequired&&n){const s=n;if(s.elicitations)return new og(s.elicitations,o)}if(t===U.UnsupportedProtocolVersion&&n){const s=n;if(Array.isArray(s.supported)&&typeof s.requested=="string")return new ng({supported:s.supported,requested:s.requested},o)}if(t===U.InvalidParams||t===U.ResourceNotFound){const s=n;if(typeof s?.uri=="string"&&(t===U.ResourceNotFound||Object.keys(s).length===1))return new tg(s.uri,o)}if(t===U.MissingRequiredClientCapability&&n){const s=n;if(s.requiredCapabilities!==null&&typeof s.requiredCapabilities=="object"&&!Array.isArray(s.requiredCapabilities))return new sg({requiredCapabilities:s.requiredCapabilities},o)}return new Rl(t,o,n)}},tg=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(U.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},og=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(U.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ng=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(U.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},sg=class extends ae{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(U.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}};const ig=0,rg="private",ag=["tools/call","prompts/get","resources/read"];function cg(e,t){const o=t.resultType;if(o===void 0)return{...t,resultType:"complete"};if(o==="complete"||ag.includes(e))return t;throw new ae(U.InternalError,`Handler for ${e} returned resultType '${String(o)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function lg(e,t){const o=eg(t);if(t.resultType!=="complete"||!Xf(e))return o===void 0?t:hg(t);const n=t,s=bl(n.ttlMs)?n.ttlMs:dg(o),a=yl(n.cacheScope)?n.cacheScope:mg(o),r={...n,ttlMs:s,cacheScope:a};return delete r[Si],r}function ug(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function pg(e,t){if(t===void 0)return e;const o=e._meta;return o===void 0?{...e,_meta:{[Oo]:t}}:!ug(o)||o[Oo]!==void 0?e:{...e,_meta:{...o,[Oo]:t}}}function dg(e){return e!==void 0&&bl(e.ttlMs)?e.ttlMs:ig}function mg(e){return e!==void 0&&yl(e.cacheScope)?e.cacheScope:rg}function hg(e){const t={...e};return delete t[Si],t}const fg=["elicitation/create","sampling/createMessage","roots/list"];let bn;function wl(){if(bn)return bn;const e=st();return bn={request:{"elicitation/create":l({method:p("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":l({method:p("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":l({method:p("roots/list"),params:I({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},bn}function Tl(e){return fg.includes(e)}function as(e){return Tl(e)?wl().request[e]:void 0}function gg(e){return Tl(e)?wl().response[e]:void 0}const Pl={"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},Sg={"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 Cl(e){return Object.prototype.hasOwnProperty.call(Pl,e)}function El(e){return Object.prototype.hasOwnProperty.call(Sg,e)}function _g(e){return Object.prototype.hasOwnProperty.call(Pl,e)}function vg(e){return Cl(e)?st().dispatchRequestSchemas[e]:void 0}function bg(e){return _g(e)?st().dispatchResultSchemas[e]:void 0}function yg(e){return El(e)?st().notificationSchemas2026[e]:void 0}function zo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Io(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};const o=e.safeParse(t);return o.success?{ok:!0,value:o.data}:{ok:!1,reason:"invalid",message:String(o.error)}}const Rg={ok:!1,reason:"not-in-era"},wg=[Zn,Dn];function Tg(e,t){let o=t,n=!1;const s=()=>(n||(o={...o},n=!0),o),a=t.tools;e==="tools/list"&&Array.isArray(a)&&a.some(c=>zo(c)&&"execution"in c)&&(s().tools=a.map(c=>{if(!zo(c)||!("execution"in c))return c;const u={...c};return delete u.execution,u}));const r=t.capabilities;if(zo(r)&&"tasks"in r){const c={...r};delete c.tasks,s().capabilities=c}return o}const _i={era:"2026-07-28",hasRequestMethod:Cl,hasNotificationMethod:El,hasInputRequestMethod:e=>as(e)!==void 0,validateRequest:(e,t)=>Io(vg(e),t),validateResult:(e,t)=>Io(bg(e),t),validateNotification:(e,t)=>Io(yg(e),t),validateInputRequest:(e,t)=>Io(as(e),t),validateInputResponse:(e,t)=>Io(gg(e),t),samplingResultVariant:()=>Rg,outboundEnvelope(e){return{[Zn]:e.protocolVersion,[Zs]:e.clientInfo,[Dn]:e.clientCapabilities,...e.logLevel!==void 0&&{[Ds]:e.logLevel}}},validateEnvelopeMeta(e){const t=[];for(const n of wg)n in e||t.push({key:n,problem:"missing"});const o=st().RequestMetaEnvelopeSchema.safeParse(e);if(!o.success)for(const n of o.error.issues){const s=n.path.map(String),a=s.length>0?s.join("."):"_meta";s.length===1&&t.some(r=>r.key===a&&r.problem==="missing")||t.push({key:a,problem:n.message})}return t},projectCallToolResult:e=>hl(e),inputRequestSchema:as,decodeResult(e,t){if(!zo(t))return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};const o=t.resultType;if(o===void 0)return{kind:"invalid",error:new ne(de.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 o!="string")return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:o})};if(o==="input_required"){const r=t.inputRequests,c=zo(r)?r:{},u=t.requestState;return Object.keys(c).length===0&&typeof u!="string"?{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:c,...typeof u=="string"&&{requestState:u}}}if(o!=="complete")return{kind:"invalid",error:new ne(de.UnsupportedResultType,`Unsupported result type '${o}' for ${e}`,{resultType:o,method:e})};const n=Pg(),s=Object.hasOwn(n,e)?n[e]:void 0;if(s!==void 0){const r=s.safeParse(t);if(!r.success)return{kind:"invalid",error:new ne(de.InvalidResult,`Invalid result for ${e}: ${r.error}`,{method:e})}}const a={...t};return delete a.resultType,{kind:"complete",result:a}},encodeResult(e,t,o){return pg(lg(e,cg(e,Tg(e,t))),o)},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)";const t=st().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(o=>o.message).join("; ")}`}};let yn;function Pg(){if(yn)return yn;const e=st();return yn={"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},yn}const kl="2026-07-28";function Nn(e){return e!==void 0&&Mf(e)?_i:gi}function or(e){return e.revision!==void 0?Nn(e.revision).era:e.era==="modern"?_i.era:gi.era}function cs(e){return $l.some(t=>t.hasRequestMethod(e))}function ls(e){return $l.some(t=>t.hasNotificationMethod(e))}const $l=[gi,_i];var Cg=du({AnnotationsSchema:()=>at,AudioContentSchema:()=>Kn,BaseMetadataSchema:()=>nt,BaseRequestParamsSchema:()=>me,BlobResourceContentsSchema:()=>oi,BooleanSchemaSchema:()=>ci,CallToolRequestParamsSchema:()=>Cc,CallToolRequestSchema:()=>Ec,CallToolResultSchema:()=>Qn,CancelTaskRequestSchema:()=>vf,CancelTaskResultSchema:()=>bf,CancelledNotificationParamsSchema:()=>Ia,CancelledNotificationSchema:()=>Gs,ClientCapabilitiesSchema:()=>za,ClientNotificationSchema:()=>Rf,ClientRequestSchema:()=>yf,ClientResultSchema:()=>wf,ClientTasksCapabilitySchema:()=>xa,CompatibilityCallToolResultSchema:()=>cf,CompleteRequestParamsSchema:()=>el,CompleteRequestSchema:()=>tl,CompleteResultSchema:()=>ol,ContentBlockSchema:()=>Mt,CreateMessageRequestParamsSchema:()=>Uc,CreateMessageRequestSchema:()=>jc,CreateMessageResultSchema:()=>Zc,CreateMessageResultWithToolsSchema:()=>Dc,CreateTaskResultSchema:()=>pf,CursorSchema:()=>Fs,DiscoverRequestSchema:()=>ja,DiscoverResultSchema:()=>Za,ElicitRequestFormParamsSchema:()=>es,ElicitRequestParamsSchema:()=>Bc,ElicitRequestSchema:()=>Wc,ElicitRequestURLParamsSchema:()=>Vc,ElicitResultSchema:()=>Yc,ElicitationCompleteNotificationParamsSchema:()=>Gc,ElicitationCompleteNotificationSchema:()=>Kc,EmbeddedResourceSchema:()=>ii,EmptyResultSchema:()=>Vn,EnumSchemaSchema:()=>Jc,GetPromptRequestParamsSchema:()=>gc,GetPromptRequestSchema:()=>Sc,GetPromptResultSchema:()=>bc,GetTaskPayloadRequestSchema:()=>ff,GetTaskPayloadResultSchema:()=>gf,GetTaskRequestSchema:()=>mf,GetTaskResultSchema:()=>hf,IconSchema:()=>Na,IconsSchema:()=>It,ImageContentSchema:()=>Gn,ImplementationSchema:()=>Nt,InitializeRequestParamsSchema:()=>Ma,InitializeRequestSchema:()=>La,InitializeResultSchema:()=>Aa,InitializedNotificationSchema:()=>Ua,JSONArraySchema:()=>nf,JSONObjectSchema:()=>ee,JSONRPCErrorResponseSchema:()=>Jn,JSONRPCMessageSchema:()=>qa,JSONRPCNotificationSchema:()=>Ws,JSONRPCRequestSchema:()=>Bs,JSONRPCResponseSchema:()=>sf,JSONRPCResultResponseSchema:()=>Fn,JSONValueSchema:()=>Et,LegacyTitledEnumSchemaSchema:()=>pi,ListChangedOptionsBaseSchema:()=>lf,ListPromptsRequestSchema:()=>hc,ListPromptsResultSchema:()=>fc,ListResourceTemplatesRequestSchema:()=>Wa,ListResourceTemplatesResultSchema:()=>Ga,ListResourcesRequestSchema:()=>Va,ListResourcesResultSchema:()=>Ba,ListRootsRequestSchema:()=>sl,ListRootsResultSchema:()=>il,ListTasksRequestSchema:()=>Sf,ListTasksResultSchema:()=>_f,ListToolsRequestSchema:()=>Tc,ListToolsResultSchema:()=>Pc,LoggingLevelSchema:()=>ai,LoggingMessageNotificationParamsSchema:()=>Ic,LoggingMessageNotificationSchema:()=>Nc,ModelHintSchema:()=>xc,ModelPreferencesSchema:()=>Oc,MultiSelectEnumSchemaSchema:()=>Fc,NotificationSchema:()=>ye,NotificationsParamsSchema:()=>be,NumberSchemaSchema:()=>qn,PaginatedRequestParamsSchema:()=>Fa,PaginatedRequestSchema:()=>xt,PaginatedResultSchema:()=>Ot,PingRequestSchema:()=>Ys,PrimitiveSchemaDefinitionSchema:()=>hi,ProgressNotificationParamsSchema:()=>Ha,ProgressNotificationSchema:()=>Qs,ProgressSchema:()=>Da,ProgressTokenSchema:()=>Hs,PromptArgumentSchema:()=>dc,PromptListChangedNotificationSchema:()=>yc,PromptMessageSchema:()=>vc,PromptReferenceSchema:()=>Xc,PromptSchema:()=>mc,ReadResourceRequestParamsSchema:()=>Ka,ReadResourceRequestSchema:()=>Ya,ReadResourceResultSchema:()=>Qa,RelatedTaskMetadataSchema:()=>$a,RequestIdSchema:()=>rt,RequestMetaSchema:()=>Js,RequestSchema:()=>te,ResourceContentsSchema:()=>Xs,ResourceLinkSchema:()=>ri,ResourceListChangedNotificationSchema:()=>Xa,ResourceRequestParamsSchema:()=>Bn,ResourceSchema:()=>ni,ResourceTemplateReferenceSchema:()=>Qc,ResourceTemplateSchema:()=>Ja,ResourceUpdatedNotificationParamsSchema:()=>uc,ResourceUpdatedNotificationSchema:()=>pc,ResultMetaObjectSchema:()=>Vs,ResultSchema:()=>oe,RoleSchema:()=>zt,RootSchema:()=>nl,RootsListChangedNotificationSchema:()=>rl,SamplingContentSchema:()=>Lc,SamplingMessageContentBlockSchema:()=>Ho,SamplingMessageSchema:()=>Ac,ServerCapabilitiesSchema:()=>Ks,ServerNotificationSchema:()=>Pf,ServerRequestSchema:()=>Tf,ServerResultSchema:()=>Cf,ServerTasksCapabilitySchema:()=>Oa,SetLevelRequestParamsSchema:()=>$c,SetLevelRequestSchema:()=>qc,SingleSelectEnumSchemaSchema:()=>Hc,StringSchemaSchema:()=>Xn,SubscribeRequestParamsSchema:()=>ec,SubscribeRequestSchema:()=>tc,SubscriptionFilterSchema:()=>si,SubscriptionsAcknowledgedNotificationParamsSchema:()=>rc,SubscriptionsAcknowledgedNotificationSchema:()=>ac,SubscriptionsListenRequestParamsSchema:()=>sc,SubscriptionsListenRequestSchema:()=>ic,SubscriptionsListenResultMetaSchema:()=>cc,SubscriptionsListenResultSchema:()=>lc,TaskAugmentedRequestParamsSchema:()=>Go,TaskCreationParamsSchema:()=>uf,TaskMetadataSchema:()=>ka,TaskSchema:()=>Lt,TaskStatusNotificationParamsSchema:()=>cl,TaskStatusNotificationSchema:()=>df,TaskStatusSchema:()=>al,TextContentSchema:()=>Wn,TextResourceContentsSchema:()=>ei,TitledMultiSelectEnumSchemaSchema:()=>mi,TitledSingleSelectEnumSchemaSchema:()=>ui,ToolAnnotationsSchema:()=>Rc,ToolChoiceSchema:()=>zc,ToolExecutionSchema:()=>wc,ToolListChangedNotificationSchema:()=>kc,ToolResultContentSchema:()=>Mc,ToolSchema:()=>Yn,ToolUseContentSchema:()=>_c,UnsubscribeRequestParamsSchema:()=>oc,UnsubscribeRequestSchema:()=>nc,UntitledMultiSelectEnumSchemaSchema:()=>di,UntitledSingleSelectEnumSchemaSchema:()=>li});const Eg=e=>Bs.safeParse(e).success,kg=e=>Ws.safeParse(e).success,nr=e=>Fn.safeParse(e).success,$g=e=>Jn.safeParse(e).success,us=-32020;U.InvalidRequest,U.UnsupportedProtocolVersion,U.InvalidParams,U.MethodNotFound,U.InvalidParams,U.MissingRequiredClientCapability;U.ParseError+"",U.InvalidRequest+"",U.MethodNotFound+"",U.UnsupportedProtocolVersion+"",U.MissingRequiredClientCapability+"";function ql(e,t){return _a(e,t)}function No(e){return new Set(e.flatMap(t=>Object.keys(t.shape)))}function Rs(e){if(e==null)return!1;const t=typeof e;return t!=="object"&&t!=="function"||!("~standard"in e)?!1:typeof e["~standard"]?.validate=="function"}let sr=!1;const ws="draft-2020-12";function qg(e,t="input"){const o=e["~standard"];let n;if(o.jsonSchema)n=o.jsonSchema[t]({target:ws});else if(o.vendor==="zod"){if(!("_zod"in e))throw new 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().");sr||(sr=!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.")),n=ga(e,{target:ws,io:t})}else throw new Error(`Schema library "${o.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output")return n.type!==void 0?n:Il(n)?{type:"object",...n}:n;if(n.type!==void 0&&n.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(n.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...n}}function Il(e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;for(const t of["oneOf","anyOf","allOf"]){const o=e[t];if(Array.isArray(o)&&o.length>0)return o.every(n=>n!==null&&typeof n=="object"&&(n.type==="object"||Il(n)))}return!1}function Ig(e){return e.path?.length?`${e.path.map(t=>String(typeof t=="object"?t.key:t)).join(".")}: ${e.message}`:e.message}async function ps(e,t){const o=await e["~standard"].validate(t);return o.issues&&o.issues.length>0?{success:!1,error:o.issues.map(n=>Ig(n)).join(", ")}:{success:!0,data:o.value}}function Ng(e){const t=ga(e,{target:ws,io:"input"});return typeof t.pattern=="string"?t.pattern:void 0}const xg=/\\\.\\d\{(\d+)\}/;function Og(e){const t=xg.exec(e),o=[void 0,-1,0];return t&&o.push(Number(t[1])),[!1,!0].flatMap(n=>[!1,!0].flatMap(s=>o.map(a=>Bo({local:n,offset:s,precision:a}))))}function zg(e,t){let o;switch(e){case"email":o=[ih()];break;case"uri":o=[Ls()];break;case"date":o=[Sa()];break;case"date-time":o=Og(t);break}return new Set(o.map(n=>Ng(n)).filter(n=>n!==void 0))}function Mg(e,t,o){return o!=="zod"?!0:zg(e,t).has(t)}function Fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lg(e){try{return qg(e,"input")}catch(t){const o=t instanceof Error?t.message:String(t);throw new ae(U.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${o}`)}}const Ag=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function vi(e){return Ag.has(e)||e.startsWith("x-")}const Ug=new Set(["$schema",...Object.keys(es.shape.requestedSchema.shape)]),ir={string:No([Xn,li,ui,pi]),number:No([qn]),integer:No([qn]),boolean:No([ci]),array:No([di,mi])},jg=new Set(Xn.shape.format.unwrap().options);function Zg(e,t,o,n){if(!Fo(e))return e;const s=typeof e.type=="string"&&Object.hasOwn(ir,e.type)?ir[e.type]:void 0;if(s===void 0)return e;const a={};for(const[r,c]of Object.entries(e))s.has(r)||vi(r)?a[r]=c:r==="pattern"&&e.type==="string"&&typeof e.format=="string"?jg.has(e.format)?(typeof c!="string"||!Mg(e.format,c,o))&&n.push(`${t}.${r}`):a[r]=c:n.push(`${t}.${r}`);return a}function Dg(e,t){const o={},n=[];for(const[s,a]of Object.entries(e))s==="properties"&&Fo(a)?o[s]=Object.fromEntries(Object.entries(a).map(([r,c])=>[r,Zg(c,`properties.${r}`,t,n)])):Ug.has(s)?o[s]=a:vi(s)||n.push(s);if(n.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);return o}function Hg(e,t){if(!Fo(e.properties))return t;const o=Object.entries(e.properties).filter(([,n])=>!ql(hi,n).success).map(([n])=>`properties.${n}`);return o.length>0?o.join(", "):t}function Ts(e,t,o=""){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((n,s)=>Ts(n,t[s],`${o}[${s}]`)):!Fo(e)||!Fo(t)?[]:Object.entries(e).flatMap(([n,s])=>{const a=o?`${o}.${n}`:n;return Object.prototype.hasOwnProperty.call(t,n)?Ts(s,t[n],a):vi(n)?[]:[a]})}function Fg(e){if(!Rs(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};const t=e.requestedSchema["~standard"].vendor,o=Dg(Lg(e.requestedSchema),t),n=ql(es.shape.requestedSchema,o);if(!n.success)throw new ae(U.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Hg(o,n.error.message)}`);const s=Ts(o,n.data);if(s.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${s.join(", ")}`);const a=(n.data.required??[]).filter(r=>!Object.prototype.hasOwnProperty.call(n.data.properties,r));if(a.length>0)throw new ae(U.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(", ")}`);return{...e,mode:"form",requestedSchema:n.data}}function Jg(e){const t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,o=typeof e.requestState=="string";if(!t&&!o)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Jg,{elicit(e){try{return{method:"elicitation/create",params:Fg(e)}}catch(t){throw t instanceof ae?new 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"}}});const Vg=["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"],Bg={IdJagTokenExchangeResponseSchema:qf,OAuthClientInformationFullSchema:Nf,OAuthClientInformationSchema:dl,OAuthClientMetadataSchema:pl,OAuthClientRegistrationErrorSchema:xf,OAuthErrorResponseSchema:If,OAuthMetadataSchema:ll,OAuthProtectedResourceMetadataSchema:Ef,OAuthTokenRevocationRequestSchema:Of,OAuthTokensSchema:$f,OpenIdProviderDiscoveryMetadataSchema:kf,OpenIdProviderMetadataSchema:ul},Nl={},xl={};function Ol(e,t){const o=e.slice(0,-6);Nl[o]=t,xl[o]=n=>t.safeParse(n).success}for(const e of Vg)Ol(e,Cg[e]);for(const[e,t]of Object.entries(Bg))Ol(e,t);Object.freeze(Nl);Object.freeze(xl);function Wg(e){switch(e){case"initialize":case"notifications/initialized":return Nn(void 0);case"server/discover":return Nn(kl);default:return}}const Gg=6e4,Kg=[Zn,Zs,Dn,Ds],Yg=["inputResponses","requestState"];function rr(e,t){const o=e.params;if(!ds(o))return{message:e,lifted:{}};const n=o._meta,s=ds(n)?Kg.filter(u=>u in n):[],a=t==="request"?Yg.filter(u=>u in o):[];if(s.length===0&&a.length===0)return{message:e,lifted:{}};const r={},c={...o};if(s.length>0&&ds(n)){const u={},d={...n};for(const h of s)u[h]=n[h],delete d[h];r.envelope=u,Object.keys(d).length>0?c._meta=d:delete c._meta}for(const u of a)u==="inputResponses"&&(r.inputResponses=c[u]),u==="requestState"&&(r.requestState=c[u]),delete c[u];return{message:{...e,params:c},lifted:r}}function ar(e,t){const o=e.validateResult(t,void 0);if(!(!o.ok&&o.reason==="not-in-era"))return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(n){const s=e.validateResult(t,n);return s.ok?{value:s.value}:{issues:[{message:s.reason==="invalid"?s.message:`not-in-era: ${t}`}]}}}}}function zl(e){return()=>e}const Qg=zl(void 0);var Xg=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Xh,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){const t=this._outboundMetaEnvelope();if(t===void 0)return e;const o=e.params??{};return{...e,params:{...o,_meta:{...t,...o._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new ne(de.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,o,n,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,t),startTime:Date.now(),timeout:t,maxTotalTimeout:o,resetTimeoutOnProgress:s,onTimeout:n})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const o=Date.now()-t.startTime;if(t.maxTotalTimeout&&o>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new ne(de.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:o});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};const o=this.transport?.onerror;this._transport.onerror=s=>{o?.(s),this._onerror(s)};const n=this._transport?.onmessage;this._transport.onmessage=(s,a)=>{n?.(s,a),nr(s)||$g(s)?this._onresponse(s):Eg(s)?this._onrequest(s,a):kg(s)?this._onnotification(s,a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();const t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;const o=new ne(de.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(const n of e.values())n(o);for(const n of t.values())n.abort(o)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){const{message:o}=rr(e,"notification"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){const r=or(t.classification);if(r!==n.era){this._onerror(new Error(`Era mismatch on inbound notification '${o.method}': classified as ${r} but this instance serves ${n.era}`));return}}if(ls(o.method)&&!n.hasNotificationMethod(o.method))return;const s=this._notificationHandlers.get(o.method),a=this.fallbackNotificationHandler;s===void 0&&a===void 0||Promise.resolve().then(()=>s===void 0?a(o):s(o,n)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,t){const{message:o,lifted:n}=rr(e,"request"),s=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(new Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}const a=this._transport,r=(P,b,A)=>{const j={jsonrpc:"2.0",id:o.id,error:{code:P,message:b,...A!==void 0&&{data:A}}};a?.send(j).catch(x=>this._onerror(new Error(`Failed to send an error response: ${x}`)))};if(t?.classification!==void 0){const P=or(t.classification);if(P!==s.era){this._onerror(new Error(`Era mismatch on inbound request '${o.method}': classified as ${P} but this instance serves ${s.era}`));const b=t.classification.revision??P;r(U.UnsupportedProtocolVersion,`Unsupported protocol version: ${b}`,{supported:this._supportedProtocolVersions,requested:b});return}}if(cs(o.method)&&!s.hasRequestMethod(o.method)){r(U.MethodNotFound,"Method not found");return}const c=this._requestHandlers.get(o.method)??this.fallbackRequestHandler;if(c===void 0){r(U.MethodNotFound,"Method not found");return}const u=s.checkInboundEnvelope(n);if(u!==void 0){r(U.InvalidParams,u);return}const d=(P,b)=>this._notificationViaCodec(this._resolveOutboundCodec(P.method),P,{...b,relatedRequestId:o.id}),h=(P,b,A)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(P.method),P,b,{...A,relatedRequestId:o.id}),S=new AbortController;this._requestHandlerAbortControllers.set(o.id,S);const v=n.inputResponses===void 0?void 0:eS(n.inputResponses),f={sessionId:a?.sessionId,mcpReq:{id:o.id,method:o.method,_meta:o.params?._meta,...n.envelope!==void 0&&{envelope:n.envelope},...v!==void 0&&{inputResponses:v.accepted},...v!==void 0&&v.droppedKeys.length>0&&{droppedInputResponseKeys:v.droppedKeys},requestState:n.requestState===void 0?Qg:zl(n.requestState),signal:S.signal,send:((P,b,A)=>{const j=this._resolveOutboundCodec(P.method);if(this._assertOutboundRequestInEra(j,P.method),Rs(b))return h(P,b,A);const x=ar(j,P.method);if(x===void 0)throw new TypeError(`'${P.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return h(P,x,b)}),notify:d},http:t?.authInfo?{authInfo:t.authInfo}:void 0},R=this.buildContext(f,t);Promise.resolve().then(()=>c(o,R)).then(async P=>{if(S.signal.aborted)return;let b;try{b=s.encodeResult(o.method,P,this._outboundServerInfo())}catch(j){this._onerror(new Error(`Failed to encode result for ${o.method}: ${j}`)),r(U.InternalError,"Internal error");return}const A={result:b,jsonrpc:"2.0",id:o.id};await a?.send(A)},async P=>{if(S.signal.aborted)return;const b=Number.isSafeInteger(P.code)?P.code:U.InternalError,A={jsonrpc:"2.0",id:o.id,error:{code:s.encodeErrorCode(b),message:P.message??"Internal error",...P.data!==void 0&&{data:P.data}}};await a?.send(A)}).catch(P=>this._onerror(new Error(`Failed to send response: ${P}`))).finally(()=>{this._requestHandlerAbortControllers.get(o.id)===S&&this._requestHandlerAbortControllers.delete(o.id)})}_onprogress(e){const{progressToken:t,...o}=e.params,n=Number(t),s=this._progressHandlers.get(n);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const a=this._responseHandlers.get(n),r=this._timeoutInfo.get(n);if(r&&a&&r.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),a(c);return}s(o)}_onresponse(e){const t=Number(e.id),o=this._responseHandlers.get(t);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),nr(e)?o(e):o(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,o){const n=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(n,e.method),Rs(t))return this._requestWithSchemaViaCodec(n,e,t,o);const s=ar(n,e.method);if(s===void 0)throw new TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(n,e,s,t)}_negotiatedWireCodec(){return Nn(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){const t=Wg(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(cs(t)&&!e.hasRequestMethod(t))throw new ne(de.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,o){const n=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(n,e.method),this._requestWithSchemaViaCodec(n,e,t,o)}_requestWithSchemaViaCodec(e,t,o,n){const{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c}=n??{},u=Date.now();let d,h;return new Promise((S,v)=>{const f=O=>{v(O)};if(!this._transport){f(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(O){f(O);return}if(n?.signal?.aborted){const O=n.signal.reason;throw O instanceof ne?O:new ne(de.RequestTimeout,String(O))}const R=e.era===kl&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,P=this._requestMessageId++;h=P;const b={...t,jsonrpc:"2.0",id:P};n?.onprogress&&(this._progressHandlers.set(P,n.onprogress),b.params={...t.params,_meta:{...t.params?._meta,progressToken:P}});const A=this._envelopeOutbound(b);let j=!1;const x=O=>{j||(this._progressHandlers.delete(P),R===void 0?t.method!=="initialize"&&this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:P,reason:String(O)}}),{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r}).catch(G=>this._onerror(new Error(`Failed to send cancellation: ${G}`))):R.abort(),v(O instanceof ne?O:new ne(de.RequestTimeout,String(O))))};this._responseHandlers.set(P,O=>{if(n?.signal?.aborted)return;if(j=!0,O instanceof Error)return v(O);let G;try{G=e.decodeResult(t.method,O.result)}catch(ie){return v(ie instanceof Error?ie:new Error(String(ie)))}if(G.kind==="invalid")return v(G.error);if(G.kind==="input_required"){if(n?.allowInputRequired===!0)return S(tS(G));const ie={codec:e,request:t,resultSchema:o,options:n,flowStartedAt:u,retry:(qe,q)=>this._requestWithSchemaViaCodec(e,qe===void 0?{method:t.method}:{method:t.method,params:qe},o,q)};return S(this._resolveNonCompleteResult(G,ie))}const se=G.result;ps(o,se).then(ie=>{ie.success?S(ie.data):v(new ne(de.InvalidResult,`Invalid result for ${t.method}: ${ie.error}`))},v)}),d=()=>x(n?.signal?.reason),n?.signal?.addEventListener("abort",d,{once:!0});const N=n?.timeout??Gg,$=()=>x(new ne(de.RequestTimeout,"Request timed out",{timeout:N}));this._setupTimeout(P,N,n?.maxTotalTimeout,$,n?.resetTimeoutOnProgress??!1),this._transport.send(A,{relatedRequestId:s,resumptionToken:a,onresumptiontoken:r,headers:c,requestSignal:R?.signal}).catch(O=>{this._progressHandlers.delete(P),v(O)})}).finally(()=>{d&&n?.signal?.removeEventListener("abort",d),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,o){if(!this._transport)throw new ne(de.NotConnected,"Not connected");if(ls(t.method)&&!e.hasNotificationMethod(t.method))throw new ne(de.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);const n=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&o?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(n,o).catch(s=>this._onerror(s))});return}await this._transport.send(n,o)}setRequestHandler(e,t,o){this.assertRequestHandlerCapability(e);let n;if(typeof t=="function"){if(!cs(e))throw new TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);n=(s,a)=>{const r=this._negotiatedWireCodec();let c=r.validateRequest(e,s);if(!c.ok&&c.reason==="not-in-era"&&(c=r.validateInputRequest(e,s)),!c.ok)throw c.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(c.message);return Promise.resolve(t(c.value,a))}}else if(o)n=async(s,a)=>{const r=await ps(t.params,{...s.params});if(!r.success)throw new ae(U.InvalidParams,`Invalid params for ${e}: ${r.error}`);return o(r.data,a)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(e,this._wrapHandler(e,n))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,o){if(typeof t=="function"){if(!ls(e))throw new TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,s)=>{const a=s.validateNotification(e,n);if(!a.ok)throw a.reason==="not-in-era"?new ae(U.InternalError,`No wire schema for ${e} in the resolved era`):new Error(a.message);return Promise.resolve(t(a.value))});return}if(!o)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async n=>{const s=await ps(t.params,{...n.params});if(!s.success)throw new ae(U.InvalidParams,`Invalid params for notification ${e}: ${s.error}`);await o(s.data,n)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ds(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eS(e){const t={},o=[];if(!cr(e))return{accepted:t,droppedKeys:o};for(const[n,s]of Object.entries(e)){if(!cr(s)||"method"in s||"result"in s){o.push(n);continue}t[n]=s}return{accepted:t,droppedKeys:o}}function tS(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}/*! * content-type * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed -*/var Zg=Kl((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=s;function s(c){if(!c)throw new TypeError("argument string is required");var u=typeof c=="object"?a(c):c;if(typeof u!="string")throw new TypeError("argument string is required to be a string");var d=u.indexOf(";"),h=d!==-1?u.slice(0,d).trim():u.trim();if(!n.test(h))throw new TypeError("invalid media type");var S=new r(h.toLowerCase());if(d!==-1){var b,f,R;for(t.lastIndex=d;f=t.exec(u);){if(f.index!==d)throw new TypeError("invalid parameter format");d+=f[0].length,b=f[1].toLowerCase(),R=f[2],R.charCodeAt(0)===34&&(R=R.slice(1,-1),R.indexOf("\\")!==-1&&(R=R.replace(o,"$1"))),S.parameters[b]=R}if(d!==u.length)throw new TypeError("invalid parameter format")}return S}function a(c){var u;if(typeof c.getHeader=="function"?u=c.getHeader("content-type"):typeof c.headers=="object"&&(u=c.headers&&c.headers["content-type"]),typeof u!="string")throw new TypeError("content-type header is missing from object");return u}function r(c){this.parameters=Object.create(null),this.type=c}}));Zg();typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");const Dg=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Hg=/^(?=.{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,Fg=/^(?:[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,Jg=/^(?:(?:[^\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,Vg=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Bg=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Wg=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Gg=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Kg=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Yg=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Qg=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function Ie(e){return e.test.bind(e)}Xg.bind(void 0,!1),Ie(Fg),Ie(Jg),Ie(Vg),Ie(Hg),Ie(Yg),Ie(Qg),Ie(Bg),Ie(Wg),Ie(Gg),Ie(Kg);function Xg(e,t){const o=t.match(Dg);if(!o)return!1;const n=+o[1],s=+o[2],a=+o[3],r=!!o[5];return(n<=23&&s<=59&&a<=59||n==23&&s==59&&a==60)&&(!e||r)}class eS{_eventSlots=new Map;setHandler(t,o){let n=this._ensureEventSlot(t);n.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", …) to add multiple listeners without replacing.`),n.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let n=this._eventSlots.get(t);if(!n)return;let s=n.listeners.indexOf(o);s!==-1&&n.listeners.splice(s,1)}dispatch(t,o){let n=this._eventSlots.get(t);if(n){n.onHandler?.(o);for(let s of[...n.listeners])s(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}}class tS{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}}var nr=new Set;function sr(e,t){let[o,n]=t,s=o?.shape;if(typeof s?.method?.value!="string")return;let a=s.method.value,r=e==="request"?"setRequestHandler":"setNotificationHandler";nr.has(r)||(nr.add(r),console.warn(`[ext-apps] ${r}(Schema, handler) is deprecated; use ${r}("${a}", { params: Schema.shape.params }, handler).`));let c=n;return[a,{params:s.params},e==="request"?(u,d)=>c({method:a,params:u},oS(d)):u=>c({method:a,params:u})]}function oS(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var nS="2026-01-26",sS="ui/notifications/tool-input-partial";class iS{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=n=>{if(o&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let s=Ra.safeParse(n.data);s.success?(console.debug("Parsed message",s.data),this.onmessage?.(s.data)):n.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",s.error.message,n):(console.error("Failed to parse message",s.error.message,n),this.onerror?.(Error("Invalid JSON-RPC message received: "+s.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==sS&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var rS=w([p("light"),p("dark")]).describe("Color theme preference for the host environment."),Do=w([p("inline"),p("fullscreen"),p("pip")]).describe("Display mode for UI presentation."),aS=w([p("--color-background-primary"),p("--color-background-secondary"),p("--color-background-tertiary"),p("--color-background-inverse"),p("--color-background-ghost"),p("--color-background-info"),p("--color-background-danger"),p("--color-background-success"),p("--color-background-warning"),p("--color-background-disabled"),p("--color-text-primary"),p("--color-text-secondary"),p("--color-text-tertiary"),p("--color-text-inverse"),p("--color-text-ghost"),p("--color-text-info"),p("--color-text-danger"),p("--color-text-success"),p("--color-text-warning"),p("--color-text-disabled"),p("--color-border-primary"),p("--color-border-secondary"),p("--color-border-tertiary"),p("--color-border-inverse"),p("--color-border-ghost"),p("--color-border-info"),p("--color-border-danger"),p("--color-border-success"),p("--color-border-warning"),p("--color-border-disabled"),p("--color-ring-primary"),p("--color-ring-secondary"),p("--color-ring-inverse"),p("--color-ring-info"),p("--color-ring-danger"),p("--color-ring-success"),p("--color-ring-warning"),p("--font-sans"),p("--font-mono"),p("--font-weight-normal"),p("--font-weight-medium"),p("--font-weight-semibold"),p("--font-weight-bold"),p("--font-text-xs-size"),p("--font-text-sm-size"),p("--font-text-md-size"),p("--font-text-lg-size"),p("--font-heading-xs-size"),p("--font-heading-sm-size"),p("--font-heading-md-size"),p("--font-heading-lg-size"),p("--font-heading-xl-size"),p("--font-heading-2xl-size"),p("--font-heading-3xl-size"),p("--font-text-xs-line-height"),p("--font-text-sm-line-height"),p("--font-text-md-line-height"),p("--font-text-lg-line-height"),p("--font-heading-xs-line-height"),p("--font-heading-sm-line-height"),p("--font-heading-md-line-height"),p("--font-heading-lg-line-height"),p("--font-heading-xl-line-height"),p("--font-heading-2xl-line-height"),p("--font-heading-3xl-line-height"),p("--border-radius-xs"),p("--border-radius-sm"),p("--border-radius-md"),p("--border-radius-lg"),p("--border-radius-xl"),p("--border-radius-full"),p("--border-width-regular"),p("--shadow-hairline"),p("--shadow-sm"),p("--shadow-md"),p("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),cS=y(aS.describe(`Style variables for theming MCP apps. +*/var oS=pu((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,o=/\\([\u000b\u0020-\u00ff])/g,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=s;function s(c){if(!c)throw new TypeError("argument string is required");var u=typeof c=="object"?a(c):c;if(typeof u!="string")throw new TypeError("argument string is required to be a string");var d=u.indexOf(";"),h=d!==-1?u.slice(0,d).trim():u.trim();if(!n.test(h))throw new TypeError("invalid media type");var S=new r(h.toLowerCase());if(d!==-1){var v,f,R;for(t.lastIndex=d;f=t.exec(u);){if(f.index!==d)throw new TypeError("invalid parameter format");d+=f[0].length,v=f[1].toLowerCase(),R=f[2],R.charCodeAt(0)===34&&(R=R.slice(1,-1),R.indexOf("\\")!==-1&&(R=R.replace(o,"$1"))),S.parameters[v]=R}if(d!==u.length)throw new TypeError("invalid parameter format")}return S}function a(c){var u;if(typeof c.getHeader=="function"?u=c.getHeader("content-type"):typeof c.headers=="object"&&(u=c.headers&&c.headers["content-type"]),typeof u!="string")throw new TypeError("content-type header is missing from object");return u}function r(c){this.parameters=Object.create(null),this.type=c}}));oS();typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");const nS=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,sS=/^(?=.{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,iS=/^(?:[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,rS=/^(?:(?:[^\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,aS=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,cS=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,lS=/^(?:\/(?:[^~/]|~0|~1)*)*$/,uS=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,pS=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,dS=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,mS=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function Ne(e){return e.test.bind(e)}hS.bind(void 0,!1),Ne(iS),Ne(rS),Ne(aS),Ne(sS),Ne(dS),Ne(mS),Ne(cS),Ne(lS),Ne(uS),Ne(pS);function hS(e,t){const o=t.match(nS);if(!o)return!1;const n=+o[1],s=+o[2],a=+o[3],r=!!o[5];return(n<=23&&s<=59&&a<=59||n==23&&s==59&&a==60)&&(!e||r)}class fS{_eventSlots=new Map;setHandler(t,o){let n=this._ensureEventSlot(t);n.onHandler&&o&&console.warn(`[MCP Apps] on${String(t)} handler replaced. Use addEventListener("${String(t)}", …) to add multiple listeners without replacing.`),n.onHandler=o}getHandler(t){return this._eventSlots.get(t)?.onHandler}addEventListener(t,o){this._ensureEventSlot(t).listeners.push(o)}removeEventListener(t,o){let n=this._eventSlots.get(t);if(!n)return;let s=n.listeners.indexOf(o);s!==-1&&n.listeners.splice(s,1)}dispatch(t,o){let n=this._eventSlots.get(t);if(n){n.onHandler?.(o);for(let s of[...n.listeners])s(o)}}_ensureEventSlot(t){let o=this._eventSlots.get(t);return o||(o={listeners:[]},this._eventSlots.set(t,o)),o}}class gS{_methods=new Set;claim(t,o){if(this._methods.has(t))throw Error(`Handler for "${t}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(t)}replace(t){this._methods.add(t)}release(t){this._methods.delete(t)}has(t){return this._methods.has(t)}}var lr=new Set;function ur(e,t){let[o,n]=t,s=o?.shape;if(typeof s?.method?.value!="string")return;let a=s.method.value,r=e==="request"?"setRequestHandler":"setNotificationHandler";lr.has(r)||(lr.add(r),console.warn(`[ext-apps] ${r}(Schema, handler) is deprecated; use ${r}("${a}", { params: Schema.shape.params }, handler).`));let c=n;return[a,{params:s.params},e==="request"?(u,d)=>c({method:a,params:u},SS(d)):u=>c({method:a,params:u})]}function SS(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var _S="2026-01-26",vS="ui/notifications/tool-input-partial";class bS{eventTarget;eventSource;messageListener;constructor(t=window.parent,o){this.eventTarget=t,this.eventSource=o,this.messageListener=n=>{if(o&&n.source!==this.eventSource){console.debug("Ignoring message from unknown source",n);return}let s=qa.safeParse(n.data);s.success?(console.debug("Parsed message",s.data),this.onmessage?.(s.data)):n.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",s.error.message,n):(console.error("Failed to parse message",s.error.message,n),this.onerror?.(Error("Invalid JSON-RPC message received: "+s.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==vS&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var yS=w([p("light"),p("dark")]).describe("Color theme preference for the host environment."),Jo=w([p("inline"),p("fullscreen"),p("pip")]).describe("Display mode for UI presentation."),RS=w([p("--color-background-primary"),p("--color-background-secondary"),p("--color-background-tertiary"),p("--color-background-inverse"),p("--color-background-ghost"),p("--color-background-info"),p("--color-background-danger"),p("--color-background-success"),p("--color-background-warning"),p("--color-background-disabled"),p("--color-text-primary"),p("--color-text-secondary"),p("--color-text-tertiary"),p("--color-text-inverse"),p("--color-text-ghost"),p("--color-text-info"),p("--color-text-danger"),p("--color-text-success"),p("--color-text-warning"),p("--color-text-disabled"),p("--color-border-primary"),p("--color-border-secondary"),p("--color-border-tertiary"),p("--color-border-inverse"),p("--color-border-ghost"),p("--color-border-info"),p("--color-border-danger"),p("--color-border-success"),p("--color-border-warning"),p("--color-border-disabled"),p("--color-ring-primary"),p("--color-ring-secondary"),p("--color-ring-inverse"),p("--color-ring-info"),p("--color-ring-danger"),p("--color-ring-success"),p("--color-ring-warning"),p("--font-sans"),p("--font-mono"),p("--font-weight-normal"),p("--font-weight-medium"),p("--font-weight-semibold"),p("--font-weight-bold"),p("--font-text-xs-size"),p("--font-text-sm-size"),p("--font-text-md-size"),p("--font-text-lg-size"),p("--font-heading-xs-size"),p("--font-heading-sm-size"),p("--font-heading-md-size"),p("--font-heading-lg-size"),p("--font-heading-xl-size"),p("--font-heading-2xl-size"),p("--font-heading-3xl-size"),p("--font-text-xs-line-height"),p("--font-text-sm-line-height"),p("--font-text-md-line-height"),p("--font-text-lg-line-height"),p("--font-heading-xs-line-height"),p("--font-heading-sm-line-height"),p("--font-heading-md-line-height"),p("--font-heading-lg-line-height"),p("--font-heading-xl-line-height"),p("--font-heading-2xl-line-height"),p("--font-heading-3xl-line-height"),p("--border-radius-xs"),p("--border-radius-sm"),p("--border-radius-md"),p("--border-radius-lg"),p("--border-radius-xl"),p("--border-radius-full"),p("--border-width-regular"),p("--shadow-hairline"),p("--shadow-sm"),p("--shadow-md"),p("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),wS=y(RS.describe(`Style variables for theming MCP apps. Individual style keys are optional - hosts may provide any subset of these values. Values are strings containing CSS values (colors, sizes, font stacks, etc.). Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\` -for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),w([i(),ds()]).describe(`Style variables for theming MCP apps. +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),w([i(),Ss()]).describe(`Style variables for theming MCP apps. Individual style keys are optional - hosts may provide any subset of these values. Values are strings containing CSS values (colors, sizes, font stacks, etc.). @@ -218,10 +235,10 @@ Values are strings containing CSS values (colors, sizes, font stacks, etc.). Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\` -for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);l({method:p("ui/open-link"),params:l({url:i().describe("URL to open in the host's browser")})});var lS=l({isError:T().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),uS=l({isError:T().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),pS=l({isError:T().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();l({method:p("ui/notifications/sandbox-proxy-ready"),params:l({})});var mi=l({connectDomains:m(i()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);l({method:p("ui/open-link"),params:l({url:i().describe("URL to open in the host's browser")})});var TS=l({isError:T().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),PS=l({isError:T().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),CS=l({isError:T().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();l({method:p("ui/notifications/sandbox-proxy-ready"),params:l({})});var bi=l({connectDomains:m(i()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). - Maps to CSP \`connect-src\` directive -- Empty or omitted → no network connections (secure default)`),resourceDomains:m(i()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:m(i()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:m(i()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),hi=l({camera:l({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:l({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:l({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:l({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});l({method:p("ui/notifications/size-changed"),params:l({width:_().optional().describe("New width in pixels."),height:_().optional().describe("New height in pixels.")})});var dS=l({method:p("ui/notifications/tool-input"),params:l({arguments:y(i(),C().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),mS=l({method:p("ui/notifications/tool-input-partial"),params:l({arguments:y(i(),C().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),hS=l({method:p("ui/notifications/tool-cancelled"),params:l({reason:i().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),fS=l({fonts:i().optional()}),gS=l({variables:cS.optional().describe("CSS variables for theming the app."),css:fS.optional().describe("CSS blocks that apps can inject.")}),SS=l({method:p("ui/resource-teardown"),params:l({})}),_S=y(i(),C()),ir=l({text:l({}).optional().describe("Host supports text content blocks."),image:l({}).optional().describe("Host supports image content blocks."),audio:l({}).optional().describe("Host supports audio content blocks."),resource:l({}).optional().describe("Host supports resource content blocks."),resourceLink:l({}).optional().describe("Host supports resource link content blocks."),structuredContent:l({}).optional().describe("Host supports structured content.")});l({method:p("ui/notifications/request-teardown"),params:l({}).optional()});var bS=l({experimental:y(i(),y(i(),Ns()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:l({}).optional().describe("Host supports opening external URLs."),downloadFile:l({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l({listChanged:T().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l({listChanged:T().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:l({}).optional().describe("Host accepts log messages."),sandbox:l({permissions:hi.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:mi.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:ir.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:ir.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:l({tools:l({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),vS=l({experimental:y(i(),y(i(),Ns()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:l({listChanged:T().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:m(Do).optional().describe("Display modes the app supports.")});l({method:p("ui/notifications/initialized"),params:l({}).optional()});l({csp:mi.optional().describe("Content Security Policy configuration for UI resources."),permissions:hi.optional().describe("Sandbox permissions requested by the UI resource."),domain:i().optional().describe(`Dedicated origin for view sandbox. +- Empty or omitted → no network connections (secure default)`),resourceDomains:m(i()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:m(i()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:m(i()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),yi=l({camera:l({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:l({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:l({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:l({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});l({method:p("ui/notifications/size-changed"),params:l({width:_().optional().describe("New width in pixels."),height:_().optional().describe("New height in pixels.")})});var ES=l({method:p("ui/notifications/tool-input"),params:l({arguments:y(i(),C().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),kS=l({method:p("ui/notifications/tool-input-partial"),params:l({arguments:y(i(),C().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),$S=l({method:p("ui/notifications/tool-cancelled"),params:l({reason:i().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),qS=l({fonts:i().optional()}),IS=l({variables:wS.optional().describe("CSS variables for theming the app."),css:qS.optional().describe("CSS blocks that apps can inject.")}),NS=l({method:p("ui/resource-teardown"),params:l({})}),xS=y(i(),C()),pr=l({text:l({}).optional().describe("Host supports text content blocks."),image:l({}).optional().describe("Host supports image content blocks."),audio:l({}).optional().describe("Host supports audio content blocks."),resource:l({}).optional().describe("Host supports resource content blocks."),resourceLink:l({}).optional().describe("Host supports resource link content blocks."),structuredContent:l({}).optional().describe("Host supports structured content.")});l({method:p("ui/notifications/request-teardown"),params:l({}).optional()});var OS=l({experimental:y(i(),y(i(),Us()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:l({}).optional().describe("Host supports opening external URLs."),downloadFile:l({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l({listChanged:T().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l({listChanged:T().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:l({}).optional().describe("Host accepts log messages."),sandbox:l({permissions:yi.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:bi.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:pr.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:pr.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:l({tools:l({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),zS=l({experimental:y(i(),y(i(),Us()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:l({listChanged:T().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:m(Jo).optional().describe("Display modes the app supports.")});l({method:p("ui/notifications/initialized"),params:l({}).optional()});l({csp:bi.optional().describe("Content Security Policy configuration for UI resources."),permissions:yi.optional().describe("Sandbox permissions requested by the UI resource."),domain:i().optional().describe(`Dedicated origin for view sandbox. Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. @@ -235,10 +252,10 @@ - \`true\`: request visible border + background - \`false\`: request no visible border + background -- omitted: host decides border`)});l({method:p("ui/request-display-mode"),params:l({mode:Do.describe("The display mode being requested.")})});var yS=l({mode:Do.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),RS=w([p("model"),p("app")]).describe("Tool visibility scope - who can access the tool.");l({resourceUri:i().optional(),visibility:m(RS).optional().describe(`Who can access this tool. Default: ["model", "app"] +- omitted: host decides border`)});l({method:p("ui/request-display-mode"),params:l({mode:Jo.describe("The display mode being requested.")})});var MS=l({mode:Jo.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),LS=w([p("model"),p("app")]).describe("Tool visibility scope - who can access the tool.");l({resourceUri:i().optional(),visibility:m(LS).optional().describe(`Who can access this tool. Default: ["model", "app"] - "model": Tool visible to and callable by the agent -- "app": Tool callable by the app from this server only`),csp:ms().optional(),permissions:ms().optional()});l({mimeTypes:m(i()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});l({method:p("ui/download-file"),params:l({contents:m(w([Qs,Xs])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});l({method:p("ui/message"),params:l({role:p("user").describe('Message role, currently only "user" is supported.'),content:m(Ot).describe("Message content blocks (text, image, etc.).")})});l({method:p("ui/notifications/sandbox-resource-ready"),params:l({html:i().describe("HTML content to load into the inner iframe."),sandbox:i().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:mi.optional().describe("CSP configuration from resource metadata."),permissions:hi.optional().describe("Sandbox permissions from resource metadata.")})});var wS=l({method:p("ui/notifications/tool-result"),params:Wn.describe("Standard MCP tool execution result.")}),kl=l({toolInfo:l({id:rt.optional().describe("JSON-RPC id of the tools/call request."),tool:Bn.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:rS.optional().describe("Current color theme preference."),styles:gS.optional().describe("Style configuration for theming the app."),displayMode:Do.optional().describe("How the UI is currently displayed."),availableDisplayModes:m(Do).optional().describe("Display modes the host supports."),containerDimensions:w([l({height:_().describe("Fixed container height in pixels.")}),l({maxHeight:w([_(),ds()]).optional().describe("Maximum container height in pixels.")})]).and(w([l({width:_().describe("Fixed container width in pixels.")}),l({maxWidth:w([_(),ds()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other -container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:i().optional().describe("User's language and region preference in BCP 47 format."),timeZone:i().optional().describe("User's timezone in IANA format."),userAgent:i().optional().describe("Host application identifier."),platform:w([p("web"),p("desktop"),p("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l({touch:T().optional().describe("Whether the device supports touch input."),hover:T().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l({top:_().describe("Top safe area inset in pixels."),right:_().describe("Right safe area inset in pixels."),bottom:_().describe("Bottom safe area inset in pixels."),left:_().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),TS=l({method:p("ui/notifications/host-context-changed"),params:kl.describe("Partial context update containing only changed fields.")});l({method:p("ui/update-model-context"),params:l({content:m(Ot).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(i(),C().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});l({method:p("ui/initialize"),params:l({appInfo:qt.describe("App identification (name and version)."),appCapabilities:vS.describe("Features and capabilities this app provides."),protocolVersion:i().describe("Protocol version this app supports.")})});var PS=l({protocolVersion:i().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:qt.describe("Host application identification and version."),hostCapabilities:bS.describe("Features and capabilities provided by the host."),hostContext:kl.describe("Rich context about the host environment.")}).passthrough(),CS={target:"draft-2020-12"};async function rr(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](CS);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function ar(e,t,o=""){let n=await e["~standard"].validate(t);if(n.issues){let s=n.issues.map(a=>{let r=a.path?.map(c=>typeof c=="object"?c.key:c).join(".");return r?`${r}: ${a.message}`:a.message}).join("; ");throw Error(o+s)}return n.value}function ES(e){let t=document.documentElement;t.setAttribute("data-theme",e),t.style.colorScheme=e}function kS(e,t=document.documentElement){for(let[o,n]of Object.entries(e))n!==void 0&&t.style.setProperty(o,n)}function $S(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}class fi extends Ag{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new eS;_methods=new tS;setRequestHandler=(...t)=>{let[o,...n]=sr("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...n)};setNotificationHandler=(...t)=>{let[o,...n]=sr("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...n)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:dS,toolinputpartial:mS,toolresult:wS,toolcancelled:hS,hostcontextchanged:TS};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!fi.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},n=>{let s=n;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s}),this._events.dispatch(t,s)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,n){o&&n&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},n={autoResize:!0}){super(n),this._appInfo=t,this._appCapabilities=o,this.options=n,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!n.allowUnsafeEval&&Ne({jitless:!0}),this.replaceRequestHandler("ping",s=>(console.log("Received ping:",s.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=$S(this._appCapabilities,t)}registerTool(t,o,n){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let s=this,a=()=>{s._initializedSent&&s._appCapabilities.tools?.listChanged&&s.sendToolListChanged()},r=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(u){Object.assign(this,u),a()},remove(){s._registeredTools[t]===c&&(delete s._registeredTools[t],a())},handler:async(u,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let h;if(r){let S=c.inputSchema,b=S?await ar(S,u??{},`Invalid input for tool ${t}: `):u??{};h=await n(b,d)}else h=await n(d);return c.outputSchema&&!h.isError&&(h.structuredContent=await ar(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let n=this._registeredTools[t.name];if(!n)throw Error(`Tool ${t.name} not found`);return n.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([n,s])=>s.enabled).map(async([n,s])=>{let a={name:n,title:s.title,description:s.description,inputSchema:s.inputSchema?await rr(s.inputSchema,"input"):{type:"object",properties:{}}};return s.outputSchema&&(a.outputSchema=await rr(s.outputSchema,"output")),s.annotations&&(a.annotations=s.annotations),s._meta&&(a._meta=s._meta),a}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:SS.shape.params,result:_S},(o,n)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,n)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,n)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,n)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,n)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,n)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},pS,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Dn,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},lS,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},uS,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},yS,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,n=0,s=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let r=document.documentElement,c=r.style.height;r.style.height="max-content";let u=Math.ceil(r.getBoundingClientRect().height);r.style.height=c;let d=Math.ceil(window.innerWidth);(d!==o||u!==n)&&(o=d,n=u,this.sendSizeChanged({width:d,height:u}))}))};s();let a=new ResizeObserver(s);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(t=new iS(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let n=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:nS}},PS,o);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(n){throw this.close(),n}}}const qS="0.1.2",cs=document.getElementById("app"),st=document.getElementById("status"),vs=document.getElementById("status-text"),$n=document.getElementById("editor"),IS=document.querySelector('meta[name="pen-editor-url"]').content,de=new fi({name:"pen.dev",version:qS});let Ae,Ue,qn,gi,Oo,ls=!1,Sn=!1,cr,ys=!1,In;de.ontoolresult=({structuredContent:e,isError:t,content:o})=>{if(!Ae){if(t){const n=o?.map(s=>s.type==="text"?s.text:"").join(" ").trim();Nn(n||"pen.dev couldn't open the editor.");return}e&&(Ae=e,Si(Ae))}};de.onhostcontextchanged=()=>{$l();const e=de.getHostContext()?.theme;e&&e!==Oo&&(Oo=e,gi?.("color-theme-changed",{theme:Oo}))};de.onteardown=async()=>(Sn=!0,{});await de.connect();Oo=de.getHostContext()?.theme;$l();de.getHostContext()?.availableDisplayModes?.includes("fullscreen")&&de.requestDisplayMode({mode:"fullscreen"}).catch(()=>{});function Nn(e){vs.textContent=e,st.classList.add("message"),st.hidden=!1}function NS(){cs.classList.remove("flashing"),cs.offsetWidth,cs.classList.add("flashing")}function $l(){const e=de.getHostContext();document.body.classList.toggle("fullscreen",e?.displayMode==="fullscreen"),e?.theme&&ES(e.theme),e?.styles?.variables&&kS(e.styles.variables)}function Si(e){const t=new URL(IS);t.searchParams.set("embed",""),vs.textContent=`Opening ${e.filePath.split(/[\\/]/).pop()}…`,setTimeout(()=>{!st.hidden&&!st.classList.contains("message")&&(vs.textContent="This is taking longer than usual…")},2e4);const o=n=>{n.source===$n.contentWindow&&n.data?.type==="pen:ready"&&OS(t.origin,e)};cr?.(),window.addEventListener("message",o),cr=()=>window.removeEventListener("message",o),qn?.(),qn=void 0,Ue=void 0,gi=void 0,$n.src=t.href}function xS(e){Ae=e,st.classList.remove("message"),st.hidden=!1,Si(e),ys=!1,de.updateModelContext({content:[{type:"text",text:`pen.dev editor opened file: ${e.filePath}`,_meta:{"openai/title":e.filePath.split(/[\\/]/).pop()}}]}).catch(()=>{})}function OS(e,t){const o=new MessageChannel,n=new Map;let s=0;qn?.(),qn=()=>{for(const a of n.values())a.reject(new Error("The editor reloaded."));n.clear(),o.port1.close()},o.port1.onmessage=({data:a})=>{switch(a?.kind){case"ready":st.hidden=!0,zS();break;case"error":Nn(a.message);break;case"request":LS(o.port1,a,t);break;case"response":{const r=n.get(a.id);n.delete(a.id),a.error?r?.reject(new Error(a.error.message)):r?.resolve(a.payload);break}case"notification":a.method==="selection-changed"&&DS(t,a.payload);break}},gi=(a,r)=>o.port1.postMessage({kind:"notification",method:a,payload:r}),Ue=(a,r)=>new Promise((c,u)=>{const d=`app-${++s}`;n.set(d,{resolve:c,reject:u}),o.port1.postMessage({kind:"request",id:d,method:a,payload:r})}),$n.contentWindow?.postMessage({type:"pen:connect",fileURI:t.fileURI,theme:Oo,clientName:"ChatGPT",cursorColor:[44/255,103/255,197/255]},e,[o.port2])}async function zS(){if(!ls){for(ls=!0;!Sn&&Ae&&Ue;){const e=Ae,t={viewId:e.viewId,filePath:e.filePath};let o;try{o=(await de.callServerTool({name:"next_command",arguments:t})).structuredContent}catch(n){if(n instanceof re&&n.code===Zh){Sn=!0,Nn("This editor is no longer connected to Codex.");break}await new Promise(s=>setTimeout(s,1e3));continue}if(e!==Ae||e===In){o.kind==="command"&&await de.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:Rs(e===In?`The pen.dev editor is switching away from ${e.filePath}.`:`The pen.dev editor now shows ${Ae?.filePath}.`)}}).catch(()=>{});continue}switch(o.kind){case"replaced":Sn=!0,$n.src="about:blank",Nn("This document is now open in a newer editor.");break;case"command":o.command.name==="get_app_state"&&NS(),await de.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:await MS(o.command)}}).catch(()=>{});break}}ls=!1}}async function MS(e){try{if(!Ue)throw new Error("The editor is not connected.");if(e.name==="save"){const t=ql(await Ue("save",void 0));return t?Rs(t):{content:[]}}return await Ue("mcp-tool-call",{name:e.name,arguments:e.arguments})}catch(t){return Rs(t instanceof Error?t.message:String(t))}}function Rs(e){return{isError:!0,content:[{type:"text",text:e}]}}async function LS(e,{id:t,method:o,payload:n},s){try{e.postMessage({kind:"response",id:t,payload:await AS(o,n,s)})}catch(a){e.postMessage({kind:"response",id:t,error:{code:"REQUEST_FAILED",message:a instanceof Error?a.message:String(a)}})}}async function AS(e,t,o){const n=e;switch(n){case"storage-load":case"storage-write":case"storage-read-asset":case"storage-write-asset":case"storage-has-asset":return US(n,t,o);case"documents-list":case"documents-open":case"documents-new":case"documents-previews":case"documents-save-preview":case"documents-remove":return jS(n,t,o);default:{const s=n;throw new Error(`Unsupported editor request: ${s}`)}}}async function US(e,t,o){const n=async c=>{const u=await de.callServerTool({name:"editor_storage",arguments:{viewId:o.viewId,filePath:o.filePath,request:c}});if(u.isError)throw new Error(JSON.stringify(u.content));return u.structuredContent},{content:s,path:a,data:r}=t??{};switch(e){case"storage-load":return n({method:e});case"storage-write":{const{saved:c}=await n({method:e,content:s??""});return c?zo.Saved:zo.WriteFailed}case"storage-read-asset":{const c=await n({method:e,path:a??""});return typeof c.data=="string"?Nl(c.data):void 0}case"storage-write-asset":await n({method:e,path:a??"",data:Il(r??new Uint8Array)});return;case"storage-has-asset":return(await n({method:e,path:a??""})).exists;default:{const c=e;throw new Error(`Unsupported editor request: ${c}`)}}}async function jS(e,t,o){const n=async r=>{const c=await de.callServerTool({name:"editor_documents",arguments:{request:r}});if(c.isError)throw new Error(JSON.stringify(c.content));return c.structuredContent},s=async r=>{In=o;try{await lr(),await a(await r())}finally{In=void 0}},a=async r=>{xS(r),await n({method:"documents-release",viewId:o.viewId,filePath:o.filePath})};switch(e){case"documents-list":{const{documents:r}=await n({method:"documents-list"});return r.map(ZS)}case"documents-previews":{const{uris:r}=t,{previews:c}=await n({method:"documents-previews",uris:r});return Object.fromEntries(Object.entries(c).map(([u,d])=>[u,Nl(d)]))}case"documents-open":{const{uri:r}=t;if(r===o.fileURI){await lr(),Si(o);return}await s(()=>n({method:"documents-open",uri:r}));return}case"documents-new":await s(()=>n({method:"documents-new"}));return;case"documents-save-preview":{const{image:r}=t;await n({method:"documents-save-preview",uri:o.fileURI,data:Il(r)});return}case"documents-remove":{const r=t,c=r.removal===Zl.Delete,{uris:u}=await n({method:"documents-remove",uris:r.uris,removal:c?"delete":"recents"});return c&&u.includes(o.fileURI)&&await a(await n({method:"documents-new"})),u}default:{const r=e;throw new Error(`Unsupported editor request: ${r}`)}}}async function lr(){if(!Ue)return;const e=ql(await Ue("save",void 0).catch(()=>zo.WriteFailed));if(e)throw new Error(`${e} The document stays open so its changes aren't lost.`)}function ql(e){return e===zo.Saved||e===zo.NothingToSave?void 0:Hl(e)}function ZS(e){const t=e.draft?yi.Managed:yi.File;return{uri:e.uri,kind:t,name:Fl(e.fileName,t),folderName:e.folderName,preview:{kind:jl.None},timestamps:{createdAt:e.createdAt,lastEditedAt:e.lastEditedAt,lastOpenedAt:e.lastOpenedAt}}}function Il(e){let t="";for(const o of e)t+=String.fromCharCode(o);return btoa(t)}function Nl(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function DS(e,{nodes:t}){t.length===0&&!ys||(ys=t.length>0,de.updateModelContext({content:t.map(o=>({type:"text",text:`pen.dev selected node id: ${o.id}${o.name?`, name: ${o.name}`:""}, type: ${o.type}, file: ${e.filePath}`,_meta:{"openai/title":o.name??o.id}}))}).catch(()=>{}))}</script> +- "app": Tool callable by the app from this server only`),csp:_s().optional(),permissions:_s().optional()});l({mimeTypes:m(i()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});l({method:p("ui/download-file"),params:l({contents:m(w([ii,ri])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});l({method:p("ui/message"),params:l({role:p("user").describe('Message role, currently only "user" is supported.'),content:m(Mt).describe("Message content blocks (text, image, etc.).")})});l({method:p("ui/notifications/sandbox-resource-ready"),params:l({html:i().describe("HTML content to load into the inner iframe."),sandbox:i().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:bi.optional().describe("CSP configuration from resource metadata."),permissions:yi.optional().describe("Sandbox permissions from resource metadata.")})});var AS=l({method:p("ui/notifications/tool-result"),params:Qn.describe("Standard MCP tool execution result.")}),Ml=l({toolInfo:l({id:rt.optional().describe("JSON-RPC id of the tools/call request."),tool:Yn.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:yS.optional().describe("Current color theme preference."),styles:IS.optional().describe("Style configuration for theming the app."),displayMode:Jo.optional().describe("How the UI is currently displayed."),availableDisplayModes:m(Jo).optional().describe("Display modes the host supports."),containerDimensions:w([l({height:_().describe("Fixed container height in pixels.")}),l({maxHeight:w([_(),Ss()]).optional().describe("Maximum container height in pixels.")})]).and(w([l({width:_().describe("Fixed container width in pixels.")}),l({maxWidth:w([_(),Ss()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:i().optional().describe("User's language and region preference in BCP 47 format."),timeZone:i().optional().describe("User's timezone in IANA format."),userAgent:i().optional().describe("Host application identifier."),platform:w([p("web"),p("desktop"),p("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l({touch:T().optional().describe("Whether the device supports touch input."),hover:T().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l({top:_().describe("Top safe area inset in pixels."),right:_().describe("Right safe area inset in pixels."),bottom:_().describe("Bottom safe area inset in pixels."),left:_().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),US=l({method:p("ui/notifications/host-context-changed"),params:Ml.describe("Partial context update containing only changed fields.")});l({method:p("ui/update-model-context"),params:l({content:m(Mt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:y(i(),C().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});l({method:p("ui/initialize"),params:l({appInfo:Nt.describe("App identification (name and version)."),appCapabilities:zS.describe("Features and capabilities this app provides."),protocolVersion:i().describe("Protocol version this app supports.")})});var jS=l({protocolVersion:i().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Nt.describe("Host application identification and version."),hostCapabilities:OS.describe("Features and capabilities provided by the host."),hostContext:Ml.describe("Rich context about the host environment.")}).passthrough(),ZS={target:"draft-2020-12"};async function dr(e,t){let o=e["~standard"];if(o.jsonSchema)return o.jsonSchema[t](ZS);throw Error(`Schema (vendor: ${o.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function mr(e,t,o=""){let n=await e["~standard"].validate(t);if(n.issues){let s=n.issues.map(a=>{let r=a.path?.map(c=>typeof c=="object"?c.key:c).join(".");return r?`${r}: ${a.message}`:a.message}).join("; ");throw Error(o+s)}return n.value}function DS(e){let t=document.documentElement;t.setAttribute("data-theme",e),t.style.colorScheme=e}function HS(e,t=document.documentElement){for(let[o,n]of Object.entries(e))n!==void 0&&t.style.setProperty(o,n)}function FS(e,t){let o={...e,...t};return t.experimental!==void 0&&(o.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(o.tools={...e.tools,...t.tools}),o}class Ri extends Xg{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new fS;_methods=new gS;setRequestHandler=(...t)=>{let[o,...n]=ur("request",t)??t;this._methods.claim(o,"setRequestHandler"),super.setRequestHandler.call(this,o,...n)};setNotificationHandler=(...t)=>{let[o,...n]=ur("notification",t)??t;this._methods.claim(o,"setNotificationHandler"),super.setNotificationHandler.call(this,o,...n)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...o)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...o)};_assertInitialized(t){if(this._initializedSent)return;let o=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}eventSchemas={toolinput:ES,toolinputpartial:kS,toolresult:AS,toolcancelled:$S,hostcontextchanged:US};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!Ri.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let o=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(t,o){o&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,o)}addEventListener(t,o){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,o)}removeEventListener(t,o){this._events.removeEventListener(t,o)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let o=this.eventSchemas[t];if(!o)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(o.shape.method.value,{params:o.shape.params},n=>{let s=n;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s}),this._events.dispatch(t,s)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,o,n){o&&n&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,o={},n={autoResize:!0}){super(n),this._appInfo=t,this._appCapabilities=o,this.options=n,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!n.allowUnsafeEval&&xe({jitless:!0}),this.replaceRequestHandler("ping",s=>(console.log("Received ping:",s.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=FS(this._appCapabilities,t)}registerTool(t,o,n){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let s=this,a=()=>{s._initializedSent&&s._appCapabilities.tools?.listChanged&&s.sendToolListChanged()},r=o.inputSchema!==void 0,c={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,a()},disable(){this.enabled=!1,a()},update(u){Object.assign(this,u),a()},remove(){s._registeredTools[t]===c&&(delete s._registeredTools[t],a())},handler:async(u,d)=>{if(!c.enabled)throw Error(`Tool ${t} is disabled`);let h;if(r){let S=c.inputSchema,v=S?await mr(S,u??{},`Invalid input for tool ${t}: `):u??{};h=await n(v,d)}else h=await n(d);return c.outputSchema&&!h.isError&&(h.structuredContent=await mr(c.outputSchema,h.structuredContent,`Invalid output for tool ${t}: `)),h}};return this._registeredTools[t]=c,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),a(),c}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,o)=>{let n=this._registeredTools[t.name];if(!n)throw Error(`Tool ${t.name} not found`);return n.handler(t.arguments,o)},this.onlisttools=async(t,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([n,s])=>s.enabled).map(async([n,s])=>{let a={name:n,title:s.title,description:s.description,inputSchema:s.inputSchema?await dr(s.inputSchema,"input"):{type:"object",properties:{}}};return s.outputSchema&&(a.outputSchema=await dr(s.outputSchema,"output")),s.annotations&&(a.annotations=s.annotations),s._meta&&(a._meta=s._meta),a}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:NS.shape.params,result:xS},(o,n)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o,n)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(o,n)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,n)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(o,n)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,n)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,o){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(t,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},o)}async listServerResources(t,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},o)}async createSamplingMessage(t,o){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},o)}sendMessage(t,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},CS,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Vn,o)}openLink(t,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},TS,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},PS,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},MS,o)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,o=0,n=0,s=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let r=document.documentElement,c=r.style.height;r.style.height="max-content";let u=Math.ceil(r.getBoundingClientRect().height);r.style.height=c;let d=Math.ceil(window.innerWidth);(d!==o||u!==n)&&(o=d,n=u,this.sendSizeChanged({width:d,height:u}))}))};s();let a=new ResizeObserver(s);return a.observe(document.documentElement),a.observe(document.body),()=>a.disconnect()}async connect(t=new bS(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let n=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:_S}},jS,o);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(n){throw this.close(),n}}}const Ll="0.1.3",Al=z(["accepted","declined"]),ms=document.getElementById("app"),je=document.getElementById("status"),Ps=document.getElementById("status-text"),Mo=document.getElementById("take-over"),xn=document.getElementById("retry"),On=document.getElementById("editor"),JS=document.querySelector('meta[name="pen-editor-url"]').content,VS=document.querySelector('meta[name="pen-install-id"]').content;let Ul=Al.safeParse(document.querySelector('meta[name="pen-analytics-consent"]').content).data;const X=new Ri({name:"pen.dev",version:Ll});let $e,hr,Cs=!1,Ue,zn,wi,Lo,hs=!1,Vo=!1,fr,Es=!1,Mn;X.ontoolresult=({structuredContent:e,isError:t,content:o})=>{if(!($e||Cs)){if(t){kt(BS(o)||"pen.dev couldn't open the editor.");return}if(e){if(e.mode==="dashboard"){Cs=!0,$t(void 0);return}$e=e,$t($e)}}};X.onhostcontextchanged=()=>{Dl();const e=X.getHostContext()?.theme;e&&e!==Lo&&(Lo=e,wi?.("color-theme-changed",{theme:Lo}))};Mo.addEventListener("click",()=>{WS()});xn.addEventListener("click",()=>{($e!=null||Cs)&&$t($e)});X.onteardown=async()=>(Vo=!0,{});await X.connect();Lo=X.getHostContext()?.theme;Dl();X.getHostContext()?.availableDisplayModes?.includes("fullscreen")&&X.requestDisplayMode({mode:"fullscreen"}).catch(()=>{});function kt(e){Ps.textContent=e,je.classList.add("message"),je.hidden=!1}function BS(e){return(e??[]).map(t=>t.type==="text"?t.text:"").join(" ").trim()}function Ko(e){return e.filePath.split(/[\\/]/).pop()}function jl(e){return`${Ko(e)} is open in another editor in this chat.`}function Zl(e,t){Vo=!0,On.src="about:blank",kt(e),Mo.hidden=!t}async function WS(){const e=$e;if(e!=null){Mo.disabled=!0;try{if((await X.callServerTool({name:"editor_take_over",arguments:{viewId:e.viewId,filePath:e.filePath}})).isError){kt(`The other editor couldn't save its changes, so ${Ko(e)} stays open there.`);return}}catch{kt("Couldn't reach pen.dev. Try again.");return}finally{Mo.disabled=!1}Vo=!1,Mo.hidden=!0,je.classList.remove("message"),$t(e)}}function GS(){ms.classList.remove("flashing"),ms.offsetWidth,ms.classList.add("flashing")}function Dl(){const e=X.getHostContext();document.body.classList.toggle("fullscreen",e?.displayMode==="fullscreen"),e?.theme&&DS(e.theme),e?.styles?.variables&&HS(e.styles.variables)}function $t(e){const t=new URL(JS);t.searchParams.set("embed",""),e==null&&t.searchParams.set("dashboard",""),Ps.textContent=e!=null?`Opening ${Ko(e)}…`:"Opening pen.dev…",xn.hidden=!0,clearTimeout(hr),hr=setTimeout(()=>{!je.hidden&&!je.classList.contains("message")&&(Ps.textContent="This is taking longer than usual…",xn.hidden=!1)},2e4);const o=n=>{n.source===On.contentWindow&&n.data?.type==="pen:ready"&&QS(t.origin,e)};fr?.(),window.addEventListener("message",o),fr=()=>window.removeEventListener("message",o),zn?.(),zn=void 0,Ue=void 0,wi=void 0,On.src=t.href}function KS(e){$e=e,je.classList.remove("message"),je.hidden=!1,$t(e)}function YS(e){Es=!1,X.updateModelContext({content:[{type:"text",text:`A pen.dev editor is open in this conversation with ${e.filePath}`,_meta:{"openai/title":Ko(e)}}]}).catch(()=>{})}function QS(e,t){const o=new MessageChannel,n=new Map;let s=0;zn?.(),zn=()=>{for(const a of n.values())a.reject(new Error("The editor reloaded."));n.clear(),o.port1.close()},o.port1.onmessage=({data:a})=>{switch(a?.kind){case"ready":je.hidden=!0,xn.hidden=!0,t!=null&&YS(t),XS();break;case"error":kt(a.message);break;case"request":t_(o.port1,a,t);break;case"response":{const r=n.get(a.id);n.delete(a.id),a.error?r?.reject(new Error(a.error.message)):r?.resolve(a.payload);break}case"notification":a.method==="selection-changed"&&t!=null&&l_(t,a.payload);break}},wi=(a,r)=>o.port1.postMessage({kind:"notification",method:a,payload:r}),Ue=(a,r)=>new Promise((c,u)=>{const d=`app-${++s}`;n.set(d,{resolve:c,reject:u}),o.port1.postMessage({kind:"request",id:d,method:a,payload:r})}),On.contentWindow?.postMessage({type:"pen:connect",fileURI:t?.fileURI,theme:Lo,clientName:"ChatGPT",cursorColor:[44/255,103/255,197/255],capabilities:["open-link"],embedder:{name:"pen-dev-mcp-app",version:Ll,host:X.getHostVersion()?.name,installId:VS,analyticsConsent:Ul}},e,[o.port2])}async function XS(){if(!hs){for(hs=!0;!Vo&&$e&&Ue;){const e=$e,t={viewId:e.viewId,filePath:e.filePath};let o;try{o=(await X.callServerTool({name:"next_command",arguments:t})).structuredContent}catch(n){if(n instanceof ae&&n.code===of){Vo=!0,kt("This editor is no longer connected to Codex.");break}await new Promise(s=>setTimeout(s,1e3));continue}if(e!==$e||e===Mn){o.kind==="command"&&await X.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:ks(e===Mn?`The pen.dev editor is switching away from ${e.filePath}.`:`The pen.dev editor now shows ${$e?.filePath}.`)}}).catch(()=>{});continue}switch(o.kind){case"replaced":Zl(jl(e),!0);break;case"command":o.command.name==="get_app_state"&&GS(),await X.callServerTool({name:"command_result",arguments:{...t,commandId:o.command.id,result:await e_(o.command)}}).catch(()=>{});break}}hs=!1}}async function e_(e){try{if(!Ue)throw new Error("The editor is not connected.");if(e.name==="save"){const t=Vl(await Ue("save",void 0));return t?ks(t):{content:[]}}return await Ue("mcp-tool-call",{name:e.name,arguments:e.arguments})}catch(t){return ks(t instanceof Error?t.message:String(t))}}function ks(e){return{isError:!0,content:[{type:"text",text:e}]}}async function t_(e,{id:t,method:o,payload:n},s){try{e.postMessage({kind:"response",id:t,payload:await o_(o,n,s)})}catch(a){e.postMessage({kind:"response",id:t,error:{code:"REQUEST_FAILED",message:a instanceof Error?a.message:String(a)}})}}async function o_(e,t,o){const n=e;switch(n){case"storage-load":case"storage-write":case"storage-read-asset":case"storage-write-asset":case"storage-has-asset":if(o==null)throw new Error("The dashboard has no document to load or save.");return i_(n,t,o);case"documents-list":case"documents-open":case"documents-new":case"documents-previews":case"documents-save-preview":case"documents-remove":return o!=null?a_(n,t,o):r_(n,t);case"analytics-consent-save":return n_(t);case"open-link":return s_(t);default:{const s=n;throw new Error(`Unsupported editor request: ${s}`)}}}async function n_(e){const t=l({answer:Al}).safeParse(e);if(!t.success)throw new Error("analytics-consent-save needs an answer");const{answer:o}=t.data,n=await X.callServerTool({name:"editor_analytics_consent",arguments:{answer:o}});if(n.isError)throw new Error(JSON.stringify(n.content));Ul=o}async function s_(e){const t=l({url:Ls()}).safeParse(e);if(!t.success)throw new Error("open-link needs a url");const{isError:o}=await X.openLink({url:t.data.url});if(o)throw new Error(`The host didn't open ${t.data.url}`)}async function i_(e,t,o){const n=async c=>{const u=await X.callServerTool({name:"editor_storage",arguments:{viewId:o.viewId,filePath:o.filePath,request:c}});if(u.isError){if(c.method==="storage-load"){const d=u.structuredContent?.kind==="replaced";Zl(d?jl(o):`pen.dev couldn't read ${Ko(o)}.`,d)}throw new Error(JSON.stringify(u.content))}return u.structuredContent},{content:s,path:a,data:r}=t??{};switch(e){case"storage-load":return n({method:e});case"storage-write":{const{saved:c}=await n({method:e,content:s??""});return c?Ao.Saved:Ao.WriteFailed}case"storage-read-asset":{const c=await n({method:e,path:a??""});return typeof c.data=="string"?Wl(c.data):void 0}case"storage-write-asset":await n({method:e,path:a??"",data:Bl(r??new Uint8Array)});return;case"storage-has-asset":return(await n({method:e,path:a??""})).exists;default:{const c=e;throw new Error(`Unsupported editor request: ${c}`)}}}async function ts(e){const t=await X.callServerTool({name:"editor_documents",arguments:{request:e}});if(t.isError)throw new Error(JSON.stringify(t.content));return t.structuredContent}async function Hl(){const{documents:e}=await ts({method:"documents-list"});return e.map(c_)}async function Fl(e){const{uris:t}=e,{previews:o}=await ts({method:"documents-previews",uris:t});return Object.fromEntries(Object.entries(o).map(([n,s])=>[n,Wl(s)]))}async function Jl(e){const{uris:t}=await ts({method:"documents-remove",uris:e.uris,removal:e.removal===vr.Delete?"delete":"recents"});return t}async function r_(e,t){switch(e){case"documents-list":return Hl();case"documents-previews":return Fl(t);case"documents-remove":return Jl(t);case"documents-open":{const{uri:o}=t,n=decodeURIComponent(new URL(o).pathname).split("/").pop();await gr(`Open ${n} in pen.dev.`,{type:"resource_link",uri:o,name:n??o});return}case"documents-new":await gr("Start a new design in pen.dev.");return;case"documents-save-preview":return;default:{const o=e;throw new Error(`Unsupported editor request: ${o}`)}}}async function gr(e,t){const o=[{type:"text",text:e}];t!=null&&o.push(t);const n={role:"user",content:o,_meta:{"openai/message":{target:"new"}}},{isError:s}=await X.sendMessage(n);if(s)throw new Error("Codex didn't start a conversation for it.")}async function a_(e,t,o){const n=ts,s=async r=>{Mn=o;try{await Sr(),await a(await r())}finally{Mn=void 0}},a=async r=>{KS(r),await n({method:"documents-release",viewId:o.viewId,filePath:o.filePath})};switch(e){case"documents-list":return Hl();case"documents-previews":return Fl(t);case"documents-open":{const{uri:r}=t;if(r===o.fileURI){await Sr(),$t(o);return}await s(()=>n({method:"documents-open",uri:r}));return}case"documents-new":await s(()=>n({method:"documents-new"}));return;case"documents-save-preview":{const{image:r}=t;await n({method:"documents-save-preview",uri:o.fileURI,data:Bl(r)});return}case"documents-remove":{const r=t,c=await Jl(r);return r.removal===vr.Delete&&c.includes(o.fileURI)&&await a(await n({method:"documents-new"})),c}default:{const r=e;throw new Error(`Unsupported editor request: ${r}`)}}}async function Sr(){if(!Ue)return;const e=Vl(await Ue("save",void 0).catch(()=>Ao.WriteFailed));if(e)throw new Error(`${e} The document stays open so its changes aren't lost.`)}function Vl(e){return e===Ao.Saved||e===Ao.NothingToSave?void 0:su(e)}function c_(e){const t=e.draft?Ei.Managed:Ei.File;return{uri:e.uri,kind:t,name:iu(e.fileName,t),folderName:e.folderName,preview:{kind:ou.None},timestamps:{createdAt:e.createdAt,lastEditedAt:e.lastEditedAt,lastOpenedAt:e.lastOpenedAt}}}function Bl(e){let t="";for(const o of e)t+=String.fromCharCode(o);return btoa(t)}function Wl(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function l_(e,{nodes:t}){t.length===0&&!Es||(Es=t.length>0,X.updateModelContext({content:t.map(o=>({type:"text",text:`pen.dev selected node id: ${o.id}${o.name?`, name: ${o.name}`:""}, type: ${o.type}, file: ${e.filePath}`,_meta:{"openai/title":o.name??o.id}}))}).catch(()=>{}))}</script> </head> <body> <div id="app"> @@ -260,6 +277,8 @@ /> <div id="spinner"></div> <p id="status-text">Opening the editor…</p> + <button id="take-over" type="button" hidden>Open here</button> + <button id="retry" type="button" hidden>Try again</button> </div> </div> </body>
Full technical diff · 33 changed fields
added /files/assets~1composer-icon.png
Field was absent
{
"sha256": "665acbc2f2aefd99fd9171ee307589e39a52f2a3ebf9366f3e93f7dfe01b34a4",
"size": 2155
}changed /files/bin~1editor.html/sha256
"a730f0c1df198931030fda13bdb9c60d574717a3abcf43a7fd9ac5cb98da4eef"
"c097a8007b79b8b4d425e2949d3880e1e84191cc06e3310e150ee3671693c245"
changed /files/bin~1editor.html/size
265165
268805
changed /files/bin~1pen-mcp-darwin-arm64/sha256
"be66dfd8f287951cf667db8da872a7e29f9a9a989189ea82b35bdee9e7590353"
"5c8c23f88ab5abd38857a892b74113ebfe712114807b9eebdae496143fae32e5"
changed /files/bin~1pen-mcp-darwin-arm64/size
4774656
5075248
changed /files/bin~1pen-mcp-darwin-x64/sha256
"d43e40930c6c517125afaed426814621a14666ff53343c514964bb71ed0fe726"
"747f025f1c118c69db550e8c42ac5fd9c494aa7c5b37deb7375e779d03e87e42"
changed /files/bin~1pen-mcp-darwin-x64/size
5099904
5489184
changed /files/bin~1pen-mcp-linux-arm64/sha256
"b9ad8617b9bcdd7a35db1c00488bea1d3defd584d1c58dc6b106a36791833b79"
"0f094f95119325a4c14cec9e766763ad6b1eb41aa65699c71d87089532f1268a"
changed /files/bin~1pen-mcp-linux-arm64/size
4718776
4980898
changed /files/bin~1pen-mcp-linux-x64/sha256
"06a2838433480995e765f0d894bbda07b4991be4a961091b6da4de8a3fe3e4a3"
"15eda46b75620f9d3b1e01d3a49d9553c3cf6a43cbb47c50c8381950df8460cd"
changed /files/bin~1pen-mcp-linux-x64/size
4911288
5296290
changed /files/bin~1pen-mcp-windows-arm64.exe/sha256
"9d219c663bc18f9214dffcc88491cc08bf67fc859860d6720fa5d8ce58aea04c"
"1b1c5853fb8972e6b1004f7199e37a095c8069bc6da9ada57bdd0c52e8ac072a"
changed /files/bin~1pen-mcp-windows-arm64.exe/size
4858552
5137080
changed /files/bin~1pen-mcp-windows-x64.exe/sha256
"ad672fdaa659d16a2fb4f3e6aa81cdc958ab8e99597b61bef7a7b18acf61e8c2"
"e8eb776bdad233a9520d20f12c66cedc2c191f179ee0e1857e17e0a1ac716cd7"
changed /files/bin~1pen-mcp-windows-x64.exe/size
5212856
5599416
changed /files/plugin.json/sha256
"48a43630f85f8c622e36cd310e1d684a415510c37003269716b113ef7c54139c"
"8e15e9c7b25f7d59eae5118c63e20edd7932f68a85efd3cc1efd0a7240c3a0f8"
changed /files/plugin.json/size
1816
1825
changed /files/skills~1pen-dev~1SKILL.md/sha256
"2339103d1e7b8f76d6f906f1489a34c252f321ba085eae733b6e1695a3fcb27f"
"0b28035dbe20ab2c3d6f2cd2a5cedfc734cb1c60092f1671fd0a3efa36691a9d"
changed /files/skills~1pen-dev~1SKILL.md/size
17895
20273
added /files/skills~1pen-dev~1code-website.md
Field was absent
{
"sha256": "55ec04e8ce6482c3784ecee7f73fae5fa3274dcf2fa6fac0a8d82a68e2a82411",
"size": 5126
}added /files/skills~1pen-dev~1competitive-research.md
Field was absent
{
"sha256": "dc2200529fd263834557277648f6ecf01e30a643ffdac3bddf8d93d8d3b9fc1d",
"size": 1151
}added /files/skills~1pen-dev~1guide~1add-stacked-animations.md
Field was absent
{
"sha256": "29b3ae97b336deeede7e19c0a5192a597e74a16a5d0de1b6febdcb0b896f6ae8",
"size": 2329
}added /files/skills~1pen-dev~1guide~1make-website-responsive.md
Field was absent
{
"sha256": "b98a2fd8687ee1187bdcbef1b0da7bf16a8c4ac3bde9ce63a961c5dca34e4783",
"size": 2438
}added /files/skills~1pen-dev~1guide~1whiteboard-example.md
Field was absent
{
"sha256": "27095714f6fc73f5e0e577ad3452efe2de65c3220f7769b75dd6ed9df8c23e62",
"size": 3545
}changed /files/skills~1pen-dev~1pen-schema.md/sha256
"af9add9d844aeeeb522a8c12db222a0367a80ba7453fea7518a539184383ba02"
"1ca56119a20d0fe58e33a50139aa83c4e9d470584d73f28cef840c626570f3a7"
changed /files/skills~1pen-dev~1pen-schema.md/size
13130
13191
added /files/skills~1pen-dev~1recruiting-profiles.md
Field was absent
{
"sha256": "2a41b4c8c5aad7714af89e47f22c608ae0091227e2e01ba433e846e67fb635f8",
"size": 1509
}changed /files/skills~1pen-dev~1scripts-and-shaders.md/sha256
"6e87c2ef2dc73f79a3fcec3b6756e081db3aaad077d17d03de4ff56ab9dbd8ed"
"d0f05efd32017780e8cad870d2a3803607011631b8a45264c6f63962c74e6072"
changed /files/skills~1pen-dev~1scripts-and-shaders.md/size
6369
6695
added /files/skills~1pen-dev~1sitemap.md
Field was absent
{
"sha256": "355f0b5c1c607b17d04136172af17556b94ebd7e95b22f4196b93589bfd8c779",
"size": 1761
}added /files/skills~1pen-dev~1travel-plan.md
Field was absent
{
"sha256": "bfc5b242ee021bafbf47fb051c775cc647d58aa926bd7934c8fbf7b340f03592",
"size": 2024
}changed /files/skills~1pen-dev~1whiteboard.md/sha256
"02bb45004a9a80f58eb2904b7b4e76a8e3d9c45d45618a40c647a1731933fd20"
"e55b143feed85f3d6a0b955800f58806f5661ad1df6eefceead9f484b5ec0b7c"
changed /files/skills~1pen-dev~1whiteboard.md/size
9305
3893
Full snapshot data
{
"files": {
"assets/composer-icon.png": {
"sha256": "665acbc2f2aefd99fd9171ee307589e39a52f2a3ebf9366f3e93f7dfe01b34a4",
"size": 2155
},
"assets/icon.png": {
"sha256": "5898e0189970c8995fc14978ad9b91483d787d2842a01369e29da928b49cc75a",
"size": 81002
},
"bin/editor.html": {
"sha256": "c097a8007b79b8b4d425e2949d3880e1e84191cc06e3310e150ee3671693c245",
"size": 268805
},
"bin/pen-mcp": {
"sha256": "2733674e3b40bf48c3a7fc92516f85e6ee2d527ae2696cbba08d4962d81349d6",
"size": 400
},
"bin/pen-mcp-darwin-arm64": {
"sha256": "5c8c23f88ab5abd38857a892b74113ebfe712114807b9eebdae496143fae32e5",
"size": 5075248
},
"bin/pen-mcp-darwin-x64": {
"sha256": "747f025f1c118c69db550e8c42ac5fd9c494aa7c5b37deb7375e779d03e87e42",
"size": 5489184
},
"bin/pen-mcp-linux-arm64": {
"sha256": "0f094f95119325a4c14cec9e766763ad6b1eb41aa65699c71d87089532f1268a",
"size": 4980898
},
"bin/pen-mcp-linux-x64": {
"sha256": "15eda46b75620f9d3b1e01d3a49d9553c3cf6a43cbb47c50c8381950df8460cd",
"size": 5296290
},
"bin/pen-mcp-windows-arm64.exe": {
"sha256": "1b1c5853fb8972e6b1004f7199e37a095c8069bc6da9ada57bdd0c52e8ac072a",
"size": 5137080
},
"bin/pen-mcp-windows-x64.exe": {
"sha256": "e8eb776bdad233a9520d20f12c66cedc2c191f179ee0e1857e17e0a1ac716cd7",
"size": 5599416
},
"bin/pen-mcp.cmd": {
"sha256": "8fe03213616ab875ac9d33b1423e84447761555eb7bf46ef0fe560315ace9961",
"size": 209
},
"mcp.json": {
"sha256": "75339f26bb02bba94409b9bfa0347e1a19bfed0f13270fc2c6a29c928c239bc1",
"size": 177
},
"plugin.json": {
"sha256": "8e15e9c7b25f7d59eae5118c63e20edd7932f68a85efd3cc1efd0a7240c3a0f8",
"size": 1825
},
"skills/pen-dev/SKILL.md": {
"sha256": "0b28035dbe20ab2c3d6f2cd2a5cedfc734cb1c60092f1671fd0a3efa36691a9d",
"size": 20273
},
"skills/pen-dev/code-website.md": {
"sha256": "55ec04e8ce6482c3784ecee7f73fae5fa3274dcf2fa6fac0a8d82a68e2a82411",
"size": 5126
},
"skills/pen-dev/competitive-research.md": {
"sha256": "dc2200529fd263834557277648f6ecf01e30a643ffdac3bddf8d93d8d3b9fc1d",
"size": 1151
},
"skills/pen-dev/execute.md": {
"sha256": "de953341486a02a35f9158caa36fe0a344d1a10438894c9e63fde9d765892f83",
"size": 21691
},
"skills/pen-dev/generate.md": {
"sha256": "b674d3bc282986a1f38c4564d25c5c14c6cf9824f44086fcb2664365bf78a4f1",
"size": 10836
},
"skills/pen-dev/guide/add-stacked-animations.md": {
"sha256": "29b3ae97b336deeede7e19c0a5192a597e74a16a5d0de1b6febdcb0b896f6ae8",
"size": 2329
},
"skills/pen-dev/guide/code.md": {
"sha256": "58946b786cf9aaba4ac823352b0fa1221e502ad52cd578d8cee242cb73284225",
"size": 8516
},
"skills/pen-dev/guide/components.md": {
"sha256": "4e4be79431a9d922e9871b8498137b2cb37d14bea27fc6e4cd88a9d2c69835ed",
"size": 5248
},
"skills/pen-dev/guide/design-system.md": {
"sha256": "a737fccd044dee99a1743d1cf06bb50415baf5138159575551b291bdd93703d3",
"size": 21435
},
"skills/pen-dev/guide/landing-page.md": {
"sha256": "ff2404f4c4f40b2c7cea70e234bd5d843fa9b8df9c7f7522c4784da8224c5968",
"size": 2240
},
"skills/pen-dev/guide/make-website-responsive.md": {
"sha256": "b98a2fd8687ee1187bdcbef1b0da7bf16a8c4ac3bde9ce63a961c5dca34e4783",
"size": 2438
},
"skills/pen-dev/guide/mobile-app.md": {
"sha256": "71388aebf621522893e17165b66d9b024a12a9f237e2b6e8bf42d3dd03e5d003",
"size": 2198
},
"skills/pen-dev/guide/slides.md": {
"sha256": "fee8c39633bad9c4056225deb7730706917265b3b0ee9bfe6f60329820ea4d3c",
"size": 4994
},
"skills/pen-dev/guide/table.md": {
"sha256": "db8165f70ebe335d793fd26c8608420fb514a61f8ca873535231f39571a76461",
"size": 1891
},
"skills/pen-dev/guide/tailwind.md": {
"sha256": "b426d429e27ab68ce32767146b67789cb465fbb079811d90889156a84e4422e5",
"size": 10328
},
"skills/pen-dev/guide/web-app.md": {
"sha256": "c749f3e22ebe5718823aa9cd03e61870fb6366ee5abe1d8c03ded9ab3d004d34",
"size": 4783
},
"skills/pen-dev/guide/whiteboard-example.md": {
"sha256": "27095714f6fc73f5e0e577ad3452efe2de65c3220f7769b75dd6ed9df8c23e62",
"size": 3545
},
"skills/pen-dev/pen-schema.md": {
"sha256": "1ca56119a20d0fe58e33a50139aa83c4e9d470584d73f28cef840c626570f3a7",
"size": 13191
},
"skills/pen-dev/recruiting-profiles.md": {
"sha256": "2a41b4c8c5aad7714af89e47f22c608ae0091227e2e01ba433e846e67fb635f8",
"size": 1509
},
"skills/pen-dev/scripts-and-shaders.md": {
"sha256": "d0f05efd32017780e8cad870d2a3803607011631b8a45264c6f63962c74e6072",
"size": 6695
},
"skills/pen-dev/sitemap.md": {
"sha256": "355f0b5c1c607b17d04136172af17556b94ebd7e95b22f4196b93589bfd8c779",
"size": 1761
},
"skills/pen-dev/travel-plan.md": {
"sha256": "bfc5b242ee021bafbf47fb051c775cc647d58aa926bd7934c8fbf7b340f03592",
"size": 2024
},
"skills/pen-dev/whiteboard.md": {
"sha256": "e55b143feed85f3d6a0b955800f58806f5661ad1df6eefceead9f484b5ec0b7c",
"size": 3893
}
}
}SHA-256 of public snapshot: f2271517835b80b094aed4d84c3b9786890341fe4b29c5c7d932b86039e5a806