@atoms-tech/atoms-mcp 0.99.0 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/apps/src/apps/browse/browse-app.html +37 -37
- package/dist/apps/src/apps/coverage/coverage-app.html +31 -31
- package/dist/apps/src/apps/editor/editor-app.html +34 -34
- package/dist/apps/src/apps/import/import-app.html +26 -26
- package/dist/apps/src/apps/mermaid/mermaid-app.html +242 -242
- package/dist/apps/src/apps/summary/summary-app.html +35 -35
- package/dist/apps/src/apps/trace/trace-app.html +37 -37
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/npm-shrinkwrap.json +5691 -0
- package/package.json +17 -11
|
@@ -4,38 +4,38 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>ATOMS Trace Graph</title>
|
|
7
|
-
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=o(r);fetch(r.href,s)}})();function d(e,t,o){function n(c,p){var h;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(h=c._zod).traits??(h.traits=new Set),c._zod.traits.add(e),t(c,p);for(const f in i.prototype)f in c||Object.defineProperty(c,f,{value:i.prototype[f].bind(c)});c._zod.constr=i,c._zod.def=p}const r=o?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function i(c){var p;const h=o?.Parent?new s:this;n(h,c),(p=h._zod).deferred??(p.deferred=[]);for(const f of h._zod.deferred)f();return h}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class ve extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const fo={};function te(e){return fo}function bn(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,r])=>t.indexOf(+n)===-1).map(([n,r])=>r)}function yn(e,t){return typeof t=="bigint"?t.toString():t}function pt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ht(e){return e==null}function mt(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function wn(e,t){const o=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=o>n?o:n,s=Number.parseInt(e.toFixed(r).replace(".","")),i=Number.parseInt(t.toFixed(r).replace(".",""));return s%i/10**r}function C(e,t,o){Object.defineProperty(e,t,{get(){{const n=o();return e[t]=n,n}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Be(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function me(e){return JSON.stringify(e)}const go=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const kn=pt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Le(e){if(je(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(je(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}const xn=new Set(["string","number","symbol"]);function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function g(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 Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Tn={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 zn(e,t){const o={},n=e._zod.def;for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(o[r]=n.shape[r])}return ie(e,{...e._zod.def,shape:o,checks:[]})}function $n(e,t){const o={...e._zod.def.shape},n=e._zod.def;for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete o[r]}return ie(e,{...e._zod.def,shape:o,checks:[]})}function In(e,t){if(!Le(t))throw new Error("Invalid input to extend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Be(this,"shape",n),n},checks:[]};return ie(e,o)}function Rn(e,t){return ie(e,{...e._zod.def,get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Be(this,"shape",o),o},catchall:t._zod.def.catchall,checks:[]})}function Pn(e,t,o){const n=t._zod.def.shape,r={...n};if(o)for(const s in o){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);o[s]&&(r[s]=e?new e({type:"optional",innerType:n[s]}):n[s])}else for(const s in n)r[s]=e?new e({type:"optional",innerType:n[s]}):n[s];return ie(t,{...t._zod.def,shape:r,checks:[]})}function En(e,t,o){const n=t._zod.def.shape,r={...n};if(o)for(const s in o){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);o[s]&&(r[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(const s in n)r[s]=new e({type:"nonoptional",innerType:n[s]});return ie(t,{...t._zod.def,shape:r,checks:[]})}function ge(e,t=0){for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function se(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function Ze(e){return typeof e=="string"?e:e?.message}function oe(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const r=Ze(e.inst?._zod.def?.error?.(e))??Ze(t?.error?.(e))??Ze(o.customError?.(e))??Ze(o.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ft(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _e(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const vo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,yn,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_o=d("$ZodError",vo),bo=d("$ZodError",vo,{Parent:Error});function Zn(e,t=o=>o.message){const o={},n=[];for(const r of e.issues)r.path.length>0?(o[r.path[0]]=o[r.path[0]]||[],o[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:o}}function Cn(e,t){const o=t||function(s){return s.message},n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>r({issues:c}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(o(i));else{let c=n,p=0;for(;p<i.path.length;){const h=i.path[p];p===i.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(o(i))):c[h]=c[h]||{_errors:[]},c=c[h],p++}}};return r(e),n}const Nn=e=>(t,o,n,r)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise)throw new ve;if(i.issues.length){const c=new(r?.Err??e)(i.issues.map(p=>oe(p,s,te())));throw go(c,r?.callee),c}return i.value},qn=e=>async(t,o,n,r)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const c=new(r?.Err??e)(i.issues.map(p=>oe(p,s,te())));throw go(c,r?.callee),c}return i.value},yo=e=>(t,o,n)=>{const r=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw new ve;return s.issues.length?{success:!1,error:new(e??_o)(s.issues.map(i=>oe(i,r,te())))}:{success:!0,data:s.value}},wo=yo(bo),ko=e=>async(t,o,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:o,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>oe(i,r,te())))}:{success:!0,data:s.value}},Mn=ko(bo),An=/^[cC][^\s-]{8,}$/,On=/^[0-9a-z]+$/,Dn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jn=/^[0-9a-vA-V]{20}$/,Ln=/^[A-Za-z0-9]{27}$/,Un=/^[a-zA-Z0-9_-]{21}$/,Hn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fn=/^([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})$/,Ft=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)$/,Bn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Wn(){return new RegExp(Vn,"u")}const Jn=/^(?:(?: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])$/,Gn=/^(([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})$/,Kn=/^((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])$/,Qn=/^(([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])$/,Yn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xo=/^[A-Za-z0-9_-]*$/,Xn=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,er=/^\+(?:[0-9]){6,14}[0-9]$/,So="(?:(?:\\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])))",tr=new RegExp(`^${So}$`);function To(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 or(e){return new RegExp(`^${To(e)}$`)}function nr(e){const t=To({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-]\\d{2}:\\d{2})");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${So}T(?:${n})$`)}const rr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},sr=/^\d+$/,ir=/^-?\d+(?:\.\d+)?/i,ar=/true|false/i,cr=/null/i,ur=/undefined/i,lr=/^[^A-Z]*$/,dr=/^[^a-z]*$/,V=d("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),zo={number:"number",bigint:"bigint",object:"date"},$o=d("$ZodCheckLessThan",(e,t)=>{V.init(e,t);const o=zo[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.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:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Io=d("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);const o=zo[typeof t.value];e._zod.onattach.push(n=>{const r=n._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.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:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pr=d("$ZodCheckMultipleOf",(e,t)=>{V.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):wn(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})}}),hr=d("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";const o=t.format?.includes("int"),n=o?"int":"number",[r,s]=Tn[t.format];e._zod.onattach.push(i=>{const c=i._zod.bag;c.format=t.format,c.minimum=r,c.maximum=s,o&&(c.pattern=sr)}),e._zod.check=i=>{const c=i.value;if(o){if(!Number.isInteger(c)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?i.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,continue:!t.abort}):i.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,continue:!t.abort});return}}c<r&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inst:e})}}),mr=d("$ZodCheckMaxLength",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!ht(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const i=ft(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fr=d("$ZodCheckMinLength",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!ht(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const i=ft(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gr=d("$ZodCheckLengthEquals",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const r=n.value;return!ht(r)&&r.length!==void 0}),e._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=ft(r),c=s>t.length;n.issues.push({origin:i,...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})}}),Ve=d("$ZodCheckStringFormat",(e,t)=>{var o,n;V.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),vr=d("$ZodCheckRegex",(e,t)=>{Ve.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})}}),_r=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=lr),Ve.init(e,t)}),br=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=dr),Ve.init(e,t)}),yr=d("$ZodCheckIncludes",(e,t)=>{V.init(e,t);const o=ke(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),wr=d("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);const o=new RegExp(`^${ke(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.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})}}),kr=d("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);const o=new RegExp(`.*${ke(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.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})}}),xr=d("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class Sr{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(`
|
|
8
|
-
`).filter(i=>i),
|
|
9
|
-
`))}}const
|
|
10
|
-
if (${
|
|
11
|
-
if (input[${
|
|
12
|
-
if (${
|
|
13
|
-
newResult[${
|
|
7
|
+
<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 r of s)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function o(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=o(s);fetch(s.href,r)}})();function d(e,t,o){function n(a,p){var h;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(h=a._zod).traits??(h.traits=new Set),a._zod.traits.add(e),t(a,p);for(const g in i.prototype)g in a||Object.defineProperty(a,g,{value:i.prototype[g].bind(a)});a._zod.constr=i,a._zod.def=p}const s=o?.Parent??Object;class r extends s{}Object.defineProperty(r,"name",{value:e});function i(a){var p;const h=o?.Parent?new r:this;n(h,a),(p=h._zod).deferred??(p.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>o?.Parent&&a instanceof o.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class _e extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const fo={};function oe(e){return fo}function _n(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 bn(e,t){return typeof t=="bigint"?t.toString():t}function pt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ht(e){return e==null}function mt(e){const t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function wn(e,t){const o=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=o>n?o:n,r=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return r%i/10**s}function N(e,t,o){Object.defineProperty(e,t,{get(){{const n=o();return e[t]=n,n}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Be(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function fe(e){return JSON.stringify(e)}const go=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yn=pt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function je(e){if(Le(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const o=t.prototype;return!(Le(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}const kn=new Set(["string","number","symbol"]);function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ae(e,t,o){const n=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(n._zod.parent=e),n}function f(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 xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Sn={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 Tn(e,t){const o={},n=e._zod.def;for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=n.shape[s])}return ae(e,{...e._zod.def,shape:o,checks:[]})}function zn(e,t){const o={...e._zod.def.shape},n=e._zod.def;for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return ae(e,{...e._zod.def,shape:o,checks:[]})}function In(e,t){if(!je(t))throw new Error("Invalid input to extend: expected a plain object");const o={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return Be(this,"shape",n),n},checks:[]};return ae(e,o)}function $n(e,t){return ae(e,{...e._zod.def,get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Be(this,"shape",o),o},catchall:t._zod.def.catchall,checks:[]})}function Rn(e,t,o){const n=t._zod.def.shape,s={...n};if(o)for(const r in o){if(!(r in n))throw new Error(`Unrecognized key: "${r}"`);o[r]&&(s[r]=e?new e({type:"optional",innerType:n[r]}):n[r])}else for(const r in n)s[r]=e?new e({type:"optional",innerType:n[r]}):n[r];return ae(t,{...t._zod.def,shape:s,checks:[]})}function Pn(e,t,o){const n=t._zod.def.shape,s={...n};if(o)for(const r in o){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);o[r]&&(s[r]=new e({type:"nonoptional",innerType:n[r]}))}else for(const r in n)s[r]=new e({type:"nonoptional",innerType:n[r]});return ae(t,{...t._zod.def,shape:s,checks:[]})}function ve(e,t=0){for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function ie(e,t){return t.map(o=>{var n;return(n=o).path??(n.path=[]),o.path.unshift(e),o})}function Ce(e){return typeof e=="string"?e:e?.message}function ne(e,t,o){const n={...e,path:e.path??[]};if(!e.message){const s=Ce(e.inst?._zod.def?.error?.(e))??Ce(t?.error?.(e))??Ce(o.customError?.(e))??Ce(o.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ft(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function be(...e){const[t,o,n]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:n}:{...t}}const vo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,bn,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_o=d("$ZodError",vo),bo=d("$ZodError",vo,{Parent:Error});function En(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 Zn(e,t){const o=t||function(r){return r.message},n={_errors:[]},s=r=>{for(const i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>s({issues:a}));else if(i.code==="invalid_key")s({issues:i.issues});else if(i.code==="invalid_element")s({issues:i.issues});else if(i.path.length===0)n._errors.push(o(i));else{let a=n,p=0;for(;p<i.path.length;){const h=i.path[p];p===i.path.length-1?(a[h]=a[h]||{_errors:[]},a[h]._errors.push(o(i))):a[h]=a[h]||{_errors:[]},a=a[h],p++}}};return s(e),n}const Cn=e=>(t,o,n,s)=>{const r=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise)throw new _e;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(p=>ne(p,r,oe())));throw go(a,s?.callee),a}return i.value},Nn=e=>async(t,o,n,s)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:o,issues:[]},r);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(p=>ne(p,r,oe())));throw go(a,s?.callee),a}return i.value},wo=e=>(t,o,n)=>{const s=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:o,issues:[]},s);if(r instanceof Promise)throw new _e;return r.issues.length?{success:!1,error:new(e??_o)(r.issues.map(i=>ne(i,s,oe())))}:{success:!0,data:r.value}},yo=wo(bo),ko=e=>async(t,o,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:o,issues:[]},s);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(i=>ne(i,s,oe())))}:{success:!0,data:r.value}},qn=ko(bo),Mn=/^[cC][^\s-]{8,}$/,An=/^[0-9a-z]+$/,On=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dn=/^[0-9a-vA-V]{20}$/,Ln=/^[A-Za-z0-9]{27}$/,jn=/^[a-zA-Z0-9_-]{21}$/,Un=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hn=/^([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})$/,Ft=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)$/,Fn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vn(){return new RegExp(Bn,"u")}const Wn=/^(?:(?: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])$/,Jn=/^(([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})$/,Gn=/^((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])$/,Kn=/^(([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])$/,Qn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xo=/^[A-Za-z0-9_-]*$/,Yn=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Xn=/^\+(?:[0-9]){6,14}[0-9]$/,So="(?:(?:\\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])))",es=new RegExp(`^${So}$`);function To(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 ts(e){return new RegExp(`^${To(e)}$`)}function os(e){const t=To({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-]\\d{2}:\\d{2})");const n=`${t}(?:${o.join("|")})`;return new RegExp(`^${So}T(?:${n})$`)}const ns=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ss=/^\d+$/,rs=/^-?\d+(?:\.\d+)?/i,is=/true|false/i,as=/null/i,cs=/undefined/i,us=/^[^A-Z]*$/,ls=/^[^a-z]*$/,V=d("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),zo={number:"number",bigint:"bigint",object:"date"},Io=d("$ZodCheckLessThan",(e,t)=>{V.init(e,t);const o=zo[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,r=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(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:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$o=d("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);const o=zo[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,r=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(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:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ds=d("$ZodCheckMultipleOf",(e,t)=>{V.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):wn(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})}}),ps=d("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";const o=t.format?.includes("int"),n=o?"int":"number",[s,r]=Sn[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=r,o&&(a.pattern=ss)}),e._zod.check=i=>{const a=i.value;if(o){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}}),hs=d("$ZodCheckMaxLength",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!ht(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 i=ft(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ms=d("$ZodCheckMinLength",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!ht(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 i=ft(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),fs=d("$ZodCheckLengthEquals",(e,t)=>{var o;V.init(e,t),(o=e._zod.def).when??(o.when=n=>{const s=n.value;return!ht(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,r=s.length;if(r===t.length)return;const i=ft(s),a=r>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ve=d("$ZodCheckStringFormat",(e,t)=>{var o,n;V.init(e,t),e._zod.onattach.push(s=>{const r=s._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.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=()=>{})}),gs=d("$ZodCheckRegex",(e,t)=>{Ve.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})}}),vs=d("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=us),Ve.init(e,t)}),_s=d("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ls),Ve.init(e,t)}),bs=d("$ZodCheckIncludes",(e,t)=>{V.init(e,t);const o=xe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=n,e._zod.onattach.push(s=>{const r=s._zod.bag;r.patterns??(r.patterns=new Set),r.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})}}),ws=d("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);const o=new RegExp(`^${xe(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})}}),ys=d("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);const o=new RegExp(`.*${xe(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})}}),ks=d("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});class xs{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(`
|
|
8
|
+
`).filter(i=>i),s=Math.min(...n.map(i=>i.length-i.trimStart().length)),r=n.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of r)this.content.push(i)}compile(){const t=Function,o=this?.args,s=[...(this?.content??[""]).map(r=>` ${r}`)];return new t(...o,s.join(`
|
|
9
|
+
`))}}const Ss={major:4,minor:0,patch:0},C=d("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ss;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const r of s._zod.onattach)r(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,i,a)=>{let p=ve(r),h;for(const g of i){if(g._zod.def.when){if(!g._zod.def.when(r))continue}else if(p)continue;const m=r.issues.length,v=g._zod.check(r);if(v instanceof Promise&&a?.async===!1)throw new _e;if(h||v instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await v,r.issues.length!==m&&(p||(p=ve(r,m)))});else{if(r.issues.length===m)continue;p||(p=ve(r,m))}}return h?h.then(()=>r):r};e._zod.run=(r,i)=>{const a=e._zod.parse(r,i);if(a instanceof Promise){if(i.async===!1)throw new _e;return a.then(p=>s(p,n,i))}return s(a,n,i)}}e["~standard"]={validate:s=>{try{const r=yo(e,s);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return qn(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),gt=d("$ZodString",(e,t)=>{C.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ns(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}}),q=d("$ZodStringFormat",(e,t)=>{Ve.init(e,t),gt.init(e,t)}),Ts=d("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Hn),q.init(e,t)}),zs=d("$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=Ft(n))}else t.pattern??(t.pattern=Ft());q.init(e,t)}),Is=d("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fn),q.init(e,t)}),$s=d("$ZodURL",(e,t)=>{q.init(e,t),e._zod.check=o=>{try{const n=o.value,s=new URL(n),r=s.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Yn.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})),!n.endsWith("/")&&r.endsWith("/")?o.value=r.slice(0,-1):o.value=r;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Rs=d("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vn()),q.init(e,t)}),Ps=d("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=jn),q.init(e,t)}),Es=d("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Mn),q.init(e,t)}),Zs=d("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=An),q.init(e,t)}),Cs=d("$ZodULID",(e,t)=>{t.pattern??(t.pattern=On),q.init(e,t)}),Ns=d("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Dn),q.init(e,t)}),qs=d("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ln),q.init(e,t)}),Ms=d("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=os(t)),q.init(e,t)}),As=d("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=es),q.init(e,t)}),Os=d("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ts(t)),q.init(e,t)}),Ds=d("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Un),q.init(e,t)}),Ls=d("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wn),q.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.format="ipv4"})}),js=d("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jn),q.init(e,t),e._zod.onattach.push(o=>{const n=o._zod.bag;n.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})}}}),Us=d("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gn),q.init(e,t)}),Hs=d("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Kn),q.init(e,t),e._zod.check=o=>{const[n,s]=o.value.split("/");try{if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${n}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function Ro(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Fs=d("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Qn),q.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{Ro(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Bs(e){if(!xo.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ro(o)}const Vs=d("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=xo),q.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{Bs(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),Ws=d("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Xn),q.init(e,t)});function Js(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 Gs=d("$ZodJWT",(e,t)=>{q.init(e,t),e._zod.check=o=>{Js(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),Po=d("$ZodNumber",(e,t)=>{C.init(e,t),e._zod.pattern=e._zod.bag.pattern??rs,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 r=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,...r?{received:r}:{}}),o}}),Ks=d("$ZodNumber",(e,t)=>{ps.init(e,t),Po.init(e,t)}),Qs=d("$ZodBoolean",(e,t)=>{C.init(e,t),e._zod.pattern=is,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}}),Ys=d("$ZodUndefined",(e,t)=>{C.init(e,t),e._zod.pattern=cs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",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}}),Xs=d("$ZodNull",(e,t)=>{C.init(e,t),e._zod.pattern=as,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}}),er=d("$ZodUnknown",(e,t)=>{C.init(e,t),e._zod.parse=o=>o}),tr=d("$ZodNever",(e,t)=>{C.init(e,t),e._zod.parse=(o,n)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)});function Bt(e,t,o){e.issues.length&&t.issues.push(...ie(o,e.issues)),t.value[o]=e.value}const or=d("$ZodArray",(e,t)=>{C.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 r=[];for(let i=0;i<s.length;i++){const a=s[i],p=t.element._zod.run({value:a,issues:[]},n);p instanceof Promise?r.push(p.then(h=>Bt(h,o,i))):Bt(p,o,i)}return r.length?Promise.all(r).then(()=>o):o}});function Ne(e,t,o){e.issues.length&&t.issues.push(...ie(o,e.issues)),t.value[o]=e.value}function Vt(e,t,o,n){e.issues.length?n[o]===void 0?o in n?t.value[o]=void 0:t.value[o]=e.value:t.issues.push(...ie(o,e.issues)):e.value===void 0?o in n&&(t.value[o]=void 0):t.value[o]=e.value}const nr=d("$ZodObject",(e,t)=>{C.init(e,t);const o=pt(()=>{const m=Object.keys(t.shape);for(const y of m)if(!(t.shape[y]instanceof C))throw new Error(`Invalid element at key "${y}": expected a Zod schema`);const v=xn(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(v)}});N(e._zod,"propValues",()=>{const m=t.shape,v={};for(const y in m){const b=m[y]._zod;if(b.values){v[y]??(v[y]=new Set);for(const z of b.values)v[y].add(z)}}return v});const n=m=>{const v=new xs(["shape","payload","ctx"]),y=o.value,b=w=>{const k=fe(w);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};v.write("const input = payload.value;");const z=Object.create(null);let S=0;for(const w of y.keys)z[w]=`key_${S++}`;v.write("const newResult = {}");for(const w of y.keys)if(y.optionalKeys.has(w)){const k=z[w];v.write(`const ${k} = ${b(w)};`);const P=fe(w);v.write(`
|
|
10
|
+
if (${k}.issues.length) {
|
|
11
|
+
if (input[${P}] === undefined) {
|
|
12
|
+
if (${P} in input) {
|
|
13
|
+
newResult[${P}] = undefined;
|
|
14
14
|
}
|
|
15
15
|
} else {
|
|
16
16
|
payload.issues = payload.issues.concat(
|
|
17
|
-
${
|
|
17
|
+
${k}.issues.map((iss) => ({
|
|
18
18
|
...iss,
|
|
19
|
-
path: iss.path ? [${
|
|
19
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}],
|
|
20
20
|
}))
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
} else if (${
|
|
24
|
-
if (${
|
|
23
|
+
} else if (${k}.value === undefined) {
|
|
24
|
+
if (${P} in input) newResult[${P}] = undefined;
|
|
25
25
|
} else {
|
|
26
|
-
newResult[${
|
|
26
|
+
newResult[${P}] = ${k}.value;
|
|
27
27
|
}
|
|
28
|
-
`)}else{const
|
|
29
|
-
if (${
|
|
28
|
+
`)}else{const k=z[w];v.write(`const ${k} = ${b(w)};`),v.write(`
|
|
29
|
+
if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
30
30
|
...iss,
|
|
31
|
-
path: iss.path ? [${
|
|
32
|
-
})));`),v.write(`newResult[${me(w)}] = ${y}.value`)}v.write("payload.value = newResult;"),v.write("return payload;");const D=v.compile();return(w,y)=>D(m,w,y)};let r;const s=je,i=!fo.jitless,p=i&&kn.value,h=t.catchall;let f;e._zod.parse=(m,v)=>{f??(f=o.value);const b=m.value;if(!s(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m;const P=[];if(i&&p&&v?.async===!1&&v.jitless!==!0)r||(r=n(t.shape)),m=r(m,v);else{m.value={};const y=f.shape;for(const z of f.keys){const F=y[z],Y=F._zod.run({value:b[z],issues:[]},v),he=F._zod.optin==="optional"&&F._zod.optout==="optional";Y instanceof Promise?P.push(Y.then(Ht=>he?Vt(Ht,m,z,b):Ce(Ht,m,z))):he?Vt(Y,m,z,b):Ce(Y,m,z)}}if(!h)return P.length?Promise.all(P).then(()=>m):m;const O=[],S=f.keySet,D=h._zod,w=D.def.type;for(const y of Object.keys(b)){if(S.has(y))continue;if(w==="never"){O.push(y);continue}const z=D.run({value:b[y],issues:[]},v);z instanceof Promise?P.push(z.then(F=>Ce(F,m,y))):Ce(z,m,y)}return O.length&&m.issues.push({code:"unrecognized_keys",keys:O,input:b,inst:e}),P.length?Promise.all(P).then(()=>m):m}});function Wt(e,t,o,n){for(const r of e)if(r.issues.length===0)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(r=>r.issues.map(s=>oe(s,n,te())))}),t}const Eo=d("$ZodUnion",(e,t)=>{Z.init(e,t),C(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),C(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),C(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),C(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>mt(n.source)).join("|")})$`)}}),e._zod.parse=(o,n)=>{let r=!1;const s=[];for(const i of t.options){const c=i._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),r=!0;else{if(c.issues.length===0)return c;s.push(c)}}return r?Promise.all(s).then(i=>Wt(i,o,e,n)):Wt(s,o,e,n)}}),ss=d("$ZodDiscriminatedUnion",(e,t)=>{Eo.init(e,t);const o=e._zod.parse;C(e._zod,"propValues",()=>{const r={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[c,p]of Object.entries(i)){r[c]||(r[c]=new Set);for(const h of p)r[c].add(h)}}return r});const n=pt(()=>{const r=t.options,s=new Map;for(const i of r){const c=i._zod.propValues[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const p of c){if(s.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);s.set(p,i)}}return s});e._zod.parse=(r,s)=>{const i=r.value;if(!je(i))return r.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),r;const c=n.value.get(i?.[t.discriminator]);return c?c._zod.run(r,s):t.unionFallback?o(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),r)}}),is=d("$ZodIntersection",(e,t)=>{Z.init(e,t),e._zod.parse=(o,n)=>{const r=o.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([p,h])=>Jt(o,p,h)):Jt(o,s,i)}});function nt(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(Le(e)&&Le(t)){const o=Object.keys(t),n=Object.keys(e).filter(s=>o.indexOf(s)!==-1),r={...e,...t};for(const s of n){const i=nt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};r[s]=i.data}return{valid:!0,data:r}}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 r=e[n],s=t[n],i=nt(r,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Jt(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),ge(e))return e;const n=nt(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const as=d("$ZodRecord",(e,t)=>{Z.init(e,t),e._zod.parse=(o,n)=>{const r=o.value;if(!Le(r))return o.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),o;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const p of i)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){const h=t.valueType._zod.run({value:r[p],issues:[]},n);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&o.issues.push(...se(p,f.issues)),o.value[p]=f.value})):(h.issues.length&&o.issues.push(...se(p,h.issues)),o.value[p]=h.value)}let c;for(const p in r)i.has(p)||(c=c??[],c.push(p));c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{o.value={};for(const i of Reflect.ownKeys(r)){if(i==="__proto__")continue;const c=t.keyType._zod.run({value:i,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){o.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map(h=>oe(h,n,te())),input:i,path:[i],inst:e}),o.value[c.value]=c.value;continue}const p=t.valueType._zod.run({value:r[i],issues:[]},n);p instanceof Promise?s.push(p.then(h=>{h.issues.length&&o.issues.push(...se(i,h.issues)),o.value[c.value]=h.value})):(p.issues.length&&o.issues.push(...se(i,p.issues)),o.value[c.value]=p.value)}}return s.length?Promise.all(s).then(()=>o):o}}),cs=d("$ZodEnum",(e,t)=>{Z.init(e,t);const o=bn(t.entries);e._zod.values=new Set(o),e._zod.pattern=new RegExp(`^(${o.filter(n=>xn.has(typeof n)).map(n=>typeof n=="string"?ke(n):n.toString()).join("|")})$`),e._zod.parse=(n,r)=>{const s=n.value;return e._zod.values.has(s)||n.issues.push({code:"invalid_value",values:o,input:s,inst:e}),n}}),us=d("$ZodLiteral",(e,t)=>{Z.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?ke(o):o?o.toString():String(o)).join("|")})$`),e._zod.parse=(o,n)=>{const r=o.value;return e._zod.values.has(r)||o.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),o}}),ls=d("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.parse=(o,n)=>{const r=t.transform(o.value,o);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(i=>(o.value=i,o));if(r instanceof Promise)throw new ve;return o.value=r,o}}),ds=d("$ZodOptional",(e,t)=>{Z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",C(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),C(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${mt(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(o,n):o.value===void 0?o:t.innerType._zod.run(o,n)}),ps=d("$ZodNullable",(e,t)=>{Z.init(e,t),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${mt(o.source)}|null)$`):void 0}),C(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)}),hs=d("$ZodDefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{if(o.value===void 0)return o.value=t.defaultValue,o;const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(s=>Gt(s,t)):Gt(r,t)}});function Gt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ms=d("$ZodPrefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),fs=d("$ZodNonOptional",(e,t)=>{Z.init(e,t),C(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 r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(s=>Kt(s,e)):Kt(r,e)}});function Kt(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 gs=d("$ZodCatch",(e,t)=>{Z.init(e,t),e._zod.optin="optional",C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(s=>(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(i=>oe(i,n,te()))},input:o.value}),o.issues=[]),o)):(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(s=>oe(s,n,te()))},input:o.value}),o.issues=[]),o)}}),vs=d("$ZodPipe",(e,t)=>{Z.init(e,t),C(e._zod,"values",()=>t.in._zod.values),C(e._zod,"optin",()=>t.in._zod.optin),C(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(o,n)=>{const r=t.in._zod.run(o,n);return r instanceof Promise?r.then(s=>Qt(s,t,n)):Qt(r,t,n)}});function Qt(e,t,o){return ge(e)?e:t.out._zod.run({value:e.value,issues:e.issues},o)}const _s=d("$ZodReadonly",(e,t)=>{Z.init(e,t),C(e._zod,"propValues",()=>t.innerType._zod.propValues),C(e._zod,"values",()=>t.innerType._zod.values),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{const r=t.innerType._zod.run(o,n);return r instanceof Promise?r.then(Yt):Yt(r)}});function Yt(e){return e.value=Object.freeze(e.value),e}const bs=d("$ZodCustom",(e,t)=>{V.init(e,t),Z.init(e,t),e._zod.parse=(o,n)=>o,e._zod.check=o=>{const n=o.value,r=t.fn(n);if(r instanceof Promise)return r.then(s=>Xt(s,o,n,e));Xt(r,o,n,e)}});function Xt(e,t,o,n){if(!e){const r={code:"custom",input:o,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(r.params=n._zod.def.params),t.issues.push(_e(r))}}class ys{constructor(){this._map=new Map,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,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)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function ws(){return new ys}const Ne=ws();function ks(e,t){return new e({type:"string",...g(t)})}function xs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function eo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Ss(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Ts(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function zs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function $s(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Is(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Rs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Ps(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Es(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Zs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function Cs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Ns(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function qs(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function Ms(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function As(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function Os(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Ds(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function js(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function Ls(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Us(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Hs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Fs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Bs(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Vs(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Ws(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Js(e,t){return new e({type:"number",checks:[],...g(t)})}function Gs(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Ks(e,t){return new e({type:"boolean",...g(t)})}function Qs(e,t){return new e({type:"undefined",...g(t)})}function Ys(e,t){return new e({type:"null",...g(t)})}function Xs(e){return new e({type:"unknown"})}function ei(e,t){return new e({type:"never",...g(t)})}function to(e,t){return new $o({check:"less_than",...g(t),value:e,inclusive:!1})}function Xe(e,t){return new $o({check:"less_than",...g(t),value:e,inclusive:!0})}function oo(e,t){return new Io({check:"greater_than",...g(t),value:e,inclusive:!1})}function et(e,t){return new Io({check:"greater_than",...g(t),value:e,inclusive:!0})}function no(e,t){return new pr({check:"multiple_of",...g(t),value:e})}function Zo(e,t){return new mr({check:"max_length",...g(t),maximum:e})}function Ue(e,t){return new fr({check:"min_length",...g(t),minimum:e})}function Co(e,t){return new gr({check:"length_equals",...g(t),length:e})}function ti(e,t){return new vr({check:"string_format",format:"regex",...g(t),pattern:e})}function oi(e){return new _r({check:"string_format",format:"lowercase",...g(e)})}function ni(e){return new br({check:"string_format",format:"uppercase",...g(e)})}function ri(e,t){return new yr({check:"string_format",format:"includes",...g(t),includes:e})}function si(e,t){return new wr({check:"string_format",format:"starts_with",...g(t),prefix:e})}function ii(e,t){return new kr({check:"string_format",format:"ends_with",...g(t),suffix:e})}function xe(e){return new xr({check:"overwrite",tx:e})}function ai(e){return xe(t=>t.normalize(e))}function ci(){return xe(e=>e.trim())}function ui(){return xe(e=>e.toLowerCase())}function li(){return xe(e=>e.toUpperCase())}function di(e,t,o){return new e({type:"array",element:t,...g(o)})}function pi(e,t,o){const n=g(o);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function hi(e,t,o){return new e({type:"custom",check:"custom",fn:t,...g(o)})}function vt(e){return!!e._zod}function No(e,t){return vt(e)?wo(e,t):e.safeParse(t)}function mi(e){if(!e)return;let t;if(vt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function fi(e){if(vt(e)){const s=e._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const o=e._def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}const n=e.value;if(n!==void 0)return n}const gi=d("ZodISODateTime",(e,t)=>{Ar.init(e,t),M.init(e,t)});function qo(e){return Fs(gi,e)}const vi=d("ZodISODate",(e,t)=>{Or.init(e,t),M.init(e,t)});function _i(e){return Bs(vi,e)}const bi=d("ZodISOTime",(e,t)=>{Dr.init(e,t),M.init(e,t)});function yi(e){return Vs(bi,e)}const wi=d("ZodISODuration",(e,t)=>{jr.init(e,t),M.init(e,t)});function ki(e){return Ws(wi,e)}const xi=(e,t)=>{_o.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Cn(e,o)},flatten:{value:o=>Zn(e,o)},addIssue:{value:o=>e.issues.push(o)},addIssues:{value:o=>e.issues.push(...o)},isEmpty:{get(){return e.issues.length===0}}})},We=d("ZodError",xi,{Parent:Error}),Si=Nn(We),Ti=qn(We),zi=yo(We),$i=ko(We),q=d("ZodType",(e,t)=>(Z.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone({...t,checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(o,n)=>ie(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>Si(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>zi(e,o,n),e.parseAsync=async(o,n)=>Ti(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>$i(e,o,n),e.spa=e.safeParseAsync,e.refine=(o,n)=>e.check(_a(o,n)),e.superRefine=o=>e.check(ba(o)),e.overwrite=o=>e.check(xe(o)),e.optional=()=>A(e),e.nullable=()=>io(e),e.nullish=()=>A(io(e)),e.nonoptional=o=>la(e,o),e.array=()=>_(e),e.or=o=>x([e,o]),e.and=o=>_t(e,o),e.transform=o=>it(e,Uo(o)),e.default=o=>aa(e,o),e.prefault=o=>ua(e,o),e.catch=o=>pa(e,o),e.pipe=o=>it(e,o),e.readonly=()=>fa(e),e.describe=o=>{const n=e.clone();return Ne.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return Ne.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return Ne.get(e);const n=e.clone();return Ne.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Mo=d("_ZodString",(e,t)=>{gt.init(e,t),q.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(ti(...n)),e.includes=(...n)=>e.check(ri(...n)),e.startsWith=(...n)=>e.check(si(...n)),e.endsWith=(...n)=>e.check(ii(...n)),e.min=(...n)=>e.check(Ue(...n)),e.max=(...n)=>e.check(Zo(...n)),e.length=(...n)=>e.check(Co(...n)),e.nonempty=(...n)=>e.check(Ue(1,...n)),e.lowercase=n=>e.check(oi(n)),e.uppercase=n=>e.check(ni(n)),e.trim=()=>e.check(ci()),e.normalize=(...n)=>e.check(ai(...n)),e.toLowerCase=()=>e.check(ui()),e.toUpperCase=()=>e.check(li())}),Ii=d("ZodString",(e,t)=>{gt.init(e,t),Mo.init(e,t),e.email=o=>e.check(xs(Ri,o)),e.url=o=>e.check(Is(Pi,o)),e.jwt=o=>e.check(Hs(Bi,o)),e.emoji=o=>e.check(Rs(Ei,o)),e.guid=o=>e.check(eo(ro,o)),e.uuid=o=>e.check(Ss(qe,o)),e.uuidv4=o=>e.check(Ts(qe,o)),e.uuidv6=o=>e.check(zs(qe,o)),e.uuidv7=o=>e.check($s(qe,o)),e.nanoid=o=>e.check(Ps(Zi,o)),e.guid=o=>e.check(eo(ro,o)),e.cuid=o=>e.check(Es(Ci,o)),e.cuid2=o=>e.check(Zs(Ni,o)),e.ulid=o=>e.check(Cs(qi,o)),e.base64=o=>e.check(js(Ui,o)),e.base64url=o=>e.check(Ls(Hi,o)),e.xid=o=>e.check(Ns(Mi,o)),e.ksuid=o=>e.check(qs(Ai,o)),e.ipv4=o=>e.check(Ms(Oi,o)),e.ipv6=o=>e.check(As(Di,o)),e.cidrv4=o=>e.check(Os(ji,o)),e.cidrv6=o=>e.check(Ds(Li,o)),e.e164=o=>e.check(Us(Fi,o)),e.datetime=o=>e.check(qo(o)),e.date=o=>e.check(_i(o)),e.time=o=>e.check(yi(o)),e.duration=o=>e.check(ki(o))});function u(e){return ks(Ii,e)}const M=d("ZodStringFormat",(e,t)=>{N.init(e,t),Mo.init(e,t)}),Ri=d("ZodEmail",(e,t)=>{Ir.init(e,t),M.init(e,t)}),ro=d("ZodGUID",(e,t)=>{zr.init(e,t),M.init(e,t)}),qe=d("ZodUUID",(e,t)=>{$r.init(e,t),M.init(e,t)}),Pi=d("ZodURL",(e,t)=>{Rr.init(e,t),M.init(e,t)}),Ei=d("ZodEmoji",(e,t)=>{Pr.init(e,t),M.init(e,t)}),Zi=d("ZodNanoID",(e,t)=>{Er.init(e,t),M.init(e,t)}),Ci=d("ZodCUID",(e,t)=>{Zr.init(e,t),M.init(e,t)}),Ni=d("ZodCUID2",(e,t)=>{Cr.init(e,t),M.init(e,t)}),qi=d("ZodULID",(e,t)=>{Nr.init(e,t),M.init(e,t)}),Mi=d("ZodXID",(e,t)=>{qr.init(e,t),M.init(e,t)}),Ai=d("ZodKSUID",(e,t)=>{Mr.init(e,t),M.init(e,t)}),Oi=d("ZodIPv4",(e,t)=>{Lr.init(e,t),M.init(e,t)}),Di=d("ZodIPv6",(e,t)=>{Ur.init(e,t),M.init(e,t)}),ji=d("ZodCIDRv4",(e,t)=>{Hr.init(e,t),M.init(e,t)}),Li=d("ZodCIDRv6",(e,t)=>{Fr.init(e,t),M.init(e,t)}),Ui=d("ZodBase64",(e,t)=>{Br.init(e,t),M.init(e,t)}),Hi=d("ZodBase64URL",(e,t)=>{Wr.init(e,t),M.init(e,t)}),Fi=d("ZodE164",(e,t)=>{Jr.init(e,t),M.init(e,t)}),Bi=d("ZodJWT",(e,t)=>{Kr.init(e,t),M.init(e,t)}),Ao=d("ZodNumber",(e,t)=>{Po.init(e,t),q.init(e,t),e.gt=(n,r)=>e.check(oo(n,r)),e.gte=(n,r)=>e.check(et(n,r)),e.min=(n,r)=>e.check(et(n,r)),e.lt=(n,r)=>e.check(to(n,r)),e.lte=(n,r)=>e.check(Xe(n,r)),e.max=(n,r)=>e.check(Xe(n,r)),e.int=n=>e.check(so(n)),e.safe=n=>e.check(so(n)),e.positive=n=>e.check(oo(0,n)),e.nonnegative=n=>e.check(et(0,n)),e.negative=n=>e.check(to(0,n)),e.nonpositive=n=>e.check(Xe(0,n)),e.multipleOf=(n,r)=>e.check(no(n,r)),e.step=(n,r)=>e.check(no(n,r)),e.finite=()=>e;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 k(e){return Js(Ao,e)}const Vi=d("ZodNumberFormat",(e,t)=>{Qr.init(e,t),Ao.init(e,t)});function so(e){return Gs(Vi,e)}const Wi=d("ZodBoolean",(e,t)=>{Yr.init(e,t),q.init(e,t)});function E(e){return Ks(Wi,e)}const Ji=d("ZodUndefined",(e,t)=>{Xr.init(e,t),q.init(e,t)});function rt(e){return Qs(Ji,e)}const Gi=d("ZodNull",(e,t)=>{es.init(e,t),q.init(e,t)});function Oo(e){return Ys(Gi,e)}const Ki=d("ZodUnknown",(e,t)=>{ts.init(e,t),q.init(e,t)});function R(){return Xs(Ki)}const Qi=d("ZodNever",(e,t)=>{os.init(e,t),q.init(e,t)});function Yi(e){return ei(Qi,e)}const Xi=d("ZodArray",(e,t)=>{ns.init(e,t),q.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Ue(o,n)),e.nonempty=o=>e.check(Ue(1,o)),e.max=(o,n)=>e.check(Zo(o,n)),e.length=(o,n)=>e.check(Co(o,n)),e.unwrap=()=>e.element});function _(e,t){return di(Xi,e,t)}const Do=d("ZodObject",(e,t)=>{rs.init(e,t),q.init(e,t),C(e,"shape",()=>t.shape),e.keyof=()=>W(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:R()}),e.loose=()=>e.clone({...e._zod.def,catchall:R()}),e.strict=()=>e.clone({...e._zod.def,catchall:Yi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>In(e,o),e.merge=o=>Rn(e,o),e.pick=o=>zn(e,o),e.omit=o=>$n(e,o),e.partial=(...o)=>Pn(Ho,e,o[0]),e.required=(...o)=>En(Fo,e,o[0])});function l(e,t){const o={type:"object",get shape(){return Be(this,"shape",{...e}),this.shape},...g(t)};return new Do(o)}function B(e,t){return new Do({type:"object",get shape(){return Be(this,"shape",{...e}),this.shape},catchall:R(),...g(t)})}const jo=d("ZodUnion",(e,t)=>{Eo.init(e,t),q.init(e,t),e.options=t.options});function x(e,t){return new jo({type:"union",options:e,...g(t)})}const ea=d("ZodDiscriminatedUnion",(e,t)=>{jo.init(e,t),ss.init(e,t)});function Lo(e,t,o){return new ea({type:"union",options:t,discriminator:e,...g(o)})}const ta=d("ZodIntersection",(e,t)=>{is.init(e,t),q.init(e,t)});function _t(e,t){return new ta({type:"intersection",left:e,right:t})}const oa=d("ZodRecord",(e,t)=>{as.init(e,t),q.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function I(e,t,o){return new oa({type:"record",keyType:e,valueType:t,...g(o)})}const st=d("ZodEnum",(e,t)=>{cs.init(e,t),q.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,r)=>{const s={};for(const i of n)if(o.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new st({...t,checks:[],...g(r),entries:s})},e.exclude=(n,r)=>{const s={...t.entries};for(const i of n)if(o.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new st({...t,checks:[],...g(r),entries:s})}});function W(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new st({type:"enum",entries:o,...g(t)})}const na=d("ZodLiteral",(e,t)=>{us.init(e,t),q.init(e,t),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 a(e,t){return new na({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}const ra=d("ZodTransform",(e,t)=>{ls.init(e,t),q.init(e,t),e._zod.parse=(o,n)=>{o.addIssue=s=>{if(typeof s=="string")o.issues.push(_e(s,o.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),o.issues.push(_e(i))}};const r=t.transform(o.value,o);return r instanceof Promise?r.then(s=>(o.value=s,o)):(o.value=r,o)}});function Uo(e){return new ra({type:"transform",transform:e})}const Ho=d("ZodOptional",(e,t)=>{ds.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function A(e){return new Ho({type:"optional",innerType:e})}const sa=d("ZodNullable",(e,t)=>{ps.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function io(e){return new sa({type:"nullable",innerType:e})}const ia=d("ZodDefault",(e,t)=>{hs.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function aa(e,t){return new ia({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ca=d("ZodPrefault",(e,t)=>{ms.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ua(e,t){return new ca({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Fo=d("ZodNonOptional",(e,t)=>{fs.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function la(e,t){return new Fo({type:"nonoptional",innerType:e,...g(t)})}const da=d("ZodCatch",(e,t)=>{gs.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pa(e,t){return new da({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ha=d("ZodPipe",(e,t)=>{vs.init(e,t),q.init(e,t),e.in=t.in,e.out=t.out});function it(e,t){return new ha({type:"pipe",in:e,out:t})}const ma=d("ZodReadonly",(e,t)=>{_s.init(e,t),q.init(e,t)});function fa(e){return new ma({type:"readonly",innerType:e})}const Bo=d("ZodCustom",(e,t)=>{bs.init(e,t),q.init(e,t)});function ga(e){const t=new V({check:"custom"});return t._zod.check=e,t}function va(e,t){return pi(Bo,e??(()=>!0),t)}function _a(e,t={}){return hi(Bo,e,t)}function ba(e){const t=ga(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(_e(n,o.value,t._zod.def));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=o.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),o.issues.push(_e(r))}},e(o.value,o)));return t}function Vo(e,t){return it(Uo(e),t)}const re="io.modelcontextprotocol/related-task",Je="2.0",j=va(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Wo=x([u(),k().int()]),Jo=u();B({ttl:x([k(),Oo()]).optional(),pollInterval:k().optional()});const ya=l({ttl:k().optional()}),wa=l({taskId:u()}),bt=B({progressToken:Wo.optional(),[re]:wa.optional()}),J=l({_meta:bt.optional()}),Se=J.extend({task:ya.optional()}),ka=e=>Se.safeParse(e).success,L=l({method:u(),params:J.loose().optional()}),G=l({_meta:bt.optional()}),K=l({method:u(),params:G.loose().optional()}),U=B({_meta:bt.optional()}),Te=x([u(),k().int()]),Go=l({jsonrpc:a(Je),id:Te,...L.shape}).strict(),ao=e=>Go.safeParse(e).success,Ko=l({jsonrpc:a(Je),...K.shape}).strict(),xa=e=>Ko.safeParse(e).success,yt=l({jsonrpc:a(Je),id:Te,result:U}).strict(),Me=e=>yt.safeParse(e).success;var $;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",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.UrlElicitationRequired=-32042]="UrlElicitationRequired"})($||($={}));const wt=l({jsonrpc:a(Je),id:Te.optional(),error:l({code:k().int(),message:u(),data:R().optional()})}).strict(),Sa=e=>wt.safeParse(e).success,Ta=x([Go,Ko,yt,wt]);x([yt,wt]);const kt=U.strict(),za=G.extend({requestId:Te.optional(),reason:u().optional()}),xt=K.extend({method:a("notifications/cancelled"),params:za}),$a=l({src:u(),mimeType:u().optional(),sizes:_(u()).optional(),theme:W(["light","dark"]).optional()}),ze=l({icons:_($a).optional()}),le=l({name:u(),title:u().optional()}),Ge=le.extend({...le.shape,...ze.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),Ia=_t(l({applyDefaults:E().optional()}),I(u(),R())),Ra=Vo(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,_t(l({form:Ia.optional(),url:j.optional()}),I(u(),R()).optional())),Pa=B({list:j.optional(),cancel:j.optional(),requests:B({sampling:B({createMessage:j.optional()}).optional(),elicitation:B({create:j.optional()}).optional()}).optional()}),Ea=B({list:j.optional(),cancel:j.optional(),requests:B({tools:B({call:j.optional()}).optional()}).optional()}),Za=l({experimental:I(u(),j).optional(),sampling:l({context:j.optional(),tools:j.optional()}).optional(),elicitation:Ra.optional(),roots:l({listChanged:E().optional()}).optional(),tasks:Pa.optional()}),Ca=J.extend({protocolVersion:u(),capabilities:Za,clientInfo:Ge}),Na=L.extend({method:a("initialize"),params:Ca}),qa=l({experimental:I(u(),j).optional(),logging:j.optional(),completions:j.optional(),prompts:l({listChanged:E().optional()}).optional(),resources:l({subscribe:E().optional(),listChanged:E().optional()}).optional(),tools:l({listChanged:E().optional()}).optional(),tasks:Ea.optional()}),Ma=U.extend({protocolVersion:u(),capabilities:qa,serverInfo:Ge,instructions:u().optional()}),Aa=K.extend({method:a("notifications/initialized"),params:G.optional()}),Ke=L.extend({method:a("ping"),params:J.optional()}),Oa=l({progress:k(),total:A(k()),message:A(u())}),Da=l({...G.shape,...Oa.shape,progressToken:Wo}),St=K.extend({method:a("notifications/progress"),params:Da}),ja=J.extend({cursor:Jo.optional()}),$e=L.extend({params:ja.optional()}),Ie=U.extend({nextCursor:Jo.optional()}),La=W(["working","input_required","completed","failed","cancelled"]),Re=l({taskId:u(),status:La,ttl:x([k(),Oo()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:A(k()),statusMessage:A(u())}),Tt=U.extend({task:Re}),Ua=G.merge(Re),He=K.extend({method:a("notifications/tasks/status"),params:Ua}),zt=L.extend({method:a("tasks/get"),params:J.extend({taskId:u()})}),$t=U.merge(Re),It=L.extend({method:a("tasks/result"),params:J.extend({taskId:u()})});U.loose();const Rt=$e.extend({method:a("tasks/list")}),Pt=Ie.extend({tasks:_(Re)}),Et=L.extend({method:a("tasks/cancel"),params:J.extend({taskId:u()})}),Ha=U.merge(Re),Qo=l({uri:u(),mimeType:A(u()),_meta:I(u(),R()).optional()}),Yo=Qo.extend({text:u()}),Zt=u().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Xo=Qo.extend({blob:Zt}),Pe=W(["user","assistant"]),pe=l({audience:_(Pe).optional(),priority:k().min(0).max(1).optional(),lastModified:qo({offset:!0}).optional()}),en=l({...le.shape,...ze.shape,uri:u(),description:A(u()),mimeType:A(u()),annotations:pe.optional(),_meta:A(B({}))}),Fa=l({...le.shape,...ze.shape,uriTemplate:u(),description:A(u()),mimeType:A(u()),annotations:pe.optional(),_meta:A(B({}))}),Ba=$e.extend({method:a("resources/list")}),tn=Ie.extend({resources:_(en)}),Va=$e.extend({method:a("resources/templates/list")}),Wa=Ie.extend({resourceTemplates:_(Fa)}),Ct=J.extend({uri:u()}),Ja=Ct,Ga=L.extend({method:a("resources/read"),params:Ja}),on=U.extend({contents:_(x([Yo,Xo]))}),Ka=K.extend({method:a("notifications/resources/list_changed"),params:G.optional()}),Qa=Ct,Ya=L.extend({method:a("resources/subscribe"),params:Qa}),Xa=Ct,ec=L.extend({method:a("resources/unsubscribe"),params:Xa}),tc=G.extend({uri:u()}),oc=K.extend({method:a("notifications/resources/updated"),params:tc}),nc=l({name:u(),description:A(u()),required:A(E())}),rc=l({...le.shape,...ze.shape,description:A(u()),arguments:A(_(nc)),_meta:A(B({}))}),sc=$e.extend({method:a("prompts/list")}),ic=Ie.extend({prompts:_(rc)}),ac=J.extend({name:u(),arguments:I(u(),u()).optional()}),cc=L.extend({method:a("prompts/get"),params:ac}),Nt=l({type:a("text"),text:u(),annotations:pe.optional(),_meta:I(u(),R()).optional()}),qt=l({type:a("image"),data:Zt,mimeType:u(),annotations:pe.optional(),_meta:I(u(),R()).optional()}),Mt=l({type:a("audio"),data:Zt,mimeType:u(),annotations:pe.optional(),_meta:I(u(),R()).optional()}),uc=l({type:a("tool_use"),name:u(),id:u(),input:I(u(),R()),_meta:I(u(),R()).optional()}),nn=l({type:a("resource"),resource:x([Yo,Xo]),annotations:pe.optional(),_meta:I(u(),R()).optional()}),rn=en.extend({type:a("resource_link")}),Ee=x([Nt,qt,Mt,rn,nn]),lc=l({role:Pe,content:Ee}),dc=U.extend({description:u().optional(),messages:_(lc)}),pc=K.extend({method:a("notifications/prompts/list_changed"),params:G.optional()}),hc=l({title:u().optional(),readOnlyHint:E().optional(),destructiveHint:E().optional(),idempotentHint:E().optional(),openWorldHint:E().optional()}),mc=l({taskSupport:W(["required","optional","forbidden"]).optional()}),At=l({...le.shape,...ze.shape,description:u().optional(),inputSchema:l({type:a("object"),properties:I(u(),j).optional(),required:_(u()).optional()}).catchall(R()),outputSchema:l({type:a("object"),properties:I(u(),j).optional(),required:_(u()).optional()}).catchall(R()).optional(),annotations:hc.optional(),execution:mc.optional(),_meta:I(u(),R()).optional()}),sn=$e.extend({method:a("tools/list")}),fc=Ie.extend({tools:_(At)}),Qe=U.extend({content:_(Ee).default([]),structuredContent:I(u(),R()).optional(),isError:E().optional()});Qe.or(U.extend({toolResult:R()}));const gc=Se.extend({name:u(),arguments:I(u(),R()).optional()}),an=L.extend({method:a("tools/call"),params:gc}),vc=K.extend({method:a("notifications/tools/list_changed"),params:G.optional()});l({autoRefresh:E().default(!0),debounceMs:k().int().nonnegative().default(300)});const cn=W(["debug","info","notice","warning","error","critical","alert","emergency"]),_c=J.extend({level:cn}),bc=L.extend({method:a("logging/setLevel"),params:_c}),yc=G.extend({level:cn,logger:u().optional(),data:R()}),wc=K.extend({method:a("notifications/message"),params:yc}),kc=l({name:u().optional()}),xc=l({hints:_(kc).optional(),costPriority:k().min(0).max(1).optional(),speedPriority:k().min(0).max(1).optional(),intelligencePriority:k().min(0).max(1).optional()}),Sc=l({mode:W(["auto","required","none"]).optional()}),Tc=l({type:a("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:_(Ee).default([]),structuredContent:l({}).loose().optional(),isError:E().optional(),_meta:I(u(),R()).optional()}),zc=Lo("type",[Nt,qt,Mt]),Fe=Lo("type",[Nt,qt,Mt,uc,Tc]),$c=l({role:Pe,content:x([Fe,_(Fe)]),_meta:I(u(),R()).optional()}),Ic=Se.extend({messages:_($c),modelPreferences:xc.optional(),systemPrompt:u().optional(),includeContext:W(["none","thisServer","allServers"]).optional(),temperature:k().optional(),maxTokens:k().int(),stopSequences:_(u()).optional(),metadata:j.optional(),tools:_(At).optional(),toolChoice:Sc.optional()}),Rc=L.extend({method:a("sampling/createMessage"),params:Ic}),Pc=U.extend({model:u(),stopReason:A(W(["endTurn","stopSequence","maxTokens"]).or(u())),role:Pe,content:zc}),Ec=U.extend({model:u(),stopReason:A(W(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:Pe,content:x([Fe,_(Fe)])}),Zc=l({type:a("boolean"),title:u().optional(),description:u().optional(),default:E().optional()}),Cc=l({type:a("string"),title:u().optional(),description:u().optional(),minLength:k().optional(),maxLength:k().optional(),format:W(["email","uri","date","date-time"]).optional(),default:u().optional()}),Nc=l({type:W(["number","integer"]),title:u().optional(),description:u().optional(),minimum:k().optional(),maximum:k().optional(),default:k().optional()}),qc=l({type:a("string"),title:u().optional(),description:u().optional(),enum:_(u()),default:u().optional()}),Mc=l({type:a("string"),title:u().optional(),description:u().optional(),oneOf:_(l({const:u(),title:u()})),default:u().optional()}),Ac=l({type:a("string"),title:u().optional(),description:u().optional(),enum:_(u()),enumNames:_(u()).optional(),default:u().optional()}),Oc=x([qc,Mc]),Dc=l({type:a("array"),title:u().optional(),description:u().optional(),minItems:k().optional(),maxItems:k().optional(),items:l({type:a("string"),enum:_(u())}),default:_(u()).optional()}),jc=l({type:a("array"),title:u().optional(),description:u().optional(),minItems:k().optional(),maxItems:k().optional(),items:l({anyOf:_(l({const:u(),title:u()}))}),default:_(u()).optional()}),Lc=x([Dc,jc]),Uc=x([Ac,Oc,Lc]),Hc=x([Uc,Zc,Cc,Nc]),Fc=Se.extend({mode:a("form").optional(),message:u(),requestedSchema:l({type:a("object"),properties:I(u(),Hc),required:_(u()).optional()})}),Bc=Se.extend({mode:a("url"),message:u(),elicitationId:u(),url:u().url()}),Vc=x([Fc,Bc]),Wc=L.extend({method:a("elicitation/create"),params:Vc}),Jc=G.extend({elicitationId:u()}),Gc=K.extend({method:a("notifications/elicitation/complete"),params:Jc}),Kc=U.extend({action:W(["accept","decline","cancel"]),content:Vo(e=>e===null?void 0:e,I(u(),x([u(),k(),E(),_(u())])).optional())}),Qc=l({type:a("ref/resource"),uri:u()}),Yc=l({type:a("ref/prompt"),name:u()}),Xc=J.extend({ref:x([Yc,Qc]),argument:l({name:u(),value:u()}),context:l({arguments:I(u(),u()).optional()}).optional()}),eu=L.extend({method:a("completion/complete"),params:Xc}),tu=U.extend({completion:B({values:_(u()).max(100),total:A(k().int()),hasMore:A(E())})}),ou=l({uri:u().startsWith("file://"),name:u().optional(),_meta:I(u(),R()).optional()}),nu=L.extend({method:a("roots/list"),params:J.optional()}),ru=U.extend({roots:_(ou)}),su=K.extend({method:a("notifications/roots/list_changed"),params:G.optional()});x([Ke,Na,eu,bc,cc,sc,Ba,Va,Ga,Ya,ec,an,sn,zt,It,Rt,Et]);x([xt,St,Aa,su,He]);x([kt,Pc,Ec,Kc,ru,$t,Pt,Tt]);x([Ke,Rc,Wc,nu,zt,It,Rt,Et]);x([xt,St,wc,oc,Ka,vc,pc,He,Gc]);x([kt,Ma,tu,dc,ic,tn,Wa,on,Qe,fc,$t,Pt,Tt]);class T extends Error{constructor(t,o,n){super(`MCP error ${t}: ${o}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,o,n){if(t===$.UrlElicitationRequired&&n){const r=n;if(r.elicitations)return new iu(r.elicitations,o)}return new T(t,o,n)}}class iu extends T{constructor(t,o=`URL elicitation${t.length>1?"s":""} required`){super($.UrlElicitationRequired,o,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function ne(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function co(e){const o=mi(e)?.method;if(!o)throw new Error("Schema is missing a method literal");const n=fi(o);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function uo(e,t){const o=No(e,t);if(!o.success)throw o.error;return o.data}const au=6e4;class cu{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(xt,o=>{this._oncancel(o)}),this.setNotificationHandler(St,o=>{this._onprogress(o)}),this.setRequestHandler(Ke,o=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zt,async(o,n)=>{const r=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!r)throw new T($.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(It,async(o,n)=>{const r=async()=>{const s=o.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(c.type==="response"||c.type==="error"){const p=c.message,h=p.id,f=this._requestResolvers.get(h);if(f)if(this._requestResolvers.delete(h),c.type==="response")f(p);else{const m=p,v=new T(m.error.code,m.error.message,m.error.data);f(v)}else{const m=c.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${h}`))}continue}await this._transport?.send(c.message,{relatedRequestId:n.requestId})}}const i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new T($.InvalidParams,`Task not found: ${s}`);if(!ne(i.status))return await this._waitForTaskUpdate(s,n.signal),await r();if(ne(i.status)){const c=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...c,_meta:{...c._meta,[re]:{taskId:s}}}}return await r()};return await r()}),this.setRequestHandler(Rt,async(o,n)=>{try{const{tasks:r,nextCursor:s}=await this._taskStore.listTasks(o.params?.cursor,n.sessionId);return{tasks:r,nextCursor:s,_meta:{}}}catch(r){throw new T($.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(Et,async(o,n)=>{try{const r=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!r)throw new T($.InvalidParams,`Task not found: ${o.params.taskId}`);if(ne(r.status))throw new T($.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(o.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(o.params.taskId);const s=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!s)throw new T($.InvalidParams,`Task not found after cancellation: ${o.params.taskId}`);return{_meta:{},...s}}catch(r){throw r instanceof T?r:new T($.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,o,n,r,s=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,o),startTime:Date.now(),timeout:o,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:r})}_resetTimeout(t){const o=this._timeoutInfo.get(t);if(!o)return!1;const n=Date.now()-o.startTime;if(o.maxTotalTimeout&&n>=o.maxTotalTimeout)throw this._timeoutInfo.delete(t),T.fromError($.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:o.maxTotalTimeout,totalElapsed:n});return clearTimeout(o.timeoutId),o.timeoutId=setTimeout(o.onTimeout,o.timeout),!0}_cleanupTimeout(t){const o=this._timeoutInfo.get(t);o&&(clearTimeout(o.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const o=this.transport?.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};const n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};const r=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{r?.(s,i),Me(s)||Sa(s)?this._onresponse(s):ao(s)?this._onrequest(s,i):xa(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();const o=T.fromError($.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const n of t.values())n(o)}_onerror(t){this.onerror?.(t)}_onnotification(t){const o=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;o!==void 0&&Promise.resolve().then(()=>o(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,o){const n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,s=t.params?._meta?.[re]?.taskId;if(n===void 0){const f={jsonrpc:"2.0",id:t.id,error:{code:$.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},r?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):r?.send(f).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(t.id,i);const c=ka(t.params)?t.params.task:void 0,p=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,h={signal:i.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async f=>{if(i.signal.aborted)return;const m={relatedRequestId:t.id};s&&(m.relatedTask={taskId:s}),await this.notification(f,m)},sendRequest:async(f,m,v)=>{if(i.signal.aborted)throw new T($.ConnectionClosed,"Request was cancelled");const b={...v,relatedRequestId:t.id};s&&!b.relatedTask&&(b.relatedTask={taskId:s});const P=b.relatedTask?.taskId??s;return P&&p&&await p.updateTaskStatus(P,"input_required"),await this.request(f,m,b)},authInfo:o?.authInfo,requestId:t.id,requestInfo:o?.requestInfo,taskId:s,taskStore:p,taskRequestedTtl:c?.ttl,closeSSEStream:o?.closeSSEStream,closeStandaloneSSEStream:o?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,h)).then(async f=>{if(i.signal.aborted)return;const m={result:f,jsonrpc:"2.0",id:t.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:m,timestamp:Date.now()},r?.sessionId):await r?.send(m)},async f=>{if(i.signal.aborted)return;const m={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(f.code)?f.code:$.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:m,timestamp:Date.now()},r?.sessionId):await r?.send(m)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:o,...n}=t.params,r=Number(o),s=this._progressHandlers.get(r);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const i=this._responseHandlers.get(r),c=this._timeoutInfo.get(r);if(c&&i&&c.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(p){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),i(p);return}s(n)}_onresponse(t){const o=Number(t.id),n=this._requestResolvers.get(o);if(n){if(this._requestResolvers.delete(o),Me(t))n(t);else{const i=new T(t.error.code,t.error.message,t.error.data);n(i)}return}const r=this._responseHandlers.get(o);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(o),this._cleanupTimeout(o);let s=!1;if(Me(t)&&t.result&&typeof t.result=="object"){const i=t.result;if(i.task&&typeof i.task=="object"){const c=i.task;typeof c.taskId=="string"&&(s=!0,this._taskProgressTokens.set(c.taskId,o))}}if(s||this._progressHandlers.delete(o),Me(t))r(t);else{const i=T.fromError(t.error.code,t.error.message,t.error.data);r(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,o,n){const{task:r}=n??{};if(!r){try{yield{type:"result",result:await this.request(t,o,n)}}catch(i){yield{type:"error",error:i instanceof T?i:new T($.InternalError,String(i))}}return}let s;try{const i=await this.request(t,Tt,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new T($.InternalError,"Task creation did not return a task");for(;;){const c=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:c},ne(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},o,n)}:c.status==="failed"?yield{type:"error",error:new T($.InternalError,`Task ${s} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new T($.InternalError,`Task ${s} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},o,n)};return}const p=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(h=>setTimeout(h,p)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof T?i:new T($.InternalError,String(i))}}}request(t,o,n){const{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i,task:c,relatedTask:p}=n??{};return new Promise((h,f)=>{const m=w=>{f(w)};if(!this._transport){m(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),c&&this.assertTaskCapability(t.method)}catch(w){m(w);return}n?.signal?.throwIfAborted();const v=this._requestMessageId++,b={...t,jsonrpc:"2.0",id:v};n?.onprogress&&(this._progressHandlers.set(v,n.onprogress),b.params={...t.params,_meta:{...t.params?._meta||{},progressToken:v}}),c&&(b.params={...b.params,task:c}),p&&(b.params={...b.params,_meta:{...b.params?._meta||{},[re]:p}});const P=w=>{this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(w)}},{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(z=>this._onerror(new Error(`Failed to send cancellation: ${z}`)));const y=w instanceof T?w:new T($.RequestTimeout,String(w));f(y)};this._responseHandlers.set(v,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return f(w);try{const y=No(o,w.result);y.success?h(y.data):f(y.error)}catch(y){f(y)}}}),n?.signal?.addEventListener("abort",()=>{P(n?.signal?.reason)});const O=n?.timeout??au,S=()=>P(T.fromError($.RequestTimeout,"Request timed out",{timeout:O}));this._setupTimeout(v,O,n?.maxTotalTimeout,S,n?.resetTimeoutOnProgress??!1);const D=p?.taskId;if(D){const w=y=>{const z=this._responseHandlers.get(v);z?z(y):this._onerror(new Error(`Response handler missing for side-channeled request ${v}`))};this._requestResolvers.set(v,w),this._enqueueTaskMessage(D,{type:"request",message:b,timestamp:Date.now()}).catch(y=>{this._cleanupTimeout(v),f(y)})}else this._transport.send(b,{relatedRequestId:r,resumptionToken:s,onresumptiontoken:i}).catch(w=>{this._cleanupTimeout(v),f(w)})})}async getTask(t,o){return this.request({method:"tasks/get",params:t},$t,o)}async getTaskResult(t,o,n){return this.request({method:"tasks/result",params:t},o,n)}async listTasks(t,o){return this.request({method:"tasks/list",params:t},Pt,o)}async cancelTask(t,o){return this.request({method:"tasks/cancel",params:t},Ha,o)}async notification(t,o){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const n=o?.relatedTask?.taskId;if(n){const c={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[re]:o.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!o?.relatedRequestId&&!o?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let c={...t,jsonrpc:"2.0"};o?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[re]:o.relatedTask}}}),this._transport?.send(c,o).catch(p=>this._onerror(p))});return}let i={...t,jsonrpc:"2.0"};o?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[re]:o.relatedTask}}}),await this._transport.send(i,o)}setRequestHandler(t,o){const n=co(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(r,s)=>{const i=uo(t,r);return Promise.resolve(o(i,s))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,o){const n=co(t);this._notificationHandlers.set(n,r=>{const s=uo(t,r);return Promise.resolve(o(s))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const o=this._taskProgressTokens.get(t);o!==void 0&&(this._progressHandlers.delete(o),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,o,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,o,n,r)}async _clearTaskQueue(t,o){if(this._taskMessageQueue){const n=await this._taskMessageQueue.dequeueAll(t,o);for(const r of n)if(r.type==="request"&&ao(r.message)){const s=r.message.id,i=this._requestResolvers.get(s);i?(i(new T($.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,o){let n=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(t);r?.pollInterval&&(n=r.pollInterval)}catch{}return new Promise((r,s)=>{if(o.aborted){s(new T($.InvalidRequest,"Request cancelled"));return}const i=setTimeout(r,n);o.addEventListener("abort",()=>{clearTimeout(i),s(new T($.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,o){const n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await n.createTask(r,t.id,{method:t.method,params:t.params},o)},getTask:async r=>{const s=await n.getTask(r,o);if(!s)throw new T($.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(r,s,i)=>{await n.storeTaskResult(r,s,i,o);const c=await n.getTask(r,o);if(c){const p=He.parse({method:"notifications/tasks/status",params:c});await this.notification(p),ne(c.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>n.getTaskResult(r,o),updateTaskStatus:async(r,s,i)=>{const c=await n.getTask(r,o);if(!c)throw new T($.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(ne(c.status))throw new T($.InvalidParams,`Cannot update task "${r}" from terminal status "${c.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(r,s,i,o);const p=await n.getTask(r,o);if(p){const h=He.parse({method:"notifications/tasks/status",params:p});await this.notification(h),ne(p.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>n.listTasks(r,o)}}}var uu="2026-01-26",lu="ui/notifications/tool-input-partial";class un{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 r=Ta.safeParse(n.data);r.success?(console.debug("Parsed message",r.data),this.onmessage?.(r.data)):n.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,n):(console.error("Failed to parse message",r.error.message,n),this.onerror?.(Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,o){t.method!==lu&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var du=x([a("light"),a("dark")]).describe("Color theme preference for the host environment."),be=x([a("inline"),a("fullscreen"),a("pip")]).describe("Display mode for UI presentation."),pu=x([a("--color-background-primary"),a("--color-background-secondary"),a("--color-background-tertiary"),a("--color-background-inverse"),a("--color-background-ghost"),a("--color-background-info"),a("--color-background-danger"),a("--color-background-success"),a("--color-background-warning"),a("--color-background-disabled"),a("--color-text-primary"),a("--color-text-secondary"),a("--color-text-tertiary"),a("--color-text-inverse"),a("--color-text-ghost"),a("--color-text-info"),a("--color-text-danger"),a("--color-text-success"),a("--color-text-warning"),a("--color-text-disabled"),a("--color-border-primary"),a("--color-border-secondary"),a("--color-border-tertiary"),a("--color-border-inverse"),a("--color-border-ghost"),a("--color-border-info"),a("--color-border-danger"),a("--color-border-success"),a("--color-border-warning"),a("--color-border-disabled"),a("--color-ring-primary"),a("--color-ring-secondary"),a("--color-ring-inverse"),a("--color-ring-info"),a("--color-ring-danger"),a("--color-ring-success"),a("--color-ring-warning"),a("--font-sans"),a("--font-mono"),a("--font-weight-normal"),a("--font-weight-medium"),a("--font-weight-semibold"),a("--font-weight-bold"),a("--font-text-xs-size"),a("--font-text-sm-size"),a("--font-text-md-size"),a("--font-text-lg-size"),a("--font-heading-xs-size"),a("--font-heading-sm-size"),a("--font-heading-md-size"),a("--font-heading-lg-size"),a("--font-heading-xl-size"),a("--font-heading-2xl-size"),a("--font-heading-3xl-size"),a("--font-text-xs-line-height"),a("--font-text-sm-line-height"),a("--font-text-md-line-height"),a("--font-text-lg-line-height"),a("--font-heading-xs-line-height"),a("--font-heading-sm-line-height"),a("--font-heading-md-line-height"),a("--font-heading-lg-line-height"),a("--font-heading-xl-line-height"),a("--font-heading-2xl-line-height"),a("--font-heading-3xl-line-height"),a("--border-radius-xs"),a("--border-radius-sm"),a("--border-radius-md"),a("--border-radius-lg"),a("--border-radius-xl"),a("--border-radius-full"),a("--border-width-regular"),a("--shadow-hairline"),a("--shadow-sm"),a("--shadow-md"),a("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),hu=I(pu.describe(`Style variables for theming MCP apps.
|
|
31
|
+
path: iss.path ? [${fe(w)}, ...iss.path] : [${fe(w)}]
|
|
32
|
+
})));`),v.write(`newResult[${fe(w)}] = ${k}.value`)}v.write("payload.value = newResult;"),v.write("return payload;");const D=v.compile();return(w,k)=>D(m,w,k)};let s;const r=Le,i=!fo.jitless,p=i&&yn.value,h=t.catchall;let g;e._zod.parse=(m,v)=>{g??(g=o.value);const y=m.value;if(!r(y))return m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m;const b=[];if(i&&p&&v?.async===!1&&v.jitless!==!0)s||(s=n(t.shape)),m=s(m,v);else{m.value={};const k=g.shape;for(const P of g.keys){const F=k[P],Y=F._zod.run({value:y[P],issues:[]},v),me=F._zod.optin==="optional"&&F._zod.optout==="optional";Y instanceof Promise?b.push(Y.then(Ht=>me?Vt(Ht,m,P,y):Ne(Ht,m,P))):me?Vt(Y,m,P,y):Ne(Y,m,P)}}if(!h)return b.length?Promise.all(b).then(()=>m):m;const z=[],S=g.keySet,D=h._zod,w=D.def.type;for(const k of Object.keys(y)){if(S.has(k))continue;if(w==="never"){z.push(k);continue}const P=D.run({value:y[k],issues:[]},v);P instanceof Promise?b.push(P.then(F=>Ne(F,m,k))):Ne(P,m,k)}return z.length&&m.issues.push({code:"unrecognized_keys",keys:z,input:y,inst:e}),b.length?Promise.all(b).then(()=>m):m}});function Wt(e,t,o,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:o,errors:e.map(s=>s.issues.map(r=>ne(r,n,oe())))}),t}const Eo=d("$ZodUnion",(e,t)=>{C.init(e,t),N(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),N(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),N(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),N(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${o.map(n=>mt(n.source)).join("|")})$`)}}),e._zod.parse=(o,n)=>{let s=!1;const r=[];for(const i of t.options){const a=i._zod.run({value:o.value,issues:[]},n);if(a instanceof Promise)r.push(a),s=!0;else{if(a.issues.length===0)return a;r.push(a)}}return s?Promise.all(r).then(i=>Wt(i,o,e,n)):Wt(r,o,e,n)}}),sr=d("$ZodDiscriminatedUnion",(e,t)=>{Eo.init(e,t);const o=e._zod.parse;N(e._zod,"propValues",()=>{const s={};for(const r of t.options){const i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const[a,p]of Object.entries(i)){s[a]||(s[a]=new Set);for(const h of p)s[a].add(h)}}return s});const n=pt(()=>{const s=t.options,r=new Map;for(const i of s){const a=i._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const p of a){if(r.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);r.set(p,i)}}return r});e._zod.parse=(s,r)=>{const i=s.value;if(!Le(i))return s.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),s;const a=n.value.get(i?.[t.discriminator]);return a?a._zod.run(s,r):t.unionFallback?o(s,r):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),s)}}),rr=d("$ZodIntersection",(e,t)=>{C.init(e,t),e._zod.parse=(o,n)=>{const s=o.value,r=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then(([p,h])=>Jt(o,p,h)):Jt(o,r,i)}});function nt(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(je(e)&&je(t)){const o=Object.keys(t),n=Object.keys(e).filter(r=>o.indexOf(r)!==-1),s={...e,...t};for(const r of n){const i=nt(e[r],t[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};s[r]=i.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],r=t[n],i=nt(s,r);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o.push(i.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function Jt(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),ve(e))return e;const n=nt(t.value,o.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const ir=d("$ZodRecord",(e,t)=>{C.init(e,t),e._zod.parse=(o,n)=>{const s=o.value;if(!je(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;const r=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;o.value={};for(const p of i)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){const h=t.valueType._zod.run({value:s[p],issues:[]},n);h instanceof Promise?r.push(h.then(g=>{g.issues.length&&o.issues.push(...ie(p,g.issues)),o.value[p]=g.value})):(h.issues.length&&o.issues.push(...ie(p,h.issues)),o.value[p]=h.value)}let a;for(const p in s)i.has(p)||(a=a??[],a.push(p));a&&a.length>0&&o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:a})}else{o.value={};for(const i of Reflect.ownKeys(s)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){o.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(h=>ne(h,n,oe())),input:i,path:[i],inst:e}),o.value[a.value]=a.value;continue}const p=t.valueType._zod.run({value:s[i],issues:[]},n);p instanceof Promise?r.push(p.then(h=>{h.issues.length&&o.issues.push(...ie(i,h.issues)),o.value[a.value]=h.value})):(p.issues.length&&o.issues.push(...ie(i,p.issues)),o.value[a.value]=p.value)}}return r.length?Promise.all(r).then(()=>o):o}}),ar=d("$ZodEnum",(e,t)=>{C.init(e,t);const o=_n(t.entries);e._zod.values=new Set(o),e._zod.pattern=new RegExp(`^(${o.filter(n=>kn.has(typeof n)).map(n=>typeof n=="string"?xe(n):n.toString()).join("|")})$`),e._zod.parse=(n,s)=>{const r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:o,input:r,inst:e}),n}}),cr=d("$ZodLiteral",(e,t)=>{C.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?xe(o):o?o.toString():String(o)).join("|")})$`),e._zod.parse=(o,n)=>{const s=o.value;return e._zod.values.has(s)||o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}}),ur=d("$ZodTransform",(e,t)=>{C.init(e,t),e._zod.parse=(o,n)=>{const s=t.transform(o.value,o);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(o.value=i,o));if(s instanceof Promise)throw new _e;return o.value=s,o}}),lr=d("$ZodOptional",(e,t)=>{C.init(e,t),e._zod.optin="optional",e._zod.optout="optional",N(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),N(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${mt(o.source)})?$`):void 0}),e._zod.parse=(o,n)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(o,n):o.value===void 0?o:t.innerType._zod.run(o,n)}),dr=d("$ZodNullable",(e,t)=>{C.init(e,t),N(e._zod,"optin",()=>t.innerType._zod.optin),N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"pattern",()=>{const o=t.innerType._zod.pattern;return o?new RegExp(`^(${mt(o.source)}|null)$`):void 0}),N(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)}),pr=d("$ZodDefault",(e,t)=>{C.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(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(r=>Gt(r,t)):Gt(s,t)}});function Gt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const hr=d("$ZodPrefault",(e,t)=>{C.init(e,t),e._zod.optin="optional",N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>(o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,n))}),mr=d("$ZodNonOptional",(e,t)=>{C.init(e,t),N(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(r=>Kt(r,e)):Kt(s,e)}});function Kt(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 fr=d("$ZodCatch",(e,t)=>{C.init(e,t),e._zod.optin="optional",N(e._zod,"optout",()=>t.innerType._zod.optout),N(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,n)=>{const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(r=>(o.value=r.value,r.issues.length&&(o.value=t.catchValue({...o,error:{issues:r.issues.map(i=>ne(i,n,oe()))},input:o.value}),o.issues=[]),o)):(o.value=s.value,s.issues.length&&(o.value=t.catchValue({...o,error:{issues:s.issues.map(r=>ne(r,n,oe()))},input:o.value}),o.issues=[]),o)}}),gr=d("$ZodPipe",(e,t)=>{C.init(e,t),N(e._zod,"values",()=>t.in._zod.values),N(e._zod,"optin",()=>t.in._zod.optin),N(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(o,n)=>{const s=t.in._zod.run(o,n);return s instanceof Promise?s.then(r=>Qt(r,t,n)):Qt(s,t,n)}});function Qt(e,t,o){return ve(e)?e:t.out._zod.run({value:e.value,issues:e.issues},o)}const vr=d("$ZodReadonly",(e,t)=>{C.init(e,t),N(e._zod,"propValues",()=>t.innerType._zod.propValues),N(e._zod,"values",()=>t.innerType._zod.values),N(e._zod,"optin",()=>t.innerType._zod.optin),N(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,n)=>{const s=t.innerType._zod.run(o,n);return s instanceof Promise?s.then(Yt):Yt(s)}});function Yt(e){return e.value=Object.freeze(e.value),e}const _r=d("$ZodCustom",(e,t)=>{V.init(e,t),C.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(r=>Xt(r,o,n,e));Xt(s,o,n,e)}});function Xt(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(be(s))}}class br{constructor(){this._map=new Map,this._idmap=new Map}add(t,...o){const n=o[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new Map,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)??{}};return delete n.id,{...n,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function wr(){return new br}const qe=wr();function yr(e,t){return new e({type:"string",...f(t)})}function kr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...f(t)})}function eo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...f(t)})}function xr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...f(t)})}function Sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...f(t)})}function Tr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...f(t)})}function zr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...f(t)})}function Ir(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...f(t)})}function $r(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...f(t)})}function Rr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...f(t)})}function Pr(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...f(t)})}function Er(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...f(t)})}function Zr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...f(t)})}function Cr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...f(t)})}function Nr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...f(t)})}function qr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...f(t)})}function Mr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...f(t)})}function Ar(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...f(t)})}function Or(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...f(t)})}function Dr(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...f(t)})}function Lr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...f(t)})}function jr(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...f(t)})}function Ur(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...f(t)})}function Hr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...f(t)})}function Fr(e,t){return new e({type:"string",format:"date",check:"string_format",...f(t)})}function Br(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...f(t)})}function Vr(e,t){return new e({type:"string",format:"duration",check:"string_format",...f(t)})}function Wr(e,t){return new e({type:"number",checks:[],...f(t)})}function Jr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...f(t)})}function Gr(e,t){return new e({type:"boolean",...f(t)})}function Kr(e,t){return new e({type:"undefined",...f(t)})}function Qr(e,t){return new e({type:"null",...f(t)})}function Yr(e){return new e({type:"unknown"})}function Xr(e,t){return new e({type:"never",...f(t)})}function to(e,t){return new Io({check:"less_than",...f(t),value:e,inclusive:!1})}function Xe(e,t){return new Io({check:"less_than",...f(t),value:e,inclusive:!0})}function oo(e,t){return new $o({check:"greater_than",...f(t),value:e,inclusive:!1})}function et(e,t){return new $o({check:"greater_than",...f(t),value:e,inclusive:!0})}function no(e,t){return new ds({check:"multiple_of",...f(t),value:e})}function Zo(e,t){return new hs({check:"max_length",...f(t),maximum:e})}function Ue(e,t){return new ms({check:"min_length",...f(t),minimum:e})}function Co(e,t){return new fs({check:"length_equals",...f(t),length:e})}function ei(e,t){return new gs({check:"string_format",format:"regex",...f(t),pattern:e})}function ti(e){return new vs({check:"string_format",format:"lowercase",...f(e)})}function oi(e){return new _s({check:"string_format",format:"uppercase",...f(e)})}function ni(e,t){return new bs({check:"string_format",format:"includes",...f(t),includes:e})}function si(e,t){return new ws({check:"string_format",format:"starts_with",...f(t),prefix:e})}function ri(e,t){return new ys({check:"string_format",format:"ends_with",...f(t),suffix:e})}function Se(e){return new ks({check:"overwrite",tx:e})}function ii(e){return Se(t=>t.normalize(e))}function ai(){return Se(e=>e.trim())}function ci(){return Se(e=>e.toLowerCase())}function ui(){return Se(e=>e.toUpperCase())}function li(e,t,o){return new e({type:"array",element:t,...f(o)})}function di(e,t,o){const n=f(o);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function pi(e,t,o){return new e({type:"custom",check:"custom",fn:t,...f(o)})}function vt(e){return!!e._zod}function No(e,t){return vt(e)?yo(e,t):e.safeParse(t)}function hi(e){if(!e)return;let t;if(vt(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function mi(e){if(vt(e)){const r=e._zod?.def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}}const o=e._def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}const n=e.value;if(n!==void 0)return n}const fi=d("ZodISODateTime",(e,t)=>{Ms.init(e,t),O.init(e,t)});function qo(e){return Hr(fi,e)}const gi=d("ZodISODate",(e,t)=>{As.init(e,t),O.init(e,t)});function vi(e){return Fr(gi,e)}const _i=d("ZodISOTime",(e,t)=>{Os.init(e,t),O.init(e,t)});function bi(e){return Br(_i,e)}const wi=d("ZodISODuration",(e,t)=>{Ds.init(e,t),O.init(e,t)});function yi(e){return Vr(wi,e)}const ki=(e,t)=>{_o.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>Zn(e,o)},flatten:{value:o=>En(e,o)},addIssue:{value:o=>e.issues.push(o)},addIssues:{value:o=>e.issues.push(...o)},isEmpty:{get(){return e.issues.length===0}}})},We=d("ZodError",ki,{Parent:Error}),xi=Cn(We),Si=Nn(We),Ti=wo(We),zi=ko(We),M=d("ZodType",(e,t)=>(C.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone({...t,checks:[...t.checks??[],...o.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),e.clone=(o,n)=>ae(e,o,n),e.brand=()=>e,e.register=((o,n)=>(o.add(e,n),e)),e.parse=(o,n)=>xi(e,o,n,{callee:e.parse}),e.safeParse=(o,n)=>Ti(e,o,n),e.parseAsync=async(o,n)=>Si(e,o,n,{callee:e.parseAsync}),e.safeParseAsync=async(o,n)=>zi(e,o,n),e.spa=e.safeParseAsync,e.refine=(o,n)=>e.check(_a(o,n)),e.superRefine=o=>e.check(ba(o)),e.overwrite=o=>e.check(Se(o)),e.optional=()=>A(e),e.nullable=()=>io(e),e.nullish=()=>A(io(e)),e.nonoptional=o=>la(e,o),e.array=()=>_(e),e.or=o=>I([e,o]),e.and=o=>_t(e,o),e.transform=o=>it(e,jo(o)),e.default=o=>aa(e,o),e.prefault=o=>ua(e,o),e.catch=o=>pa(e,o),e.pipe=o=>it(e,o),e.readonly=()=>fa(e),e.describe=o=>{const n=e.clone();return qe.add(n,{description:o}),n},Object.defineProperty(e,"description",{get(){return qe.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return qe.get(e);const n=e.clone();return qe.add(n,o[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Mo=d("_ZodString",(e,t)=>{gt.init(e,t),M.init(e,t);const o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...n)=>e.check(ei(...n)),e.includes=(...n)=>e.check(ni(...n)),e.startsWith=(...n)=>e.check(si(...n)),e.endsWith=(...n)=>e.check(ri(...n)),e.min=(...n)=>e.check(Ue(...n)),e.max=(...n)=>e.check(Zo(...n)),e.length=(...n)=>e.check(Co(...n)),e.nonempty=(...n)=>e.check(Ue(1,...n)),e.lowercase=n=>e.check(ti(n)),e.uppercase=n=>e.check(oi(n)),e.trim=()=>e.check(ai()),e.normalize=(...n)=>e.check(ii(...n)),e.toLowerCase=()=>e.check(ci()),e.toUpperCase=()=>e.check(ui())}),Ii=d("ZodString",(e,t)=>{gt.init(e,t),Mo.init(e,t),e.email=o=>e.check(kr($i,o)),e.url=o=>e.check(Ir(Ri,o)),e.jwt=o=>e.check(Ur(Fi,o)),e.emoji=o=>e.check($r(Pi,o)),e.guid=o=>e.check(eo(so,o)),e.uuid=o=>e.check(xr(Me,o)),e.uuidv4=o=>e.check(Sr(Me,o)),e.uuidv6=o=>e.check(Tr(Me,o)),e.uuidv7=o=>e.check(zr(Me,o)),e.nanoid=o=>e.check(Rr(Ei,o)),e.guid=o=>e.check(eo(so,o)),e.cuid=o=>e.check(Pr(Zi,o)),e.cuid2=o=>e.check(Er(Ci,o)),e.ulid=o=>e.check(Zr(Ni,o)),e.base64=o=>e.check(Dr(ji,o)),e.base64url=o=>e.check(Lr(Ui,o)),e.xid=o=>e.check(Cr(qi,o)),e.ksuid=o=>e.check(Nr(Mi,o)),e.ipv4=o=>e.check(qr(Ai,o)),e.ipv6=o=>e.check(Mr(Oi,o)),e.cidrv4=o=>e.check(Ar(Di,o)),e.cidrv6=o=>e.check(Or(Li,o)),e.e164=o=>e.check(jr(Hi,o)),e.datetime=o=>e.check(qo(o)),e.date=o=>e.check(vi(o)),e.time=o=>e.check(bi(o)),e.duration=o=>e.check(yi(o))});function u(e){return yr(Ii,e)}const O=d("ZodStringFormat",(e,t)=>{q.init(e,t),Mo.init(e,t)}),$i=d("ZodEmail",(e,t)=>{Is.init(e,t),O.init(e,t)}),so=d("ZodGUID",(e,t)=>{Ts.init(e,t),O.init(e,t)}),Me=d("ZodUUID",(e,t)=>{zs.init(e,t),O.init(e,t)}),Ri=d("ZodURL",(e,t)=>{$s.init(e,t),O.init(e,t)}),Pi=d("ZodEmoji",(e,t)=>{Rs.init(e,t),O.init(e,t)}),Ei=d("ZodNanoID",(e,t)=>{Ps.init(e,t),O.init(e,t)}),Zi=d("ZodCUID",(e,t)=>{Es.init(e,t),O.init(e,t)}),Ci=d("ZodCUID2",(e,t)=>{Zs.init(e,t),O.init(e,t)}),Ni=d("ZodULID",(e,t)=>{Cs.init(e,t),O.init(e,t)}),qi=d("ZodXID",(e,t)=>{Ns.init(e,t),O.init(e,t)}),Mi=d("ZodKSUID",(e,t)=>{qs.init(e,t),O.init(e,t)}),Ai=d("ZodIPv4",(e,t)=>{Ls.init(e,t),O.init(e,t)}),Oi=d("ZodIPv6",(e,t)=>{js.init(e,t),O.init(e,t)}),Di=d("ZodCIDRv4",(e,t)=>{Us.init(e,t),O.init(e,t)}),Li=d("ZodCIDRv6",(e,t)=>{Hs.init(e,t),O.init(e,t)}),ji=d("ZodBase64",(e,t)=>{Fs.init(e,t),O.init(e,t)}),Ui=d("ZodBase64URL",(e,t)=>{Vs.init(e,t),O.init(e,t)}),Hi=d("ZodE164",(e,t)=>{Ws.init(e,t),O.init(e,t)}),Fi=d("ZodJWT",(e,t)=>{Gs.init(e,t),O.init(e,t)}),Ao=d("ZodNumber",(e,t)=>{Po.init(e,t),M.init(e,t),e.gt=(n,s)=>e.check(oo(n,s)),e.gte=(n,s)=>e.check(et(n,s)),e.min=(n,s)=>e.check(et(n,s)),e.lt=(n,s)=>e.check(to(n,s)),e.lte=(n,s)=>e.check(Xe(n,s)),e.max=(n,s)=>e.check(Xe(n,s)),e.int=n=>e.check(ro(n)),e.safe=n=>e.check(ro(n)),e.positive=n=>e.check(oo(0,n)),e.nonnegative=n=>e.check(et(0,n)),e.negative=n=>e.check(to(0,n)),e.nonpositive=n=>e.check(Xe(0,n)),e.multipleOf=(n,s)=>e.check(no(n,s)),e.step=(n,s)=>e.check(no(n,s)),e.finite=()=>e;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 x(e){return Wr(Ao,e)}const Bi=d("ZodNumberFormat",(e,t)=>{Ks.init(e,t),Ao.init(e,t)});function ro(e){return Jr(Bi,e)}const Vi=d("ZodBoolean",(e,t)=>{Qs.init(e,t),M.init(e,t)});function Z(e){return Gr(Vi,e)}const Wi=d("ZodUndefined",(e,t)=>{Ys.init(e,t),M.init(e,t)});function st(e){return Kr(Wi,e)}const Ji=d("ZodNull",(e,t)=>{Xs.init(e,t),M.init(e,t)});function Gi(e){return Qr(Ji,e)}const Ki=d("ZodUnknown",(e,t)=>{er.init(e,t),M.init(e,t)});function E(){return Yr(Ki)}const Qi=d("ZodNever",(e,t)=>{tr.init(e,t),M.init(e,t)});function Yi(e){return Xr(Qi,e)}const Xi=d("ZodArray",(e,t)=>{or.init(e,t),M.init(e,t),e.element=t.element,e.min=(o,n)=>e.check(Ue(o,n)),e.nonempty=o=>e.check(Ue(1,o)),e.max=(o,n)=>e.check(Zo(o,n)),e.length=(o,n)=>e.check(Co(o,n)),e.unwrap=()=>e.element});function _(e,t){return li(Xi,e,t)}const Oo=d("ZodObject",(e,t)=>{nr.init(e,t),M.init(e,t),N(e,"shape",()=>t.shape),e.keyof=()=>W(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:E()}),e.loose=()=>e.clone({...e._zod.def,catchall:E()}),e.strict=()=>e.clone({...e._zod.def,catchall:Yi()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>In(e,o),e.merge=o=>$n(e,o),e.pick=o=>Tn(e,o),e.omit=o=>zn(e,o),e.partial=(...o)=>Rn(Uo,e,o[0]),e.required=(...o)=>Pn(Ho,e,o[0])});function l(e,t){const o={type:"object",get shape(){return Be(this,"shape",{...e}),this.shape},...f(t)};return new Oo(o)}function B(e,t){return new Oo({type:"object",get shape(){return Be(this,"shape",{...e}),this.shape},catchall:E(),...f(t)})}const Do=d("ZodUnion",(e,t)=>{Eo.init(e,t),M.init(e,t),e.options=t.options});function I(e,t){return new Do({type:"union",options:e,...f(t)})}const ea=d("ZodDiscriminatedUnion",(e,t)=>{Do.init(e,t),sr.init(e,t)});function Lo(e,t,o){return new ea({type:"union",options:t,discriminator:e,...f(o)})}const ta=d("ZodIntersection",(e,t)=>{rr.init(e,t),M.init(e,t)});function _t(e,t){return new ta({type:"intersection",left:e,right:t})}const oa=d("ZodRecord",(e,t)=>{ir.init(e,t),M.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function R(e,t,o){return new oa({type:"record",keyType:e,valueType:t,...f(o)})}const rt=d("ZodEnum",(e,t)=>{ar.init(e,t),M.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const o=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const r={};for(const i of n)if(o.has(i))r[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new rt({...t,checks:[],...f(s),entries:r})},e.exclude=(n,s)=>{const r={...t.entries};for(const i of n)if(o.has(i))delete r[i];else throw new Error(`Key ${i} not found in enum`);return new rt({...t,checks:[],...f(s),entries:r})}});function W(e,t){const o=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new rt({type:"enum",entries:o,...f(t)})}const na=d("ZodLiteral",(e,t)=>{cr.init(e,t),M.init(e,t),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 c(e,t){return new na({type:"literal",values:Array.isArray(e)?e:[e],...f(t)})}const sa=d("ZodTransform",(e,t)=>{ur.init(e,t),M.init(e,t),e._zod.parse=(o,n)=>{o.addIssue=r=>{if(typeof r=="string")o.issues.push(be(r,o.value,t));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),o.issues.push(be(i))}};const s=t.transform(o.value,o);return s instanceof Promise?s.then(r=>(o.value=r,o)):(o.value=s,o)}});function jo(e){return new sa({type:"transform",transform:e})}const Uo=d("ZodOptional",(e,t)=>{lr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function A(e){return new Uo({type:"optional",innerType:e})}const ra=d("ZodNullable",(e,t)=>{dr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function io(e){return new ra({type:"nullable",innerType:e})}const ia=d("ZodDefault",(e,t)=>{pr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function aa(e,t){return new ia({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const ca=d("ZodPrefault",(e,t)=>{hr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ua(e,t){return new ca({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Ho=d("ZodNonOptional",(e,t)=>{mr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType});function la(e,t){return new Ho({type:"nonoptional",innerType:e,...f(t)})}const da=d("ZodCatch",(e,t)=>{fr.init(e,t),M.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pa(e,t){return new da({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const ha=d("ZodPipe",(e,t)=>{gr.init(e,t),M.init(e,t),e.in=t.in,e.out=t.out});function it(e,t){return new ha({type:"pipe",in:e,out:t})}const ma=d("ZodReadonly",(e,t)=>{vr.init(e,t),M.init(e,t)});function fa(e){return new ma({type:"readonly",innerType:e})}const Fo=d("ZodCustom",(e,t)=>{_r.init(e,t),M.init(e,t)});function ga(e){const t=new V({check:"custom"});return t._zod.check=e,t}function va(e,t){return di(Fo,e??(()=>!0),t)}function _a(e,t={}){return pi(Fo,e,t)}function ba(e){const t=ga(o=>(o.addIssue=n=>{if(typeof n=="string")o.issues.push(be(n,o.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),o.issues.push(be(s))}},e(o.value,o)));return t}function Bo(e,t){return it(jo(e),t)}const re="io.modelcontextprotocol/related-task",Je="2.0",L=va(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Vo=I([u(),x().int()]),Wo=u();B({ttl:x().optional(),pollInterval:x().optional()});const wa=l({ttl:x().optional()}),ya=l({taskId:u()}),bt=B({progressToken:Vo.optional(),[re]:ya.optional()}),J=l({_meta:bt.optional()}),Te=J.extend({task:wa.optional()}),ka=e=>Te.safeParse(e).success,j=l({method:u(),params:J.loose().optional()}),G=l({_meta:bt.optional()}),K=l({method:u(),params:G.loose().optional()}),U=B({_meta:bt.optional()}),ze=I([u(),x().int()]),Jo=l({jsonrpc:c(Je),id:ze,...j.shape}).strict(),ao=e=>Jo.safeParse(e).success,Go=l({jsonrpc:c(Je),...K.shape}).strict(),xa=e=>Go.safeParse(e).success,wt=l({jsonrpc:c(Je),id:ze,result:U}).strict(),Ae=e=>wt.safeParse(e).success;var $;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",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.UrlElicitationRequired=-32042]="UrlElicitationRequired"})($||($={}));const yt=l({jsonrpc:c(Je),id:ze.optional(),error:l({code:x().int(),message:u(),data:E().optional()})}).strict(),Sa=e=>yt.safeParse(e).success,Ta=I([Jo,Go,wt,yt]);I([wt,yt]);const kt=U.strict(),za=G.extend({requestId:ze.optional(),reason:u().optional()}),xt=K.extend({method:c("notifications/cancelled"),params:za}),Ia=l({src:u(),mimeType:u().optional(),sizes:_(u()).optional(),theme:W(["light","dark"]).optional()}),Ie=l({icons:_(Ia).optional()}),de=l({name:u(),title:u().optional()}),Ge=de.extend({...de.shape,...Ie.shape,version:u(),websiteUrl:u().optional(),description:u().optional()}),$a=_t(l({applyDefaults:Z().optional()}),R(u(),E())),Ra=Bo(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,_t(l({form:$a.optional(),url:L.optional()}),R(u(),E()).optional())),Pa=B({list:L.optional(),cancel:L.optional(),requests:B({sampling:B({createMessage:L.optional()}).optional(),elicitation:B({create:L.optional()}).optional()}).optional()}),Ea=B({list:L.optional(),cancel:L.optional(),requests:B({tools:B({call:L.optional()}).optional()}).optional()}),Za=l({experimental:R(u(),L).optional(),sampling:l({context:L.optional(),tools:L.optional()}).optional(),elicitation:Ra.optional(),roots:l({listChanged:Z().optional()}).optional(),tasks:Pa.optional(),extensions:R(u(),L).optional()}),Ca=J.extend({protocolVersion:u(),capabilities:Za,clientInfo:Ge}),Na=j.extend({method:c("initialize"),params:Ca}),qa=l({experimental:R(u(),L).optional(),logging:L.optional(),completions:L.optional(),prompts:l({listChanged:Z().optional()}).optional(),resources:l({subscribe:Z().optional(),listChanged:Z().optional()}).optional(),tools:l({listChanged:Z().optional()}).optional(),tasks:Ea.optional(),extensions:R(u(),L).optional()}),Ma=U.extend({protocolVersion:u(),capabilities:qa,serverInfo:Ge,instructions:u().optional()}),Aa=K.extend({method:c("notifications/initialized"),params:G.optional()}),Ke=j.extend({method:c("ping"),params:J.optional()}),Oa=l({progress:x(),total:A(x()),message:A(u())}),Da=l({...G.shape,...Oa.shape,progressToken:Vo}),St=K.extend({method:c("notifications/progress"),params:Da}),La=J.extend({cursor:Wo.optional()}),$e=j.extend({params:La.optional()}),Re=U.extend({nextCursor:Wo.optional()}),ja=W(["working","input_required","completed","failed","cancelled"]),Pe=l({taskId:u(),status:ja,ttl:I([x(),Gi()]),createdAt:u(),lastUpdatedAt:u(),pollInterval:A(x()),statusMessage:A(u())}),Tt=U.extend({task:Pe}),Ua=G.merge(Pe),He=K.extend({method:c("notifications/tasks/status"),params:Ua}),zt=j.extend({method:c("tasks/get"),params:J.extend({taskId:u()})}),It=U.merge(Pe),$t=j.extend({method:c("tasks/result"),params:J.extend({taskId:u()})});U.loose();const Rt=$e.extend({method:c("tasks/list")}),Pt=Re.extend({tasks:_(Pe)}),Et=j.extend({method:c("tasks/cancel"),params:J.extend({taskId:u()})}),Ha=U.merge(Pe),Ko=l({uri:u(),mimeType:A(u()),_meta:R(u(),E()).optional()}),Qo=Ko.extend({text:u()}),Zt=u().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Yo=Ko.extend({blob:Zt}),Ee=W(["user","assistant"]),he=l({audience:_(Ee).optional(),priority:x().min(0).max(1).optional(),lastModified:qo({offset:!0}).optional()}),Xo=l({...de.shape,...Ie.shape,uri:u(),description:A(u()),mimeType:A(u()),size:A(x()),annotations:he.optional(),_meta:A(B({}))}),Fa=l({...de.shape,...Ie.shape,uriTemplate:u(),description:A(u()),mimeType:A(u()),annotations:he.optional(),_meta:A(B({}))}),Ba=$e.extend({method:c("resources/list")}),en=Re.extend({resources:_(Xo)}),Va=$e.extend({method:c("resources/templates/list")}),Wa=Re.extend({resourceTemplates:_(Fa)}),Ct=J.extend({uri:u()}),Ja=Ct,Ga=j.extend({method:c("resources/read"),params:Ja}),tn=U.extend({contents:_(I([Qo,Yo]))}),Ka=K.extend({method:c("notifications/resources/list_changed"),params:G.optional()}),Qa=Ct,Ya=j.extend({method:c("resources/subscribe"),params:Qa}),Xa=Ct,ec=j.extend({method:c("resources/unsubscribe"),params:Xa}),tc=G.extend({uri:u()}),oc=K.extend({method:c("notifications/resources/updated"),params:tc}),nc=l({name:u(),description:A(u()),required:A(Z())}),sc=l({...de.shape,...Ie.shape,description:A(u()),arguments:A(_(nc)),_meta:A(B({}))}),rc=$e.extend({method:c("prompts/list")}),ic=Re.extend({prompts:_(sc)}),ac=J.extend({name:u(),arguments:R(u(),u()).optional()}),cc=j.extend({method:c("prompts/get"),params:ac}),Nt=l({type:c("text"),text:u(),annotations:he.optional(),_meta:R(u(),E()).optional()}),qt=l({type:c("image"),data:Zt,mimeType:u(),annotations:he.optional(),_meta:R(u(),E()).optional()}),Mt=l({type:c("audio"),data:Zt,mimeType:u(),annotations:he.optional(),_meta:R(u(),E()).optional()}),uc=l({type:c("tool_use"),name:u(),id:u(),input:R(u(),E()),_meta:R(u(),E()).optional()}),on=l({type:c("resource"),resource:I([Qo,Yo]),annotations:he.optional(),_meta:R(u(),E()).optional()}),nn=Xo.extend({type:c("resource_link")}),Ze=I([Nt,qt,Mt,nn,on]),lc=l({role:Ee,content:Ze}),dc=U.extend({description:u().optional(),messages:_(lc)}),pc=K.extend({method:c("notifications/prompts/list_changed"),params:G.optional()}),hc=l({title:u().optional(),readOnlyHint:Z().optional(),destructiveHint:Z().optional(),idempotentHint:Z().optional(),openWorldHint:Z().optional()}),mc=l({taskSupport:W(["required","optional","forbidden"]).optional()}),At=l({...de.shape,...Ie.shape,description:u().optional(),inputSchema:l({type:c("object"),properties:R(u(),L).optional(),required:_(u()).optional()}).catchall(E()),outputSchema:l({type:c("object"),properties:R(u(),L).optional(),required:_(u()).optional()}).catchall(E()).optional(),annotations:hc.optional(),execution:mc.optional(),_meta:R(u(),E()).optional()}),sn=$e.extend({method:c("tools/list")}),fc=Re.extend({tools:_(At)}),Qe=U.extend({content:_(Ze).default([]),structuredContent:R(u(),E()).optional(),isError:Z().optional()});Qe.or(U.extend({toolResult:E()}));const gc=Te.extend({name:u(),arguments:R(u(),E()).optional()}),rn=j.extend({method:c("tools/call"),params:gc}),vc=K.extend({method:c("notifications/tools/list_changed"),params:G.optional()});l({autoRefresh:Z().default(!0),debounceMs:x().int().nonnegative().default(300)});const an=W(["debug","info","notice","warning","error","critical","alert","emergency"]),_c=J.extend({level:an}),bc=j.extend({method:c("logging/setLevel"),params:_c}),wc=G.extend({level:an,logger:u().optional(),data:E()}),yc=K.extend({method:c("notifications/message"),params:wc}),kc=l({name:u().optional()}),xc=l({hints:_(kc).optional(),costPriority:x().min(0).max(1).optional(),speedPriority:x().min(0).max(1).optional(),intelligencePriority:x().min(0).max(1).optional()}),Sc=l({mode:W(["auto","required","none"]).optional()}),Tc=l({type:c("tool_result"),toolUseId:u().describe("The unique identifier for the corresponding tool call."),content:_(Ze).default([]),structuredContent:l({}).loose().optional(),isError:Z().optional(),_meta:R(u(),E()).optional()}),zc=Lo("type",[Nt,qt,Mt]),Fe=Lo("type",[Nt,qt,Mt,uc,Tc]),Ic=l({role:Ee,content:I([Fe,_(Fe)]),_meta:R(u(),E()).optional()}),$c=Te.extend({messages:_(Ic),modelPreferences:xc.optional(),systemPrompt:u().optional(),includeContext:W(["none","thisServer","allServers"]).optional(),temperature:x().optional(),maxTokens:x().int(),stopSequences:_(u()).optional(),metadata:L.optional(),tools:_(At).optional(),toolChoice:Sc.optional()}),Rc=j.extend({method:c("sampling/createMessage"),params:$c}),Pc=U.extend({model:u(),stopReason:A(W(["endTurn","stopSequence","maxTokens"]).or(u())),role:Ee,content:zc}),Ec=U.extend({model:u(),stopReason:A(W(["endTurn","stopSequence","maxTokens","toolUse"]).or(u())),role:Ee,content:I([Fe,_(Fe)])}),Zc=l({type:c("boolean"),title:u().optional(),description:u().optional(),default:Z().optional()}),Cc=l({type:c("string"),title:u().optional(),description:u().optional(),minLength:x().optional(),maxLength:x().optional(),format:W(["email","uri","date","date-time"]).optional(),default:u().optional()}),Nc=l({type:W(["number","integer"]),title:u().optional(),description:u().optional(),minimum:x().optional(),maximum:x().optional(),default:x().optional()}),qc=l({type:c("string"),title:u().optional(),description:u().optional(),enum:_(u()),default:u().optional()}),Mc=l({type:c("string"),title:u().optional(),description:u().optional(),oneOf:_(l({const:u(),title:u()})),default:u().optional()}),Ac=l({type:c("string"),title:u().optional(),description:u().optional(),enum:_(u()),enumNames:_(u()).optional(),default:u().optional()}),Oc=I([qc,Mc]),Dc=l({type:c("array"),title:u().optional(),description:u().optional(),minItems:x().optional(),maxItems:x().optional(),items:l({type:c("string"),enum:_(u())}),default:_(u()).optional()}),Lc=l({type:c("array"),title:u().optional(),description:u().optional(),minItems:x().optional(),maxItems:x().optional(),items:l({anyOf:_(l({const:u(),title:u()}))}),default:_(u()).optional()}),jc=I([Dc,Lc]),Uc=I([Ac,Oc,jc]),Hc=I([Uc,Zc,Cc,Nc]),Fc=Te.extend({mode:c("form").optional(),message:u(),requestedSchema:l({type:c("object"),properties:R(u(),Hc),required:_(u()).optional()})}),Bc=Te.extend({mode:c("url"),message:u(),elicitationId:u(),url:u().url()}),Vc=I([Fc,Bc]),Wc=j.extend({method:c("elicitation/create"),params:Vc}),Jc=G.extend({elicitationId:u()}),Gc=K.extend({method:c("notifications/elicitation/complete"),params:Jc}),Kc=U.extend({action:W(["accept","decline","cancel"]),content:Bo(e=>e===null?void 0:e,R(u(),I([u(),x(),Z(),_(u())])).optional())}),Qc=l({type:c("ref/resource"),uri:u()}),Yc=l({type:c("ref/prompt"),name:u()}),Xc=J.extend({ref:I([Yc,Qc]),argument:l({name:u(),value:u()}),context:l({arguments:R(u(),u()).optional()}).optional()}),eu=j.extend({method:c("completion/complete"),params:Xc}),tu=U.extend({completion:B({values:_(u()).max(100),total:A(x().int()),hasMore:A(Z())})}),ou=l({uri:u().startsWith("file://"),name:u().optional(),_meta:R(u(),E()).optional()}),nu=j.extend({method:c("roots/list"),params:J.optional()}),su=U.extend({roots:_(ou)}),ru=K.extend({method:c("notifications/roots/list_changed"),params:G.optional()});I([Ke,Na,eu,bc,cc,rc,Ba,Va,Ga,Ya,ec,rn,sn,zt,$t,Rt,Et]);I([xt,St,Aa,ru,He]);I([kt,Pc,Ec,Kc,su,It,Pt,Tt]);I([Ke,Rc,Wc,nu,zt,$t,Rt,Et]);I([xt,St,yc,oc,Ka,vc,pc,He,Gc]);I([kt,Ma,tu,dc,ic,en,Wa,tn,Qe,fc,It,Pt,Tt]);class T extends Error{constructor(t,o,n){super(`MCP error ${t}: ${o}`),this.code=t,this.data=n,this.name="McpError"}static fromError(t,o,n){if(t===$.UrlElicitationRequired&&n){const s=n;if(s.elicitations)return new iu(s.elicitations,o)}return new T(t,o,n)}}class iu extends T{constructor(t,o=`URL elicitation${t.length>1?"s":""} required`){super($.UrlElicitationRequired,o,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}}function se(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function co(e){const o=hi(e)?.method;if(!o)throw new Error("Schema is missing a method literal");const n=mi(o);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function uo(e,t){const o=No(e,t);if(!o.success)throw o.error;return o.data}const au=6e4;class cu{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(xt,o=>{this._oncancel(o)}),this.setNotificationHandler(St,o=>{this._onprogress(o)}),this.setRequestHandler(Ke,o=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(zt,async(o,n)=>{const s=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!s)throw new T($.InvalidParams,"Failed to retrieve task: Task not found");return{...s}}),this.setRequestHandler($t,async(o,n)=>{const s=async()=>{const r=o.params.taskId;if(!await this._taskStore.getTask(r,n.sessionId))throw new T($.InvalidParams,`Task not found: ${r}`);if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(r,n.sessionId);){if(a.type==="response"||a.type==="error"){const p=a.message,h=p.id,g=this._requestResolvers.get(h);if(g)if(this._requestResolvers.delete(h),a.type==="response")g(p);else{const m=p,v=new T(m.error.code,m.error.message,m.error.data);g(v)}else{const m=a.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${h}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}const i=await this._taskStore.getTask(r,n.sessionId);if(!i)throw new T($.InvalidParams,`Task not found: ${r}`);if(!se(i.status))return await this._waitForTaskUpdate(r,n.signal,n.sessionId),await s();if(se(i.status)){const a=await this._taskStore.getTaskResult(r,n.sessionId);return this._clearTaskQueue(r,n.sessionId),{...a,_meta:{...a._meta,[re]:{taskId:r}}}}return await s()};return await s()}),this.setRequestHandler(Rt,async(o,n)=>{try{const{tasks:s,nextCursor:r}=await this._taskStore.listTasks(o.params?.cursor,n.sessionId);return{tasks:s,nextCursor:r,_meta:{}}}catch(s){throw new T($.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(Et,async(o,n)=>{try{const s=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!s)throw new T($.InvalidParams,`Task not found: ${o.params.taskId}`);if(se(s.status))throw new T($.InvalidParams,`Cannot cancel task in terminal status: ${s.status}`);await this._taskStore.updateTaskStatus(o.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(o.params.taskId,n.sessionId);const r=await this._taskStore.getTask(o.params.taskId,n.sessionId);if(!r)throw new T($.InvalidParams,`Task not found after cancellation: ${o.params.taskId}`);return{_meta:{},...r}}catch(s){throw s instanceof T?s:new T($.InvalidRequest,`Failed to cancel task: ${s instanceof Error?s.message:String(s)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,o,n,s,r=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(s,o),startTime:Date.now(),timeout:o,maxTotalTimeout:n,resetTimeoutOnProgress:r,onTimeout:s})}_resetTimeout(t){const o=this._timeoutInfo.get(t);if(!o)return!1;const n=Date.now()-o.startTime;if(o.maxTotalTimeout&&n>=o.maxTotalTimeout)throw this._timeoutInfo.delete(t),T.fromError($.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:o.maxTotalTimeout,totalElapsed:n});return clearTimeout(o.timeoutId),o.timeoutId=setTimeout(o.onTimeout,o.timeout),!0}_cleanupTimeout(t){const o=this._timeoutInfo.get(t);o&&(clearTimeout(o.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const o=this.transport?.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};const n=this.transport?.onerror;this._transport.onerror=r=>{n?.(r),this._onerror(r)};const s=this._transport?.onmessage;this._transport.onmessage=(r,i)=>{s?.(r,i),Ae(r)||Sa(r)?this._onresponse(r):ao(r)?this._onrequest(r,i):xa(r)?this._onnotification(r):this._onerror(new Error(`Unknown message type: ${JSON.stringify(r)}`))},await this._transport.start()}_onclose(){const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(const n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();const o=T.fromError($.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const n of t.values())n(o)}_onerror(t){this.onerror?.(t)}_onnotification(t){const o=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;o!==void 0&&Promise.resolve().then(()=>o(t)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(t,o){const n=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,s=this._transport,r=t.params?._meta?.[re]?.taskId,i=s?.sessionId,a=this._taskStore;let p=!0,h;if(r&&a&&this._taskMessageQueue&&i!==void 0&&(p=!1,h=(async()=>{if(!await a.getTask(r,i))throw new T($.InvalidParams,`Task not found: ${r}`);p=!0})()),n===void 0){const b={jsonrpc:"2.0",id:t.id,error:{code:$.MethodNotFound,message:"Method not found"}};if(r&&h){const z={type:"error",message:b,timestamp:Date.now()};h.then(()=>this._enqueueTaskMessage(r,z,i),()=>s?.send(b)).catch(S=>this._onerror(new Error(`Failed to send an error response: ${S}`)))}else r&&this._taskMessageQueue?this._enqueueTaskMessage(r,{type:"error",message:b,timestamp:Date.now()},s?.sessionId).catch(z=>this._onerror(new Error(`Failed to enqueue error response: ${z}`))):s?.send(b).catch(z=>this._onerror(new Error(`Failed to send an error response: ${z}`)));return}const g=new AbortController;this._requestHandlerAbortControllers.set(t.id,g);const m=ka(t.params)?t.params.task:void 0,v=this._taskStore?this.requestTaskStore(t,s?.sessionId):void 0,y={signal:g.signal,sessionId:s?.sessionId,_meta:t.params?._meta,sendNotification:async b=>{if(g.signal.aborted)return;const z={relatedRequestId:t.id};r&&(z.relatedTask={taskId:r}),await this.notification(b,z)},sendRequest:async(b,z,S)=>{if(g.signal.aborted)throw new T($.ConnectionClosed,"Request was cancelled");const D={...S,relatedRequestId:t.id};r&&!D.relatedTask&&(D.relatedTask={taskId:r});const w=D.relatedTask?.taskId??r;return w&&v&&await v.updateTaskStatus(w,"input_required"),await this.request(b,z,D)},authInfo:o?.authInfo,requestId:t.id,requestInfo:o?.requestInfo,taskId:r,taskStore:v,taskRequestedTtl:m?.ttl,closeSSEStream:o?.closeSSEStream,closeStandaloneSSEStream:o?.closeStandaloneSSEStream};(h??Promise.resolve()).then(()=>{if(h&&g.signal.aborted)throw new T($.ConnectionClosed,"Request was cancelled");m&&this.assertTaskHandlerCapability(t.method)}).then(()=>n(t,y)).then(async b=>{if(g.signal.aborted)return;const z={result:b,jsonrpc:"2.0",id:t.id};r&&this._taskMessageQueue?await this._enqueueTaskMessage(r,{type:"response",message:z,timestamp:Date.now()},s?.sessionId):await s?.send(z)},async b=>{if(g.signal.aborted)return;const z={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(b.code)?b.code:$.InternalError,message:b.message??"Internal error",...b.data!==void 0&&{data:b.data}}};r&&this._taskMessageQueue&&p?await this._enqueueTaskMessage(r,{type:"error",message:z,timestamp:Date.now()},s?.sessionId):await s?.send(z)}).catch(b=>this._onerror(new Error(`Failed to send response: ${b}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===g&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:o,...n}=t.params,s=Number(o),r=this._progressHandlers.get(s);if(!r){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const i=this._responseHandlers.get(s),a=this._timeoutInfo.get(s);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(p){this._responseHandlers.delete(s),this._progressHandlers.delete(s),this._cleanupTimeout(s),i(p);return}r(n)}_onresponse(t){const o=Number(t.id),n=this._requestResolvers.get(o);if(n){if(this._requestResolvers.delete(o),Ae(t))n(t);else{const i=new T(t.error.code,t.error.message,t.error.data);n(i)}return}const s=this._responseHandlers.get(o);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(o),this._cleanupTimeout(o);let r=!1;if(Ae(t)&&t.result&&typeof t.result=="object"){const i=t.result;if(i.task&&typeof i.task=="object"){const a=i.task;typeof a.taskId=="string"&&(r=!0,this._taskProgressTokens.set(a.taskId,o))}}if(r||this._progressHandlers.delete(o),Ae(t))s(t);else{const i=T.fromError(t.error.code,t.error.message,t.error.data);s(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,o,n){const{task:s}=n??{};if(!s){try{yield{type:"result",result:await this.request(t,o,n)}}catch(i){yield{type:"error",error:i instanceof T?i:new T($.InternalError,String(i))}}return}let r;try{const i=await this.request(t,Tt,n);if(i.task)r=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new T($.InternalError,"Task creation did not return a task");for(;;){const a=await this.getTask({taskId:r},n);if(yield{type:"taskStatus",task:a},se(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:r},o,n)}:a.status==="failed"?yield{type:"error",error:new T($.InternalError,`Task ${r} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new T($.InternalError,`Task ${r} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:r},o,n)};return}const p=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(h=>setTimeout(h,p)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof T?i:new T($.InternalError,String(i))}}}request(t,o,n){const{relatedRequestId:s,resumptionToken:r,onresumptiontoken:i,task:a,relatedTask:p}=n??{};return new Promise((h,g)=>{const m=w=>{g(w)};if(!this._transport){m(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(w){m(w);return}n?.signal?.throwIfAborted();const v=this._requestMessageId++,y={...t,jsonrpc:"2.0",id:v};n?.onprogress&&(this._progressHandlers.set(v,n.onprogress),y.params={...t.params,_meta:{...t.params?._meta||{},progressToken:v}}),a&&(y.params={...y.params,task:a}),p&&(y.params={...y.params,_meta:{...y.params?._meta||{},[re]:p}});const b=w=>{this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(w)}},{relatedRequestId:s,resumptionToken:r,onresumptiontoken:i}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`)));const k=w instanceof T?w:new T($.RequestTimeout,String(w));g(k)};this._responseHandlers.set(v,w=>{if(!n?.signal?.aborted){if(w instanceof Error)return g(w);try{const k=No(o,w.result);k.success?h(k.data):g(k.error)}catch(k){g(k)}}}),n?.signal?.addEventListener("abort",()=>{b(n?.signal?.reason)});const z=n?.timeout??au,S=()=>b(T.fromError($.RequestTimeout,"Request timed out",{timeout:z}));this._setupTimeout(v,z,n?.maxTotalTimeout,S,n?.resetTimeoutOnProgress??!1);const D=p?.taskId;if(D){const w=k=>{const P=this._responseHandlers.get(v);P?P(k):this._onerror(new Error(`Response handler missing for side-channeled request ${v}`))};this._requestResolvers.set(v,w),this._enqueueTaskMessage(D,{type:"request",message:y,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(v),g(k)})}else this._transport.send(y,{relatedRequestId:s,resumptionToken:r,onresumptiontoken:i}).catch(w=>{this._cleanupTimeout(v),g(w)})})}async getTask(t,o){return this.request({method:"tasks/get",params:t},It,o)}async getTaskResult(t,o,n){return this.request({method:"tasks/result",params:t},o,n)}async listTasks(t,o){return this.request({method:"tasks/list",params:t},Pt,o)}async cancelTask(t,o){return this.request({method:"tasks/cancel",params:t},Ha,o)}async notification(t,o){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const n=o?.relatedTask?.taskId;if(n){const a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[re]:o.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!o?.relatedRequestId&&!o?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};o?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[re]:o.relatedTask}}}),this._transport?.send(a,o).catch(p=>this._onerror(p))});return}let i={...t,jsonrpc:"2.0"};o?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[re]:o.relatedTask}}}),await this._transport.send(i,o)}setRequestHandler(t,o){const n=co(t);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(s,r)=>{const i=uo(t,s);return Promise.resolve(o(i,r))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,o){const n=co(t);this._notificationHandlers.set(n,s=>{const r=uo(t,s);return Promise.resolve(o(r))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const o=this._taskProgressTokens.get(t);o!==void 0&&(this._progressHandlers.delete(o),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,o,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const s=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,o,n??this._transport?.sessionId,s)}async _clearTaskQueue(t,o){if(this._taskMessageQueue){const n=await this._taskMessageQueue.dequeueAll(t,o);for(const s of n)if(s.type==="request"&&ao(s.message)){const r=s.message.id,i=this._requestResolvers.get(r);i?(i(new T($.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(r)):this._onerror(new Error(`Resolver missing for request ${r} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,o,n){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(t,n);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,i)=>{if(o.aborted){i(new T($.InvalidRequest,"Request cancelled"));return}const a=setTimeout(r,s);o.addEventListener("abort",()=>{clearTimeout(a),i(new T($.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,o){const n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async s=>{if(!t)throw new Error("No request provided");return await n.createTask(s,t.id,{method:t.method,params:t.params},o)},getTask:async s=>{const r=await n.getTask(s,o);if(!r)throw new T($.InvalidParams,"Failed to retrieve task: Task not found");return r},storeTaskResult:async(s,r,i)=>{await n.storeTaskResult(s,r,i,o);const a=await n.getTask(s,o);if(a){const p=He.parse({method:"notifications/tasks/status",params:a});await this.notification(p),se(a.status)&&this._cleanupTaskProgressHandler(s)}},getTaskResult:s=>n.getTaskResult(s,o),updateTaskStatus:async(s,r,i)=>{const a=await n.getTask(s,o);if(!a)throw new T($.InvalidParams,`Task "${s}" not found - it may have been cleaned up`);if(se(a.status))throw new T($.InvalidParams,`Cannot update task "${s}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(s,r,i,o);const p=await n.getTask(s,o);if(p){const h=He.parse({method:"notifications/tasks/status",params:p});await this.notification(h),se(p.status)&&this._cleanupTaskProgressHandler(s)}},listTasks:s=>n.listTasks(s,o)}}}var uu="2026-01-26",lu="ui/notifications/tool-input-partial";class cn{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=Ta.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!==lu&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}var du=I([c("light"),c("dark")]).describe("Color theme preference for the host environment."),we=I([c("inline"),c("fullscreen"),c("pip")]).describe("Display mode for UI presentation."),pu=I([c("--color-background-primary"),c("--color-background-secondary"),c("--color-background-tertiary"),c("--color-background-inverse"),c("--color-background-ghost"),c("--color-background-info"),c("--color-background-danger"),c("--color-background-success"),c("--color-background-warning"),c("--color-background-disabled"),c("--color-text-primary"),c("--color-text-secondary"),c("--color-text-tertiary"),c("--color-text-inverse"),c("--color-text-ghost"),c("--color-text-info"),c("--color-text-danger"),c("--color-text-success"),c("--color-text-warning"),c("--color-text-disabled"),c("--color-border-primary"),c("--color-border-secondary"),c("--color-border-tertiary"),c("--color-border-inverse"),c("--color-border-ghost"),c("--color-border-info"),c("--color-border-danger"),c("--color-border-success"),c("--color-border-warning"),c("--color-border-disabled"),c("--color-ring-primary"),c("--color-ring-secondary"),c("--color-ring-inverse"),c("--color-ring-info"),c("--color-ring-danger"),c("--color-ring-success"),c("--color-ring-warning"),c("--font-sans"),c("--font-mono"),c("--font-weight-normal"),c("--font-weight-medium"),c("--font-weight-semibold"),c("--font-weight-bold"),c("--font-text-xs-size"),c("--font-text-sm-size"),c("--font-text-md-size"),c("--font-text-lg-size"),c("--font-heading-xs-size"),c("--font-heading-sm-size"),c("--font-heading-md-size"),c("--font-heading-lg-size"),c("--font-heading-xl-size"),c("--font-heading-2xl-size"),c("--font-heading-3xl-size"),c("--font-text-xs-line-height"),c("--font-text-sm-line-height"),c("--font-text-md-line-height"),c("--font-text-lg-line-height"),c("--font-heading-xs-line-height"),c("--font-heading-sm-line-height"),c("--font-heading-md-line-height"),c("--font-heading-lg-line-height"),c("--font-heading-xl-line-height"),c("--font-heading-2xl-line-height"),c("--font-heading-3xl-line-height"),c("--border-radius-xs"),c("--border-radius-sm"),c("--border-radius-md"),c("--border-radius-lg"),c("--border-radius-xl"),c("--border-radius-full"),c("--border-width-regular"),c("--shadow-hairline"),c("--shadow-sm"),c("--shadow-md"),c("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),hu=R(pu.describe(`Style variables for theming MCP apps.
|
|
33
33
|
|
|
34
34
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
35
35
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
36
36
|
|
|
37
37
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
38
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
38
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),I([u(),st()]).describe(`Style variables for theming MCP apps.
|
|
39
39
|
|
|
40
40
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
41
41
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
@@ -47,10 +47,10 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
47
47
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
48
48
|
|
|
49
49
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
50
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);l({method:
|
|
50
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);l({method:c("ui/open-link"),params:l({url:u().describe("URL to open in the host's browser")})});var mu=l({isError:Z().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),fu=l({isError:Z().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),gu=l({isError:Z().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();l({method:c("ui/notifications/sandbox-proxy-ready"),params:l({})});var Ot=l({connectDomains:_(u()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
51
51
|
|
|
52
52
|
- Maps to CSP \`connect-src\` directive
|
|
53
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:_(u()).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:_(u()).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:_(u()).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'`)")}),Dt=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:
|
|
53
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:_(u()).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:_(u()).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:_(u()).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'`)")}),Dt=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:c("ui/notifications/size-changed"),params:l({width:x().optional().describe("New width in pixels."),height:x().optional().describe("New height in pixels.")})});var vu=l({method:c("ui/notifications/tool-input"),params:l({arguments:R(u(),E().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),_u=l({method:c("ui/notifications/tool-input-partial"),params:l({arguments:R(u(),E().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),bu=l({method:c("ui/notifications/tool-cancelled"),params:l({reason:u().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),wu=l({fonts:u().optional()}),yu=l({variables:hu.optional().describe("CSS variables for theming the app."),css:wu.optional().describe("CSS blocks that apps can inject.")}),ku=l({method:c("ui/resource-teardown"),params:l({})});R(u(),E());var lo=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:c("ui/notifications/request-teardown"),params:l({}).optional()});var xu=l({experimental:l({}).optional().describe("Experimental features (structure TBD)."),openLinks:l({}).optional().describe("Host supports opening external URLs."),downloadFile:l({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:l({listChanged:Z().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:l({listChanged:Z().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:Dt.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:Ot.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:lo.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:lo.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),Su=l({experimental:l({}).optional().describe("Experimental features (structure TBD)."),tools:l({listChanged:Z().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:_(we).optional().describe("Display modes the app supports.")});l({method:c("ui/notifications/initialized"),params:l({}).optional()});l({csp:Ot.optional().describe("Content Security Policy configuration for UI resources."),permissions:Dt.optional().describe("Sandbox permissions requested by the UI resource."),domain:u().optional().describe(`Dedicated origin for view sandbox.
|
|
54
54
|
|
|
55
55
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
56
56
|
|
|
@@ -58,28 +58,28 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
|
|
|
58
58
|
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
59
59
|
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
60
60
|
|
|
61
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:
|
|
61
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Z().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
62
62
|
|
|
63
63
|
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
64
64
|
|
|
65
65
|
- \`true\`: request visible border + background
|
|
66
66
|
- \`false\`: request no visible border + background
|
|
67
|
-
- omitted: host decides border`)});l({method:
|
|
67
|
+
- omitted: host decides border`)});l({method:c("ui/request-display-mode"),params:l({mode:we.describe("The display mode being requested.")})});var Tu=l({mode:we.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),zu=I([c("model"),c("app")]).describe("Tool visibility scope - who can access the tool.");l({resourceUri:u().optional(),visibility:_(zu).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
68
68
|
- "model": Tool visible to and callable by the agent
|
|
69
|
-
- "app": Tool callable by the app from this server only`)});l({mimeTypes:_(u()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});l({method:
|
|
70
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u().optional().describe("User's timezone in IANA format."),userAgent:u().optional().describe("Host application identifier."),platform:
|
|
71
|
-
<div class="tt-id">${
|
|
72
|
-
<div class="tt-title">${
|
|
73
|
-
<div class="tt-meta">${
|
|
74
|
-
`}function
|
|
69
|
+
- "app": Tool callable by the app from this server only`)});l({mimeTypes:_(u()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});l({method:c("ui/download-file"),params:l({contents:_(I([on,nn])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});l({method:c("ui/message"),params:l({role:c("user").describe('Message role, currently only "user" is supported.'),content:_(Ze).describe("Message content blocks (text, image, etc.).")})});l({method:c("ui/notifications/sandbox-resource-ready"),params:l({html:u().describe("HTML content to load into the inner iframe."),sandbox:u().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Ot.optional().describe("CSP configuration from resource metadata."),permissions:Dt.optional().describe("Sandbox permissions from resource metadata.")})});var Iu=l({method:c("ui/notifications/tool-result"),params:Qe.describe("Standard MCP tool execution result.")}),un=l({toolInfo:l({id:ze.optional().describe("JSON-RPC id of the tools/call request."),tool:At.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:du.optional().describe("Current color theme preference."),styles:yu.optional().describe("Style configuration for theming the app."),displayMode:we.optional().describe("How the UI is currently displayed."),availableDisplayModes:_(we).optional().describe("Display modes the host supports."),containerDimensions:I([l({height:x().describe("Fixed container height in pixels.")}),l({maxHeight:I([x(),st()]).optional().describe("Maximum container height in pixels.")})]).and(I([l({width:x().describe("Fixed container width in pixels.")}),l({maxWidth:I([x(),st()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
70
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:u().optional().describe("User's language and region preference in BCP 47 format."),timeZone:u().optional().describe("User's timezone in IANA format."),userAgent:u().optional().describe("Host application identifier."),platform:I([c("web"),c("desktop"),c("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:l({touch:Z().optional().describe("Whether the device supports touch input."),hover:Z().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:l({top:x().describe("Top safe area inset in pixels."),right:x().describe("Right safe area inset in pixels."),bottom:x().describe("Bottom safe area inset in pixels."),left:x().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),$u=l({method:c("ui/notifications/host-context-changed"),params:un.describe("Partial context update containing only changed fields.")});l({method:c("ui/update-model-context"),params:l({content:_(Ze).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:R(u(),E().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});l({method:c("ui/initialize"),params:l({appInfo:Ge.describe("App identification (name and version)."),appCapabilities:Su.describe("Features and capabilities this app provides."),protocolVersion:u().describe("Protocol version this app supports.")})});var Ru=l({protocolVersion:u().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ge.describe("Host application identification and version."),hostCapabilities:xu.describe("Features and capabilities provided by the host."),hostContext:un.describe("Rich context about the host environment.")}).passthrough();function Pu(e,t=document.documentElement){for(let[o,n]of Object.entries(e))n!==void 0&&t.style.setProperty(o,n)}function Eu(e){if(document.getElementById("__mcp-host-fonts"))return;let t=document.createElement("style");t.id="__mcp-host-fonts",t.textContent=e,document.head.appendChild(t)}class Zu extends cu{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor(t,o={},n={autoResize:!0}){super(n),this._appInfo=t,this._capabilities=o,this.options=n,this.setRequestHandler(Ke,s=>(console.log("Received ping:",s.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(t){this.setNotificationHandler(vu,o=>t(o.params))}set ontoolinputpartial(t){this.setNotificationHandler(_u,o=>t(o.params))}set ontoolresult(t){this.setNotificationHandler(Iu,o=>t(o.params))}set ontoolcancelled(t){this.setNotificationHandler(bu,o=>t(o.params))}set onhostcontextchanged(t){this.setNotificationHandler($u,o=>{this._hostContext={...this._hostContext,...o.params},t(o.params)})}set onteardown(t){this.setRequestHandler(ku,(o,n)=>t(o.params,n))}set oncalltool(t){this.setRequestHandler(rn,(o,n)=>t(o.params,n))}set onlisttools(t){this.setRequestHandler(sn,(o,n)=>t(o.params,n))}assertCapabilityForMethod(t){}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${t} registered`)}}assertNotificationCapability(t){}assertTaskCapability(t){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(t){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(t,o){if(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},Qe,o)}async readServerResource(t,o){return await this.request({method:"resources/read",params:t},tn,o)}async listServerResources(t,o){return await this.request({method:"resources/list",params:t},en,o)}sendMessage(t,o){return this.request({method:"ui/message",params:t},gu,o)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,o){return this.request({method:"ui/update-model-context",params:t},kt,o)}openLink(t,o){return this.request({method:"ui/open-link",params:t},mu,o)}sendOpenLink=this.openLink;downloadFile(t,o){return this.request({method:"ui/download-file",params:t},fu,o)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,o){return this.request({method:"ui/request-display-mode",params:t},Tu,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 i=document.documentElement,a=i.style.width,p=i.style.height;i.style.width="fit-content",i.style.height="max-content";let h=i.getBoundingClientRect();i.style.width=a,i.style.height=p;let g=window.innerWidth-i.clientWidth,m=Math.ceil(h.width+g),v=Math.ceil(h.height);(m!==o||v!==n)&&(o=m,n=v,this.sendSizeChanged({width:m,height:v}))}))};s();let r=new ResizeObserver(s);return r.observe(document.documentElement),r.observe(document.body),()=>r.disconnect()}async connect(t=new cn(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(t);try{let n=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:uu}},Ru,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.options?.autoResize&&this.setupSizeChangedNotifications()}catch(n){throw this.close(),n}}}class po extends Error{structured;constructor(t,o){super(t),this.name="ToolCallError",this.structured=o}}async function Cu(e){const t=new Zu({name:e.name,version:e.version});return t.ontoolresult=o=>{try{const n=o.structuredContent;if(n&&typeof n=="object"&&n.status==="success")ho(e,n.data,n.meta,o);else if(n&&typeof n=="object"&&n.status==="error"){const s=n.message;tt(s||"Unknown error"),e.onError?.(s||"Unknown error")}else{const s=o.content?.find(r=>r.type==="text");if(s&&"text"in s){const r=JSON.parse(s.text);r.status==="success"?ho(e,r.data,r.meta,o):tt(r.message||"Unknown error")}}}catch(n){const s=n instanceof Error?n.message:String(n);tt(`Failed to parse result: ${s}`),e.onError?.(s)}},t.ontoolinput=o=>e.onInput?.(o.arguments??{}),t.onhostcontextchanged=o=>{if(o.styles?.variables&&Pu(o.styles.variables),o.styles?.css?.fonts&&Eu(o.styles.css.fonts),o.safeAreaInsets){const{top:n,right:s,bottom:r,left:i}=o.safeAreaInsets;document.body.style.padding=`${n}px ${s}px ${r}px ${i}px`}},t.onteardown=async()=>({}),await t.connect(new cn(window.parent,window.parent)),t}function ho(e,t,o,n){const s=n._meta;s===void 0?e.onData(t,o):e.onData(t,o,s)}function tt(e){const t=document.querySelector(".atoms-error");t&&t.remove();const o=document.createElement("div");o.className="atoms-error",o.textContent=e,document.body.prepend(o)}async function Nu(e,t,o){return(await qu(e,t,o)).data}async function qu(e,t,o){const n=await e.callServerTool({name:t,arguments:o}),s=n._meta,r=p=>s===void 0?p:{...p,resultMeta:s},i=n.structuredContent;if(i&&typeof i=="object"&&"status"in i){if(i.status==="success")return r({data:i.data,meta:i.meta});throw new po(i.message||"Tool call failed",i)}const a=n.content?.find(p=>p.type==="text");if(a&&"text"in a){const p=JSON.parse(a.text);if(p.status==="success")return r({data:p.data,meta:p.meta});throw new po(p.message||"Tool call failed",p)}throw new Error("No structured or text content in tool response")}const Mu={"&":"&","<":"<",">":">",'"':""","'":"'"};function te(e){return e==null?"":String(e).replace(/[&<>"']/g,t=>Mu[t])}function Au(e){const t=Number(e);return Number.isFinite(t)?t:0}function Ou(e){return`
|
|
71
|
+
<div class="tt-id">${te(e.id)}</div>
|
|
72
|
+
<div class="tt-title">${te(e.title)}</div>
|
|
73
|
+
<div class="tt-meta">${te(e.type)} · ${te(e.relationship)}${e.isRoot?" (root)":""}</div>
|
|
74
|
+
`}function Du(e){return e==="requirement"||e==="test-case"?"rect":e==="function"?"hexagon":"diamond"}function ln(e,t,o,n){const s=o/2,r=n/2,i=Math.min(r,o/6);return[[e-s+i,t-r],[e+s-i,t-r],[e+s,t],[e+s-i,t+r],[e-s+i,t+r],[e-s,t]]}const dn={requirement:"#a855f7","test-case":"#e4e4e7",note:"#a855f780",function:"#14b8a6"},at={parent:{dash:[],color:"#888"},child:{dash:[],color:"#888"},verifies:{dash:[6,3],color:"#a855f7"},verified_by:{dash:[6,3],color:"#a855f7"},related:{dash:[2,2],color:"#666"},allocated_to:{dash:[8,3,2,3],color:"#14b8a6"},allocated_from:{dash:[8,3,2,3],color:"#14b8a6"}};function pn(e){const t=dn.function,o=at.allocated_to,n=ln(10,6,18,10).map(([s,r])=>`${s},${r}`).join(" ");return`
|
|
75
75
|
<div class="legend-item"><div class="legend-shape" style="background:#a855f7"></div>Requirement</div>
|
|
76
76
|
<div class="legend-item"><div class="legend-shape" style="background:#e4e4e7"></div>Test Case</div>
|
|
77
77
|
<div class="legend-item"><div class="legend-shape" style="background:rgba(168,85,247,0.6);transform:rotate(45deg);width:10px;height:10px"></div>Note</div>
|
|
78
|
-
${e?`<div class="legend-item" data-legend="function"><svg width="20" height="12"><polygon points="${n}" fill="${t}"/></svg>Function</div>
|
|
78
|
+
${e?`<div class="legend-item" data-legend="function"><svg width="20" height="12"><polygon points="${te(n)}" fill="${te(t)}"/></svg>Function</div>
|
|
79
79
|
`:""}<div class="legend-item"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="#888" stroke-width="1.5"/></svg>Parent/Child</div>
|
|
80
80
|
<div class="legend-item"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="#a855f7" stroke-width="1.5" stroke-dasharray="6,3"/></svg>Verifies</div>
|
|
81
|
-
${e?`<div class="legend-item" data-legend="allocation"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="${o.color}" stroke-width="1.5" stroke-dasharray="${o.dash.join(",")}"/></svg>Allocation</div>
|
|
82
|
-
`:""}`}function
|
|
81
|
+
${e?`<div class="legend-item" data-legend="allocation"><svg width="20" height="10"><line x1="0" y1="5" x2="20" y2="5" stroke="${te(o.color)}" stroke-width="1.5" stroke-dasharray="${te(o.dash.join(","))}"/></svg>Allocation</div>
|
|
82
|
+
`:""}`}function Lu(e,t){return t==="function"?!0:e.some(o=>o.type==="function"||o.relationship==="allocated_to"||o.relationship==="allocated_from")}const hn=document.createElement("style");hn.textContent=`
|
|
83
83
|
#graph-canvas {
|
|
84
84
|
display: block;
|
|
85
85
|
width: 100%;
|
|
@@ -188,27 +188,27 @@ container holding the app. Specify either width or maxWidth, and either height o
|
|
|
188
188
|
height: 12px;
|
|
189
189
|
flex-shrink: 0;
|
|
190
190
|
}
|
|
191
|
-
`;document.head.appendChild(
|
|
191
|
+
`;document.head.appendChild(hn);const H=document.getElementById("graph-canvas"),ge=document.getElementById("tooltip"),Oe=document.getElementById("loading"),Lt=document.getElementById("stats");let ee=[],De=[],ye=0,ke=0,Q=1,jt=!1,mn=0,fn=0,ct=null,ut="",lt="",X=5,ue="downstream",le=!1,ce=null;function gn(e){const t=new Map,o=typeof e.root=="object"?e.root.id:e.root,n=typeof e.root=="object"?e.root.title:e.root,s=typeof e.root=="object"?e.root.type:"requirement",r=le?e.items:e.items.filter(S=>S.type!=="test-case"),i=110,a=36,p=16,h=60,g=60,m=new Map;for(const S of r)m.has(S.depth)||m.set(S.depth,[]),m.get(S.depth).push(S);const v=Math.max(0,...Array.from(m.keys()));let y=i;for(const[,S]of m){const D=S.length*(i+p)-p;D>y&&(y=D)}const b=y/2+60;t.set(o,{id:o,title:n,type:s,relationship:"root",depth:0,x:b,y:g+a/2,vx:0,vy:0,isRoot:!0});for(let S=1;S<=v;S++){const D=m.get(S)??[],w=D.length*(i+p)-p,k=b-w/2+i/2,P=g+a/2+S*(a+h);D.forEach((F,Y)=>{t.set(F.id,{id:F.id,title:F.title,type:F.type,relationship:F.relationship,depth:F.depth,x:k+Y*(i+p),y:P,vx:0,vy:0,isRoot:!1})})}ee=Array.from(t.values()),De=[];for(const S of r)S.depth===1&&De.push({source:o,target:S.id,type:S.relationship});const z=new Map;z.set(0,[o]);for(const S of r)z.has(S.depth)||z.set(S.depth,[]),z.get(S.depth).push(S.id);for(const S of r){if(S.depth<=1)continue;const D=z.get(S.depth-1)??[];if(D.length>0){const w=t.get(S.id);if(!w)continue;let k=D[0],P=1/0;for(const F of D){const Y=t.get(F);if(!Y)continue;const me=Math.abs(Y.x-w.x);me<P&&(P=me,k=F)}De.push({source:k,target:S.id,type:S.relationship})}}}function dt(){if(ee.length===0)return;const e=window.devicePixelRatio||1,t=60,o=22;let n=1/0,s=1/0,r=-1/0,i=-1/0;for(const b of ee)n=Math.min(n,b.x-t),s=Math.min(s,b.y-o),r=Math.max(r,b.x+t),i=Math.max(i,b.y+o);const a=r-n,p=i-s;if(a===0||p===0)return;const h=H.width/e,g=H.height/e,m=24;Q=Math.min((h-m*2)/a,(g-m*2)/p);const v=(n+r)/2,y=(s+i)/2;ye=h/2-v*Q,ke=g/2-y*Q}function pe(){const e=H.getContext("2d"),t=window.devicePixelRatio||1;e.clearRect(0,0,H.width,H.height),e.save(),e.scale(t,t),e.translate(ye,ke),e.scale(Q,Q);const o=new Map(ee.map(n=>[n.id,n]));for(const n of De){const s=o.get(n.source),r=o.get(n.target);if(!s||!r)continue;const i=at[n.type]??at.related;e.beginPath(),e.strokeStyle=i.color,e.lineWidth=1,e.setLineDash(i.dash);const a=s.y+18,p=r.y-18,h=(a+p)/2;e.moveTo(s.x,a),e.lineTo(s.x,h),e.lineTo(r.x,h),e.lineTo(r.x,p),e.stroke(),e.setLineDash([]);const g=6;e.beginPath(),e.moveTo(r.x,p),e.lineTo(r.x-g*.5,p-g),e.lineTo(r.x+g*.5,p-g),e.closePath(),e.fillStyle=i.color,e.fill()}for(const n of ee){const s=dn[n.type]??"#888",r=100,i=36;e.fillStyle="#1a1a1a",e.strokeStyle=s,e.lineWidth=n.isRoot?3:1.5;const a=Du(n.type);if(a==="rect")e.beginPath(),e.rect(n.x-r/2,n.y-i/2,r,i),e.fill(),e.stroke();else if(a==="hexagon"){const h=ln(n.x,n.y,r,i);e.beginPath(),e.moveTo(h[0][0],h[0][1]);for(const[g,m]of h.slice(1))e.lineTo(g,m);e.closePath(),e.fill(),e.stroke()}else{const h=r/2,g=i/2;e.beginPath(),e.moveTo(n.x,n.y-g),e.lineTo(n.x+h,n.y),e.lineTo(n.x,n.y+g),e.lineTo(n.x-h,n.y),e.closePath(),e.fill(),e.stroke()}n.isRoot&&(e.shadowColor="#a855f7",e.shadowBlur=12,e.strokeStyle="#a855f7",e.lineWidth=2,e.stroke(),e.shadowBlur=0),e.fillStyle="#e0e0e0",e.font=`500 11px ${getComputedStyle(document.body).getPropertyValue("--font-main").trim()||"'IBM Plex Sans', sans-serif"}`,e.textAlign="center",e.textBaseline="middle";const p=n.id.length>14?n.id.substring(0,12)+"...":n.id;e.fillText(p,n.x,n.y)}e.restore()}function Ut(){const e=window.devicePixelRatio||1,t=H.getBoundingClientRect();t.width===0||t.height===0||(H.width=t.width*e,H.height=t.height*e,ee.length>0&&pe())}H.addEventListener("mousedown",e=>{jt=!0,mn=e.clientX-ye,fn=e.clientY-ke});H.addEventListener("mousemove",e=>{if(jt){ye=e.clientX-mn,ke=e.clientY-fn,pe();return}const t=H.getBoundingClientRect(),o=(e.clientX-t.left-ye)/Q,n=(e.clientY-t.top-ke)/Q;let s=null;for(let r=ee.length-1;r>=0;r--){const i=ee[r];if(Math.abs(o-i.x)<55&&Math.abs(n-i.y)<18){s=i;break}}s?(ge.style.display="block",ge.style.left=`${e.clientX-t.left+12}px`,ge.style.top=`${e.clientY-t.top-10}px`,ge.innerHTML=Ou(s)):ge.style.display="none"});H.addEventListener("mouseup",()=>{jt=!1});H.addEventListener("wheel",e=>{e.preventDefault(),Q*=e.deltaY>0?.95:1.05,Q=Math.max(.1,Math.min(3,Q)),pe()},{passive:!1});window.addEventListener("resize",Ut);let mo=window.devicePixelRatio||1;window.matchMedia(`(resolution: ${mo}dppx)`).addEventListener("change",()=>{mo=window.devicePixelRatio||1,Ut()});function ju(){const e=document.getElementById("toolbar");e.innerHTML=`
|
|
192
192
|
<span class="toolbar-label">Root:</span>
|
|
193
193
|
<span class="toolbar-value" id="root-id"></span>
|
|
194
194
|
<span class="toolbar-label">Direction:</span>
|
|
195
195
|
<select class="trace-select" id="direction-select">
|
|
196
|
-
<option value="downstream"${
|
|
197
|
-
<option value="upstream"${
|
|
198
|
-
<option value="both"${
|
|
196
|
+
<option value="downstream"${ue==="downstream"?" selected":""}>Downstream</option>
|
|
197
|
+
<option value="upstream"${ue==="upstream"?" selected":""}>Upstream</option>
|
|
198
|
+
<option value="both"${ue==="both"?" selected":""}>Both</option>
|
|
199
199
|
</select>
|
|
200
200
|
<span class="toolbar-label">Depth:</span>
|
|
201
201
|
<span class="trace-stepper">
|
|
202
202
|
<button class="trace-stepper-btn" id="depth-down">-</button>
|
|
203
|
-
<span class="trace-stepper-value" id="depth-value">${X}</span>
|
|
203
|
+
<span class="trace-stepper-value" id="depth-value">${Au(X)}</span>
|
|
204
204
|
<button class="trace-stepper-btn" id="depth-up">+</button>
|
|
205
205
|
</span>
|
|
206
206
|
<button class="trace-stepper-btn" id="fit-btn" title="Fit to view" style="margin-left:8px;padding:2px 10px">⤢</button>
|
|
207
207
|
<label style="margin-left:12px;display:flex;align-items:center;gap:4px;font-size:11px;color:var(--text-secondary);cursor:pointer;user-select:none">
|
|
208
|
-
<input type="checkbox" id="show-tests" ${
|
|
208
|
+
<input type="checkbox" id="show-tests" ${le?"checked":""} style="cursor:pointer;accent-color:#a855f7" />
|
|
209
209
|
Show Tests
|
|
210
210
|
</label>
|
|
211
|
-
`,document.getElementById("direction-select").addEventListener("change",t=>{
|
|
211
|
+
`,document.getElementById("direction-select").addEventListener("change",t=>{ue=t.target.value,ot()}),document.getElementById("depth-down").addEventListener("click",()=>{X>1&&(X--,document.getElementById("depth-value").textContent=String(X),ot())}),document.getElementById("depth-up").addEventListener("click",()=>{X<10&&(X++,document.getElementById("depth-value").textContent=String(X),ot())}),document.getElementById("fit-btn").addEventListener("click",()=>{dt(),pe()}),document.getElementById("show-tests").addEventListener("change",t=>{if(le=t.target.checked,ce){gn(ce),dt(),pe();const o=ee.length,n=typeof ce.root=="object"?ce.root.id:ce.root;Lt.textContent=`${o} items traced from ${n}${le?"":" (tests hidden)"}`}})}async function ot(){if(!(!ct||!ut||!lt)){H.style.display="none",Oe.style.display="",Oe.textContent="Reloading...";try{const e=await Nu(ct,"atoms_trace",{project_id:ut,item_id:lt,direction:ue,depth:X});vn(e)}catch(e){Oe.style.display="none",H.style.display="block",Lt.textContent=`Error: ${e instanceof Error?e.message:String(e)}`}}}function vn(e){Oe.style.display="none",H.style.display="block",ce=e;const t=typeof e.root=="object"?e.root.id:e.root,o=typeof e.root=="object"?`${e.root.id}: ${e.root.title}`:e.root;lt=t,ue=e.direction,X=e.depth_limit;const n=e.items.filter(r=>r.type==="test-case").length,s=le?e.total_count:e.total_count-n;Lt.textContent=`${s} items traced from ${t}${!le&&n>0?` (${n} tests hidden)`:""}`,document.getElementById("root-id").textContent=o,Ut(),gn(e),Ye.innerHTML=pn(Lu(e.items,typeof e.root=="object"?e.root.type:void 0)),dt(),pe()}const Ye=document.createElement("div");Ye.className="legend";Ye.innerHTML=pn(!1);document.getElementById("app").appendChild(Ye);Cu({name:"ATOMS Trace Graph",version:"1.0.0",onData:e=>{const t=e;t.project_id&&(ut=t.project_id),ju(),vn(t)}}).then(e=>{ct=e});</script>
|
|
212
212
|
<style rel="stylesheet" crossorigin>@import"https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap";:root{--atoms-purple: #a855f7;--atoms-purple-light: #c084fc;--atoms-purple-hover: #b975f9;--atoms-green: #22c55e;--atoms-green-light: #4ade80;--atoms-red: #ef4444;--atoms-red-light: #f87171;--atoms-amber: #f59e0b;--atoms-blue: #58a6ff;--tc-color: #e4e4e7;--note-color: rgba(168, 85, 247, .6);--bg-primary: #0c0c0c;--bg-secondary: #121212;--bg-tertiary: #181818;--text-primary: #fafafa;--text-secondary: #a0a0a0;--text-muted: #606060;--border-color: #252525;--font-main: "IBM Plex Sans", sans-serif;--font-code: "IBM Plex Mono", monospace;color-scheme:dark}*{margin:0;padding:0;box-sizing:border-box}body{font-family:var(--font-main);background:var(--bg-primary);color:var(--text-primary);line-height:1.5;-webkit-font-smoothing:antialiased}.atoms-card{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:0;padding:16px}.atoms-header{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border-color);background:var(--bg-secondary)}.atoms-header .logo{width:20px;height:20px}.atoms-header .title{font-size:14px;font-weight:600;color:var(--text-primary)}.atoms-header .subtitle{font-size:12px;color:var(--text-muted);margin-left:auto}.atoms-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;font-size:12px;font-weight:500;font-family:var(--font-main);border:1px solid var(--border-color);border-radius:0;background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background .1s ease}.atoms-btn:hover{background:var(--bg-tertiary)}.atoms-btn-primary{background:var(--atoms-purple);color:#fff;border-color:var(--atoms-purple)}.atoms-btn-primary:hover{background:var(--atoms-purple-hover)}.atoms-watermark{position:fixed;bottom:8px;right:12px;display:flex;align-items:center;gap:6px;font-size:10px;color:var(--text-muted);opacity:.5;font-family:var(--font-main);pointer-events:none}.atoms-watermark img{width:14px;height:14px;opacity:.6}.atoms-loading{display:flex;align-items:center;justify-content:center;min-height:200px;color:var(--text-muted);font-size:13px}.atoms-loading:before{content:"";width:16px;height:16px;border:2px solid var(--border-color);border-top-color:var(--atoms-purple);border-radius:50%;margin-right:10px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.atoms-error{padding:16px;background:color-mix(in srgb,var(--atoms-red) 10%,var(--bg-primary));border:1px solid var(--atoms-red);color:var(--text-primary);font-size:13px}.atoms-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;padding:16px}.atoms-metric{background:var(--bg-secondary);border:1px solid var(--border-color);padding:12px;text-align:center}.atoms-metric .value{font-size:24px;font-weight:700;color:var(--atoms-purple);font-variant-numeric:tabular-nums}.atoms-metric .label{font-size:11px;font-weight:500;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px;margin-top:4px}.atoms-toolbar{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--border-color);background:var(--bg-secondary);flex-wrap:wrap}</style>
|
|
213
213
|
</head>
|
|
214
214
|
<body>
|