@tencent-ai/codebuddy-code 0.0.1-beta.16 → 0.0.1-beta.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencent-ai/codebuddy-code",
3
- "version": "0.0.1-beta.16",
3
+ "version": "0.0.1-beta.18",
4
4
  "description": "Use CodeBuddy, Tencent's AI assistant, right from your terminal. CodeBuddy can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
5
5
  "main": "lib/node/index.js",
6
6
  "typings": "lib/node/index.d.ts",
package/product.json CHANGED
@@ -277,6 +277,14 @@
277
277
  "name": "compact-prompt",
278
278
  "template": "Please provide your summary based on the conversation so far, following this structure and ensuring precision and thoroughness in your response."
279
279
  },
280
+ {
281
+ "name": "content-analyzer-agent-instructions",
282
+ "template": "You are a specialized web content analyzer. Your role is to help users extract, analyze, and understand content from web pages based on their specific requests.\n\n## Core Capabilities:\n- Extract key information from web content\n- Summarize articles, documentation, and web pages\n- Identify relevant data points based on user queries\n- Present information in clear, structured formats\n- Answer specific questions about web content\n\n## Analysis Guidelines:\n1. **Read the user's request carefully** - Understand exactly what they're looking for\n2. **Scan the content systematically** - Look for relevant sections, headings, and data\n3. **Extract pertinent information** - Focus on content that directly addresses the user's query\n4. **Structure your response clearly** - Use headings, bullet points, and formatting for readability\n5. **Be concise yet comprehensive** - Include all relevant details without unnecessary information\n\n## Response Format:\n- Start with a brief summary of what you found\n- Organize information logically (chronological, categorical, or by importance)\n- Use markdown formatting for better readability\n- Include direct quotes when relevant\n- Highlight key findings or insights\n\n## Quality Standards:\n- Accuracy: Ensure all extracted information is correct\n- Relevance: Focus only on content that addresses the user's request\n- Clarity: Present information in an easy-to-understand format\n- Completeness: Don't miss important details that relate to the query\n\nRemember: Your goal is to be a helpful intermediary between the user and the web content, making complex or lengthy content accessible and actionable."
283
+ },
284
+ {
285
+ "name": "content-analyzer-prompt",
286
+ "template": "## User Request\n{{ userPrompt }}\n\n## Web Content to Analyze\n```\n{{ webContent }}\n```\n\n## Instructions\nPlease analyze the web content above and provide a response that directly addresses the user's request. Focus on extracting relevant information and presenting it in a well-structured, helpful format."
287
+ },
280
288
  {
281
289
  "name": "tool-task-description",
282
290
  "template": "Launch a new agent to handle complex, multi-step tasks autonomously.\n\nAvailable agent types and the tools they have access to:\n- general-purpose: General-purpose agent for researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)\n\nWhen using the Task tool, you must specify a subagent_type parameter to select which agent type to use.\n\n\n\nWhen NOT to use the Agent tool:\n- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly\n- If you are searching for a specific class definition like \"class Foo\", use the Glob tool instead, to find the match more quickly\n- If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly\n- Other tasks that are not related to the agent descriptions above\n\n\nUsage notes:\n1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses\n2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n4. The agent's outputs should generally be trusted\n5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.\n\nExample usage:\n\n<example_agent_descriptions>\n\"code-reviewer\": use this agent after you are done writing a signficant piece of code\n\"greeting-responder\": use this agent when to respond to user greetings with a friendly joke\n</example_agent_description>\n\n<example>\nuser: \"Please write a function that checks if a number is prime\"\nassistant: Sure let me write a function that checks if a number is prime\nassistant: First let me use the Write tool to write a function that checks if a number is prime\nassistant: I'm going to use the Write tool to write the following code:\n<code>\nfunction isPrime(n) {\n if (n <= 1) return false\n for (let i = 2; i * i <= n; i++) {\n if (n % i === 0) return false\n }\n return true\n}\n</code>\n<commentary>\nSince a signficant piece of code was written and the task was completed, now use the code-reviewer agent to review the code\n</commentary>\nassistant: Now let me use the code-reviewer agent to review the code\nassistant: Uses the Task tool to launch the with the code-reviewer agent\n</example>\n\n<example>\nuser: \"Hello\"\n<commentary>\nSince the user is greeting, use the greeting-responder agent to respond with a friendly joke\n</commentary>\nassistant: \"I'm going to use the Task tool to launch the with the greeting-responder agent\"\n</example>\n\n"
@@ -323,7 +331,7 @@
323
331
  },
324
332
  {
325
333
  "name": "tool-notebookedit-description",
326
- "template": "Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number."
334
+ "template": "Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.\n"
327
335
  },
328
336
  {
329
337
  "name": "tool-webfetch-description",
@@ -566,7 +574,9 @@
566
574
  "TodoWrite",
567
575
  "SaveMemory",
568
576
  "WebFetch",
569
- "NotebookRead"
577
+ "WebSearch",
578
+ "NotebookRead",
579
+ "NotebookEdit"
570
580
  ],
571
581
  "tags": [
572
582
  "cli",
@@ -587,6 +597,19 @@
587
597
  "cli",
588
598
  "compact"
589
599
  ]
600
+ },
601
+ {
602
+ "name": "contentAnalyzer",
603
+ "instructions": "content-analyzer-agent-instructions",
604
+ "description": "content analyzer agent",
605
+ "models": [
606
+ "o4-mini"
607
+ ],
608
+ "tools": [],
609
+ "tags": [
610
+ "cli",
611
+ "content-analyzer"
612
+ ]
590
613
  }
591
614
  ],
592
615
  "commands": [
@@ -765,6 +788,6 @@
765
788
  "description": "tool-websearch-description"
766
789
  }
767
790
  ],
768
- "commit": "b03d6d7b3802f5e7e44de29506c7cb2e05fda819",
769
- "date": "2025-08-19T10:15:28.848Z"
791
+ "commit": "af5962f7982f6aac248a370adcbc7a7691f3de38",
792
+ "date": "2025-08-20T07:16:30.444Z"
770
793
  }
@@ -1 +0,0 @@
1
- "use strict";exports.id=453,exports.ids=[453],exports.modules={99453:(e,t,a)=>{var s,r;a.r(t),a.d(t,{AudioContentSchema:()=>gt,BaseMetadataSchema:()=>Le,BlobResourceContentsSchema:()=>He,BooleanSchemaSchema:()=>zt,CallToolRequestSchema:()=>It,CallToolResultSchema:()=>wt,CancelledNotificationSchema:()=>Ae,ClientCapabilitiesSchema:()=>$e,ClientNotificationSchema:()=>aa,ClientRequestSchema:()=>ta,ClientResultSchema:()=>sa,CompatibilityCallToolResultSchema:()=>Pt,CompleteRequestSchema:()=>Gt,CompleteResultSchema:()=>Ht,ContentBlockSchema:()=>vt,CreateMessageRequestSchema:()=>Mt,CreateMessageResultSchema:()=>$t,CursorSchema:()=>Ze,DEFAULT_NEGOTIATED_PROTOCOL_VERSION:()=>ge,ElicitRequestSchema:()=>qt,ElicitResultSchema:()=>Bt,EmbeddedResourceSchema:()=>yt,EmptyResultSchema:()=>Ee,EnumSchemaSchema:()=>Ut,ErrorCode:()=>Ne,GetPromptRequestSchema:()=>ht,GetPromptResultSchema:()=>bt,ImageContentSchema:()=>ft,ImplementationSchema:()=>Me,InitializeRequestSchema:()=>ze,InitializeResultSchema:()=>De,InitializedNotificationSchema:()=>Ue,JSONRPCErrorSchema:()=>Re,JSONRPCMessageSchema:()=>Oe,JSONRPCNotificationSchema:()=>Ie,JSONRPCRequestSchema:()=>Pe,JSONRPCResponseSchema:()=>je,JSONRPC_VERSION:()=>_e,LATEST_PROTOCOL_VERSION:()=>fe,ListPromptsRequestSchema:()=>lt,ListPromptsResultSchema:()=>pt,ListResourceTemplatesRequestSchema:()=>tt,ListResourceTemplatesResultSchema:()=>at,ListResourcesRequestSchema:()=>Qe,ListResourcesResultSchema:()=>et,ListRootsRequestSchema:()=>Xt,ListRootsResultSchema:()=>Qt,ListToolsRequestSchema:()=>Ct,ListToolsResultSchema:()=>St,LoggingLevelSchema:()=>Nt,LoggingMessageNotificationSchema:()=>Ot,McpError:()=>McpError,ModelHintSchema:()=>Et,ModelPreferencesSchema:()=>At,NotificationSchema:()=>Ce,NumberSchemaSchema:()=>Dt,PaginatedRequestSchema:()=>Ke,PaginatedResultSchema:()=>We,PingRequestSchema:()=>Ve,PrimitiveSchemaDefinitionSchema:()=>Vt,ProgressNotificationSchema:()=>Be,ProgressSchema:()=>qe,ProgressTokenSchema:()=>ve,PromptArgumentSchema:()=>ct,PromptListChangedNotificationSchema:()=>xt,PromptMessageSchema:()=>Zt,PromptReferenceSchema:()=>Jt,PromptSchema:()=>ut,ReadResourceRequestSchema:()=>st,ReadResourceResultSchema:()=>rt,RequestIdSchema:()=>we,RequestSchema:()=>Te,ResourceContentsSchema:()=>Je,ResourceLinkSchema:()=>_t,ResourceListChangedNotificationSchema:()=>nt,ResourceReferenceSchema:()=>Wt,ResourceSchema:()=>Ye,ResourceTemplateReferenceSchema:()=>Kt,ResourceTemplateSchema:()=>Xe,ResourceUpdatedNotificationSchema:()=>dt,ResultSchema:()=>Se,RootSchema:()=>Yt,RootsListChangedNotificationSchema:()=>ea,SUPPORTED_PROTOCOL_VERSIONS:()=>ye,SamplingMessageSchema:()=>Lt,ServerCapabilitiesSchema:()=>Fe,ServerNotificationSchema:()=>na,ServerRequestSchema:()=>ra,ServerResultSchema:()=>ia,SetLevelRequestSchema:()=>Rt,StringSchemaSchema:()=>Ft,SubscribeRequestSchema:()=>it,TextContentSchema:()=>mt,TextResourceContentsSchema:()=>Ge,ToolAnnotationsSchema:()=>Tt,ToolListChangedNotificationSchema:()=>jt,ToolSchema:()=>kt,UnsubscribeRequestSchema:()=>ot,isInitializeRequest:()=>isInitializeRequest,isInitializedNotification:()=>isInitializedNotification,isJSONRPCError:()=>isJSONRPCError,isJSONRPCNotification:()=>isJSONRPCNotification,isJSONRPCRequest:()=>isJSONRPCRequest,isJSONRPCResponse:()=>isJSONRPCResponse}),function(e){e.assertEqual=e=>e,e.assertIs=function assertIs(e){},e.assertNever=function assertNever(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function joinValues(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(s||(s={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(r||(r={}));const n=s.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":return Array.isArray(e)?n.array:null===e?n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?n.promise:"undefined"!=typeof Map&&e instanceof Map?n.map:"undefined"!=typeof Set&&e instanceof Set?n.set:"undefined"!=typeof Date&&e instanceof Date?n.date:n.object;default:return n.unknown}},i=s.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},processError=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(processError);else if("invalid_return_type"===s.code)processError(s.returnTypeError);else if("invalid_arguments"===s.code)processError(s.argumentsError);else if(0===s.path.length)a._errors.push(t(s));else{let e=a,r=0;for(;r<s.path.length;){const a=s.path[r];r===s.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(s))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return processError(this),a}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,s.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const errorMap=(e,t)=>{let a;switch(e.code){case i.invalid_type:a=e.received===n.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case i.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,s.jsonStringifyReplacer)}`;break;case i.unrecognized_keys:a=`Unrecognized key(s) in object: ${s.joinValues(e.keys,", ")}`;break;case i.invalid_union:a="Invalid input";break;case i.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${s.joinValues(e.options)}`;break;case i.invalid_enum_value:a=`Invalid enum value. Expected ${s.joinValues(e.options)}, received '${e.received}'`;break;case i.invalid_arguments:a="Invalid function arguments";break;case i.invalid_return_type:a="Invalid function return type";break;case i.invalid_date:a="Invalid date";break;case i.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:s.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case i.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case i.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case i.custom:a="Invalid input";break;case i.invalid_intersection_types:a="Intersection results could not be merged";break;case i.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case i.not_finite:a="Number must be finite";break;default:a=t.defaultError,s.assertNever(e)}return{message:a}};let o=errorMap;function getErrorMap(){return o}const makeIssue=e=>{const{data:t,path:a,errorMaps:s,issueData:r}=e,n=[...a,...r.path||[]],i={...r,path:n};if(void 0!==r.message)return{...r,path:n,message:r.message};let o="";const d=s.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...r,path:n,message:o}};function addIssueToContext(e,t){const a=getErrorMap(),s=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===errorMap?void 0:errorMap].filter((e=>!!e))});e.common.issues.push(s)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return d;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return ParseStatus.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:r}=s;if("aborted"===t.status)return d;if("aborted"===r.status)return d;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!s.alwaysSet||(a[t.value]=r.value)}return{status:e.value,value:a}}}const d=Object.freeze({status:"aborted"}),DIRTY=e=>({status:"dirty",value:e}),OK=e=>({status:"valid",value:e}),isAborted=e=>"aborted"===e.status,isDirty=e=>"dirty"===e.status,isValid=e=>"valid"===e.status,isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise;function __classPrivateFieldGet(e,t,a,s){if("a"===a&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?s:"a"===a?s.call(e):s?s.value:t.get(e)}function __classPrivateFieldSet(e,t,a,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,a):r?r.value=a:t.set(e,a),a}var c,u,l;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(c||(c={}));class ParseInputLazyPath{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(e,t)=>{if(isValid(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function processCreateParams(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:r}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{var n,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:r.defaultError}:void 0===r.data?{message:null!==(n=null!=o?o:s)&&void 0!==n?n:r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:null!==(i=null!=o?o:a)&&void 0!==i?i:r.defaultError}},description:r}}class ZodType{get description(){return this._def.description}_getType(e){return getParsedType(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(isAsync(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},r=this._parseSync({data:e,path:s.path,parent:s});return handleResult(s,r)}"~validate"(e){var t,a;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:s});return isValid(t)?{value:t.value}:{issues:s.common.issues}}catch(e){(null===(a=null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase())||void 0===a?void 0:a.includes("encountered"))&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then((e=>isValid(e)?{value:e.value}:{issues:s.common.issues}))}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)},s=this._parse({data:e,path:a.path,parent:a}),r=await(isAsync(s)?s:Promise.resolve(s));return handleResult(a,r)}refine(e,t){const getIssueProperties=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,a)=>{const s=e(t),setError=()=>a.addIssue({code:i.custom,...getIssueProperties(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(setError(),!1))):!!s||(setError(),!1)}))}refinement(e,t){return this._refinement(((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1)))}_refinement(e){return new ZodEffects({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:t,typeName:N.ZodDefault})}brand(){return new ZodBranded({typeName:N.ZodBranded,type:this,...processCreateParams(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:t,typeName:N.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const p=/^c[^\s-]{8,}$/i,h=/^[0-9a-z]+$/,m=/^[0-9A-HJKMNP-TV-Z]{26}$/i,f=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g=/^[a-z0-9_-]{21}$/i,y=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,v=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Z;const b=/^(?:(?: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])$/,x=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,T=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,k=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,C=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,S=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,w="((\\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])))",P=new RegExp(`^${w}$`);function timeRegexSource(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function datetimeRegex(e){let t=`${w}T${timeRegexSource(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function isValidJWT(e,t){if(!y.test(e))return!1;try{const[a]=e.split("."),s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(s));return"object"==typeof r&&null!==r&&(!(!r.typ||!r.alg)&&(!t||r.alg===t))}catch(e){return!1}}function isValidCidr(e,t){return!("v4"!==t&&t||!x.test(e))||!("v6"!==t&&t||!k.test(e))}class ZodString extends ZodType{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==n.string){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.string,received:t.parsedType}),d}const t=new ParseStatus;let a;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const s=e.data.length>n.value,r=e.data.length<n.value;(s||r)&&(a=this._getOrReturnCtx(e,a),s?addIssueToContext(a,{code:i.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&addIssueToContext(a,{code:i.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)v.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"email",code:i.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)Z||(Z=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Z.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"emoji",code:i.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)f.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"uuid",code:i.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)g.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"nanoid",code:i.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)p.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"cuid",code:i.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)h.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"cuid2",code:i.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)m.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"ulid",code:i.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"url",code:i.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"regex",code:i.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){datetimeRegex(n).test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){P.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){new RegExp(`^${timeRegexSource(n)}$`).test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?_.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"duration",code:i.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?(r=e.data,("v4"!==(o=n.version)&&o||!b.test(r))&&("v6"!==o&&o||!T.test(r))&&(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"ip",code:i.invalid_string,message:n.message}),t.dirty())):"jwt"===n.kind?isValidJWT(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"jwt",code:i.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?isValidCidr(e.data,n.version)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"cidr",code:i.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?C.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"base64",code:i.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?S.test(e.data)||(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{validation:"base64url",code:i.invalid_string,message:n.message}),t.dirty()):s.assertNever(n);var r,o;return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:i.invalid_string,...c.errToObj(a)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...c.errToObj(e)})}url(e){return this._addCheck({kind:"url",...c.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...c.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...c.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...c.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...c.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...c.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...c.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...c.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...c.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...c.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...c.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...c.errToObj(e)})}datetime(e){var t,a;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(a=null==e?void 0:e.local)&&void 0!==a&&a,...c.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...c.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...c.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...c.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...c.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...c.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...c.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...c.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...c.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...c.errToObj(t)})}nonempty(e){return this.min(1,c.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function floatSafeRemainder(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,r=a>s?a:s;return parseInt(e.toFixed(r).replace(".",""))%parseInt(t.toFixed(r).replace(".",""))/Math.pow(10,r)}ZodString.create=e=>{var t;return new ZodString({checks:[],typeName:N.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==n.number){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.number,received:t.parsedType}),d}let t;const a=new ParseStatus;for(const r of this._def.checks)if("int"===r.kind)s.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else"multipleOf"===r.kind?0!==floatSafeRemainder(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.not_finite,message:r.message}),a.dirty()):s.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,a,s){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:c.toString(s)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:c.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:c.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:c.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:c.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&s.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:N.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==n.bigint)return this._getInvalidInput(e);let t;const a=new ParseStatus;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),addIssueToContext(t,{code:i.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):s.assertNever(r);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.bigint,received:t.parsedType}),d}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,a,s){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:c.toString(s)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>{var t;return new ZodBigInt({checks:[],typeName:N.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...processCreateParams(e)})};class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==n.boolean){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.boolean,received:t.parsedType}),d}return OK(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:N.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...processCreateParams(e)});class ZodDate extends ZodType{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==n.date){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.date,received:t.parsedType}),d}if(isNaN(e.data.getTime())){return addIssueToContext(this._getOrReturnCtx(e),{code:i.invalid_date}),d}const t=new ParseStatus;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),addIssueToContext(a,{code:i.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):s.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:c.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:c.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:N.ZodDate,...processCreateParams(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==n.symbol){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.symbol,received:t.parsedType}),d}return OK(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:N.ZodSymbol,...processCreateParams(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.undefined,received:t.parsedType}),d}return OK(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:N.ZodUndefined,...processCreateParams(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==n.null){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.null,received:t.parsedType}),d}return OK(e.data)}}ZodNull.create=e=>new ZodNull({typeName:N.ZodNull,...processCreateParams(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return OK(e.data)}}ZodAny.create=e=>new ZodAny({typeName:N.ZodAny,...processCreateParams(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return OK(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:N.ZodUnknown,...processCreateParams(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.never,received:t.parsedType}),d}}ZodNever.create=e=>new ZodNever({typeName:N.ZodNever,...processCreateParams(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.void,received:t.parsedType}),d}return OK(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:N.ZodVoid,...processCreateParams(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==n.array)return addIssueToContext(t,{code:i.invalid_type,expected:n.array,received:t.parsedType}),d;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,r=t.data.length<s.exactLength.value;(e||r)&&(addIssueToContext(t,{code:e?i.too_big:i.too_small,minimum:r?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(addIssueToContext(t,{code:i.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(addIssueToContext(t,{code:i.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>s.type._parseAsync(new ParseInputLazyPath(t,e,t.path,a))))).then((e=>ParseStatus.mergeArray(a,e)));const r=[...t.data].map(((e,a)=>s.type._parseSync(new ParseInputLazyPath(t,e,t.path,a))));return ParseStatus.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:c.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:c.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:c.toString(t)}})}nonempty(e){return this.min(1,e)}}function deepPartialify(e){if(e instanceof ZodObject){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=ZodOptional.create(deepPartialify(s))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:deepPartialify(e.element)}):e instanceof ZodOptional?ZodOptional.create(deepPartialify(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(deepPartialify(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map((e=>deepPartialify(e)))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...processCreateParams(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=s.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==n.object){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),d}const{status:t,ctx:a}=this._processInputParams(e),{shape:s,keys:r}=this._getCached(),o=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||o.push(e);const c=[];for(const e of r){const t=s[e],r=a.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)c.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)o.length>0&&(addIssueToContext(a,{code:i.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const s=a.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(a,s,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of c){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e})).then((e=>ParseStatus.mergeObjectSync(t,e))):ParseStatus.mergeObjectSync(t,c)}get shape(){return this._def.shape()}strict(e){return c.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var s,r,n,i;const o=null!==(n=null===(r=(s=this._def).errorMap)||void 0===r?void 0:r.call(s,t,a).message)&&void 0!==n?n:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=c.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(e){const t={};return s.objectKeys(e).forEach((a=>{e[a]&&this.shape[a]&&(t[a]=this.shape[a])})),new ZodObject({...this._def,shape:()=>t})}omit(e){const t={};return s.objectKeys(this.shape).forEach((a=>{e[a]||(t[a]=this.shape[a])})),new ZodObject({...this._def,shape:()=>t})}deepPartial(){return deepPartialify(this)}partial(e){const t={};return s.objectKeys(this.shape).forEach((a=>{const s=this.shape[a];e&&!e[a]?t[a]=s:t[a]=s.optional()})),new ZodObject({...this._def,shape:()=>t})}required(e){const t={};return s.objectKeys(this.shape).forEach((a=>{if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof ZodOptional;)e=e._def.innerType;t[a]=e}})),new ZodObject({...this._def,shape:()=>t})}keyof(){return createZodEnum(s.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:N.ZodObject,...processCreateParams(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:N.ZodObject,...processCreateParams(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:N.ZodObject,...processCreateParams(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function handleResults(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new ZodError(e.ctx.common.issues)));return addIssueToContext(t,{code:i.invalid_union,unionErrors:a}),d}));{let e;const s=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},n=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===n.status)return n;"dirty"!==n.status||e||(e={result:n,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=s.map((e=>new ZodError(e)));return addIssueToContext(t,{code:i.invalid_union,unionErrors:r}),d}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:N.ZodUnion,...processCreateParams(t)});const getDiscriminator=e=>e instanceof ZodLazy?getDiscriminator(e.schema):e instanceof ZodEffects?getDiscriminator(e.innerType()):e instanceof ZodLiteral?[e.value]:e instanceof ZodEnum?e.options:e instanceof ZodNativeEnum?s.objectValues(e.enum):e instanceof ZodDefault?getDiscriminator(e._def.innerType):e instanceof ZodUndefined?[void 0]:e instanceof ZodNull?[null]:e instanceof ZodOptional?[void 0,...getDiscriminator(e.unwrap())]:e instanceof ZodNullable?[null,...getDiscriminator(e.unwrap())]:e instanceof ZodBranded||e instanceof ZodReadonly?getDiscriminator(e.unwrap()):e instanceof ZodCatch?getDiscriminator(e._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return addIssueToContext(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),d;const a=this.discriminator,s=t.data[a],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(addIssueToContext(t,{code:i.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),d)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=getDiscriminator(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(s.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);s.set(r,a)}}return new ZodDiscriminatedUnion({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...processCreateParams(a)})}}function mergeValues(e,t){const a=getParsedType(e),r=getParsedType(t);if(e===t)return{valid:!0,data:e};if(a===n.object&&r===n.object){const a=s.objectKeys(t),r=s.objectKeys(e).filter((e=>-1!==a.indexOf(e))),n={...e,...t};for(const a of r){const s=mergeValues(e[a],t[a]);if(!s.valid)return{valid:!1};n[a]=s.data}return{valid:!0,data:n}}if(a===n.array&&r===n.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let s=0;s<e.length;s++){const r=mergeValues(e[s],t[s]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===n.date&&r===n.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),handleParsed=(e,s)=>{if(isAborted(e)||isAborted(s))return d;const r=mergeValues(e.value,s.value);return r.valid?((isDirty(e)||isDirty(s))&&t.dirty(),{status:t.value,value:r.data}):(addIssueToContext(a,{code:i.invalid_intersection_types}),d)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>handleParsed(e,t))):handleParsed(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ZodIntersection.create=(e,t,a)=>new ZodIntersection({left:e,right:t,typeName:N.ZodIntersection,...processCreateParams(a)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.array)return addIssueToContext(a,{code:i.invalid_type,expected:n.array,received:a.parsedType}),d;if(a.data.length<this._def.items.length)return addIssueToContext(a,{code:i.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),d;!this._def.rest&&a.data.length>this._def.items.length&&(addIssueToContext(a,{code:i.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new ParseInputLazyPath(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(s).then((e=>ParseStatus.mergeArray(t,e))):ParseStatus.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:N.ZodTuple,rest:null,...processCreateParams(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.object)return addIssueToContext(a,{code:i.invalid_type,expected:n.object,received:a.parsedType}),d;const s=[],r=this._def.keyType,o=this._def.valueType;for(const e in a.data)s.push({key:r._parse(new ParseInputLazyPath(a,e,a.path,e)),value:o._parse(new ParseInputLazyPath(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?ParseStatus.mergeObjectAsync(t,s):ParseStatus.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:N.ZodRecord,...processCreateParams(a)}:{keyType:ZodString.create(),valueType:e,typeName:N.ZodRecord,...processCreateParams(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.map)return addIssueToContext(a,{code:i.invalid_type,expected:n.map,received:a.parsedType}),d;const s=this._def.keyType,r=this._def.valueType,o=[...a.data.entries()].map((([e,t],n)=>({key:s._parse(new ParseInputLazyPath(a,e,a.path,[n,"key"])),value:r._parse(new ParseInputLazyPath(a,t,a.path,[n,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of o){const s=await a.key,r=await a.value;if("aborted"===s.status||"aborted"===r.status)return d;"dirty"!==s.status&&"dirty"!==r.status||t.dirty(),e.set(s.value,r.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of o){const s=a.key,r=a.value;if("aborted"===s.status||"aborted"===r.status)return d;"dirty"!==s.status&&"dirty"!==r.status||t.dirty(),e.set(s.value,r.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,a)=>new ZodMap({valueType:t,keyType:e,typeName:N.ZodMap,...processCreateParams(a)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.set)return addIssueToContext(a,{code:i.invalid_type,expected:n.set,received:a.parsedType}),d;const s=this._def;null!==s.minSize&&a.data.size<s.minSize.value&&(addIssueToContext(a,{code:i.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&a.data.size>s.maxSize.value&&(addIssueToContext(a,{code:i.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const r=this._def.valueType;function finalizeSet(e){const a=new Set;for(const s of e){if("aborted"===s.status)return d;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const o=[...a.data.values()].map(((e,t)=>r._parse(new ParseInputLazyPath(a,e,a.path,t))));return a.common.async?Promise.all(o).then((e=>finalizeSet(e))):finalizeSet(o)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:c.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:c.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:N.ZodSet,...processCreateParams(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return addIssueToContext(t,{code:i.invalid_type,expected:n.function,received:t.parsedType}),d;function makeArgsIssue(e,a){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:i.invalid_arguments,argumentsError:a}})}function makeReturnsIssue(e,a){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((e=>!!e)),issueData:{code:i.invalid_return_type,returnTypeError:a}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return OK((async function(...t){const r=new ZodError([]),n=await e._def.args.parseAsync(t,a).catch((e=>{throw r.addIssue(makeArgsIssue(t,e)),r})),i=await Reflect.apply(s,this,n);return await e._def.returns._def.type.parseAsync(i,a).catch((e=>{throw r.addIssue(makeReturnsIssue(i,e)),r}))}))}{const e=this;return OK((function(...t){const r=e._def.args.safeParse(t,a);if(!r.success)throw new ZodError([makeArgsIssue(t,r.error)]);const n=Reflect.apply(s,this,r.data),i=e._def.returns.safeParse(n,a);if(!i.success)throw new ZodError([makeReturnsIssue(n,i.error)]);return i.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:N.ZodFunction,...processCreateParams(a)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:N.ZodLazy,...processCreateParams(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{received:t.data,code:i.invalid_literal,expected:this._def.value}),d}return{status:"valid",value:e.data}}get value(){return this._def.value}}function createZodEnum(e,t){return new ZodEnum({values:e,typeName:N.ZodEnum,...processCreateParams(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:N.ZodLiteral,...processCreateParams(t)});class ZodEnum extends ZodType{constructor(){super(...arguments),u.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return addIssueToContext(t,{expected:s.joinValues(a),received:t.parsedType,code:i.invalid_type}),d}if(__classPrivateFieldGet(this,u,"f")||__classPrivateFieldSet(this,u,new Set(this._def.values),"f"),!__classPrivateFieldGet(this,u,"f").has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return addIssueToContext(t,{received:t.data,code:i.invalid_enum_value,options:a}),d}return OK(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}u=new WeakMap,ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{constructor(){super(...arguments),l.set(this,void 0)}_parse(e){const t=s.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==n.string&&a.parsedType!==n.number){const e=s.objectValues(t);return addIssueToContext(a,{expected:s.joinValues(e),received:a.parsedType,code:i.invalid_type}),d}if(__classPrivateFieldGet(this,l,"f")||__classPrivateFieldSet(this,l,new Set(s.getValidEnumValues(this._def.values)),"f"),!__classPrivateFieldGet(this,l,"f").has(e.data)){const e=s.objectValues(t);return addIssueToContext(a,{received:a.data,code:i.invalid_enum_value,options:e}),d}return OK(e.data)}get enum(){return this._def.values}}l=new WeakMap,ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:N.ZodNativeEnum,...processCreateParams(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return addIssueToContext(t,{code:i.invalid_type,expected:n.promise,received:t.parsedType}),d;const a=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return OK(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:N.ZodPromise,...processCreateParams(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:e=>{addIssueToContext(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===r.type){const e=r.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return d;const s=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===s.status?d:"dirty"===s.status||"dirty"===t.value?DIRTY(s.value):s}));{if("aborted"===t.value)return d;const s=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===s.status?d:"dirty"===s.status||"dirty"===t.value?DIRTY(s.value):s}}if("refinement"===r.type){const executeRefinement=e=>{const t=r.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?d:("dirty"===e.status&&t.dirty(),executeRefinement(e.value),{status:t.value,value:e.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>"aborted"===e.status?d:("dirty"===e.status&&t.dirty(),executeRefinement(e.value).then((()=>({status:t.value,value:e.value}))))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!isValid(e))return e;const s=r.transform(e.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then((e=>isValid(e)?Promise.resolve(r.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}s.assertNever(r)}}ZodEffects.create=(e,t,a)=>new ZodEffects({schema:e,typeName:N.ZodEffects,effect:t,...processCreateParams(a)}),ZodEffects.createWithPreprocess=(e,t,a)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:N.ZodEffects,...processCreateParams(a)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===n.undefined?OK(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:N.ZodOptional,...processCreateParams(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===n.null?OK(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:N.ZodNullable,...processCreateParams(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===n.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:N.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...processCreateParams(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return isAsync(s)?s.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:N.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...processCreateParams(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==n.nan){const t=this._getOrReturnCtx(e);return addIssueToContext(t,{code:i.invalid_type,expected:n.nan,received:t.parsedType}),d}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:N.ZodNaN,...processCreateParams(e)});const I=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),DIRTY(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?d:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:N.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),freeze=e=>(isValid(e)&&(e.value=Object.freeze(e.value)),e);return isAsync(t)?t.then((e=>freeze(e))):freeze(t)}unwrap(){return this._def.innerType}}function cleanParams(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function custom(e,t={},a){return e?ZodAny.create().superRefine(((s,r)=>{var n,i;const o=e(s);if(o instanceof Promise)return o.then((e=>{var n,i;if(!e){const e=cleanParams(t,s),o=null===(i=null!==(n=e.fatal)&&void 0!==n?n:a)||void 0===i||i;r.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=cleanParams(t,s),o=null===(i=null!==(n=e.fatal)&&void 0!==n?n:a)||void 0===i||i;r.addIssue({code:"custom",...e,fatal:o})}})):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:N.ZodReadonly,...processCreateParams(t)});const j={object:ZodObject.lazycreate};var N;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(N||(N={}));const R=ZodString.create,O=ZodNumber.create,E=ZodNaN.create,A=ZodBigInt.create,L=ZodBoolean.create,M=ZodDate.create,$=ZodSymbol.create,z=ZodUndefined.create,F=ZodNull.create,D=ZodAny.create,U=ZodUnknown.create,V=ZodNever.create,q=ZodVoid.create,B=ZodArray.create,K=ZodObject.create,W=ZodObject.strictCreate,J=ZodUnion.create,G=ZodDiscriminatedUnion.create,H=ZodIntersection.create,Y=ZodTuple.create,X=ZodRecord.create,Q=ZodMap.create,ee=ZodSet.create,te=ZodFunction.create,ae=ZodLazy.create,se=ZodLiteral.create,re=ZodEnum.create,ne=ZodNativeEnum.create,ie=ZodPromise.create,oe=ZodEffects.create,de=ZodOptional.create,ce=ZodNullable.create,ue=ZodEffects.createWithPreprocess,le=ZodPipeline.create,pe={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},he=d;var me=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:function setErrorMap(e){o=e},getErrorMap,makeIssue,EMPTY_PATH:[],addIssueToContext,ParseStatus,INVALID:d,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return s},get objectUtil(){return r},ZodParsedType:n,getParsedType,ZodType,datetimeRegex,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND:I,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late:j,get ZodFirstPartyTypeKind(){return N},coerce:pe,any:D,array:B,bigint:A,boolean:L,date:M,discriminatedUnion:G,effect:oe,enum:re,function:te,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>custom((t=>t instanceof e),t),intersection:H,lazy:ae,literal:se,map:Q,nan:E,nativeEnum:ne,never:V,null:F,nullable:ce,number:O,object:K,oboolean:()=>L().optional(),onumber:()=>O().optional(),optional:de,ostring:()=>R().optional(),pipeline:le,preprocess:ue,promise:ie,record:X,set:ee,strictObject:W,string:R,symbol:$,transformer:oe,tuple:Y,undefined:z,union:J,unknown:U,void:q,NEVER:he,ZodIssueCode:i,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError});const fe="2025-06-18",ge="2025-03-26",ye=[fe,"2025-03-26","2024-11-05","2024-10-07"],_e="2.0",ve=me.union([me.string(),me.number().int()]),Ze=me.string(),be=me.object({progressToken:me.optional(ve)}).passthrough(),xe=me.object({_meta:me.optional(be)}).passthrough(),Te=me.object({method:me.string(),params:me.optional(xe)}),ke=me.object({_meta:me.optional(me.object({}).passthrough())}).passthrough(),Ce=me.object({method:me.string(),params:me.optional(ke)}),Se=me.object({_meta:me.optional(me.object({}).passthrough())}).passthrough(),we=me.union([me.string(),me.number().int()]),Pe=me.object({jsonrpc:me.literal(_e),id:we}).merge(Te).strict(),isJSONRPCRequest=e=>Pe.safeParse(e).success,Ie=me.object({jsonrpc:me.literal(_e)}).merge(Ce).strict(),isJSONRPCNotification=e=>Ie.safeParse(e).success,je=me.object({jsonrpc:me.literal(_e),id:we,result:Se}).strict(),isJSONRPCResponse=e=>je.safeParse(e).success;var Ne;!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"}(Ne||(Ne={}));const Re=me.object({jsonrpc:me.literal(_e),id:we,error:me.object({code:me.number().int(),message:me.string(),data:me.optional(me.unknown())})}).strict(),isJSONRPCError=e=>Re.safeParse(e).success,Oe=me.union([Pe,Ie,je,Re]),Ee=Se.strict(),Ae=Ce.extend({method:me.literal("notifications/cancelled"),params:ke.extend({requestId:we,reason:me.string().optional()})}),Le=me.object({name:me.string(),title:me.optional(me.string())}).passthrough(),Me=Le.extend({version:me.string()}),$e=me.object({experimental:me.optional(me.object({}).passthrough()),sampling:me.optional(me.object({}).passthrough()),elicitation:me.optional(me.object({}).passthrough()),roots:me.optional(me.object({listChanged:me.optional(me.boolean())}).passthrough())}).passthrough(),ze=Te.extend({method:me.literal("initialize"),params:xe.extend({protocolVersion:me.string(),capabilities:$e,clientInfo:Me})}),isInitializeRequest=e=>ze.safeParse(e).success,Fe=me.object({experimental:me.optional(me.object({}).passthrough()),logging:me.optional(me.object({}).passthrough()),completions:me.optional(me.object({}).passthrough()),prompts:me.optional(me.object({listChanged:me.optional(me.boolean())}).passthrough()),resources:me.optional(me.object({subscribe:me.optional(me.boolean()),listChanged:me.optional(me.boolean())}).passthrough()),tools:me.optional(me.object({listChanged:me.optional(me.boolean())}).passthrough())}).passthrough(),De=Se.extend({protocolVersion:me.string(),capabilities:Fe,serverInfo:Me,instructions:me.optional(me.string())}),Ue=Ce.extend({method:me.literal("notifications/initialized")}),isInitializedNotification=e=>Ue.safeParse(e).success,Ve=Te.extend({method:me.literal("ping")}),qe=me.object({progress:me.number(),total:me.optional(me.number()),message:me.optional(me.string())}).passthrough(),Be=Ce.extend({method:me.literal("notifications/progress"),params:ke.merge(qe).extend({progressToken:ve})}),Ke=Te.extend({params:xe.extend({cursor:me.optional(Ze)}).optional()}),We=Se.extend({nextCursor:me.optional(Ze)}),Je=me.object({uri:me.string(),mimeType:me.optional(me.string()),_meta:me.optional(me.object({}).passthrough())}).passthrough(),Ge=Je.extend({text:me.string()}),He=Je.extend({blob:me.string().base64()}),Ye=Le.extend({uri:me.string(),description:me.optional(me.string()),mimeType:me.optional(me.string()),_meta:me.optional(me.object({}).passthrough())}),Xe=Le.extend({uriTemplate:me.string(),description:me.optional(me.string()),mimeType:me.optional(me.string()),_meta:me.optional(me.object({}).passthrough())}),Qe=Ke.extend({method:me.literal("resources/list")}),et=We.extend({resources:me.array(Ye)}),tt=Ke.extend({method:me.literal("resources/templates/list")}),at=We.extend({resourceTemplates:me.array(Xe)}),st=Te.extend({method:me.literal("resources/read"),params:xe.extend({uri:me.string()})}),rt=Se.extend({contents:me.array(me.union([Ge,He]))}),nt=Ce.extend({method:me.literal("notifications/resources/list_changed")}),it=Te.extend({method:me.literal("resources/subscribe"),params:xe.extend({uri:me.string()})}),ot=Te.extend({method:me.literal("resources/unsubscribe"),params:xe.extend({uri:me.string()})}),dt=Ce.extend({method:me.literal("notifications/resources/updated"),params:ke.extend({uri:me.string()})}),ct=me.object({name:me.string(),description:me.optional(me.string()),required:me.optional(me.boolean())}).passthrough(),ut=Le.extend({description:me.optional(me.string()),arguments:me.optional(me.array(ct)),_meta:me.optional(me.object({}).passthrough())}),lt=Ke.extend({method:me.literal("prompts/list")}),pt=We.extend({prompts:me.array(ut)}),ht=Te.extend({method:me.literal("prompts/get"),params:xe.extend({name:me.string(),arguments:me.optional(me.record(me.string()))})}),mt=me.object({type:me.literal("text"),text:me.string(),_meta:me.optional(me.object({}).passthrough())}).passthrough(),ft=me.object({type:me.literal("image"),data:me.string().base64(),mimeType:me.string(),_meta:me.optional(me.object({}).passthrough())}).passthrough(),gt=me.object({type:me.literal("audio"),data:me.string().base64(),mimeType:me.string(),_meta:me.optional(me.object({}).passthrough())}).passthrough(),yt=me.object({type:me.literal("resource"),resource:me.union([Ge,He]),_meta:me.optional(me.object({}).passthrough())}).passthrough(),_t=Ye.extend({type:me.literal("resource_link")}),vt=me.union([mt,ft,gt,_t,yt]),Zt=me.object({role:me.enum(["user","assistant"]),content:vt}).passthrough(),bt=Se.extend({description:me.optional(me.string()),messages:me.array(Zt)}),xt=Ce.extend({method:me.literal("notifications/prompts/list_changed")}),Tt=me.object({title:me.optional(me.string()),readOnlyHint:me.optional(me.boolean()),destructiveHint:me.optional(me.boolean()),idempotentHint:me.optional(me.boolean()),openWorldHint:me.optional(me.boolean())}).passthrough(),kt=Le.extend({description:me.optional(me.string()),inputSchema:me.object({type:me.literal("object"),properties:me.optional(me.object({}).passthrough()),required:me.optional(me.array(me.string()))}).passthrough(),outputSchema:me.optional(me.object({type:me.literal("object"),properties:me.optional(me.object({}).passthrough()),required:me.optional(me.array(me.string()))}).passthrough()),annotations:me.optional(Tt),_meta:me.optional(me.object({}).passthrough())}),Ct=Ke.extend({method:me.literal("tools/list")}),St=We.extend({tools:me.array(kt)}),wt=Se.extend({content:me.array(vt).default([]),structuredContent:me.object({}).passthrough().optional(),isError:me.optional(me.boolean())}),Pt=wt.or(Se.extend({toolResult:me.unknown()})),It=Te.extend({method:me.literal("tools/call"),params:xe.extend({name:me.string(),arguments:me.optional(me.record(me.unknown()))})}),jt=Ce.extend({method:me.literal("notifications/tools/list_changed")}),Nt=me.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Rt=Te.extend({method:me.literal("logging/setLevel"),params:xe.extend({level:Nt})}),Ot=Ce.extend({method:me.literal("notifications/message"),params:ke.extend({level:Nt,logger:me.optional(me.string()),data:me.unknown()})}),Et=me.object({name:me.string().optional()}).passthrough(),At=me.object({hints:me.optional(me.array(Et)),costPriority:me.optional(me.number().min(0).max(1)),speedPriority:me.optional(me.number().min(0).max(1)),intelligencePriority:me.optional(me.number().min(0).max(1))}).passthrough(),Lt=me.object({role:me.enum(["user","assistant"]),content:me.union([mt,ft,gt])}).passthrough(),Mt=Te.extend({method:me.literal("sampling/createMessage"),params:xe.extend({messages:me.array(Lt),systemPrompt:me.optional(me.string()),includeContext:me.optional(me.enum(["none","thisServer","allServers"])),temperature:me.optional(me.number()),maxTokens:me.number().int(),stopSequences:me.optional(me.array(me.string())),metadata:me.optional(me.object({}).passthrough()),modelPreferences:me.optional(At)})}),$t=Se.extend({model:me.string(),stopReason:me.optional(me.enum(["endTurn","stopSequence","maxTokens"]).or(me.string())),role:me.enum(["user","assistant"]),content:me.discriminatedUnion("type",[mt,ft,gt])}),zt=me.object({type:me.literal("boolean"),title:me.optional(me.string()),description:me.optional(me.string()),default:me.optional(me.boolean())}).passthrough(),Ft=me.object({type:me.literal("string"),title:me.optional(me.string()),description:me.optional(me.string()),minLength:me.optional(me.number()),maxLength:me.optional(me.number()),format:me.optional(me.enum(["email","uri","date","date-time"]))}).passthrough(),Dt=me.object({type:me.enum(["number","integer"]),title:me.optional(me.string()),description:me.optional(me.string()),minimum:me.optional(me.number()),maximum:me.optional(me.number())}).passthrough(),Ut=me.object({type:me.literal("string"),title:me.optional(me.string()),description:me.optional(me.string()),enum:me.array(me.string()),enumNames:me.optional(me.array(me.string()))}).passthrough(),Vt=me.union([zt,Ft,Dt,Ut]),qt=Te.extend({method:me.literal("elicitation/create"),params:xe.extend({message:me.string(),requestedSchema:me.object({type:me.literal("object"),properties:me.record(me.string(),Vt),required:me.optional(me.array(me.string()))}).passthrough()})}),Bt=Se.extend({action:me.enum(["accept","decline","cancel"]),content:me.optional(me.record(me.string(),me.unknown()))}),Kt=me.object({type:me.literal("ref/resource"),uri:me.string()}).passthrough(),Wt=Kt,Jt=me.object({type:me.literal("ref/prompt"),name:me.string()}).passthrough(),Gt=Te.extend({method:me.literal("completion/complete"),params:xe.extend({ref:me.union([Jt,Kt]),argument:me.object({name:me.string(),value:me.string()}).passthrough(),context:me.optional(me.object({arguments:me.optional(me.record(me.string(),me.string()))}))})}),Ht=Se.extend({completion:me.object({values:me.array(me.string()).max(100),total:me.optional(me.number().int()),hasMore:me.optional(me.boolean())}).passthrough()}),Yt=me.object({uri:me.string().startsWith("file://"),name:me.optional(me.string()),_meta:me.optional(me.object({}).passthrough())}).passthrough(),Xt=Te.extend({method:me.literal("roots/list")}),Qt=Se.extend({roots:me.array(Yt)}),ea=Ce.extend({method:me.literal("notifications/roots/list_changed")}),ta=me.union([Ve,ze,Gt,Rt,ht,lt,Qe,tt,st,it,ot,It,Ct]),aa=me.union([Ae,Be,Ue,ea]),sa=me.union([Ee,$t,Bt,Qt]),ra=me.union([Ve,Mt,qt,Xt]),na=me.union([Ae,Be,Ot,dt,nt,jt,xt]),ia=me.union([Ee,De,Ht,bt,pt,et,at,rt,wt,St]);class McpError extends Error{constructor(e,t,a){super(`MCP error ${e}: ${t}`),this.code=e,this.data=a,this.name="McpError"}}}};