@github/copilot 0.0.336-3 → 0.0.336-4

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/index.js CHANGED
@@ -704,7 +704,7 @@ Note: ${m.warning}`);e.debug(`Code review completed: ${p}`);let A=b.map(W=>W.met
704
704
  * Cannot be used if the specified path already exists
705
705
  * Parent directories must exist before creating the file
706
706
  * Path *must* be absolute
707
- `,input_schema:{type:"object",properties:{path:{description:"Absolute path to file to create.",type:"string"},file_text:{description:"The content of the file to be created.",type:"string"}},required:["path","file_text"]},callback:(n,r)=>I.callback({...n,command:"create"},r),summariseIntention:n=>I.summariseIntention({...n,command:"create"}),safeForTelemetry:!0},{name:"str_replace",description:"Tool for making string replacements in files.\n * Replaces exactly one occurrence of `old_str` with `new_str` in the specified file\n * When called multiple times in a single response, edits are independently made in the order calls are specified\n * The `old_str` parameter must match EXACTLY one or more consecutive lines from the original file\n * If `old_str` is not unique in the file, replacement will not be performed\n * Make sure to include enough context in `old_str` to make it unique\n * Path *must* be absolute\n ",input_schema:{type:"object",properties:{path:{description:"Absolute path to file to edit.",type:"string"},old_str:{description:"The string in the file to replace. Leading and ending whitespaces from file content should be preserved!",type:"string"},new_str:{description:"The new string to replace old_str with.",type:"string"}},required:["path","old_str"]},callback:(n,r)=>I.callback({...n,command:"str_replace"},r),shutdown:async()=>await I.shutdown(),summariseIntention:n=>I.summariseIntention({...n,command:"str_replace"}),safeForTelemetry:!0}]},ehe=(t,e,l)=>{let I=new qpe,n=new Map,r={truncateBasedOn:"tokenCount",truncateStyle:"middle"};return e.debug(`str_replace_editor: default options: ${JSON.stringify(r,null,2)}`),{name:"str_replace_editor",description:"Editing tool for viewing, creating and editing files\n * State is persistent across command calls and discussions with the user\n * If `path` is a file, `view` displays the result of applying `cat -n`. If `path` is a directory, `view` lists non-hidden files and directories up to 2 levels deep\n * The `create` command cannot be used if the specified `path` already exists, or if parent directories don't exist\n * If a `command` generates a long output, output will be truncated and marked with `<file too long...`\n * Path *must* be absolute\n\n Notes for using the `str_replace` command:\n * The `old_str` parameter should match EXACTLY one or more consecutive lines from the original file\n * If the `old_str` parameter is not unique in the file, replacement will not be performed. Make sure to include enough context in `old_str` to make it unique\n * The `new_str` parameter should contain the edited lines that should replace the `old_str`",input_schema:{type:"object",properties:{command:{type:"string",enum:["view","create","str_replace","insert"],description:`The commands to run. Allowed options are: ${Array.from(u5e).map(s=>`\`${s}\``).join(", ")}.`},file_text:{description:"Required parameter of `create` command; the content of the file to be created.",type:"string"},insert_line:{description:"Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.",type:"integer"},new_str:{description:"Required parameter of `str_replace` command containing the new string. Required parameter of `insert` command containing the string to insert.",type:"string"},old_str:{description:"Required parameter of `str_replace` command containing the string in `path` to replace. Leading and ending whitespaces from file content should be preserved!",type:"string"},path:{description:"Absolute path to file or directory.",type:"string"},view_range:{description:"Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.",items:{type:"integer"},type:"array"}},required:["command","path"]},shutdown:async()=>{let s=I.getTrackedEditsJsonArrString();return I.reset(),{kind:"telemetry",telemetry:{event:"str_replace_editor_shutdown",properties:{trackedEdits:s},metrics:{},restrictedProperties:{}}}},summariseIntention:s=>{switch(s.command){case"create":return`create a new file at ${s.path}.`;case"view":return`view the file at ${s.path}.`;case"str_replace":case"insert":return`edit the file at ${s.path}.`;default:{let o=s;return`unknown command: ${JSON.stringify(s)}`}}},callback:async(s,o)=>{if(s.command==="view")return a(s,o);let d=n.get(s.path);return d||(d=new $pe(e),n.set(s.path,d)),d.enqueue(()=>a(s,o))},safeForTelemetry:!0};async function a(s,o){let d={...r,...o?.toolOptions||{}};e.debug(s.command+": "+s.path);let m={properties:{command:gGt(s.command),options:JSON.stringify(d),inputs:JSON.stringify(Object.keys(s)),resolvedPathAgainstCwd:"false",fileExtension:s.path?Dpe(s.path):void 0},metrics:{resultLength:0,resultForLlmLength:0,responseTokenLimit:o?.truncationOptions?.tokenLimit},restrictedProperties:{}},b;try{if(typeof s.path!="string"||!s.path)return Kh("failure",m,{},"A path parameter is required, and must be a non-empty string.","",void 0,"Path not provided");if(t.cwd){let p=await t.cwd();if(p){let A=await dGt(s.path,p);if(!VVl(A))return e.debug(`Could not resolve path "${s.path}" against agent cwd "${p}". Need to use absolute path.`),Kh("failure",m,{},`Path "${s.path}" is not absolute. Please provide an absolute path.`,"",void 0,"Path not absolute");A!==s.path&&(e.debug(`using resolved path ${A} based on agent cwd ${p}`),s.path=A,m.properties.resolvedPathAgainstCwd="true")}}switch(s.command){case"view":b=await A5e(s,m,e,o);break;case"str_replace":b=await CVl(s,m,t.permissions,e,o);break;case"create":b=await vVl(s,m,t.permissions,e,o);break;case"insert":b=await fVl(s,m,t.permissions,e,o);break;default:{let p=s,A=p.command?`Unknown command: ${p.command}`:"No command provided";return Promise.reject(new Error(`${A}. Allowed commands are: ${Array.from(u5e).join(", ")}`))}}}catch(p){b=Kh("failure",m,{},`Failed to execute \`str_replace_editor\` tool with arguments: ${JSON.stringify(s)} due to error: ${p}`,"",void 0,`Unhandled error: ${p}`)}return b.resultType!=="rejected"&&b.resultType!=="denied"&&s.path&&s.command&&typeof s.path=="string"&&typeof s.command=="string"&&I.trackEdit(s.path,gGt(s.command),b.resultType,o?.toolCallId),b}};async function A5e(t,e,l,I){let n={truncateBasedOn:"tokenCount",truncateStyle:"middle",...I?.toolOptions||{}},r,a,s="";if(!yVl(t.path))return Kh("failure",e,{properties:{viewType:"unknown"}},`Path ${t.path} does not exist. Please provide a valid path.`,"",void 0,"Path does not exist");if((await RVl(t.path)).isDirectory()){r="directory";let m=await EVl(t.path);a=m.join(`
707
+ `,input_schema:{type:"object",properties:{path:{description:"Absolute path to file to create.",type:"string"},file_text:{description:"The content of the file to be created.",type:"string"}},required:["path","file_text"]},callback:(n,r)=>I.callback({...n,command:"create"},r),summariseIntention:n=>I.summariseIntention({...n,command:"create"}),safeForTelemetry:!0},{name:"str_replace",description:"Tool for making string replacements in files.\n * Replaces exactly one occurrence of `old_str` with `new_str` in the specified file\n * When called multiple times in a single response, edits are independently made in the order calls are specified\n * The `old_str` parameter must match EXACTLY one or more consecutive lines from the original file\n * If `old_str` is not unique in the file, replacement will not be performed\n * Make sure to include enough context in `old_str` to make it unique\n * Path *must* be absolute\n ",input_schema:{type:"object",properties:{path:{description:"Absolute path to file to edit.",type:"string"},old_str:{description:"The string in the file to replace. Leading and ending whitespaces from file content should be preserved!",type:"string"},new_str:{description:"The new string to replace old_str with.",type:"string"}},required:["path","old_str"]},callback:(n,r)=>I.callback({...n,command:"str_replace"},r),shutdown:async()=>await I.shutdown(),summariseIntention:n=>I.summariseIntention({...n,command:"str_replace"}),safeForTelemetry:!0}]},ehe=(t,e,l)=>{let I=new qpe,n=new Map,r={truncateBasedOn:"tokenCount",truncateStyle:"middle"};return e.debug(`str_replace_editor: default options: ${JSON.stringify(r,null,2)}`),{name:"str_replace_editor",description:"Editing tool for viewing, creating and editing files\n * State is persistent across command calls and discussions with the user\n * If `path` is a file, `view` displays the result of applying `cat -n`. If `path` is a directory, `view` lists non-hidden files and directories up to 2 levels deep\n * The `create` command cannot be used if the specified `path` already exists, or if parent directories don't exist\n * If a `command` generates a long output, output will be truncated and marked with `<file too long...`\n * Path *must* be absolute\n\n Notes for using the `str_replace` command:\n * The `old_str` parameter should match EXACTLY one or more consecutive lines from the original file\n * If the `old_str` parameter is not unique in the file, replacement will not be performed. Make sure to include enough context in `old_str` to make it unique\n * The `new_str` parameter should contain the edited lines that should replace the `old_str`",input_schema:{type:"object",properties:{command:{type:"string",enum:["view","create","str_replace","insert"],description:`The commands to run. Allowed options are: ${Array.from(u5e).map(s=>`\`${s}\``).join(", ")}.`},file_text:{description:"Required parameter of `create` command; the content of the file to be created.",type:"string"},insert_line:{description:"Required parameter of `insert` command. The `new_str` will be inserted AFTER the line `insert_line` of `path`.",type:"integer"},new_str:{description:"Required parameter of `str_replace` command containing the new string. Required parameter of `insert` command containing the string to insert.",type:"string"},old_str:{description:"Required parameter of `str_replace` command containing the string in `path` to replace. Leading and ending whitespaces from file content should be preserved!",type:"string"},path:{description:"Absolute path to file or directory.",type:"string"},view_range:{description:"Optional parameter of `view` command when `path` points to a file. If none is given, the full file is shown. If provided, the file will be shown in the indicated line number range, e.g. [11, 12] will show lines 11 and 12. Indexing at 1 to start. Setting `[start_line, -1]` shows all lines from `start_line` to the end of the file.",items:{type:"integer"},type:"array"}},required:["command","path"]},shutdown:async()=>{let s=I.getTrackedEditsJsonArrString();return I.reset(),{kind:"telemetry",telemetry:{event:"str_replace_editor_shutdown",properties:{trackedEdits:s},metrics:{},restrictedProperties:{}}}},summariseIntention:s=>{switch(s.command){case"create":return`create a new file at ${s.path}.`;case"view":return`view the file at ${s.path}.`;case"str_replace":case"insert":return`edit the file at ${s.path}.`;default:{let o=s;return`unknown command: ${JSON.stringify(s)}`}}},callback:async(s,o)=>{if(s.command==="view")return a(s,o);let d=n.get(s.path);return d||(d=new $pe(e),n.set(s.path,d)),d.enqueue(()=>a(s,o))},safeForTelemetry:!0};async function a(s,o){let d={...r,...o?.toolOptions||{}};e.debug(s.command+": "+s.path);let m={properties:{command:gGt(s.command),options:JSON.stringify(d),inputs:JSON.stringify(Object.keys(s)),resolvedPathAgainstCwd:"false",fileExtension:s.path?Dpe(s.path):void 0},metrics:{resultLength:0,resultForLlmLength:0,responseTokenLimit:o?.truncationOptions?.tokenLimit},restrictedProperties:{}},b;try{if(typeof s.path!="string"||!s.path)return Kh("failure",m,{},"A path parameter is required, and must be a non-empty string.","",void 0,"Path not provided");let p=process.cwd();if(p){let A=await dGt(s.path,p);if(!VVl(A))return e.debug(`Could not resolve path "${s.path}" against agent cwd "${p}". Need to use absolute path.`),Kh("failure",m,{},`Path "${s.path}" is not absolute. Please provide an absolute path.`,"",void 0,"Path not absolute");A!==s.path&&(e.debug(`using resolved path ${A} based on agent cwd ${p}`),s.path=A,m.properties.resolvedPathAgainstCwd="true")}switch(s.command){case"view":b=await A5e(s,m,e,o);break;case"str_replace":b=await CVl(s,m,t.permissions,e,o);break;case"create":b=await vVl(s,m,t.permissions,e,o);break;case"insert":b=await fVl(s,m,t.permissions,e,o);break;default:{let A=s,W=A.command?`Unknown command: ${A.command}`:"No command provided";return Promise.reject(new Error(`${W}. Allowed commands are: ${Array.from(u5e).join(", ")}`))}}}catch(p){b=Kh("failure",m,{},`Failed to execute \`str_replace_editor\` tool with arguments: ${JSON.stringify(s)} due to error: ${p}`,"",void 0,`Unhandled error: ${p}`)}return b.resultType!=="rejected"&&b.resultType!=="denied"&&s.path&&s.command&&typeof s.path=="string"&&typeof s.command=="string"&&I.trackEdit(s.path,gGt(s.command),b.resultType,o?.toolCallId),b}};async function A5e(t,e,l,I){let n={truncateBasedOn:"tokenCount",truncateStyle:"middle",...I?.toolOptions||{}},r,a,s="";if(!yVl(t.path))return Kh("failure",e,{properties:{viewType:"unknown"}},`Path ${t.path} does not exist. Please provide a valid path.`,"",void 0,"Path does not exist");if((await RVl(t.path)).isDirectory()){r="directory";let m=await EVl(t.path);a=m.join(`
708
708
  `);let b=`@@ -1,0 +1,${m.length} @@`;s=g$(void 0,t.path,`${b}
709
709
  ${m.map(p=>` ${p}`).join(`
710
710
  `)}`)}else{r="file";let m,b;t.view_range&&t.view_range.length>=1&&(m=t.view_range.at(0),b=t.view_range.at(1)),m===void 0&&(m=1,b=void 0);let p=(await G5e(t.path,"utf-8")).split(`
@@ -751,14 +751,14 @@ ${this.outputBuffer.substring(e).trim()}`:""}shutdown(){if(this.process){this.is
751
751
  }
752
752
  `;return this.outputBuffer="",this.trySendInput(I)}async waitForCommandCompletion(){let e,l="";for(e=this.readOutput();e?.exitCode===void 0&&this.process;e=this.readOutput()){if(this.onPartialOutputChanged&&e){let I=e.output;I!==l&&(l=I,this.onPartialOutputChanged(e))}await new Promise(I=>{setTimeout(I,xVl)})}if(this.isCommandInProgress=!1,e)return e;throw new Error("terminal unexpectedly exited before command completed")}tryExtractOutputFromDoneMarker(){let e=this.outputBuffer.lastIndexOf(iF),l=this.outputBuffer.match(BVl);if(e<0||!l)return;let I=this.outputBuffer.lastIndexOf(y$),n=this.outputBuffer.substring(e+iF.length,I).trim(),r=parseInt(l[1]);return{output:n,exitCode:r,truncated:this.wasTruncated}}static ensureShellIsSupported(e){return l(t.shellIsSupportedCache,e,async()=>{if(e==="powershell"){let I="timeout";try{await Promise.race([LVl(JVl)("pwsh.exe --version",{timeout:2e4}),new Promise((n,r)=>setTimeout(()=>r(I),1e4))])}catch(n){throw t.shellIsSupportedCache.delete(e),new Error(n===I?"Timed out checking whether PowerShell 6+ (pwsh) is installed":`PowerShell 6+ (pwsh) is not available. Please install it from https://aka.ms/powershell. Error: ${n}`)}}});function l(I,n,r){return I.has(n)||I.set(n,r(n)),I.get(n)}}};async function SVl(t,e,l){await t;let I=128,n=100;for(let r=0;r<l.length;r+=I){let a=l.substring(r,r+I);e.write(a),await new Promise(s=>setTimeout(s,n))}}var E$=600,QGt=10,nhe=class{constructor(e,l=!1){this.config=e;this.inTests=l;this.shellConfig=e.shellConfig||fZ.bash,this.shellDisplayName=this.shellConfig.displayName,this.defaultSessionId=`default-${this.shellConfig.shellType}-session`}sessions=new Map;shutdownSessionsInfos=[];shellConfig;defaultSessionId;shellDisplayName;getShellTool(){return{name:this.shellConfig.shellToolName,description:`Runs a ${this.shellDisplayName} command in an interactive ${this.shellDisplayName} session.
753
753
  ${['* When invoking this tool, the contents of the "command" parameter does NOT need to be XML-escaped.',"* You don't have access to the internet via this tool.","* You can run Python, Node.js and Go code with the `python`, `node` and `go` commands.",`* Each sessionId identifies a persistent ${this.shellDisplayName} session. State is saved across command calls and discussions with the user.`,`* \`timeout\` parameter must be greater than the default timeout of ${this.defaultTimeoutInMs()/1e3} seconds and less than ${E$} seconds}. Give long-running commands enough time to complete.`,`* If the command does not complete within "timeout" seconds, the tool will return a status indicating that it is still running asynchronously. You can then use \`${this.shellConfig.readShellToolName}\` or \`${this.shellConfig.stopShellToolName}\`.`,...this.shellConfig.descriptionLines].join(`
754
- `)}`,input_schema:{type:"object",properties:{command:{type:"string",description:`The ${this.shellDisplayName} command and arguments to run.`},description:{type:"string",description:'A short human-readable description of what the command does, limited to 100 characters, for example "List files in the current directory", "Install dependencies with npm" or "Run RSpec tests".'},timeout:{type:"integer",description:`(Optional) Maximum time in seconds to wait for the command to complete when "async" is false. Default is ${this.defaultTimeoutInMs()/1e3} seconds if not provided.`},sessionId:{type:"string",description:`Indicates which ${this.shellDisplayName} session to run the command in. Multiple sessions may be used to run different commands at the same time.`},async:{type:"boolean",description:`If true, runs the command asynchronously. You can send input to the command using the \`${this.shellConfig.writeShellToolName}\` tool and read its output using the \`${this.shellConfig.readShellToolName}\` tool.`}},required:["command","description","sessionId","async"]},shutdown:this.shutdown.bind(this),summariseIntention:e=>e.description||e.command,callback:async(e,l)=>{if(!this.config.permissions.requestRequired)return this.shellTool(l?.toolCallId,e);let I=await this.shellConfig.assessScriptSafety(e.command);if(I.result==="failed")return{textResultForLlm:I.reason,resultType:"failure",error:I.reason,sessionLog:`<error>${I.reason}</error>`,toolTelemetry:{}};let n=await this.config.permissions.request({kind:"shell",fullCommandText:e.command,intention:e.description,commands:I.commands,possiblePaths:I.possiblePaths,hasWriteFileRedirection:I.hasWriteFileRedirection,canOfferSessionApproval:I.canOfferSessionApproval});switch(n.kind){case"approved":return this.shellTool(l?.toolCallId,e);case"denied-by-rules":return lhe(n.rules);case"denied-no-approval-rule-and-could-not-request-from-user":return Ihe;case"denied-interactively-by-user":return the;default:yg(n,`Unhandled permission result kind: ${n}`)}},cwd:async()=>await(await this.getOrCreateSession(this.config.location,this.defaultSessionId))?.cwd()||this.config.location,safeForTelemetry:!0}}getWriteShellTool(){return{name:this.shellConfig.writeShellToolName,description:`Sends input to the specified command or ${this.shellDisplayName} session.
754
+ `)}`,input_schema:{type:"object",properties:{command:{type:"string",description:`The ${this.shellDisplayName} command and arguments to run.`},description:{type:"string",description:'A short human-readable description of what the command does, limited to 100 characters, for example "List files in the current directory", "Install dependencies with npm" or "Run RSpec tests".'},timeout:{type:"integer",description:`(Optional) Maximum time in seconds to wait for the command to complete when "async" is false. Default is ${this.defaultTimeoutInMs()/1e3} seconds if not provided.`},sessionId:{type:"string",description:`Indicates which ${this.shellDisplayName} session to run the command in. Multiple sessions may be used to run different commands at the same time.`},async:{type:"boolean",description:`If true, runs the command asynchronously. You can send input to the command using the \`${this.shellConfig.writeShellToolName}\` tool and read its output using the \`${this.shellConfig.readShellToolName}\` tool.`}},required:["command","description","sessionId","async"]},shutdown:this.shutdown.bind(this),summariseIntention:e=>e.description||e.command,callback:async(e,l)=>{if(!this.config.permissions.requestRequired)return this.shellTool(l?.toolCallId,e);let I=await this.shellConfig.assessScriptSafety(e.command);if(I.result==="failed")return{textResultForLlm:I.reason,resultType:"failure",error:I.reason,sessionLog:`<error>${I.reason}</error>`,toolTelemetry:{}};let n=await this.config.permissions.request({kind:"shell",fullCommandText:e.command,intention:e.description,commands:I.commands,possiblePaths:I.possiblePaths,hasWriteFileRedirection:I.hasWriteFileRedirection,canOfferSessionApproval:I.canOfferSessionApproval});switch(n.kind){case"approved":return this.shellTool(l?.toolCallId,e);case"denied-by-rules":return lhe(n.rules);case"denied-no-approval-rule-and-could-not-request-from-user":return Ihe;case"denied-interactively-by-user":return the;default:yg(n,`Unhandled permission result kind: ${n}`)}},safeForTelemetry:!0}}getWriteShellTool(){return{name:this.shellConfig.writeShellToolName,description:`Sends input to the specified command or ${this.shellDisplayName} session.
755
755
  * This tool can be used to send input to a running ${this.shellDisplayName} command or an interactive console app.
756
756
  * ${this.shellDisplayName} commands are run in an interactive ${this.shellDisplayName} session with a TTY device and ${this.shellDisplayName} command processor.
757
757
  * sessionId (required) must match the sessionId used to invoke the async ${this.shellConfig.shellToolName} command.
758
758
  * You can send text, {up}, {down}, {left}, {right}, {enter}, and {backspace} as input.
759
759
  * Some applications present a list of options to select from. The selection is often denoted using \u276F, >, or different formatting.
760
760
  * When presented with a list of items, make a selection by sending arrow keys like {up} or {down} to move the selection to your chosen item and then {enter} to select it.
761
- * The response will contain any output read after "delay" seconds. Delay should be appropriate for the task and never less than 10 seconds.`,input_schema:{type:"object",properties:{sessionId:{type:"string",description:`Indicates which ${this.shellDisplayName} session to run the command in. Multiple sessions may be used to run different commands at the same time.`},input:{type:"string",description:"The input to send to the command or session."},delay:{type:"integer",description:"(Optional) The amount of time in seconds to wait before reading the output that resulted from the input."}},required:["sessionId","input"]},shutdown:this.shutdown.bind(this),callback:this.writeShellTool.bind(this),cwd:async()=>await(await this.getOrCreateSession(this.config.location,this.defaultSessionId))?.cwd()||this.config.location,safeForTelemetry:!0}}getReadShellTool(){return{name:this.shellConfig.readShellToolName,description:`Reads output from a ${this.shellDisplayName} command.
761
+ * The response will contain any output read after "delay" seconds. Delay should be appropriate for the task and never less than 10 seconds.`,input_schema:{type:"object",properties:{sessionId:{type:"string",description:`Indicates which ${this.shellDisplayName} session to run the command in. Multiple sessions may be used to run different commands at the same time.`},input:{type:"string",description:"The input to send to the command or session."},delay:{type:"integer",description:"(Optional) The amount of time in seconds to wait before reading the output that resulted from the input."}},required:["sessionId","input"]},shutdown:this.shutdown.bind(this),callback:this.writeShellTool.bind(this),safeForTelemetry:!0}}getReadShellTool(){return{name:this.shellConfig.readShellToolName,description:`Reads output from a ${this.shellDisplayName} command.
762
762
  * Reads the output of a command running in an "async" ${this.shellDisplayName} session.
763
763
  * The sessionId must be the same one used to invoke the ${this.shellConfig.shellToolName} command.
764
764
  * You can call this tool multiple times to read output produced since the last call.
@@ -1718,7 +1718,7 @@ Answer:
1718
1718
  This tool is used to perform a semantic search of the codebase to find relevant information based on the question asked.
1719
1719
  * It leverages advanced AI techniques to understand the context and semantics of the codebase.
1720
1720
  * Use this tool when you need to find information that is not easily accessible through traditional search methods.
1721
- `,input_schema:{type:"object",properties:{question:{type:"string",description:"A question about the codebase. It should reference by name any topics, specific file names, and concepts that are relevant to the question and specify the desired output format."}},required:["question"]},callback:async I=>{let n,r=Zbe(t),a="",s="",o=r.split("/");if(o.length===2){[a,s]=o,l.info("Searching for repository insights");try{n=await jOe(I.question,a,s,e,l),l.info(`Blackbird results: ${n}`)}catch(d){l.error(`Error occurred while searching for repository insights: ${d}`)}}return{resultType:"success",textResultForLlm:n??"No results found.",toolTelemetry:{}}}}}async function mCt(t,e,l,I,n,r,a){let s=await pCt(t),o={cwd:s.shellTool.cwd,...t},d=await VKl(o,l,I),m=iCt(l)?[new qye(I,l,n,r,t,t.location,jpe(),a).getSearch()]:[],b=t.splitEditingTools?h5e(o,I,l):[ehe(o,I,l)];return[s.shellTool,...s.otherTools??[],...d,...m,...b,mGt(o,e,l,I,n),$o(l,Vbe)?vdt(o,I,n,l):void 0,t?.requireReasoning?Z5e(o):void 0,$o(l,rGt)?aGt:void 0,await QKl(t,l,I,n)].filter(p=>p!==void 0)}async function uCt(t,e){let l=await pCt(t),I={cwd:l.shellTool.cwd,...t},n=t.splitEditingTools?h5e(I,e):[ehe(I,e)];return[l.shellTool,...l.otherTools??[],...n,t?.requireReasoning?Z5e(I):void 0].filter(r=>r!==void 0)}async function YKl(t,e,l,I,n,r,a){return[...await mCt(t,e,l,I,n,r,a),oGt(t,I)]}var GCt=t=>({...EV,supports:{...EV.supports,reasoning:t?.thinkingMode?!0:EV.supports?.reasoning}}),EV={supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!1},createPR:{toolInit:mCt,jitInstructions:aLe},prDetails:{},respondToPRComment:{toolInit:YKl,jitInstructions:aLe}},bCt=t=>({"sweagent-capi":{"claude-3.5-sonnet":{...EV,supports:{tool_choice:!1,reasoning:!1}},"claude-3.7-sonnet":{...EV,supports:{tool_choice:!1,reasoning:!1,vision:!0}},"claude-sonnet-4":{...EV,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},"claude-sonnet-4.5":{...EV,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},oswe:{...EV,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"oswe-prime":{...EV,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"gpt-5":{...EV,supports:{tool_choice:!0,reasoning:!0,parallel_tool_calls:!0,vision:!0,steering:!0},toolConfigOverrides:{splitEditingTools:!0}}}});async function pCt(t){let e=new nhe(t);return{shellTool:e.getShellTool(),otherTools:[e.getWriteShellTool(),e.getReadShellTool(),e.getStopShellTool()]}}async function VKl(t,e,l){if(B4e(e,"cloud"))return[new M$(new Lhe(e,l,void 0)).getStoreMemory()];if(B4e(e,"local")){let I=new M$(new Jhe(t.location));return[I.getStoreMemory(),I.getReadMemory()]}return[]}async function QKl(t,e,l,I){if(t.includeCodeQLTool){let n=new FZ(l,I),r=e.swebench_base_commit??await n.getCurrentCommitHash(t.location);return new Mpe(t,n,r,e,l).getCodeQLCheckerTool()}}c();function hCt(t,e){switch(t.kind){case"image_processing":return e.onImageProcessingEvent(t);case"images_removed":return e.onImageRemovalEvent(t);case"message":return e.onMessage(t);case"model_call_failure":return e.onModelCallFailure(t);case"model_call_success":return e.onModelCallSuccess(t);case"response":return e.onResponse(t);case"tool_execution":return e.onToolExecution(t);case"history_truncated":return e.onTruncationEvent(t);case"turn_started":case"turn_ended":case"turn_failed":case"turn_retry":return e.onTurnEvent(t);default:{let l=t;throw new Error(`unexpected event kind: ${JSON.stringify(t)}`)}}}c();c();c();import{Writable as zII}from"stream";c();c();c();c();c();var z={};Ju(z,{BRAND:()=>e8l,DIRTY:()=>iS,EMPTY_PATH:()=>vKl,INVALID:()=>Bn,NEVER:()=>V8l,OK:()=>nh,ParseStatus:()=>$b,Schema:()=>Aa,ZodAny:()=>f4,ZodArray:()=>DC,ZodBigInt:()=>mS,ZodBoolean:()=>uS,ZodBranded:()=>Jse,ZodCatch:()=>ES,ZodDate:()=>GS,ZodDefault:()=>yS,ZodDiscriminatedUnion:()=>tEe,ZodEffects:()=>mE,ZodEnum:()=>gS,ZodError:()=>GN,ZodFirstPartyTypeKind:()=>_n,ZodFunction:()=>IEe,ZodIntersection:()=>AS,ZodIssueCode:()=>vl,ZodLazy:()=>ZS,ZodLiteral:()=>NS,ZodMap:()=>Tj,ZodNaN:()=>Mj,ZodNativeEnum:()=>WS,ZodNever:()=>DR,ZodNull:()=>pS,ZodNullable:()=>VV,ZodNumber:()=>dS,ZodObject:()=>bN,ZodOptional:()=>iE,ZodParsedType:()=>QI,ZodPipeline:()=>Lse,ZodPromise:()=>H4,ZodReadonly:()=>RS,ZodRecord:()=>lEe,ZodSchema:()=>Aa,ZodSet:()=>Uj,ZodString:()=>v4,ZodSymbol:()=>Sj,ZodTransformer:()=>mE,ZodTuple:()=>YV,ZodType:()=>Aa,ZodUndefined:()=>bS,ZodUnion:()=>hS,ZodUnknown:()=>_C,ZodVoid:()=>Oj,addIssueToContext:()=>pI,any:()=>lTe,array:()=>km,bigint:()=>n8l,boolean:()=>Nu,coerce:()=>Bse,custom:()=>RCt,date:()=>r8l,datetimeRegex:()=>yCt,defaultErrorMap:()=>UC,discriminatedUnion:()=>nTe,effect:()=>Z8l,enum:()=>zR,function:()=>b8l,getErrorMap:()=>Lj,getParsedType:()=>RV,instanceof:()=>l8l,intersection:()=>m8l,isAborted:()=>$ye,isAsync:()=>Bj,isDirty:()=>eEe,isValid:()=>C4,late:()=>t8l,lazy:()=>p8l,literal:()=>Is,makeIssue:()=>kse,map:()=>u8l,nan:()=>I8l,nativeEnum:()=>h8l,never:()=>c8l,null:()=>o8l,nullable:()=>g8l,number:()=>QV,object:()=>Vn,objectUtil:()=>$Oe,oboolean:()=>Y8l,onumber:()=>R8l,optional:()=>N8l,ostring:()=>E8l,pipeline:()=>y8l,preprocess:()=>W8l,promise:()=>A8l,quotelessJson:()=>wKl,record:()=>zC,set:()=>G8l,setErrorMap:()=>CKl,strictObject:()=>d8l,string:()=>fl,symbol:()=>a8l,transformer:()=>Z8l,tuple:()=>rTe,undefined:()=>s8l,union:()=>rh,unknown:()=>ITe,util:()=>ls,void:()=>i8l});c();c();c();c();c();var ls;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function l(n){throw new Error}t.assertNever=l,t.arrayToEnum=n=>{let r={};for(let a of n)r[a]=a;return r},t.getValidEnumValues=n=>{let r=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of r)a[s]=n[s];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(r){return n[r]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let r=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.push(a);return r},t.find=(n,r)=>{for(let a of n)if(r(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function I(n,r=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(r)}t.joinValues=I,t.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(ls||(ls={}));var $Oe;(function(t){t.mergeShapes=(e,l)=>({...e,...l})})($Oe||($Oe={}));var QI=ls.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),RV=t=>{switch(typeof t){case"undefined":return QI.undefined;case"string":return QI.string;case"number":return Number.isNaN(t)?QI.nan:QI.number;case"boolean":return QI.boolean;case"function":return QI.function;case"bigint":return QI.bigint;case"symbol":return QI.symbol;case"object":return Array.isArray(t)?QI.array:t===null?QI.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?QI.promise:typeof Map<"u"&&t instanceof Map?QI.map:typeof Set<"u"&&t instanceof Set?QI.set:typeof Date<"u"&&t instanceof Date?QI.date:QI.object;default:return QI.unknown}};var vl=ls.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"]),wKl=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),GN=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=I=>{this.issues=[...this.issues,I]},this.addIssues=(I=[])=>{this.issues=[...this.issues,...I]};let l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=e}format(e){let l=e||function(r){return r.message},I={_errors:[]},n=r=>{for(let a of r.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)I._errors.push(l(a));else{let s=I,o=0;for(;o<a.path.length;){let d=a.path[o];o===a.path.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(l(a))):s[d]=s[d]||{_errors:[]},s=s[d],o++}}};return n(this),I}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ls.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=l=>l.message){let l={},I=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];l[r]=l[r]||[],l[r].push(e(n))}else I.push(e(n));return{formErrors:I,fieldErrors:l}}get formErrors(){return this.flatten()}};GN.create=t=>new GN(t);var FKl=(t,e)=>{let l;switch(t.code){case vl.invalid_type:t.received===QI.undefined?l="Required":l=`Expected ${t.expected}, received ${t.received}`;break;case vl.invalid_literal:l=`Invalid literal value, expected ${JSON.stringify(t.expected,ls.jsonStringifyReplacer)}`;break;case vl.unrecognized_keys:l=`Unrecognized key(s) in object: ${ls.joinValues(t.keys,", ")}`;break;case vl.invalid_union:l="Invalid input";break;case vl.invalid_union_discriminator:l=`Invalid discriminator value. Expected ${ls.joinValues(t.options)}`;break;case vl.invalid_enum_value:l=`Invalid enum value. Expected ${ls.joinValues(t.options)}, received '${t.received}'`;break;case vl.invalid_arguments:l="Invalid function arguments";break;case vl.invalid_return_type:l="Invalid function return type";break;case vl.invalid_date:l="Invalid date";break;case vl.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(l=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(l=`${l} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?l=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?l=`Invalid input: must end with "${t.validation.endsWith}"`:ls.assertNever(t.validation):t.validation!=="regex"?l=`Invalid ${t.validation}`:l="Invalid";break;case vl.too_small:t.type==="array"?l=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?l=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?l=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?l=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?l=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:l="Invalid input";break;case vl.too_big:t.type==="array"?l=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?l=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?l=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?l=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?l=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:l="Invalid input";break;case vl.custom:l="Invalid input";break;case vl.invalid_intersection_types:l="Intersection results could not be merged";break;case vl.not_multiple_of:l=`Number must be a multiple of ${t.multipleOf}`;break;case vl.not_finite:l="Number must be finite";break;default:l=e.defaultError,ls.assertNever(t)}return{message:l}},UC=FKl;var ACt=UC;function CKl(t){ACt=t}function Lj(){return ACt}c();var kse=t=>{let{data:e,path:l,errorMaps:I,issueData:n}=t,r=[...l,...n.path||[]],a={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let s="",o=I.filter(d=>!!d).slice().reverse();for(let d of o)s=d(a,{data:e,defaultError:s}).message;return{...n,path:r,message:s}},vKl=[];function pI(t,e){let l=Lj(),I=kse({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l,l===UC?void 0:UC].filter(n=>!!n)});t.common.issues.push(I)}var $b=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,l){let I=[];for(let n of l){if(n.status==="aborted")return Bn;n.status==="dirty"&&e.dirty(),I.push(n.value)}return{status:e.value,value:I}}static async mergeObjectAsync(e,l){let I=[];for(let n of l){let r=await n.key,a=await n.value;I.push({key:r,value:a})}return t.mergeObjectSync(e,I)}static mergeObjectSync(e,l){let I={};for(let n of l){let{key:r,value:a}=n;if(r.status==="aborted"||a.status==="aborted")return Bn;r.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(I[r.value]=a.value)}return{status:e.value,value:I}}},Bn=Object.freeze({status:"aborted"}),iS=t=>({status:"dirty",value:t}),nh=t=>({status:"valid",value:t}),$ye=t=>t.status==="aborted",eEe=t=>t.status==="dirty",C4=t=>t.status==="valid",Bj=t=>typeof Promise<"u"&&t instanceof Promise;c();c();var In;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(In||(In={}));var dE=class{constructor(e,l,I,n){this._cachedPath=[],this.parent=e,this.data=l,this._path=I,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ZCt=(t,e)=>{if(C4(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let l=new GN(t.common.issues);return this._error=l,this._error}}};function qr(t){if(!t)return{};let{errorMap:e,invalid_type_error:l,required_error:I,description:n}=t;if(e&&(l||I))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,s)=>{let{message:o}=t;return a.code==="invalid_enum_value"?{message:o??s.defaultError}:typeof s.data>"u"?{message:o??I??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:o??l??s.defaultError}},description:n}}var Aa=class{get description(){return this._def.description}_getType(e){return RV(e.data)}_getOrReturnCtx(e,l){return l||{common:e.parent.common,data:e.data,parsedType:RV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $b,ctx:{common:e.parent.common,data:e.data,parsedType:RV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let l=this._parse(e);if(Bj(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(e){let l=this._parse(e);return Promise.resolve(l)}parse(e,l){let I=this.safeParse(e,l);if(I.success)return I.data;throw I.error}safeParse(e,l){let I={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)},n=this._parseSync({data:e,path:I.path,parent:I});return ZCt(I,n)}"~validate"(e){let l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)};if(!this["~standard"].async)try{let I=this._parseSync({data:e,path:[],parent:l});return C4(I)?{value:I.value}:{issues:l.common.issues}}catch(I){I?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:l}).then(I=>C4(I)?{value:I.value}:{issues:l.common.issues})}async parseAsync(e,l){let I=await this.safeParseAsync(e,l);if(I.success)return I.data;throw I.error}async safeParseAsync(e,l){let I={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)},n=this._parse({data:e,path:I.path,parent:I}),r=await(Bj(n)?n:Promise.resolve(n));return ZCt(I,r)}refine(e,l){let I=n=>typeof l=="string"||typeof l>"u"?{message:l}:typeof l=="function"?l(n):l;return this._refinement((n,r)=>{let a=e(n),s=()=>r.addIssue({code:vl.custom,...I(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(o=>o?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,l){return this._refinement((I,n)=>e(I)?!0:(n.addIssue(typeof l=="function"?l(I,n):l),!1))}_refinement(e){return new mE({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:l=>this["~validate"](l)}}optional(){return iE.create(this,this._def)}nullable(){return VV.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return DC.create(this)}promise(){return H4.create(this,this._def)}or(e){return hS.create([this,e],this._def)}and(e){return AS.create(this,e,this._def)}transform(e){return new mE({...qr(this._def),schema:this,typeName:_n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let l=typeof e=="function"?e:()=>e;return new yS({...qr(this._def),innerType:this,defaultValue:l,typeName:_n.ZodDefault})}brand(){return new Jse({typeName:_n.ZodBranded,type:this,...qr(this._def)})}catch(e){let l=typeof e=="function"?e:()=>e;return new ES({...qr(this._def),innerType:this,catchValue:l,typeName:_n.ZodCatch})}describe(e){let l=this.constructor;return new l({...this._def,description:e})}pipe(e){return Lse.create(this,e)}readonly(){return RS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fKl=/^c[^\s-]{8,}$/i,HKl=/^[0-9a-z]+$/,XKl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kKl=/^[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,JKl=/^[a-z0-9_-]{21}$/i,LKl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BKl=/^[-+]?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)?)??$/,xKl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SKl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eTe,OKl=/^(?:(?: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])$/,TKl=/^(?:(?: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])$/,UKl=/^(([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]))$/,MKl=/^(([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])$/,_Kl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DKl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gCt="((\\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])))",zKl=new RegExp(`^${gCt}$`);function WCt(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let l=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${l}`}function PKl(t){return new RegExp(`^${WCt(t)}$`)}function yCt(t){let e=`${gCt}T${WCt(t)}`,l=[];return l.push(t.local?"Z?":"Z"),t.offset&&l.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${l.join("|")})`,new RegExp(`^${e}$`)}function jKl(t,e){return!!((e==="v4"||!e)&&OKl.test(t)||(e==="v6"||!e)&&UKl.test(t))}function KKl(t,e){if(!LKl.test(t))return!1;try{let[l]=t.split(".");if(!l)return!1;let I=l.replace(/-/g,"+").replace(/_/g,"/").padEnd(l.length+(4-l.length%4)%4,"="),n=JSON.parse(atob(I));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function qKl(t,e){return!!((e==="v4"||!e)&&TKl.test(t)||(e==="v6"||!e)&&MKl.test(t))}var v4=class t extends Aa{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==QI.string){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.string,received:r.parsedType}),Bn}let I=new $b,n;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),I.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),I.dirty());else if(r.kind==="length"){let a=e.data.length>r.value,s=e.data.length<r.value;(a||s)&&(n=this._getOrReturnCtx(e,n),a?pI(n,{code:vl.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&pI(n,{code:vl.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),I.dirty())}else if(r.kind==="email")xKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"email",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="emoji")eTe||(eTe=new RegExp(SKl,"u")),eTe.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"emoji",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="uuid")kKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"uuid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="nanoid")JKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"nanoid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="cuid")fKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cuid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="cuid2")HKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cuid2",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="ulid")XKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"ulid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),pI(n,{validation:"url",code:vl.invalid_string,message:r.message}),I.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"regex",code:vl.invalid_string,message:r.message}),I.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),I.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{startsWith:r.value},message:r.message}),I.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{endsWith:r.value},message:r.message}),I.dirty()):r.kind==="datetime"?yCt(r).test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"datetime",message:r.message}),I.dirty()):r.kind==="date"?zKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"date",message:r.message}),I.dirty()):r.kind==="time"?PKl(r).test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"time",message:r.message}),I.dirty()):r.kind==="duration"?BKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"duration",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="ip"?jKl(e.data,r.version)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"ip",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="jwt"?KKl(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"jwt",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="cidr"?qKl(e.data,r.version)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cidr",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="base64"?_Kl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"base64",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="base64url"?DKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"base64url",code:vl.invalid_string,message:r.message}),I.dirty()):ls.assertNever(r);return{status:I.value,value:e.data}}_regex(e,l,I){return this.refinement(n=>e.test(n),{validation:l,code:vl.invalid_string,...In.errToObj(I)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...In.errToObj(e)})}url(e){return this._addCheck({kind:"url",...In.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...In.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...In.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...In.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...In.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...In.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...In.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...In.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...In.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...In.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...In.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...In.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...In.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...In.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...In.errToObj(e)})}regex(e,l){return this._addCheck({kind:"regex",regex:e,...In.errToObj(l)})}includes(e,l){return this._addCheck({kind:"includes",value:e,position:l?.position,...In.errToObj(l?.message)})}startsWith(e,l){return this._addCheck({kind:"startsWith",value:e,...In.errToObj(l)})}endsWith(e,l){return this._addCheck({kind:"endsWith",value:e,...In.errToObj(l)})}min(e,l){return this._addCheck({kind:"min",value:e,...In.errToObj(l)})}max(e,l){return this._addCheck({kind:"max",value:e,...In.errToObj(l)})}length(e,l){return this._addCheck({kind:"length",value:e,...In.errToObj(l)})}nonempty(e){return this.min(1,In.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxLength(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}};v4.create=t=>new v4({checks:[],typeName:_n.ZodString,coerce:t?.coerce??!1,...qr(t)});function $Kl(t,e){let l=(t.toString().split(".")[1]||"").length,I=(e.toString().split(".")[1]||"").length,n=l>I?l:I,r=Number.parseInt(t.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return r%a/10**n}var dS=class t extends Aa{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==QI.number){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.number,received:r.parsedType}),Bn}let I,n=new $b;for(let r of this._def.checks)r.kind==="int"?ls.isInteger(e.data)||(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?$Kl(e.data,r.value)!==0&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_finite,message:r.message}),n.dirty()):ls.assertNever(r);return{status:n.value,value:e.data}}gte(e,l){return this.setLimit("min",e,!0,In.toString(l))}gt(e,l){return this.setLimit("min",e,!1,In.toString(l))}lte(e,l){return this.setLimit("max",e,!0,In.toString(l))}lt(e,l){return this.setLimit("max",e,!1,In.toString(l))}setLimit(e,l,I,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:l,inclusive:I,message:In.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:In.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:In.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:In.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:In.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:In.toString(e)})}multipleOf(e,l){return this._addCheck({kind:"multipleOf",value:e,message:In.toString(l)})}finite(e){return this._addCheck({kind:"finite",message:In.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:In.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:In.toString(e)})}get minValue(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxValue(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ls.isInteger(e.value))}get isFinite(){let e=null,l=null;for(let I of this._def.checks){if(I.kind==="finite"||I.kind==="int"||I.kind==="multipleOf")return!0;I.kind==="min"?(l===null||I.value>l)&&(l=I.value):I.kind==="max"&&(e===null||I.value<e)&&(e=I.value)}return Number.isFinite(l)&&Number.isFinite(e)}};dS.create=t=>new dS({checks:[],typeName:_n.ZodNumber,coerce:t?.coerce||!1,...qr(t)});var mS=class t extends Aa{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==QI.bigint)return this._getInvalidInput(e);let I,n=new $b;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):ls.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let l=this._getOrReturnCtx(e);return pI(l,{code:vl.invalid_type,expected:QI.bigint,received:l.parsedType}),Bn}gte(e,l){return this.setLimit("min",e,!0,In.toString(l))}gt(e,l){return this.setLimit("min",e,!1,In.toString(l))}lte(e,l){return this.setLimit("max",e,!0,In.toString(l))}lt(e,l){return this.setLimit("max",e,!1,In.toString(l))}setLimit(e,l,I,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:l,inclusive:I,message:In.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:In.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:In.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:In.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:In.toString(e)})}multipleOf(e,l){return this._addCheck({kind:"multipleOf",value:e,message:In.toString(l)})}get minValue(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxValue(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}};mS.create=t=>new mS({checks:[],typeName:_n.ZodBigInt,coerce:t?.coerce??!1,...qr(t)});var uS=class extends Aa{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==QI.boolean){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.boolean,received:I.parsedType}),Bn}return nh(e.data)}};uS.create=t=>new uS({typeName:_n.ZodBoolean,coerce:t?.coerce||!1,...qr(t)});var GS=class t extends Aa{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==QI.date){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.date,received:r.parsedType}),Bn}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_date}),Bn}let I=new $b,n;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),I.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),I.dirty()):ls.assertNever(r);return{status:I.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,l){return this._addCheck({kind:"min",value:e.getTime(),message:In.toString(l)})}max(e,l){return this._addCheck({kind:"max",value:e.getTime(),message:In.toString(l)})}get minDate(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e!=null?new Date(e):null}};GS.create=t=>new GS({checks:[],coerce:t?.coerce||!1,typeName:_n.ZodDate,...qr(t)});var Sj=class extends Aa{_parse(e){if(this._getType(e)!==QI.symbol){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.symbol,received:I.parsedType}),Bn}return nh(e.data)}};Sj.create=t=>new Sj({typeName:_n.ZodSymbol,...qr(t)});var bS=class extends Aa{_parse(e){if(this._getType(e)!==QI.undefined){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.undefined,received:I.parsedType}),Bn}return nh(e.data)}};bS.create=t=>new bS({typeName:_n.ZodUndefined,...qr(t)});var pS=class extends Aa{_parse(e){if(this._getType(e)!==QI.null){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.null,received:I.parsedType}),Bn}return nh(e.data)}};pS.create=t=>new pS({typeName:_n.ZodNull,...qr(t)});var f4=class extends Aa{constructor(){super(...arguments),this._any=!0}_parse(e){return nh(e.data)}};f4.create=t=>new f4({typeName:_n.ZodAny,...qr(t)});var _C=class extends Aa{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nh(e.data)}};_C.create=t=>new _C({typeName:_n.ZodUnknown,...qr(t)});var DR=class extends Aa{_parse(e){let l=this._getOrReturnCtx(e);return pI(l,{code:vl.invalid_type,expected:QI.never,received:l.parsedType}),Bn}};DR.create=t=>new DR({typeName:_n.ZodNever,...qr(t)});var Oj=class extends Aa{_parse(e){if(this._getType(e)!==QI.undefined){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.void,received:I.parsedType}),Bn}return nh(e.data)}};Oj.create=t=>new Oj({typeName:_n.ZodVoid,...qr(t)});var DC=class t extends Aa{_parse(e){let{ctx:l,status:I}=this._processInputParams(e),n=this._def;if(l.parsedType!==QI.array)return pI(l,{code:vl.invalid_type,expected:QI.array,received:l.parsedType}),Bn;if(n.exactLength!==null){let a=l.data.length>n.exactLength.value,s=l.data.length<n.exactLength.value;(a||s)&&(pI(l,{code:a?vl.too_big:vl.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),I.dirty())}if(n.minLength!==null&&l.data.length<n.minLength.value&&(pI(l,{code:vl.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),I.dirty()),n.maxLength!==null&&l.data.length>n.maxLength.value&&(pI(l,{code:vl.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),I.dirty()),l.common.async)return Promise.all([...l.data].map((a,s)=>n.type._parseAsync(new dE(l,a,l.path,s)))).then(a=>$b.mergeArray(I,a));let r=[...l.data].map((a,s)=>n.type._parseSync(new dE(l,a,l.path,s)));return $b.mergeArray(I,r)}get element(){return this._def.type}min(e,l){return new t({...this._def,minLength:{value:e,message:In.toString(l)}})}max(e,l){return new t({...this._def,maxLength:{value:e,message:In.toString(l)}})}length(e,l){return new t({...this._def,exactLength:{value:e,message:In.toString(l)}})}nonempty(e){return this.min(1,e)}};DC.create=(t,e)=>new DC({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_n.ZodArray,...qr(e)});function xj(t){if(t instanceof bN){let e={};for(let l in t.shape){let I=t.shape[l];e[l]=iE.create(xj(I))}return new bN({...t._def,shape:()=>e})}else return t instanceof DC?new DC({...t._def,type:xj(t.element)}):t instanceof iE?iE.create(xj(t.unwrap())):t instanceof VV?VV.create(xj(t.unwrap())):t instanceof YV?YV.create(t.items.map(e=>xj(e))):t}var bN=class t extends Aa{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),l=ls.objectKeys(e);return this._cached={shape:e,keys:l},this._cached}_parse(e){if(this._getType(e)!==QI.object){let d=this._getOrReturnCtx(e);return pI(d,{code:vl.invalid_type,expected:QI.object,received:d.parsedType}),Bn}let{status:I,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof DR&&this._def.unknownKeys==="strip"))for(let d in n.data)a.includes(d)||s.push(d);let o=[];for(let d of a){let m=r[d],b=n.data[d];o.push({key:{status:"valid",value:d},value:m._parse(new dE(n,b,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof DR){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of s)o.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(d==="strict")s.length>0&&(pI(n,{code:vl.unrecognized_keys,keys:s}),I.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of s){let b=n.data[m];o.push({key:{status:"valid",value:m},value:d._parse(new dE(n,b,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of o){let b=await m.key,p=await m.value;d.push({key:b,value:p,alwaysSet:m.alwaysSet})}return d}).then(d=>$b.mergeObjectSync(I,d)):$b.mergeObjectSync(I,o)}get shape(){return this._def.shape()}strict(e){return In.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(l,I)=>{let n=this._def.errorMap?.(l,I).message??I.defaultError;return l.code==="unrecognized_keys"?{message:In.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_n.ZodObject})}setKey(e,l){return this.augment({[e]:l})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let l={};for(let I of ls.objectKeys(e))e[I]&&this.shape[I]&&(l[I]=this.shape[I]);return new t({...this._def,shape:()=>l})}omit(e){let l={};for(let I of ls.objectKeys(this.shape))e[I]||(l[I]=this.shape[I]);return new t({...this._def,shape:()=>l})}deepPartial(){return xj(this)}partial(e){let l={};for(let I of ls.objectKeys(this.shape)){let n=this.shape[I];e&&!e[I]?l[I]=n:l[I]=n.optional()}return new t({...this._def,shape:()=>l})}required(e){let l={};for(let I of ls.objectKeys(this.shape))if(e&&!e[I])l[I]=this.shape[I];else{let r=this.shape[I];for(;r instanceof iE;)r=r._def.innerType;l[I]=r}return new t({...this._def,shape:()=>l})}keyof(){return ECt(ls.objectKeys(this.shape))}};bN.create=(t,e)=>new bN({shape:()=>t,unknownKeys:"strip",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});bN.strictCreate=(t,e)=>new bN({shape:()=>t,unknownKeys:"strict",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});bN.lazycreate=(t,e)=>new bN({shape:t,unknownKeys:"strip",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});var hS=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=this._def.options;function n(r){for(let s of r)if(s.result.status==="valid")return s.result;for(let s of r)if(s.result.status==="dirty")return l.common.issues.push(...s.ctx.common.issues),s.result;let a=r.map(s=>new GN(s.ctx.common.issues));return pI(l,{code:vl.invalid_union,unionErrors:a}),Bn}if(l.common.async)return Promise.all(I.map(async r=>{let a={...l,common:{...l.common,issues:[]},parent:null};return{result:await r._parseAsync({data:l.data,path:l.path,parent:a}),ctx:a}})).then(n);{let r,a=[];for(let o of I){let d={...l,common:{...l.common,issues:[]},parent:null},m=o._parseSync({data:l.data,path:l.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!r&&(r={result:m,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(r)return l.common.issues.push(...r.ctx.common.issues),r.result;let s=a.map(o=>new GN(o));return pI(l,{code:vl.invalid_union,unionErrors:s}),Bn}}get options(){return this._def.options}};hS.create=(t,e)=>new hS({options:t,typeName:_n.ZodUnion,...qr(e)});var MC=t=>t instanceof ZS?MC(t.schema):t instanceof mE?MC(t.innerType()):t instanceof NS?[t.value]:t instanceof gS?t.options:t instanceof WS?ls.objectValues(t.enum):t instanceof yS?MC(t._def.innerType):t instanceof bS?[void 0]:t instanceof pS?[null]:t instanceof iE?[void 0,...MC(t.unwrap())]:t instanceof VV?[null,...MC(t.unwrap())]:t instanceof Jse||t instanceof RS?MC(t.unwrap()):t instanceof ES?MC(t._def.innerType):[],tEe=class t extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.object)return pI(l,{code:vl.invalid_type,expected:QI.object,received:l.parsedType}),Bn;let I=this.discriminator,n=l.data[I],r=this.optionsMap.get(n);return r?l.common.async?r._parseAsync({data:l.data,path:l.path,parent:l}):r._parseSync({data:l.data,path:l.path,parent:l}):(pI(l,{code:vl.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[I]}),Bn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,l,I){let n=new Map;for(let r of l){let a=MC(r.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,r)}}return new t({typeName:_n.ZodDiscriminatedUnion,discriminator:e,options:l,optionsMap:n,...qr(I)})}};function tTe(t,e){let l=RV(t),I=RV(e);if(t===e)return{valid:!0,data:t};if(l===QI.object&&I===QI.object){let n=ls.objectKeys(e),r=ls.objectKeys(t).filter(s=>n.indexOf(s)!==-1),a={...t,...e};for(let s of r){let o=tTe(t[s],e[s]);if(!o.valid)return{valid:!1};a[s]=o.data}return{valid:!0,data:a}}else if(l===QI.array&&I===QI.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let r=0;r<t.length;r++){let a=t[r],s=e[r],o=tTe(a,s);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else return l===QI.date&&I===QI.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var AS=class extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e),n=(r,a)=>{if($ye(r)||$ye(a))return Bn;let s=tTe(r.value,a.value);return s.valid?((eEe(r)||eEe(a))&&l.dirty(),{status:l.value,value:s.data}):(pI(I,{code:vl.invalid_intersection_types}),Bn)};return I.common.async?Promise.all([this._def.left._parseAsync({data:I.data,path:I.path,parent:I}),this._def.right._parseAsync({data:I.data,path:I.path,parent:I})]).then(([r,a])=>n(r,a)):n(this._def.left._parseSync({data:I.data,path:I.path,parent:I}),this._def.right._parseSync({data:I.data,path:I.path,parent:I}))}};AS.create=(t,e,l)=>new AS({left:t,right:e,typeName:_n.ZodIntersection,...qr(l)});var YV=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.array)return pI(I,{code:vl.invalid_type,expected:QI.array,received:I.parsedType}),Bn;if(I.data.length<this._def.items.length)return pI(I,{code:vl.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bn;!this._def.rest&&I.data.length>this._def.items.length&&(pI(I,{code:vl.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());let r=[...I.data].map((a,s)=>{let o=this._def.items[s]||this._def.rest;return o?o._parse(new dE(I,a,I.path,s)):null}).filter(a=>!!a);return I.common.async?Promise.all(r).then(a=>$b.mergeArray(l,a)):$b.mergeArray(l,r)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};YV.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new YV({items:t,typeName:_n.ZodTuple,rest:null,...qr(e)})};var lEe=class t extends Aa{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.object)return pI(I,{code:vl.invalid_type,expected:QI.object,received:I.parsedType}),Bn;let n=[],r=this._def.keyType,a=this._def.valueType;for(let s in I.data)n.push({key:r._parse(new dE(I,s,I.path,s)),value:a._parse(new dE(I,I.data[s],I.path,s)),alwaysSet:s in I.data});return I.common.async?$b.mergeObjectAsync(l,n):$b.mergeObjectSync(l,n)}get element(){return this._def.valueType}static create(e,l,I){return l instanceof Aa?new t({keyType:e,valueType:l,typeName:_n.ZodRecord,...qr(I)}):new t({keyType:v4.create(),valueType:e,typeName:_n.ZodRecord,...qr(l)})}},Tj=class extends Aa{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.map)return pI(I,{code:vl.invalid_type,expected:QI.map,received:I.parsedType}),Bn;let n=this._def.keyType,r=this._def.valueType,a=[...I.data.entries()].map(([s,o],d)=>({key:n._parse(new dE(I,s,I.path,[d,"key"])),value:r._parse(new dE(I,o,I.path,[d,"value"]))}));if(I.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let o of a){let d=await o.key,m=await o.value;if(d.status==="aborted"||m.status==="aborted")return Bn;(d.status==="dirty"||m.status==="dirty")&&l.dirty(),s.set(d.value,m.value)}return{status:l.value,value:s}})}else{let s=new Map;for(let o of a){let d=o.key,m=o.value;if(d.status==="aborted"||m.status==="aborted")return Bn;(d.status==="dirty"||m.status==="dirty")&&l.dirty(),s.set(d.value,m.value)}return{status:l.value,value:s}}}};Tj.create=(t,e,l)=>new Tj({valueType:e,keyType:t,typeName:_n.ZodMap,...qr(l)});var Uj=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.set)return pI(I,{code:vl.invalid_type,expected:QI.set,received:I.parsedType}),Bn;let n=this._def;n.minSize!==null&&I.data.size<n.minSize.value&&(pI(I,{code:vl.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),l.dirty()),n.maxSize!==null&&I.data.size>n.maxSize.value&&(pI(I,{code:vl.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),l.dirty());let r=this._def.valueType;function a(o){let d=new Set;for(let m of o){if(m.status==="aborted")return Bn;m.status==="dirty"&&l.dirty(),d.add(m.value)}return{status:l.value,value:d}}let s=[...I.data.values()].map((o,d)=>r._parse(new dE(I,o,I.path,d)));return I.common.async?Promise.all(s).then(o=>a(o)):a(s)}min(e,l){return new t({...this._def,minSize:{value:e,message:In.toString(l)}})}max(e,l){return new t({...this._def,maxSize:{value:e,message:In.toString(l)}})}size(e,l){return this.min(e,l).max(e,l)}nonempty(e){return this.min(1,e)}};Uj.create=(t,e)=>new Uj({valueType:t,minSize:null,maxSize:null,typeName:_n.ZodSet,...qr(e)});var IEe=class t extends Aa{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.function)return pI(l,{code:vl.invalid_type,expected:QI.function,received:l.parsedType}),Bn;function I(s,o){return kse({data:s,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,Lj(),UC].filter(d=>!!d),issueData:{code:vl.invalid_arguments,argumentsError:o}})}function n(s,o){return kse({data:s,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,Lj(),UC].filter(d=>!!d),issueData:{code:vl.invalid_return_type,returnTypeError:o}})}let r={errorMap:l.common.contextualErrorMap},a=l.data;if(this._def.returns instanceof H4){let s=this;return nh(async function(...o){let d=new GN([]),m=await s._def.args.parseAsync(o,r).catch(A=>{throw d.addIssue(I(o,A)),d}),b=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(b,r).catch(A=>{throw d.addIssue(n(b,A)),d})})}else{let s=this;return nh(function(...o){let d=s._def.args.safeParse(o,r);if(!d.success)throw new GN([I(o,d.error)]);let m=Reflect.apply(a,this,d.data),b=s._def.returns.safeParse(m,r);if(!b.success)throw new GN([n(m,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:YV.create(e).rest(_C.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,l,I){return new t({args:e||YV.create([]).rest(_C.create()),returns:l||_C.create(),typeName:_n.ZodFunction,...qr(I)})}},ZS=class extends Aa{get schema(){return this._def.getter()}_parse(e){let{ctx:l}=this._processInputParams(e);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}};ZS.create=(t,e)=>new ZS({getter:t,typeName:_n.ZodLazy,...qr(e)});var NS=class extends Aa{_parse(e){if(e.data!==this._def.value){let l=this._getOrReturnCtx(e);return pI(l,{received:l.data,code:vl.invalid_literal,expected:this._def.value}),Bn}return{status:"valid",value:e.data}}get value(){return this._def.value}};NS.create=(t,e)=>new NS({value:t,typeName:_n.ZodLiteral,...qr(e)});function ECt(t,e){return new gS({values:t,typeName:_n.ZodEnum,...qr(e)})}var gS=class t extends Aa{_parse(e){if(typeof e.data!="string"){let l=this._getOrReturnCtx(e),I=this._def.values;return pI(l,{expected:ls.joinValues(I),received:l.parsedType,code:vl.invalid_type}),Bn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let l=this._getOrReturnCtx(e),I=this._def.values;return pI(l,{received:l.data,code:vl.invalid_enum_value,options:I}),Bn}return nh(e.data)}get options(){return this._def.values}get enum(){let e={};for(let l of this._def.values)e[l]=l;return e}get Values(){let e={};for(let l of this._def.values)e[l]=l;return e}get Enum(){let e={};for(let l of this._def.values)e[l]=l;return e}extract(e,l=this._def){return t.create(e,{...this._def,...l})}exclude(e,l=this._def){return t.create(this.options.filter(I=>!e.includes(I)),{...this._def,...l})}};gS.create=ECt;var WS=class extends Aa{_parse(e){let l=ls.getValidEnumValues(this._def.values),I=this._getOrReturnCtx(e);if(I.parsedType!==QI.string&&I.parsedType!==QI.number){let n=ls.objectValues(l);return pI(I,{expected:ls.joinValues(n),received:I.parsedType,code:vl.invalid_type}),Bn}if(this._cache||(this._cache=new Set(ls.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=ls.objectValues(l);return pI(I,{received:I.data,code:vl.invalid_enum_value,options:n}),Bn}return nh(e.data)}get enum(){return this._def.values}};WS.create=(t,e)=>new WS({values:t,typeName:_n.ZodNativeEnum,...qr(e)});var H4=class extends Aa{unwrap(){return this._def.type}_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.promise&&l.common.async===!1)return pI(l,{code:vl.invalid_type,expected:QI.promise,received:l.parsedType}),Bn;let I=l.parsedType===QI.promise?l.data:Promise.resolve(l.data);return nh(I.then(n=>this._def.type.parseAsync(n,{path:l.path,errorMap:l.common.contextualErrorMap})))}};H4.create=(t,e)=>new H4({type:t,typeName:_n.ZodPromise,...qr(e)});var mE=class extends Aa{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:l,ctx:I}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:a=>{pI(I,a),a.fatal?l.abort():l.dirty()},get path(){return I.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){let a=n.transform(I.data,r);if(I.common.async)return Promise.resolve(a).then(async s=>{if(l.value==="aborted")return Bn;let o=await this._def.schema._parseAsync({data:s,path:I.path,parent:I});return o.status==="aborted"?Bn:o.status==="dirty"?iS(o.value):l.value==="dirty"?iS(o.value):o});{if(l.value==="aborted")return Bn;let s=this._def.schema._parseSync({data:a,path:I.path,parent:I});return s.status==="aborted"?Bn:s.status==="dirty"?iS(s.value):l.value==="dirty"?iS(s.value):s}}if(n.type==="refinement"){let a=s=>{let o=n.refinement(s,r);if(I.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(I.common.async===!1){let s=this._def.schema._parseSync({data:I.data,path:I.path,parent:I});return s.status==="aborted"?Bn:(s.status==="dirty"&&l.dirty(),a(s.value),{status:l.value,value:s.value})}else return this._def.schema._parseAsync({data:I.data,path:I.path,parent:I}).then(s=>s.status==="aborted"?Bn:(s.status==="dirty"&&l.dirty(),a(s.value).then(()=>({status:l.value,value:s.value}))))}if(n.type==="transform")if(I.common.async===!1){let a=this._def.schema._parseSync({data:I.data,path:I.path,parent:I});if(!C4(a))return Bn;let s=n.transform(a.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:s}}else return this._def.schema._parseAsync({data:I.data,path:I.path,parent:I}).then(a=>C4(a)?Promise.resolve(n.transform(a.value,r)).then(s=>({status:l.value,value:s})):Bn);ls.assertNever(n)}};mE.create=(t,e,l)=>new mE({schema:t,typeName:_n.ZodEffects,effect:e,...qr(l)});mE.createWithPreprocess=(t,e,l)=>new mE({schema:e,effect:{type:"preprocess",transform:t},typeName:_n.ZodEffects,...qr(l)});var iE=class extends Aa{_parse(e){return this._getType(e)===QI.undefined?nh(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};iE.create=(t,e)=>new iE({innerType:t,typeName:_n.ZodOptional,...qr(e)});var VV=class extends Aa{_parse(e){return this._getType(e)===QI.null?nh(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};VV.create=(t,e)=>new VV({innerType:t,typeName:_n.ZodNullable,...qr(e)});var yS=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=l.data;return l.parsedType===QI.undefined&&(I=this._def.defaultValue()),this._def.innerType._parse({data:I,path:l.path,parent:l})}removeDefault(){return this._def.innerType}};yS.create=(t,e)=>new yS({innerType:t,typeName:_n.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...qr(e)});var ES=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I={...l,common:{...l.common,issues:[]}},n=this._def.innerType._parse({data:I.data,path:I.path,parent:{...I}});return Bj(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new GN(I.common.issues)},input:I.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new GN(I.common.issues)},input:I.data})}}removeCatch(){return this._def.innerType}};ES.create=(t,e)=>new ES({innerType:t,typeName:_n.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...qr(e)});var Mj=class extends Aa{_parse(e){if(this._getType(e)!==QI.nan){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.nan,received:I.parsedType}),Bn}return{status:"valid",value:e.data}}};Mj.create=t=>new Mj({typeName:_n.ZodNaN,...qr(t)});var e8l=Symbol("zod_brand"),Jse=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=l.data;return this._def.type._parse({data:I,path:l.path,parent:l})}unwrap(){return this._def.type}},Lse=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:I.data,path:I.path,parent:I});return r.status==="aborted"?Bn:r.status==="dirty"?(l.dirty(),iS(r.value)):this._def.out._parseAsync({data:r.value,path:I.path,parent:I})})();{let n=this._def.in._parseSync({data:I.data,path:I.path,parent:I});return n.status==="aborted"?Bn:n.status==="dirty"?(l.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:I.path,parent:I})}}static create(e,l){return new t({in:e,out:l,typeName:_n.ZodPipeline})}},RS=class extends Aa{_parse(e){let l=this._def.innerType._parse(e),I=n=>(C4(n)&&(n.value=Object.freeze(n.value)),n);return Bj(l)?l.then(n=>I(n)):I(l)}unwrap(){return this._def.innerType}};RS.create=(t,e)=>new RS({innerType:t,typeName:_n.ZodReadonly,...qr(e)});function NCt(t,e){let l=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof l=="string"?{message:l}:l}function RCt(t,e={},l){return t?f4.create().superRefine((I,n)=>{let r=t(I);if(r instanceof Promise)return r.then(a=>{if(!a){let s=NCt(e,I),o=s.fatal??l??!0;n.addIssue({code:"custom",...s,fatal:o})}});if(!r){let a=NCt(e,I),s=a.fatal??l??!0;n.addIssue({code:"custom",...a,fatal:s})}}):f4.create()}var t8l={object:bN.lazycreate},_n;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_n||(_n={}));var l8l=(t,e={message:`Input not instance of ${t.name}`})=>RCt(l=>l instanceof t,e),fl=v4.create,QV=dS.create,I8l=Mj.create,n8l=mS.create,Nu=uS.create,r8l=GS.create,a8l=Sj.create,s8l=bS.create,o8l=pS.create,lTe=f4.create,ITe=_C.create,c8l=DR.create,i8l=Oj.create,km=DC.create,Vn=bN.create,d8l=bN.strictCreate,rh=hS.create,nTe=tEe.create,m8l=AS.create,rTe=YV.create,zC=lEe.create,u8l=Tj.create,G8l=Uj.create,b8l=IEe.create,p8l=ZS.create,Is=NS.create,zR=gS.create,h8l=WS.create,A8l=H4.create,Z8l=mE.create,N8l=iE.create,g8l=VV.create,W8l=mE.createWithPreprocess,y8l=Lse.create,E8l=()=>fl().optional(),R8l=()=>QV().optional(),Y8l=()=>Nu().optional(),Bse={string:t=>v4.create({...t,coerce:!0}),number:t=>dS.create({...t,coerce:!0}),boolean:t=>uS.create({...t,coerce:!0}),bigint:t=>mS.create({...t,coerce:!0}),date:t=>GS.create({...t,coerce:!0})};var V8l=Bn;var _j="2025-06-18";var YCt=[_j,"2025-03-26","2024-11-05","2024-10-07"],nEe="2.0",VCt=z.union([z.string(),z.number().int()]),QCt=z.string(),Q8l=z.object({progressToken:z.optional(VCt)}).passthrough(),bE=z.object({_meta:z.optional(Q8l)}).passthrough(),pN=z.object({method:z.string(),params:z.optional(bE)}),Sse=z.object({_meta:z.optional(z.object({}).passthrough())}).passthrough(),wV=z.object({method:z.string(),params:z.optional(Sse)}),pE=z.object({_meta:z.optional(z.object({}).passthrough())}).passthrough(),rEe=z.union([z.string(),z.number().int()]),wCt=z.object({jsonrpc:z.literal(nEe),id:rEe}).merge(pN).strict(),aEe=t=>wCt.safeParse(t).success,FCt=z.object({jsonrpc:z.literal(nEe)}).merge(wV).strict(),CCt=t=>FCt.safeParse(t).success,vCt=z.object({jsonrpc:z.literal(nEe),id:rEe,result:pE}).strict(),Ose=t=>vCt.safeParse(t).success,uE;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(uE||(uE={}));var fCt=z.object({jsonrpc:z.literal(nEe),id:rEe,error:z.object({code:z.number().int(),message:z.string(),data:z.optional(z.unknown())})}).strict(),HCt=t=>fCt.safeParse(t).success,X4=z.union([wCt,FCt,vCt,fCt]),YS=pE.strict(),sEe=wV.extend({method:z.literal("notifications/cancelled"),params:Sse.extend({requestId:rEe,reason:z.string().optional()})}),oEe=z.object({src:z.string(),mimeType:z.optional(z.string()),sizes:z.optional(z.string())}).passthrough(),Tse=z.object({name:z.string(),title:z.optional(z.string())}).passthrough(),XCt=Tse.extend({version:z.string(),websiteUrl:z.optional(z.string()),icons:z.optional(z.array(oEe))}),w8l=z.object({experimental:z.optional(z.object({}).passthrough()),sampling:z.optional(z.object({}).passthrough()),elicitation:z.optional(z.object({}).passthrough()),roots:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough())}).passthrough(),F8l=pN.extend({method:z.literal("initialize"),params:bE.extend({protocolVersion:z.string(),capabilities:w8l,clientInfo:XCt})});var C8l=z.object({experimental:z.optional(z.object({}).passthrough()),logging:z.optional(z.object({}).passthrough()),completions:z.optional(z.object({}).passthrough()),prompts:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough()),resources:z.optional(z.object({subscribe:z.optional(z.boolean()),listChanged:z.optional(z.boolean())}).passthrough()),tools:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough())}).passthrough(),aTe=pE.extend({protocolVersion:z.string(),capabilities:C8l,serverInfo:XCt,instructions:z.optional(z.string())}),kCt=wV.extend({method:z.literal("notifications/initialized")}),JCt=t=>kCt.safeParse(t).success,cEe=pN.extend({method:z.literal("ping")}),v8l=z.object({progress:z.number(),total:z.optional(z.number()),message:z.optional(z.string())}).passthrough(),iEe=wV.extend({method:z.literal("notifications/progress"),params:Sse.merge(v8l).extend({progressToken:VCt})}),dEe=pN.extend({params:bE.extend({cursor:z.optional(QCt)}).optional()}),mEe=pE.extend({nextCursor:z.optional(QCt)}),LCt=z.object({uri:z.string(),mimeType:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}).passthrough(),BCt=LCt.extend({text:z.string()}),sTe=z.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),xCt=LCt.extend({blob:sTe}),SCt=Tse.extend({uri:z.string(),description:z.optional(z.string()),mimeType:z.optional(z.string()),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),f8l=Tse.extend({uriTemplate:z.string(),description:z.optional(z.string()),mimeType:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}),H8l=dEe.extend({method:z.literal("resources/list")}),oTe=mEe.extend({resources:z.array(SCt)}),X8l=dEe.extend({method:z.literal("resources/templates/list")}),cTe=mEe.extend({resourceTemplates:z.array(f8l)}),k8l=pN.extend({method:z.literal("resources/read"),params:bE.extend({uri:z.string()})}),iTe=pE.extend({contents:z.array(z.union([BCt,xCt]))}),J8l=wV.extend({method:z.literal("notifications/resources/list_changed")}),L8l=pN.extend({method:z.literal("resources/subscribe"),params:bE.extend({uri:z.string()})}),B8l=pN.extend({method:z.literal("resources/unsubscribe"),params:bE.extend({uri:z.string()})}),x8l=wV.extend({method:z.literal("notifications/resources/updated"),params:Sse.extend({uri:z.string()})}),S8l=z.object({name:z.string(),description:z.optional(z.string()),required:z.optional(z.boolean())}).passthrough(),O8l=Tse.extend({description:z.optional(z.string()),arguments:z.optional(z.array(S8l)),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),T8l=dEe.extend({method:z.literal("prompts/list")}),dTe=mEe.extend({prompts:z.array(O8l)}),U8l=pN.extend({method:z.literal("prompts/get"),params:bE.extend({name:z.string(),arguments:z.optional(z.record(z.string()))})}),mTe=z.object({type:z.literal("text"),text:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),uTe=z.object({type:z.literal("image"),data:sTe,mimeType:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),GTe=z.object({type:z.literal("audio"),data:sTe,mimeType:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),M8l=z.object({type:z.literal("resource"),resource:z.union([BCt,xCt]),_meta:z.optional(z.object({}).passthrough())}).passthrough(),_8l=SCt.extend({type:z.literal("resource_link")}),OCt=z.union([mTe,uTe,GTe,_8l,M8l]),D8l=z.object({role:z.enum(["user","assistant"]),content:OCt}).passthrough(),bTe=pE.extend({description:z.optional(z.string()),messages:z.array(D8l)}),z8l=wV.extend({method:z.literal("notifications/prompts/list_changed")}),P8l=z.object({title:z.optional(z.string()),readOnlyHint:z.optional(z.boolean()),destructiveHint:z.optional(z.boolean()),idempotentHint:z.optional(z.boolean()),openWorldHint:z.optional(z.boolean())}).passthrough(),j8l=Tse.extend({description:z.optional(z.string()),inputSchema:z.object({type:z.literal("object"),properties:z.optional(z.object({}).passthrough()),required:z.optional(z.array(z.string()))}).passthrough(),outputSchema:z.optional(z.object({type:z.literal("object"),properties:z.optional(z.object({}).passthrough()),required:z.optional(z.array(z.string()))}).passthrough()),annotations:z.optional(P8l),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),K8l=dEe.extend({method:z.literal("tools/list")}),pTe=mEe.extend({tools:z.array(j8l)}),uEe=pE.extend({content:z.array(OCt).default([]),structuredContent:z.object({}).passthrough().optional(),isError:z.optional(z.boolean())}),kTr=uEe.or(pE.extend({toolResult:z.unknown()})),q8l=pN.extend({method:z.literal("tools/call"),params:bE.extend({name:z.string(),arguments:z.optional(z.record(z.unknown()))})}),$8l=wV.extend({method:z.literal("notifications/tools/list_changed")}),TCt=z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),eql=pN.extend({method:z.literal("logging/setLevel"),params:bE.extend({level:TCt})}),tql=wV.extend({method:z.literal("notifications/message"),params:Sse.extend({level:TCt,logger:z.optional(z.string()),data:z.unknown()})}),lql=z.object({name:z.string().optional()}).passthrough(),Iql=z.object({hints:z.optional(z.array(lql)),costPriority:z.optional(z.number().min(0).max(1)),speedPriority:z.optional(z.number().min(0).max(1)),intelligencePriority:z.optional(z.number().min(0).max(1))}).passthrough(),nql=z.object({role:z.enum(["user","assistant"]),content:z.union([mTe,uTe,GTe])}).passthrough(),rql=pN.extend({method:z.literal("sampling/createMessage"),params:bE.extend({messages:z.array(nql),systemPrompt:z.optional(z.string()),includeContext:z.optional(z.enum(["none","thisServer","allServers"])),temperature:z.optional(z.number()),maxTokens:z.number().int(),stopSequences:z.optional(z.array(z.string())),metadata:z.optional(z.object({}).passthrough()),modelPreferences:z.optional(Iql)})}),aql=pE.extend({model:z.string(),stopReason:z.optional(z.enum(["endTurn","stopSequence","maxTokens"]).or(z.string())),role:z.enum(["user","assistant"]),content:z.discriminatedUnion("type",[mTe,uTe,GTe])}),sql=z.object({type:z.literal("boolean"),title:z.optional(z.string()),description:z.optional(z.string()),default:z.optional(z.boolean())}).passthrough(),oql=z.object({type:z.literal("string"),title:z.optional(z.string()),description:z.optional(z.string()),minLength:z.optional(z.number()),maxLength:z.optional(z.number()),format:z.optional(z.enum(["email","uri","date","date-time"]))}).passthrough(),cql=z.object({type:z.enum(["number","integer"]),title:z.optional(z.string()),description:z.optional(z.string()),minimum:z.optional(z.number()),maximum:z.optional(z.number())}).passthrough(),iql=z.object({type:z.literal("string"),title:z.optional(z.string()),description:z.optional(z.string()),enum:z.array(z.string()),enumNames:z.optional(z.array(z.string()))}).passthrough(),dql=z.union([sql,oql,cql,iql]),mql=pN.extend({method:z.literal("elicitation/create"),params:bE.extend({message:z.string(),requestedSchema:z.object({type:z.literal("object"),properties:z.record(z.string(),dql),required:z.optional(z.array(z.string()))}).passthrough()})}),uql=pE.extend({action:z.enum(["accept","decline","cancel"]),content:z.optional(z.record(z.string(),z.unknown()))}),Gql=z.object({type:z.literal("ref/resource"),uri:z.string()}).passthrough();var bql=z.object({type:z.literal("ref/prompt"),name:z.string()}).passthrough(),pql=pN.extend({method:z.literal("completion/complete"),params:bE.extend({ref:z.union([bql,Gql]),argument:z.object({name:z.string(),value:z.string()}).passthrough(),context:z.optional(z.object({arguments:z.optional(z.record(z.string(),z.string()))}))})}),hTe=pE.extend({completion:z.object({values:z.array(z.string()).max(100),total:z.optional(z.number().int()),hasMore:z.optional(z.boolean())}).passthrough()}),hql=z.object({uri:z.string().startsWith("file://"),name:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}).passthrough(),Aql=pN.extend({method:z.literal("roots/list")}),Zql=pE.extend({roots:z.array(hql)}),Nql=wV.extend({method:z.literal("notifications/roots/list_changed")}),JTr=z.union([cEe,F8l,pql,eql,U8l,T8l,H8l,X8l,k8l,L8l,B8l,q8l,K8l]),LTr=z.union([sEe,iEe,kCt,Nql]),BTr=z.union([YS,aql,uql,Zql]),xTr=z.union([cEe,rql,mql,Aql]),STr=z.union([sEe,iEe,tql,x8l,J8l,$8l,z8l]),OTr=z.union([YS,aTe,hTe,bTe,dTe,oTe,cTe,iTe,uEe,pTe]),GE=class extends Error{constructor(e,l,I){super(`MCP error ${e}: ${l}`),this.code=e,this.data=I,this.name="McpError"}};var gql=6e4,GEe=class{constructor(e){this._options=e,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.setNotificationHandler(sEe,l=>{let I=this._requestHandlerAbortControllers.get(l.params.requestId);I?.abort(l.params.reason)}),this.setNotificationHandler(iEe,l=>{this._onprogress(l)}),this.setRequestHandler(cEe,l=>({}))}_setupTimeout(e,l,I,n,r=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,l),startTime:Date.now(),timeout:l,maxTotalTimeout:I,resetTimeoutOnProgress:r,onTimeout:n})}_resetTimeout(e){let l=this._timeoutInfo.get(e);if(!l)return!1;let I=Date.now()-l.startTime;if(l.maxTotalTimeout&&I>=l.maxTotalTimeout)throw this._timeoutInfo.delete(e),new GE(uE.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:l.maxTotalTimeout,totalElapsed:I});return clearTimeout(l.timeoutId),l.timeoutId=setTimeout(l.onTimeout,l.timeout),!0}_cleanupTimeout(e){let l=this._timeoutInfo.get(e);l&&(clearTimeout(l.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var l,I,n;this._transport=e;let r=(l=this.transport)===null||l===void 0?void 0:l.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let a=(I=this.transport)===null||I===void 0?void 0:I.onerror;this._transport.onerror=o=>{a?.(o),this._onerror(o)};let s=(n=this._transport)===null||n===void 0?void 0:n.onmessage;this._transport.onmessage=(o,d)=>{s?.(o,d),Ose(o)||HCt(o)?this._onresponse(o):aEe(o)?this._onrequest(o,d):CCt(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){var e;let l=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let I=new GE(uE.ConnectionClosed,"Connection closed");for(let n of l.values())n(I)}_onerror(e){var l;(l=this.onerror)===null||l===void 0||l.call(this,e)}_onnotification(e){var l;let I=(l=this._notificationHandlers.get(e.method))!==null&&l!==void 0?l:this.fallbackNotificationHandler;I!==void 0&&Promise.resolve().then(()=>I(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,l){var I,n;let r=(I=this._requestHandlers.get(e.method))!==null&&I!==void 0?I:this.fallbackRequestHandler,a=this._transport;if(r===void 0){a?.send({jsonrpc:"2.0",id:e.id,error:{code:uE.MethodNotFound,message:"Method not found"}}).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let o={signal:s.signal,sessionId:a?.sessionId,_meta:(n=e.params)===null||n===void 0?void 0:n._meta,sendNotification:d=>this.notification(d,{relatedRequestId:e.id}),sendRequest:(d,m,b)=>this.request(d,m,{...b,relatedRequestId:e.id}),authInfo:l?.authInfo,requestId:e.id,requestInfo:l?.requestInfo};Promise.resolve().then(()=>r(e,o)).then(d=>{if(!s.signal.aborted)return a?.send({result:d,jsonrpc:"2.0",id:e.id})},d=>{var m;if(!s.signal.aborted)return a?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(d.code)?d.code:uE.InternalError,message:(m=d.message)!==null&&m!==void 0?m:"Internal error"}})}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:l,...I}=e.params,n=Number(l),r=this._progressHandlers.get(n);if(!r){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(o){a(o);return}r(I)}_onresponse(e){let l=Number(e.id),I=this._responseHandlers.get(l);if(I===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(l),this._progressHandlers.delete(l),this._cleanupTimeout(l),Ose(e))I(e);else{let n=new GE(e.error.code,e.error.message,e.error.data);I(n)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,l,I){let{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}=I??{};return new Promise((s,o)=>{var d,m,b,p,A,W;if(!this._transport){o(new Error("Not connected"));return}((d=this._options)===null||d===void 0?void 0:d.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(m=I?.signal)===null||m===void 0||m.throwIfAborted();let E=this._requestMessageId++,R={...e,jsonrpc:"2.0",id:E};I?.onprogress&&(this._progressHandlers.set(E,I.onprogress),R.params={...e.params,_meta:{...((b=e.params)===null||b===void 0?void 0:b._meta)||{},progressToken:E}});let w=S=>{var U;this._responseHandlers.delete(E),this._progressHandlers.delete(E),this._cleanupTimeout(E),(U=this._transport)===null||U===void 0||U.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,reason:String(S)}},{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`))),o(S)};this._responseHandlers.set(E,S=>{var U;if(!(!((U=I?.signal)===null||U===void 0)&&U.aborted)){if(S instanceof Error)return o(S);try{let P=l.parse(S.result);s(P)}catch(P){o(P)}}}),(p=I?.signal)===null||p===void 0||p.addEventListener("abort",()=>{var S;w((S=I?.signal)===null||S===void 0?void 0:S.reason)});let v=(A=I?.timeout)!==null&&A!==void 0?A:gql,J=()=>w(new GE(uE.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(E,v,I?.maxTotalTimeout,J,(W=I?.resetTimeoutOnProgress)!==null&&W!==void 0?W:!1),this._transport.send(R,{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}).catch(S=>{this._cleanupTimeout(E),o(S)})})}async notification(e,l){var I,n;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((n=(I=this._options)===null||I===void 0?void 0:I.debouncedNotificationMethods)!==null&&n!==void 0?n:[]).includes(e.method)&&!e.params&&!l?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var o;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let d={...e,jsonrpc:"2.0"};(o=this._transport)===null||o===void 0||o.send(d,l).catch(m=>this._onerror(m))});return}let s={...e,jsonrpc:"2.0"};await this._transport.send(s,l)}setRequestHandler(e,l){let I=e.shape.method.value;this.assertRequestHandlerCapability(I),this._requestHandlers.set(I,(n,r)=>Promise.resolve(l(e.parse(n),r)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,l){this._notificationHandlers.set(e.shape.method.value,I=>Promise.resolve(l(e.parse(I))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function UCt(t,e){return Object.entries(e).reduce((l,[I,n])=>(n&&typeof n=="object"?l[I]=l[I]?{...l[I],...n}:n:l[I]=n,l),{...t})}var EHt=mt(yHt(),1),PEe=class extends GEe{constructor(e,l){var I;super(l),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(I=l?.capabilities)!==null&&I!==void 0?I:{},this._ajv=new EHt.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=UCt(this._capabilities,e)}assertCapability(e,l){var I;if(!(!((I=this._serverCapabilities)===null||I===void 0)&&I[e]))throw new Error(`Server does not support ${e} (required for ${l})`)}async connect(e,l){if(await super.connect(e),e.sessionId===void 0)try{let I=await this.request({method:"initialize",params:{protocolVersion:_j,capabilities:this._capabilities,clientInfo:this._clientInfo}},aTe,l);if(I===void 0)throw new Error(`Server sent invalid initialize result: ${I}`);if(!YCt.includes(I.protocolVersion))throw new Error(`Server's protocol version is not supported: ${I.protocolVersion}`);this._serverCapabilities=I.capabilities,this._serverVersion=I.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(I.protocolVersion),this._instructions=I.instructions,await this.notification({method:"notifications/initialized"})}catch(I){throw this.close(),I}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var l,I,n,r,a;switch(e){case"logging/setLevel":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((I=this._serverCapabilities)===null||I===void 0)&&I.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var l;switch(e){case"notifications/roots/list_changed":if(!(!((l=this._capabilities.roots)===null||l===void 0)&&l.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},YS,e)}async complete(e,l){return this.request({method:"completion/complete",params:e},hTe,l)}async setLoggingLevel(e,l){return this.request({method:"logging/setLevel",params:{level:e}},YS,l)}async getPrompt(e,l){return this.request({method:"prompts/get",params:e},bTe,l)}async listPrompts(e,l){return this.request({method:"prompts/list",params:e},dTe,l)}async listResources(e,l){return this.request({method:"resources/list",params:e},oTe,l)}async listResourceTemplates(e,l){return this.request({method:"resources/templates/list",params:e},cTe,l)}async readResource(e,l){return this.request({method:"resources/read",params:e},iTe,l)}async subscribeResource(e,l){return this.request({method:"resources/subscribe",params:e},YS,l)}async unsubscribeResource(e,l){return this.request({method:"resources/unsubscribe",params:e},YS,l)}async callTool(e,l=uEe,I){let n=await this.request({method:"tools/call",params:e},l,I),r=this.getToolOutputValidator(e.name);if(r){if(!n.structuredContent&&!n.isError)throw new GE(uE.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{if(!r(n.structuredContent))throw new GE(uE.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(r.errors)}`)}catch(a){throw a instanceof GE?a:new GE(uE.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return n}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let l of e)if(l.outputSchema)try{let I=this._ajv.compile(l.outputSchema);this._cachedToolOutputValidators.set(l.name,I)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,l){let I=await this.request({method:"tools/list",params:e},pTe,l);return this.cacheToolOutputSchemas(I.tools),I}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var jEe=class{createClient(e,l){return new PEe(e,l)}};c();c();c();c();var KEe=class extends Error{constructor(e,l){super(e),this.name="ParseError",this.type=l.type,this.field=l.field,this.value=l.value,this.line=l.line}};function tMe(t){}function qEe(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=tMe,onError:l=tMe,onRetry:I=tMe,onComment:n}=t,r="",a=!0,s,o="",d="";function m(E){let R=a?E.replace(/^\xEF\xBB\xBF/,""):E,[w,v]=_lI(`${r}${R}`);for(let J of w)b(J);r=v,a=!1}function b(E){if(E===""){A();return}if(E.startsWith(":")){n&&n(E.slice(E.startsWith(": ")?2:1));return}let R=E.indexOf(":");if(R!==-1){let w=E.slice(0,R),v=E[R+1]===" "?2:1,J=E.slice(R+v);p(w,J,E);return}p(E,"",E)}function p(E,R,w){switch(E){case"event":d=R;break;case"data":o=`${o}${R}
1721
+ `,input_schema:{type:"object",properties:{question:{type:"string",description:"A question about the codebase. It should reference by name any topics, specific file names, and concepts that are relevant to the question and specify the desired output format."}},required:["question"]},callback:async I=>{let n,r=Zbe(t),a="",s="",o=r.split("/");if(o.length===2){[a,s]=o,l.info("Searching for repository insights");try{n=await jOe(I.question,a,s,e,l),l.info(`Blackbird results: ${n}`)}catch(d){l.error(`Error occurred while searching for repository insights: ${d}`)}}return{resultType:"success",textResultForLlm:n??"No results found.",toolTelemetry:{}}}}}async function mCt(t,e,l,I,n,r,a){let s=await pCt(t),o=await VKl(t,l,I),d=iCt(l)?[new qye(I,l,n,r,t,t.location,jpe(),a).getSearch()]:[],m=t.splitEditingTools?h5e(t,I,l):[ehe(t,I,l)];return[s.shellTool,...s.otherTools??[],...o,...d,...m,mGt(t,e,l,I,n),$o(l,Vbe)?vdt(t,I,n,l):void 0,t?.requireReasoning?Z5e(t):void 0,$o(l,rGt)?aGt:void 0,await QKl(t,l,I,n)].filter(b=>b!==void 0)}async function uCt(t,e){let l=await pCt(t),I=t.splitEditingTools?h5e(t,e):[ehe(t,e)];return[l.shellTool,...l.otherTools??[],...I,t?.requireReasoning?Z5e(t):void 0].filter(n=>n!==void 0)}async function YKl(t,e,l,I,n,r,a){return[...await mCt(t,e,l,I,n,r,a),oGt(t,I)]}var GCt=t=>({...EV,supports:{...EV.supports,reasoning:t?.thinkingMode?!0:EV.supports?.reasoning}}),EV={supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!1},createPR:{toolInit:mCt,jitInstructions:aLe},prDetails:{},respondToPRComment:{toolInit:YKl,jitInstructions:aLe}},bCt=t=>({"sweagent-capi":{"claude-3.5-sonnet":{...EV,supports:{tool_choice:!1,reasoning:!1}},"claude-3.7-sonnet":{...EV,supports:{tool_choice:!1,reasoning:!1,vision:!0}},"claude-sonnet-4":{...EV,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},"claude-sonnet-4.5":{...EV,supports:{tool_choice:!1,reasoning:!0,parallel_tool_calls:!0,vision:!0},toolConfigOverrides:{splitEditingTools:!0}},oswe:{...EV,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"oswe-prime":{...EV,supports:{tool_choice:!0,reasoning:!0,vision:!0}},"gpt-5":{...EV,supports:{tool_choice:!0,reasoning:!0,parallel_tool_calls:!0,vision:!0,steering:!0},toolConfigOverrides:{splitEditingTools:!0}}}});async function pCt(t){let e=new nhe(t);return{shellTool:e.getShellTool(),otherTools:[e.getWriteShellTool(),e.getReadShellTool(),e.getStopShellTool()]}}async function VKl(t,e,l){if(B4e(e,"cloud"))return[new M$(new Lhe(e,l,void 0)).getStoreMemory()];if(B4e(e,"local")){let I=new M$(new Jhe(t.location));return[I.getStoreMemory(),I.getReadMemory()]}return[]}async function QKl(t,e,l,I){if(t.includeCodeQLTool){let n=new FZ(l,I),r=e.swebench_base_commit??await n.getCurrentCommitHash(t.location);return new Mpe(t,n,r,e,l).getCodeQLCheckerTool()}}c();function hCt(t,e){switch(t.kind){case"image_processing":return e.onImageProcessingEvent(t);case"images_removed":return e.onImageRemovalEvent(t);case"message":return e.onMessage(t);case"model_call_failure":return e.onModelCallFailure(t);case"model_call_success":return e.onModelCallSuccess(t);case"response":return e.onResponse(t);case"tool_execution":return e.onToolExecution(t);case"history_truncated":return e.onTruncationEvent(t);case"turn_started":case"turn_ended":case"turn_failed":case"turn_retry":return e.onTurnEvent(t);default:{let l=t;throw new Error(`unexpected event kind: ${JSON.stringify(t)}`)}}}c();c();c();import{Writable as zII}from"stream";c();c();c();c();c();var z={};Ju(z,{BRAND:()=>e8l,DIRTY:()=>iS,EMPTY_PATH:()=>vKl,INVALID:()=>Bn,NEVER:()=>V8l,OK:()=>nh,ParseStatus:()=>$b,Schema:()=>Aa,ZodAny:()=>f4,ZodArray:()=>DC,ZodBigInt:()=>mS,ZodBoolean:()=>uS,ZodBranded:()=>Jse,ZodCatch:()=>ES,ZodDate:()=>GS,ZodDefault:()=>yS,ZodDiscriminatedUnion:()=>tEe,ZodEffects:()=>mE,ZodEnum:()=>gS,ZodError:()=>GN,ZodFirstPartyTypeKind:()=>_n,ZodFunction:()=>IEe,ZodIntersection:()=>AS,ZodIssueCode:()=>vl,ZodLazy:()=>ZS,ZodLiteral:()=>NS,ZodMap:()=>Tj,ZodNaN:()=>Mj,ZodNativeEnum:()=>WS,ZodNever:()=>DR,ZodNull:()=>pS,ZodNullable:()=>VV,ZodNumber:()=>dS,ZodObject:()=>bN,ZodOptional:()=>iE,ZodParsedType:()=>QI,ZodPipeline:()=>Lse,ZodPromise:()=>H4,ZodReadonly:()=>RS,ZodRecord:()=>lEe,ZodSchema:()=>Aa,ZodSet:()=>Uj,ZodString:()=>v4,ZodSymbol:()=>Sj,ZodTransformer:()=>mE,ZodTuple:()=>YV,ZodType:()=>Aa,ZodUndefined:()=>bS,ZodUnion:()=>hS,ZodUnknown:()=>_C,ZodVoid:()=>Oj,addIssueToContext:()=>pI,any:()=>lTe,array:()=>km,bigint:()=>n8l,boolean:()=>Nu,coerce:()=>Bse,custom:()=>RCt,date:()=>r8l,datetimeRegex:()=>yCt,defaultErrorMap:()=>UC,discriminatedUnion:()=>nTe,effect:()=>Z8l,enum:()=>zR,function:()=>b8l,getErrorMap:()=>Lj,getParsedType:()=>RV,instanceof:()=>l8l,intersection:()=>m8l,isAborted:()=>$ye,isAsync:()=>Bj,isDirty:()=>eEe,isValid:()=>C4,late:()=>t8l,lazy:()=>p8l,literal:()=>Is,makeIssue:()=>kse,map:()=>u8l,nan:()=>I8l,nativeEnum:()=>h8l,never:()=>c8l,null:()=>o8l,nullable:()=>g8l,number:()=>QV,object:()=>Vn,objectUtil:()=>$Oe,oboolean:()=>Y8l,onumber:()=>R8l,optional:()=>N8l,ostring:()=>E8l,pipeline:()=>y8l,preprocess:()=>W8l,promise:()=>A8l,quotelessJson:()=>wKl,record:()=>zC,set:()=>G8l,setErrorMap:()=>CKl,strictObject:()=>d8l,string:()=>fl,symbol:()=>a8l,transformer:()=>Z8l,tuple:()=>rTe,undefined:()=>s8l,union:()=>rh,unknown:()=>ITe,util:()=>ls,void:()=>i8l});c();c();c();c();c();var ls;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function l(n){throw new Error}t.assertNever=l,t.arrayToEnum=n=>{let r={};for(let a of n)r[a]=a;return r},t.getValidEnumValues=n=>{let r=t.objectKeys(n).filter(s=>typeof n[n[s]]!="number"),a={};for(let s of r)a[s]=n[s];return t.objectValues(a)},t.objectValues=n=>t.objectKeys(n).map(function(r){return n[r]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let r=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&r.push(a);return r},t.find=(n,r)=>{for(let a of n)if(r(a))return a},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function I(n,r=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(r)}t.joinValues=I,t.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(ls||(ls={}));var $Oe;(function(t){t.mergeShapes=(e,l)=>({...e,...l})})($Oe||($Oe={}));var QI=ls.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),RV=t=>{switch(typeof t){case"undefined":return QI.undefined;case"string":return QI.string;case"number":return Number.isNaN(t)?QI.nan:QI.number;case"boolean":return QI.boolean;case"function":return QI.function;case"bigint":return QI.bigint;case"symbol":return QI.symbol;case"object":return Array.isArray(t)?QI.array:t===null?QI.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?QI.promise:typeof Map<"u"&&t instanceof Map?QI.map:typeof Set<"u"&&t instanceof Set?QI.set:typeof Date<"u"&&t instanceof Date?QI.date:QI.object;default:return QI.unknown}};var vl=ls.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"]),wKl=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),GN=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=I=>{this.issues=[...this.issues,I]},this.addIssues=(I=[])=>{this.issues=[...this.issues,...I]};let l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=e}format(e){let l=e||function(r){return r.message},I={_errors:[]},n=r=>{for(let a of r.issues)if(a.code==="invalid_union")a.unionErrors.map(n);else if(a.code==="invalid_return_type")n(a.returnTypeError);else if(a.code==="invalid_arguments")n(a.argumentsError);else if(a.path.length===0)I._errors.push(l(a));else{let s=I,o=0;for(;o<a.path.length;){let d=a.path[o];o===a.path.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(l(a))):s[d]=s[d]||{_errors:[]},s=s[d],o++}}};return n(this),I}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ls.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=l=>l.message){let l={},I=[];for(let n of this.issues)if(n.path.length>0){let r=n.path[0];l[r]=l[r]||[],l[r].push(e(n))}else I.push(e(n));return{formErrors:I,fieldErrors:l}}get formErrors(){return this.flatten()}};GN.create=t=>new GN(t);var FKl=(t,e)=>{let l;switch(t.code){case vl.invalid_type:t.received===QI.undefined?l="Required":l=`Expected ${t.expected}, received ${t.received}`;break;case vl.invalid_literal:l=`Invalid literal value, expected ${JSON.stringify(t.expected,ls.jsonStringifyReplacer)}`;break;case vl.unrecognized_keys:l=`Unrecognized key(s) in object: ${ls.joinValues(t.keys,", ")}`;break;case vl.invalid_union:l="Invalid input";break;case vl.invalid_union_discriminator:l=`Invalid discriminator value. Expected ${ls.joinValues(t.options)}`;break;case vl.invalid_enum_value:l=`Invalid enum value. Expected ${ls.joinValues(t.options)}, received '${t.received}'`;break;case vl.invalid_arguments:l="Invalid function arguments";break;case vl.invalid_return_type:l="Invalid function return type";break;case vl.invalid_date:l="Invalid date";break;case vl.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(l=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(l=`${l} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?l=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?l=`Invalid input: must end with "${t.validation.endsWith}"`:ls.assertNever(t.validation):t.validation!=="regex"?l=`Invalid ${t.validation}`:l="Invalid";break;case vl.too_small:t.type==="array"?l=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?l=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?l=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?l=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?l=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:l="Invalid input";break;case vl.too_big:t.type==="array"?l=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?l=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?l=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?l=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?l=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:l="Invalid input";break;case vl.custom:l="Invalid input";break;case vl.invalid_intersection_types:l="Intersection results could not be merged";break;case vl.not_multiple_of:l=`Number must be a multiple of ${t.multipleOf}`;break;case vl.not_finite:l="Number must be finite";break;default:l=e.defaultError,ls.assertNever(t)}return{message:l}},UC=FKl;var ACt=UC;function CKl(t){ACt=t}function Lj(){return ACt}c();var kse=t=>{let{data:e,path:l,errorMaps:I,issueData:n}=t,r=[...l,...n.path||[]],a={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let s="",o=I.filter(d=>!!d).slice().reverse();for(let d of o)s=d(a,{data:e,defaultError:s}).message;return{...n,path:r,message:s}},vKl=[];function pI(t,e){let l=Lj(),I=kse({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,l,l===UC?void 0:UC].filter(n=>!!n)});t.common.issues.push(I)}var $b=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,l){let I=[];for(let n of l){if(n.status==="aborted")return Bn;n.status==="dirty"&&e.dirty(),I.push(n.value)}return{status:e.value,value:I}}static async mergeObjectAsync(e,l){let I=[];for(let n of l){let r=await n.key,a=await n.value;I.push({key:r,value:a})}return t.mergeObjectSync(e,I)}static mergeObjectSync(e,l){let I={};for(let n of l){let{key:r,value:a}=n;if(r.status==="aborted"||a.status==="aborted")return Bn;r.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(I[r.value]=a.value)}return{status:e.value,value:I}}},Bn=Object.freeze({status:"aborted"}),iS=t=>({status:"dirty",value:t}),nh=t=>({status:"valid",value:t}),$ye=t=>t.status==="aborted",eEe=t=>t.status==="dirty",C4=t=>t.status==="valid",Bj=t=>typeof Promise<"u"&&t instanceof Promise;c();c();var In;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(In||(In={}));var dE=class{constructor(e,l,I,n){this._cachedPath=[],this.parent=e,this.data=l,this._path=I,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ZCt=(t,e)=>{if(C4(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let l=new GN(t.common.issues);return this._error=l,this._error}}};function qr(t){if(!t)return{};let{errorMap:e,invalid_type_error:l,required_error:I,description:n}=t;if(e&&(l||I))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,s)=>{let{message:o}=t;return a.code==="invalid_enum_value"?{message:o??s.defaultError}:typeof s.data>"u"?{message:o??I??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:o??l??s.defaultError}},description:n}}var Aa=class{get description(){return this._def.description}_getType(e){return RV(e.data)}_getOrReturnCtx(e,l){return l||{common:e.parent.common,data:e.data,parsedType:RV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $b,ctx:{common:e.parent.common,data:e.data,parsedType:RV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let l=this._parse(e);if(Bj(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(e){let l=this._parse(e);return Promise.resolve(l)}parse(e,l){let I=this.safeParse(e,l);if(I.success)return I.data;throw I.error}safeParse(e,l){let I={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)},n=this._parseSync({data:e,path:I.path,parent:I});return ZCt(I,n)}"~validate"(e){let l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)};if(!this["~standard"].async)try{let I=this._parseSync({data:e,path:[],parent:l});return C4(I)?{value:I.value}:{issues:l.common.issues}}catch(I){I?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:l}).then(I=>C4(I)?{value:I.value}:{issues:l.common.issues})}async parseAsync(e,l){let I=await this.safeParseAsync(e,l);if(I.success)return I.data;throw I.error}async safeParseAsync(e,l){let I={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:RV(e)},n=this._parse({data:e,path:I.path,parent:I}),r=await(Bj(n)?n:Promise.resolve(n));return ZCt(I,r)}refine(e,l){let I=n=>typeof l=="string"||typeof l>"u"?{message:l}:typeof l=="function"?l(n):l;return this._refinement((n,r)=>{let a=e(n),s=()=>r.addIssue({code:vl.custom,...I(n)});return typeof Promise<"u"&&a instanceof Promise?a.then(o=>o?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,l){return this._refinement((I,n)=>e(I)?!0:(n.addIssue(typeof l=="function"?l(I,n):l),!1))}_refinement(e){return new mE({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:l=>this["~validate"](l)}}optional(){return iE.create(this,this._def)}nullable(){return VV.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return DC.create(this)}promise(){return H4.create(this,this._def)}or(e){return hS.create([this,e],this._def)}and(e){return AS.create(this,e,this._def)}transform(e){return new mE({...qr(this._def),schema:this,typeName:_n.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let l=typeof e=="function"?e:()=>e;return new yS({...qr(this._def),innerType:this,defaultValue:l,typeName:_n.ZodDefault})}brand(){return new Jse({typeName:_n.ZodBranded,type:this,...qr(this._def)})}catch(e){let l=typeof e=="function"?e:()=>e;return new ES({...qr(this._def),innerType:this,catchValue:l,typeName:_n.ZodCatch})}describe(e){let l=this.constructor;return new l({...this._def,description:e})}pipe(e){return Lse.create(this,e)}readonly(){return RS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fKl=/^c[^\s-]{8,}$/i,HKl=/^[0-9a-z]+$/,XKl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kKl=/^[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,JKl=/^[a-z0-9_-]{21}$/i,LKl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BKl=/^[-+]?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)?)??$/,xKl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,SKl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",eTe,OKl=/^(?:(?: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])$/,TKl=/^(?:(?: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])$/,UKl=/^(([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]))$/,MKl=/^(([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])$/,_Kl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DKl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gCt="((\\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])))",zKl=new RegExp(`^${gCt}$`);function WCt(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let l=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${l}`}function PKl(t){return new RegExp(`^${WCt(t)}$`)}function yCt(t){let e=`${gCt}T${WCt(t)}`,l=[];return l.push(t.local?"Z?":"Z"),t.offset&&l.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${l.join("|")})`,new RegExp(`^${e}$`)}function jKl(t,e){return!!((e==="v4"||!e)&&OKl.test(t)||(e==="v6"||!e)&&UKl.test(t))}function KKl(t,e){if(!LKl.test(t))return!1;try{let[l]=t.split(".");if(!l)return!1;let I=l.replace(/-/g,"+").replace(/_/g,"/").padEnd(l.length+(4-l.length%4)%4,"="),n=JSON.parse(atob(I));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function qKl(t,e){return!!((e==="v4"||!e)&&TKl.test(t)||(e==="v6"||!e)&&MKl.test(t))}var v4=class t extends Aa{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==QI.string){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.string,received:r.parsedType}),Bn}let I=new $b,n;for(let r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),I.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),I.dirty());else if(r.kind==="length"){let a=e.data.length>r.value,s=e.data.length<r.value;(a||s)&&(n=this._getOrReturnCtx(e,n),a?pI(n,{code:vl.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&pI(n,{code:vl.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),I.dirty())}else if(r.kind==="email")xKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"email",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="emoji")eTe||(eTe=new RegExp(SKl,"u")),eTe.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"emoji",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="uuid")kKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"uuid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="nanoid")JKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"nanoid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="cuid")fKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cuid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="cuid2")HKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cuid2",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="ulid")XKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"ulid",code:vl.invalid_string,message:r.message}),I.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),pI(n,{validation:"url",code:vl.invalid_string,message:r.message}),I.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"regex",code:vl.invalid_string,message:r.message}),I.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),I.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{startsWith:r.value},message:r.message}),I.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:{endsWith:r.value},message:r.message}),I.dirty()):r.kind==="datetime"?yCt(r).test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"datetime",message:r.message}),I.dirty()):r.kind==="date"?zKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"date",message:r.message}),I.dirty()):r.kind==="time"?PKl(r).test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.invalid_string,validation:"time",message:r.message}),I.dirty()):r.kind==="duration"?BKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"duration",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="ip"?jKl(e.data,r.version)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"ip",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="jwt"?KKl(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"jwt",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="cidr"?qKl(e.data,r.version)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"cidr",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="base64"?_Kl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"base64",code:vl.invalid_string,message:r.message}),I.dirty()):r.kind==="base64url"?DKl.test(e.data)||(n=this._getOrReturnCtx(e,n),pI(n,{validation:"base64url",code:vl.invalid_string,message:r.message}),I.dirty()):ls.assertNever(r);return{status:I.value,value:e.data}}_regex(e,l,I){return this.refinement(n=>e.test(n),{validation:l,code:vl.invalid_string,...In.errToObj(I)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...In.errToObj(e)})}url(e){return this._addCheck({kind:"url",...In.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...In.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...In.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...In.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...In.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...In.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...In.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...In.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...In.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...In.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...In.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...In.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...In.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...In.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...In.errToObj(e)})}regex(e,l){return this._addCheck({kind:"regex",regex:e,...In.errToObj(l)})}includes(e,l){return this._addCheck({kind:"includes",value:e,position:l?.position,...In.errToObj(l?.message)})}startsWith(e,l){return this._addCheck({kind:"startsWith",value:e,...In.errToObj(l)})}endsWith(e,l){return this._addCheck({kind:"endsWith",value:e,...In.errToObj(l)})}min(e,l){return this._addCheck({kind:"min",value:e,...In.errToObj(l)})}max(e,l){return this._addCheck({kind:"max",value:e,...In.errToObj(l)})}length(e,l){return this._addCheck({kind:"length",value:e,...In.errToObj(l)})}nonempty(e){return this.min(1,In.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxLength(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}};v4.create=t=>new v4({checks:[],typeName:_n.ZodString,coerce:t?.coerce??!1,...qr(t)});function $Kl(t,e){let l=(t.toString().split(".")[1]||"").length,I=(e.toString().split(".")[1]||"").length,n=l>I?l:I,r=Number.parseInt(t.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return r%a/10**n}var dS=class t extends Aa{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==QI.number){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.number,received:r.parsedType}),Bn}let I,n=new $b;for(let r of this._def.checks)r.kind==="int"?ls.isInteger(e.data)||(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?$Kl(e.data,r.value)!==0&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_finite,message:r.message}),n.dirty()):ls.assertNever(r);return{status:n.value,value:e.data}}gte(e,l){return this.setLimit("min",e,!0,In.toString(l))}gt(e,l){return this.setLimit("min",e,!1,In.toString(l))}lte(e,l){return this.setLimit("max",e,!0,In.toString(l))}lt(e,l){return this.setLimit("max",e,!1,In.toString(l))}setLimit(e,l,I,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:l,inclusive:I,message:In.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:In.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:In.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:In.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:In.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:In.toString(e)})}multipleOf(e,l){return this._addCheck({kind:"multipleOf",value:e,message:In.toString(l)})}finite(e){return this._addCheck({kind:"finite",message:In.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:In.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:In.toString(e)})}get minValue(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxValue(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ls.isInteger(e.value))}get isFinite(){let e=null,l=null;for(let I of this._def.checks){if(I.kind==="finite"||I.kind==="int"||I.kind==="multipleOf")return!0;I.kind==="min"?(l===null||I.value>l)&&(l=I.value):I.kind==="max"&&(e===null||I.value<e)&&(e=I.value)}return Number.isFinite(l)&&Number.isFinite(e)}};dS.create=t=>new dS({checks:[],typeName:_n.ZodNumber,coerce:t?.coerce||!1,...qr(t)});var mS=class t extends Aa{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==QI.bigint)return this._getInvalidInput(e);let I,n=new $b;for(let r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(I=this._getOrReturnCtx(e,I),pI(I,{code:vl.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):ls.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let l=this._getOrReturnCtx(e);return pI(l,{code:vl.invalid_type,expected:QI.bigint,received:l.parsedType}),Bn}gte(e,l){return this.setLimit("min",e,!0,In.toString(l))}gt(e,l){return this.setLimit("min",e,!1,In.toString(l))}lte(e,l){return this.setLimit("max",e,!0,In.toString(l))}lt(e,l){return this.setLimit("max",e,!1,In.toString(l))}setLimit(e,l,I,n){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:l,inclusive:I,message:In.toString(n)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:In.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:In.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:In.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:In.toString(e)})}multipleOf(e,l){return this._addCheck({kind:"multipleOf",value:e,message:In.toString(l)})}get minValue(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e}get maxValue(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e}};mS.create=t=>new mS({checks:[],typeName:_n.ZodBigInt,coerce:t?.coerce??!1,...qr(t)});var uS=class extends Aa{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==QI.boolean){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.boolean,received:I.parsedType}),Bn}return nh(e.data)}};uS.create=t=>new uS({typeName:_n.ZodBoolean,coerce:t?.coerce||!1,...qr(t)});var GS=class t extends Aa{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==QI.date){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_type,expected:QI.date,received:r.parsedType}),Bn}if(Number.isNaN(e.data.getTime())){let r=this._getOrReturnCtx(e);return pI(r,{code:vl.invalid_date}),Bn}let I=new $b,n;for(let r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),I.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),pI(n,{code:vl.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),I.dirty()):ls.assertNever(r);return{status:I.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,l){return this._addCheck({kind:"min",value:e.getTime(),message:In.toString(l)})}max(e,l){return this._addCheck({kind:"max",value:e.getTime(),message:In.toString(l)})}get minDate(){let e=null;for(let l of this._def.checks)l.kind==="min"&&(e===null||l.value>e)&&(e=l.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let l of this._def.checks)l.kind==="max"&&(e===null||l.value<e)&&(e=l.value);return e!=null?new Date(e):null}};GS.create=t=>new GS({checks:[],coerce:t?.coerce||!1,typeName:_n.ZodDate,...qr(t)});var Sj=class extends Aa{_parse(e){if(this._getType(e)!==QI.symbol){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.symbol,received:I.parsedType}),Bn}return nh(e.data)}};Sj.create=t=>new Sj({typeName:_n.ZodSymbol,...qr(t)});var bS=class extends Aa{_parse(e){if(this._getType(e)!==QI.undefined){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.undefined,received:I.parsedType}),Bn}return nh(e.data)}};bS.create=t=>new bS({typeName:_n.ZodUndefined,...qr(t)});var pS=class extends Aa{_parse(e){if(this._getType(e)!==QI.null){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.null,received:I.parsedType}),Bn}return nh(e.data)}};pS.create=t=>new pS({typeName:_n.ZodNull,...qr(t)});var f4=class extends Aa{constructor(){super(...arguments),this._any=!0}_parse(e){return nh(e.data)}};f4.create=t=>new f4({typeName:_n.ZodAny,...qr(t)});var _C=class extends Aa{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nh(e.data)}};_C.create=t=>new _C({typeName:_n.ZodUnknown,...qr(t)});var DR=class extends Aa{_parse(e){let l=this._getOrReturnCtx(e);return pI(l,{code:vl.invalid_type,expected:QI.never,received:l.parsedType}),Bn}};DR.create=t=>new DR({typeName:_n.ZodNever,...qr(t)});var Oj=class extends Aa{_parse(e){if(this._getType(e)!==QI.undefined){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.void,received:I.parsedType}),Bn}return nh(e.data)}};Oj.create=t=>new Oj({typeName:_n.ZodVoid,...qr(t)});var DC=class t extends Aa{_parse(e){let{ctx:l,status:I}=this._processInputParams(e),n=this._def;if(l.parsedType!==QI.array)return pI(l,{code:vl.invalid_type,expected:QI.array,received:l.parsedType}),Bn;if(n.exactLength!==null){let a=l.data.length>n.exactLength.value,s=l.data.length<n.exactLength.value;(a||s)&&(pI(l,{code:a?vl.too_big:vl.too_small,minimum:s?n.exactLength.value:void 0,maximum:a?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),I.dirty())}if(n.minLength!==null&&l.data.length<n.minLength.value&&(pI(l,{code:vl.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),I.dirty()),n.maxLength!==null&&l.data.length>n.maxLength.value&&(pI(l,{code:vl.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),I.dirty()),l.common.async)return Promise.all([...l.data].map((a,s)=>n.type._parseAsync(new dE(l,a,l.path,s)))).then(a=>$b.mergeArray(I,a));let r=[...l.data].map((a,s)=>n.type._parseSync(new dE(l,a,l.path,s)));return $b.mergeArray(I,r)}get element(){return this._def.type}min(e,l){return new t({...this._def,minLength:{value:e,message:In.toString(l)}})}max(e,l){return new t({...this._def,maxLength:{value:e,message:In.toString(l)}})}length(e,l){return new t({...this._def,exactLength:{value:e,message:In.toString(l)}})}nonempty(e){return this.min(1,e)}};DC.create=(t,e)=>new DC({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_n.ZodArray,...qr(e)});function xj(t){if(t instanceof bN){let e={};for(let l in t.shape){let I=t.shape[l];e[l]=iE.create(xj(I))}return new bN({...t._def,shape:()=>e})}else return t instanceof DC?new DC({...t._def,type:xj(t.element)}):t instanceof iE?iE.create(xj(t.unwrap())):t instanceof VV?VV.create(xj(t.unwrap())):t instanceof YV?YV.create(t.items.map(e=>xj(e))):t}var bN=class t extends Aa{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),l=ls.objectKeys(e);return this._cached={shape:e,keys:l},this._cached}_parse(e){if(this._getType(e)!==QI.object){let d=this._getOrReturnCtx(e);return pI(d,{code:vl.invalid_type,expected:QI.object,received:d.parsedType}),Bn}let{status:I,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof DR&&this._def.unknownKeys==="strip"))for(let d in n.data)a.includes(d)||s.push(d);let o=[];for(let d of a){let m=r[d],b=n.data[d];o.push({key:{status:"valid",value:d},value:m._parse(new dE(n,b,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof DR){let d=this._def.unknownKeys;if(d==="passthrough")for(let m of s)o.push({key:{status:"valid",value:m},value:{status:"valid",value:n.data[m]}});else if(d==="strict")s.length>0&&(pI(n,{code:vl.unrecognized_keys,keys:s}),I.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let m of s){let b=n.data[m];o.push({key:{status:"valid",value:m},value:d._parse(new dE(n,b,n.path,m)),alwaysSet:m in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let m of o){let b=await m.key,p=await m.value;d.push({key:b,value:p,alwaysSet:m.alwaysSet})}return d}).then(d=>$b.mergeObjectSync(I,d)):$b.mergeObjectSync(I,o)}get shape(){return this._def.shape()}strict(e){return In.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(l,I)=>{let n=this._def.errorMap?.(l,I).message??I.defaultError;return l.code==="unrecognized_keys"?{message:In.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_n.ZodObject})}setKey(e,l){return this.augment({[e]:l})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let l={};for(let I of ls.objectKeys(e))e[I]&&this.shape[I]&&(l[I]=this.shape[I]);return new t({...this._def,shape:()=>l})}omit(e){let l={};for(let I of ls.objectKeys(this.shape))e[I]||(l[I]=this.shape[I]);return new t({...this._def,shape:()=>l})}deepPartial(){return xj(this)}partial(e){let l={};for(let I of ls.objectKeys(this.shape)){let n=this.shape[I];e&&!e[I]?l[I]=n:l[I]=n.optional()}return new t({...this._def,shape:()=>l})}required(e){let l={};for(let I of ls.objectKeys(this.shape))if(e&&!e[I])l[I]=this.shape[I];else{let r=this.shape[I];for(;r instanceof iE;)r=r._def.innerType;l[I]=r}return new t({...this._def,shape:()=>l})}keyof(){return ECt(ls.objectKeys(this.shape))}};bN.create=(t,e)=>new bN({shape:()=>t,unknownKeys:"strip",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});bN.strictCreate=(t,e)=>new bN({shape:()=>t,unknownKeys:"strict",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});bN.lazycreate=(t,e)=>new bN({shape:t,unknownKeys:"strip",catchall:DR.create(),typeName:_n.ZodObject,...qr(e)});var hS=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=this._def.options;function n(r){for(let s of r)if(s.result.status==="valid")return s.result;for(let s of r)if(s.result.status==="dirty")return l.common.issues.push(...s.ctx.common.issues),s.result;let a=r.map(s=>new GN(s.ctx.common.issues));return pI(l,{code:vl.invalid_union,unionErrors:a}),Bn}if(l.common.async)return Promise.all(I.map(async r=>{let a={...l,common:{...l.common,issues:[]},parent:null};return{result:await r._parseAsync({data:l.data,path:l.path,parent:a}),ctx:a}})).then(n);{let r,a=[];for(let o of I){let d={...l,common:{...l.common,issues:[]},parent:null},m=o._parseSync({data:l.data,path:l.path,parent:d});if(m.status==="valid")return m;m.status==="dirty"&&!r&&(r={result:m,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(r)return l.common.issues.push(...r.ctx.common.issues),r.result;let s=a.map(o=>new GN(o));return pI(l,{code:vl.invalid_union,unionErrors:s}),Bn}}get options(){return this._def.options}};hS.create=(t,e)=>new hS({options:t,typeName:_n.ZodUnion,...qr(e)});var MC=t=>t instanceof ZS?MC(t.schema):t instanceof mE?MC(t.innerType()):t instanceof NS?[t.value]:t instanceof gS?t.options:t instanceof WS?ls.objectValues(t.enum):t instanceof yS?MC(t._def.innerType):t instanceof bS?[void 0]:t instanceof pS?[null]:t instanceof iE?[void 0,...MC(t.unwrap())]:t instanceof VV?[null,...MC(t.unwrap())]:t instanceof Jse||t instanceof RS?MC(t.unwrap()):t instanceof ES?MC(t._def.innerType):[],tEe=class t extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.object)return pI(l,{code:vl.invalid_type,expected:QI.object,received:l.parsedType}),Bn;let I=this.discriminator,n=l.data[I],r=this.optionsMap.get(n);return r?l.common.async?r._parseAsync({data:l.data,path:l.path,parent:l}):r._parseSync({data:l.data,path:l.path,parent:l}):(pI(l,{code:vl.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[I]}),Bn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,l,I){let n=new Map;for(let r of l){let a=MC(r.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(n.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);n.set(s,r)}}return new t({typeName:_n.ZodDiscriminatedUnion,discriminator:e,options:l,optionsMap:n,...qr(I)})}};function tTe(t,e){let l=RV(t),I=RV(e);if(t===e)return{valid:!0,data:t};if(l===QI.object&&I===QI.object){let n=ls.objectKeys(e),r=ls.objectKeys(t).filter(s=>n.indexOf(s)!==-1),a={...t,...e};for(let s of r){let o=tTe(t[s],e[s]);if(!o.valid)return{valid:!1};a[s]=o.data}return{valid:!0,data:a}}else if(l===QI.array&&I===QI.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let r=0;r<t.length;r++){let a=t[r],s=e[r],o=tTe(a,s);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else return l===QI.date&&I===QI.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var AS=class extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e),n=(r,a)=>{if($ye(r)||$ye(a))return Bn;let s=tTe(r.value,a.value);return s.valid?((eEe(r)||eEe(a))&&l.dirty(),{status:l.value,value:s.data}):(pI(I,{code:vl.invalid_intersection_types}),Bn)};return I.common.async?Promise.all([this._def.left._parseAsync({data:I.data,path:I.path,parent:I}),this._def.right._parseAsync({data:I.data,path:I.path,parent:I})]).then(([r,a])=>n(r,a)):n(this._def.left._parseSync({data:I.data,path:I.path,parent:I}),this._def.right._parseSync({data:I.data,path:I.path,parent:I}))}};AS.create=(t,e,l)=>new AS({left:t,right:e,typeName:_n.ZodIntersection,...qr(l)});var YV=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.array)return pI(I,{code:vl.invalid_type,expected:QI.array,received:I.parsedType}),Bn;if(I.data.length<this._def.items.length)return pI(I,{code:vl.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Bn;!this._def.rest&&I.data.length>this._def.items.length&&(pI(I,{code:vl.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());let r=[...I.data].map((a,s)=>{let o=this._def.items[s]||this._def.rest;return o?o._parse(new dE(I,a,I.path,s)):null}).filter(a=>!!a);return I.common.async?Promise.all(r).then(a=>$b.mergeArray(l,a)):$b.mergeArray(l,r)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};YV.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new YV({items:t,typeName:_n.ZodTuple,rest:null,...qr(e)})};var lEe=class t extends Aa{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.object)return pI(I,{code:vl.invalid_type,expected:QI.object,received:I.parsedType}),Bn;let n=[],r=this._def.keyType,a=this._def.valueType;for(let s in I.data)n.push({key:r._parse(new dE(I,s,I.path,s)),value:a._parse(new dE(I,I.data[s],I.path,s)),alwaysSet:s in I.data});return I.common.async?$b.mergeObjectAsync(l,n):$b.mergeObjectSync(l,n)}get element(){return this._def.valueType}static create(e,l,I){return l instanceof Aa?new t({keyType:e,valueType:l,typeName:_n.ZodRecord,...qr(I)}):new t({keyType:v4.create(),valueType:e,typeName:_n.ZodRecord,...qr(l)})}},Tj=class extends Aa{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.map)return pI(I,{code:vl.invalid_type,expected:QI.map,received:I.parsedType}),Bn;let n=this._def.keyType,r=this._def.valueType,a=[...I.data.entries()].map(([s,o],d)=>({key:n._parse(new dE(I,s,I.path,[d,"key"])),value:r._parse(new dE(I,o,I.path,[d,"value"]))}));if(I.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let o of a){let d=await o.key,m=await o.value;if(d.status==="aborted"||m.status==="aborted")return Bn;(d.status==="dirty"||m.status==="dirty")&&l.dirty(),s.set(d.value,m.value)}return{status:l.value,value:s}})}else{let s=new Map;for(let o of a){let d=o.key,m=o.value;if(d.status==="aborted"||m.status==="aborted")return Bn;(d.status==="dirty"||m.status==="dirty")&&l.dirty(),s.set(d.value,m.value)}return{status:l.value,value:s}}}};Tj.create=(t,e,l)=>new Tj({valueType:e,keyType:t,typeName:_n.ZodMap,...qr(l)});var Uj=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.parsedType!==QI.set)return pI(I,{code:vl.invalid_type,expected:QI.set,received:I.parsedType}),Bn;let n=this._def;n.minSize!==null&&I.data.size<n.minSize.value&&(pI(I,{code:vl.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),l.dirty()),n.maxSize!==null&&I.data.size>n.maxSize.value&&(pI(I,{code:vl.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),l.dirty());let r=this._def.valueType;function a(o){let d=new Set;for(let m of o){if(m.status==="aborted")return Bn;m.status==="dirty"&&l.dirty(),d.add(m.value)}return{status:l.value,value:d}}let s=[...I.data.values()].map((o,d)=>r._parse(new dE(I,o,I.path,d)));return I.common.async?Promise.all(s).then(o=>a(o)):a(s)}min(e,l){return new t({...this._def,minSize:{value:e,message:In.toString(l)}})}max(e,l){return new t({...this._def,maxSize:{value:e,message:In.toString(l)}})}size(e,l){return this.min(e,l).max(e,l)}nonempty(e){return this.min(1,e)}};Uj.create=(t,e)=>new Uj({valueType:t,minSize:null,maxSize:null,typeName:_n.ZodSet,...qr(e)});var IEe=class t extends Aa{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.function)return pI(l,{code:vl.invalid_type,expected:QI.function,received:l.parsedType}),Bn;function I(s,o){return kse({data:s,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,Lj(),UC].filter(d=>!!d),issueData:{code:vl.invalid_arguments,argumentsError:o}})}function n(s,o){return kse({data:s,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,Lj(),UC].filter(d=>!!d),issueData:{code:vl.invalid_return_type,returnTypeError:o}})}let r={errorMap:l.common.contextualErrorMap},a=l.data;if(this._def.returns instanceof H4){let s=this;return nh(async function(...o){let d=new GN([]),m=await s._def.args.parseAsync(o,r).catch(A=>{throw d.addIssue(I(o,A)),d}),b=await Reflect.apply(a,this,m);return await s._def.returns._def.type.parseAsync(b,r).catch(A=>{throw d.addIssue(n(b,A)),d})})}else{let s=this;return nh(function(...o){let d=s._def.args.safeParse(o,r);if(!d.success)throw new GN([I(o,d.error)]);let m=Reflect.apply(a,this,d.data),b=s._def.returns.safeParse(m,r);if(!b.success)throw new GN([n(m,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:YV.create(e).rest(_C.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,l,I){return new t({args:e||YV.create([]).rest(_C.create()),returns:l||_C.create(),typeName:_n.ZodFunction,...qr(I)})}},ZS=class extends Aa{get schema(){return this._def.getter()}_parse(e){let{ctx:l}=this._processInputParams(e);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}};ZS.create=(t,e)=>new ZS({getter:t,typeName:_n.ZodLazy,...qr(e)});var NS=class extends Aa{_parse(e){if(e.data!==this._def.value){let l=this._getOrReturnCtx(e);return pI(l,{received:l.data,code:vl.invalid_literal,expected:this._def.value}),Bn}return{status:"valid",value:e.data}}get value(){return this._def.value}};NS.create=(t,e)=>new NS({value:t,typeName:_n.ZodLiteral,...qr(e)});function ECt(t,e){return new gS({values:t,typeName:_n.ZodEnum,...qr(e)})}var gS=class t extends Aa{_parse(e){if(typeof e.data!="string"){let l=this._getOrReturnCtx(e),I=this._def.values;return pI(l,{expected:ls.joinValues(I),received:l.parsedType,code:vl.invalid_type}),Bn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let l=this._getOrReturnCtx(e),I=this._def.values;return pI(l,{received:l.data,code:vl.invalid_enum_value,options:I}),Bn}return nh(e.data)}get options(){return this._def.values}get enum(){let e={};for(let l of this._def.values)e[l]=l;return e}get Values(){let e={};for(let l of this._def.values)e[l]=l;return e}get Enum(){let e={};for(let l of this._def.values)e[l]=l;return e}extract(e,l=this._def){return t.create(e,{...this._def,...l})}exclude(e,l=this._def){return t.create(this.options.filter(I=>!e.includes(I)),{...this._def,...l})}};gS.create=ECt;var WS=class extends Aa{_parse(e){let l=ls.getValidEnumValues(this._def.values),I=this._getOrReturnCtx(e);if(I.parsedType!==QI.string&&I.parsedType!==QI.number){let n=ls.objectValues(l);return pI(I,{expected:ls.joinValues(n),received:I.parsedType,code:vl.invalid_type}),Bn}if(this._cache||(this._cache=new Set(ls.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=ls.objectValues(l);return pI(I,{received:I.data,code:vl.invalid_enum_value,options:n}),Bn}return nh(e.data)}get enum(){return this._def.values}};WS.create=(t,e)=>new WS({values:t,typeName:_n.ZodNativeEnum,...qr(e)});var H4=class extends Aa{unwrap(){return this._def.type}_parse(e){let{ctx:l}=this._processInputParams(e);if(l.parsedType!==QI.promise&&l.common.async===!1)return pI(l,{code:vl.invalid_type,expected:QI.promise,received:l.parsedType}),Bn;let I=l.parsedType===QI.promise?l.data:Promise.resolve(l.data);return nh(I.then(n=>this._def.type.parseAsync(n,{path:l.path,errorMap:l.common.contextualErrorMap})))}};H4.create=(t,e)=>new H4({type:t,typeName:_n.ZodPromise,...qr(e)});var mE=class extends Aa{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_n.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:l,ctx:I}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:a=>{pI(I,a),a.fatal?l.abort():l.dirty()},get path(){return I.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){let a=n.transform(I.data,r);if(I.common.async)return Promise.resolve(a).then(async s=>{if(l.value==="aborted")return Bn;let o=await this._def.schema._parseAsync({data:s,path:I.path,parent:I});return o.status==="aborted"?Bn:o.status==="dirty"?iS(o.value):l.value==="dirty"?iS(o.value):o});{if(l.value==="aborted")return Bn;let s=this._def.schema._parseSync({data:a,path:I.path,parent:I});return s.status==="aborted"?Bn:s.status==="dirty"?iS(s.value):l.value==="dirty"?iS(s.value):s}}if(n.type==="refinement"){let a=s=>{let o=n.refinement(s,r);if(I.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(I.common.async===!1){let s=this._def.schema._parseSync({data:I.data,path:I.path,parent:I});return s.status==="aborted"?Bn:(s.status==="dirty"&&l.dirty(),a(s.value),{status:l.value,value:s.value})}else return this._def.schema._parseAsync({data:I.data,path:I.path,parent:I}).then(s=>s.status==="aborted"?Bn:(s.status==="dirty"&&l.dirty(),a(s.value).then(()=>({status:l.value,value:s.value}))))}if(n.type==="transform")if(I.common.async===!1){let a=this._def.schema._parseSync({data:I.data,path:I.path,parent:I});if(!C4(a))return Bn;let s=n.transform(a.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:s}}else return this._def.schema._parseAsync({data:I.data,path:I.path,parent:I}).then(a=>C4(a)?Promise.resolve(n.transform(a.value,r)).then(s=>({status:l.value,value:s})):Bn);ls.assertNever(n)}};mE.create=(t,e,l)=>new mE({schema:t,typeName:_n.ZodEffects,effect:e,...qr(l)});mE.createWithPreprocess=(t,e,l)=>new mE({schema:e,effect:{type:"preprocess",transform:t},typeName:_n.ZodEffects,...qr(l)});var iE=class extends Aa{_parse(e){return this._getType(e)===QI.undefined?nh(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};iE.create=(t,e)=>new iE({innerType:t,typeName:_n.ZodOptional,...qr(e)});var VV=class extends Aa{_parse(e){return this._getType(e)===QI.null?nh(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};VV.create=(t,e)=>new VV({innerType:t,typeName:_n.ZodNullable,...qr(e)});var yS=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=l.data;return l.parsedType===QI.undefined&&(I=this._def.defaultValue()),this._def.innerType._parse({data:I,path:l.path,parent:l})}removeDefault(){return this._def.innerType}};yS.create=(t,e)=>new yS({innerType:t,typeName:_n.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...qr(e)});var ES=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I={...l,common:{...l.common,issues:[]}},n=this._def.innerType._parse({data:I.data,path:I.path,parent:{...I}});return Bj(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new GN(I.common.issues)},input:I.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new GN(I.common.issues)},input:I.data})}}removeCatch(){return this._def.innerType}};ES.create=(t,e)=>new ES({innerType:t,typeName:_n.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...qr(e)});var Mj=class extends Aa{_parse(e){if(this._getType(e)!==QI.nan){let I=this._getOrReturnCtx(e);return pI(I,{code:vl.invalid_type,expected:QI.nan,received:I.parsedType}),Bn}return{status:"valid",value:e.data}}};Mj.create=t=>new Mj({typeName:_n.ZodNaN,...qr(t)});var e8l=Symbol("zod_brand"),Jse=class extends Aa{_parse(e){let{ctx:l}=this._processInputParams(e),I=l.data;return this._def.type._parse({data:I,path:l.path,parent:l})}unwrap(){return this._def.type}},Lse=class t extends Aa{_parse(e){let{status:l,ctx:I}=this._processInputParams(e);if(I.common.async)return(async()=>{let r=await this._def.in._parseAsync({data:I.data,path:I.path,parent:I});return r.status==="aborted"?Bn:r.status==="dirty"?(l.dirty(),iS(r.value)):this._def.out._parseAsync({data:r.value,path:I.path,parent:I})})();{let n=this._def.in._parseSync({data:I.data,path:I.path,parent:I});return n.status==="aborted"?Bn:n.status==="dirty"?(l.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:I.path,parent:I})}}static create(e,l){return new t({in:e,out:l,typeName:_n.ZodPipeline})}},RS=class extends Aa{_parse(e){let l=this._def.innerType._parse(e),I=n=>(C4(n)&&(n.value=Object.freeze(n.value)),n);return Bj(l)?l.then(n=>I(n)):I(l)}unwrap(){return this._def.innerType}};RS.create=(t,e)=>new RS({innerType:t,typeName:_n.ZodReadonly,...qr(e)});function NCt(t,e){let l=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof l=="string"?{message:l}:l}function RCt(t,e={},l){return t?f4.create().superRefine((I,n)=>{let r=t(I);if(r instanceof Promise)return r.then(a=>{if(!a){let s=NCt(e,I),o=s.fatal??l??!0;n.addIssue({code:"custom",...s,fatal:o})}});if(!r){let a=NCt(e,I),s=a.fatal??l??!0;n.addIssue({code:"custom",...a,fatal:s})}}):f4.create()}var t8l={object:bN.lazycreate},_n;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_n||(_n={}));var l8l=(t,e={message:`Input not instance of ${t.name}`})=>RCt(l=>l instanceof t,e),fl=v4.create,QV=dS.create,I8l=Mj.create,n8l=mS.create,Nu=uS.create,r8l=GS.create,a8l=Sj.create,s8l=bS.create,o8l=pS.create,lTe=f4.create,ITe=_C.create,c8l=DR.create,i8l=Oj.create,km=DC.create,Vn=bN.create,d8l=bN.strictCreate,rh=hS.create,nTe=tEe.create,m8l=AS.create,rTe=YV.create,zC=lEe.create,u8l=Tj.create,G8l=Uj.create,b8l=IEe.create,p8l=ZS.create,Is=NS.create,zR=gS.create,h8l=WS.create,A8l=H4.create,Z8l=mE.create,N8l=iE.create,g8l=VV.create,W8l=mE.createWithPreprocess,y8l=Lse.create,E8l=()=>fl().optional(),R8l=()=>QV().optional(),Y8l=()=>Nu().optional(),Bse={string:t=>v4.create({...t,coerce:!0}),number:t=>dS.create({...t,coerce:!0}),boolean:t=>uS.create({...t,coerce:!0}),bigint:t=>mS.create({...t,coerce:!0}),date:t=>GS.create({...t,coerce:!0})};var V8l=Bn;var _j="2025-06-18";var YCt=[_j,"2025-03-26","2024-11-05","2024-10-07"],nEe="2.0",VCt=z.union([z.string(),z.number().int()]),QCt=z.string(),Q8l=z.object({progressToken:z.optional(VCt)}).passthrough(),bE=z.object({_meta:z.optional(Q8l)}).passthrough(),pN=z.object({method:z.string(),params:z.optional(bE)}),Sse=z.object({_meta:z.optional(z.object({}).passthrough())}).passthrough(),wV=z.object({method:z.string(),params:z.optional(Sse)}),pE=z.object({_meta:z.optional(z.object({}).passthrough())}).passthrough(),rEe=z.union([z.string(),z.number().int()]),wCt=z.object({jsonrpc:z.literal(nEe),id:rEe}).merge(pN).strict(),aEe=t=>wCt.safeParse(t).success,FCt=z.object({jsonrpc:z.literal(nEe)}).merge(wV).strict(),CCt=t=>FCt.safeParse(t).success,vCt=z.object({jsonrpc:z.literal(nEe),id:rEe,result:pE}).strict(),Ose=t=>vCt.safeParse(t).success,uE;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(uE||(uE={}));var fCt=z.object({jsonrpc:z.literal(nEe),id:rEe,error:z.object({code:z.number().int(),message:z.string(),data:z.optional(z.unknown())})}).strict(),HCt=t=>fCt.safeParse(t).success,X4=z.union([wCt,FCt,vCt,fCt]),YS=pE.strict(),sEe=wV.extend({method:z.literal("notifications/cancelled"),params:Sse.extend({requestId:rEe,reason:z.string().optional()})}),oEe=z.object({src:z.string(),mimeType:z.optional(z.string()),sizes:z.optional(z.string())}).passthrough(),Tse=z.object({name:z.string(),title:z.optional(z.string())}).passthrough(),XCt=Tse.extend({version:z.string(),websiteUrl:z.optional(z.string()),icons:z.optional(z.array(oEe))}),w8l=z.object({experimental:z.optional(z.object({}).passthrough()),sampling:z.optional(z.object({}).passthrough()),elicitation:z.optional(z.object({}).passthrough()),roots:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough())}).passthrough(),F8l=pN.extend({method:z.literal("initialize"),params:bE.extend({protocolVersion:z.string(),capabilities:w8l,clientInfo:XCt})});var C8l=z.object({experimental:z.optional(z.object({}).passthrough()),logging:z.optional(z.object({}).passthrough()),completions:z.optional(z.object({}).passthrough()),prompts:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough()),resources:z.optional(z.object({subscribe:z.optional(z.boolean()),listChanged:z.optional(z.boolean())}).passthrough()),tools:z.optional(z.object({listChanged:z.optional(z.boolean())}).passthrough())}).passthrough(),aTe=pE.extend({protocolVersion:z.string(),capabilities:C8l,serverInfo:XCt,instructions:z.optional(z.string())}),kCt=wV.extend({method:z.literal("notifications/initialized")}),JCt=t=>kCt.safeParse(t).success,cEe=pN.extend({method:z.literal("ping")}),v8l=z.object({progress:z.number(),total:z.optional(z.number()),message:z.optional(z.string())}).passthrough(),iEe=wV.extend({method:z.literal("notifications/progress"),params:Sse.merge(v8l).extend({progressToken:VCt})}),dEe=pN.extend({params:bE.extend({cursor:z.optional(QCt)}).optional()}),mEe=pE.extend({nextCursor:z.optional(QCt)}),LCt=z.object({uri:z.string(),mimeType:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}).passthrough(),BCt=LCt.extend({text:z.string()}),sTe=z.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),xCt=LCt.extend({blob:sTe}),SCt=Tse.extend({uri:z.string(),description:z.optional(z.string()),mimeType:z.optional(z.string()),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),f8l=Tse.extend({uriTemplate:z.string(),description:z.optional(z.string()),mimeType:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}),H8l=dEe.extend({method:z.literal("resources/list")}),oTe=mEe.extend({resources:z.array(SCt)}),X8l=dEe.extend({method:z.literal("resources/templates/list")}),cTe=mEe.extend({resourceTemplates:z.array(f8l)}),k8l=pN.extend({method:z.literal("resources/read"),params:bE.extend({uri:z.string()})}),iTe=pE.extend({contents:z.array(z.union([BCt,xCt]))}),J8l=wV.extend({method:z.literal("notifications/resources/list_changed")}),L8l=pN.extend({method:z.literal("resources/subscribe"),params:bE.extend({uri:z.string()})}),B8l=pN.extend({method:z.literal("resources/unsubscribe"),params:bE.extend({uri:z.string()})}),x8l=wV.extend({method:z.literal("notifications/resources/updated"),params:Sse.extend({uri:z.string()})}),S8l=z.object({name:z.string(),description:z.optional(z.string()),required:z.optional(z.boolean())}).passthrough(),O8l=Tse.extend({description:z.optional(z.string()),arguments:z.optional(z.array(S8l)),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),T8l=dEe.extend({method:z.literal("prompts/list")}),dTe=mEe.extend({prompts:z.array(O8l)}),U8l=pN.extend({method:z.literal("prompts/get"),params:bE.extend({name:z.string(),arguments:z.optional(z.record(z.string()))})}),mTe=z.object({type:z.literal("text"),text:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),uTe=z.object({type:z.literal("image"),data:sTe,mimeType:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),GTe=z.object({type:z.literal("audio"),data:sTe,mimeType:z.string(),_meta:z.optional(z.object({}).passthrough())}).passthrough(),M8l=z.object({type:z.literal("resource"),resource:z.union([BCt,xCt]),_meta:z.optional(z.object({}).passthrough())}).passthrough(),_8l=SCt.extend({type:z.literal("resource_link")}),OCt=z.union([mTe,uTe,GTe,_8l,M8l]),D8l=z.object({role:z.enum(["user","assistant"]),content:OCt}).passthrough(),bTe=pE.extend({description:z.optional(z.string()),messages:z.array(D8l)}),z8l=wV.extend({method:z.literal("notifications/prompts/list_changed")}),P8l=z.object({title:z.optional(z.string()),readOnlyHint:z.optional(z.boolean()),destructiveHint:z.optional(z.boolean()),idempotentHint:z.optional(z.boolean()),openWorldHint:z.optional(z.boolean())}).passthrough(),j8l=Tse.extend({description:z.optional(z.string()),inputSchema:z.object({type:z.literal("object"),properties:z.optional(z.object({}).passthrough()),required:z.optional(z.array(z.string()))}).passthrough(),outputSchema:z.optional(z.object({type:z.literal("object"),properties:z.optional(z.object({}).passthrough()),required:z.optional(z.array(z.string()))}).passthrough()),annotations:z.optional(P8l),icons:z.optional(z.array(oEe)),_meta:z.optional(z.object({}).passthrough())}),K8l=dEe.extend({method:z.literal("tools/list")}),pTe=mEe.extend({tools:z.array(j8l)}),uEe=pE.extend({content:z.array(OCt).default([]),structuredContent:z.object({}).passthrough().optional(),isError:z.optional(z.boolean())}),kTr=uEe.or(pE.extend({toolResult:z.unknown()})),q8l=pN.extend({method:z.literal("tools/call"),params:bE.extend({name:z.string(),arguments:z.optional(z.record(z.unknown()))})}),$8l=wV.extend({method:z.literal("notifications/tools/list_changed")}),TCt=z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),eql=pN.extend({method:z.literal("logging/setLevel"),params:bE.extend({level:TCt})}),tql=wV.extend({method:z.literal("notifications/message"),params:Sse.extend({level:TCt,logger:z.optional(z.string()),data:z.unknown()})}),lql=z.object({name:z.string().optional()}).passthrough(),Iql=z.object({hints:z.optional(z.array(lql)),costPriority:z.optional(z.number().min(0).max(1)),speedPriority:z.optional(z.number().min(0).max(1)),intelligencePriority:z.optional(z.number().min(0).max(1))}).passthrough(),nql=z.object({role:z.enum(["user","assistant"]),content:z.union([mTe,uTe,GTe])}).passthrough(),rql=pN.extend({method:z.literal("sampling/createMessage"),params:bE.extend({messages:z.array(nql),systemPrompt:z.optional(z.string()),includeContext:z.optional(z.enum(["none","thisServer","allServers"])),temperature:z.optional(z.number()),maxTokens:z.number().int(),stopSequences:z.optional(z.array(z.string())),metadata:z.optional(z.object({}).passthrough()),modelPreferences:z.optional(Iql)})}),aql=pE.extend({model:z.string(),stopReason:z.optional(z.enum(["endTurn","stopSequence","maxTokens"]).or(z.string())),role:z.enum(["user","assistant"]),content:z.discriminatedUnion("type",[mTe,uTe,GTe])}),sql=z.object({type:z.literal("boolean"),title:z.optional(z.string()),description:z.optional(z.string()),default:z.optional(z.boolean())}).passthrough(),oql=z.object({type:z.literal("string"),title:z.optional(z.string()),description:z.optional(z.string()),minLength:z.optional(z.number()),maxLength:z.optional(z.number()),format:z.optional(z.enum(["email","uri","date","date-time"]))}).passthrough(),cql=z.object({type:z.enum(["number","integer"]),title:z.optional(z.string()),description:z.optional(z.string()),minimum:z.optional(z.number()),maximum:z.optional(z.number())}).passthrough(),iql=z.object({type:z.literal("string"),title:z.optional(z.string()),description:z.optional(z.string()),enum:z.array(z.string()),enumNames:z.optional(z.array(z.string()))}).passthrough(),dql=z.union([sql,oql,cql,iql]),mql=pN.extend({method:z.literal("elicitation/create"),params:bE.extend({message:z.string(),requestedSchema:z.object({type:z.literal("object"),properties:z.record(z.string(),dql),required:z.optional(z.array(z.string()))}).passthrough()})}),uql=pE.extend({action:z.enum(["accept","decline","cancel"]),content:z.optional(z.record(z.string(),z.unknown()))}),Gql=z.object({type:z.literal("ref/resource"),uri:z.string()}).passthrough();var bql=z.object({type:z.literal("ref/prompt"),name:z.string()}).passthrough(),pql=pN.extend({method:z.literal("completion/complete"),params:bE.extend({ref:z.union([bql,Gql]),argument:z.object({name:z.string(),value:z.string()}).passthrough(),context:z.optional(z.object({arguments:z.optional(z.record(z.string(),z.string()))}))})}),hTe=pE.extend({completion:z.object({values:z.array(z.string()).max(100),total:z.optional(z.number().int()),hasMore:z.optional(z.boolean())}).passthrough()}),hql=z.object({uri:z.string().startsWith("file://"),name:z.optional(z.string()),_meta:z.optional(z.object({}).passthrough())}).passthrough(),Aql=pN.extend({method:z.literal("roots/list")}),Zql=pE.extend({roots:z.array(hql)}),Nql=wV.extend({method:z.literal("notifications/roots/list_changed")}),JTr=z.union([cEe,F8l,pql,eql,U8l,T8l,H8l,X8l,k8l,L8l,B8l,q8l,K8l]),LTr=z.union([sEe,iEe,kCt,Nql]),BTr=z.union([YS,aql,uql,Zql]),xTr=z.union([cEe,rql,mql,Aql]),STr=z.union([sEe,iEe,tql,x8l,J8l,$8l,z8l]),OTr=z.union([YS,aTe,hTe,bTe,dTe,oTe,cTe,iTe,uEe,pTe]),GE=class extends Error{constructor(e,l,I){super(`MCP error ${e}: ${l}`),this.code=e,this.data=I,this.name="McpError"}};var gql=6e4,GEe=class{constructor(e){this._options=e,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.setNotificationHandler(sEe,l=>{let I=this._requestHandlerAbortControllers.get(l.params.requestId);I?.abort(l.params.reason)}),this.setNotificationHandler(iEe,l=>{this._onprogress(l)}),this.setRequestHandler(cEe,l=>({}))}_setupTimeout(e,l,I,n,r=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,l),startTime:Date.now(),timeout:l,maxTotalTimeout:I,resetTimeoutOnProgress:r,onTimeout:n})}_resetTimeout(e){let l=this._timeoutInfo.get(e);if(!l)return!1;let I=Date.now()-l.startTime;if(l.maxTotalTimeout&&I>=l.maxTotalTimeout)throw this._timeoutInfo.delete(e),new GE(uE.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:l.maxTotalTimeout,totalElapsed:I});return clearTimeout(l.timeoutId),l.timeoutId=setTimeout(l.onTimeout,l.timeout),!0}_cleanupTimeout(e){let l=this._timeoutInfo.get(e);l&&(clearTimeout(l.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var l,I,n;this._transport=e;let r=(l=this.transport)===null||l===void 0?void 0:l.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let a=(I=this.transport)===null||I===void 0?void 0:I.onerror;this._transport.onerror=o=>{a?.(o),this._onerror(o)};let s=(n=this._transport)===null||n===void 0?void 0:n.onmessage;this._transport.onmessage=(o,d)=>{s?.(o,d),Ose(o)||HCt(o)?this._onresponse(o):aEe(o)?this._onrequest(o,d):CCt(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){var e;let l=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let I=new GE(uE.ConnectionClosed,"Connection closed");for(let n of l.values())n(I)}_onerror(e){var l;(l=this.onerror)===null||l===void 0||l.call(this,e)}_onnotification(e){var l;let I=(l=this._notificationHandlers.get(e.method))!==null&&l!==void 0?l:this.fallbackNotificationHandler;I!==void 0&&Promise.resolve().then(()=>I(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,l){var I,n;let r=(I=this._requestHandlers.get(e.method))!==null&&I!==void 0?I:this.fallbackRequestHandler,a=this._transport;if(r===void 0){a?.send({jsonrpc:"2.0",id:e.id,error:{code:uE.MethodNotFound,message:"Method not found"}}).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let o={signal:s.signal,sessionId:a?.sessionId,_meta:(n=e.params)===null||n===void 0?void 0:n._meta,sendNotification:d=>this.notification(d,{relatedRequestId:e.id}),sendRequest:(d,m,b)=>this.request(d,m,{...b,relatedRequestId:e.id}),authInfo:l?.authInfo,requestId:e.id,requestInfo:l?.requestInfo};Promise.resolve().then(()=>r(e,o)).then(d=>{if(!s.signal.aborted)return a?.send({result:d,jsonrpc:"2.0",id:e.id})},d=>{var m;if(!s.signal.aborted)return a?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(d.code)?d.code:uE.InternalError,message:(m=d.message)!==null&&m!==void 0?m:"Internal error"}})}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:l,...I}=e.params,n=Number(l),r=this._progressHandlers.get(n);if(!r){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(n),s=this._timeoutInfo.get(n);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(o){a(o);return}r(I)}_onresponse(e){let l=Number(e.id),I=this._responseHandlers.get(l);if(I===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(l),this._progressHandlers.delete(l),this._cleanupTimeout(l),Ose(e))I(e);else{let n=new GE(e.error.code,e.error.message,e.error.data);I(n)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,l,I){let{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}=I??{};return new Promise((s,o)=>{var d,m,b,p,A,W;if(!this._transport){o(new Error("Not connected"));return}((d=this._options)===null||d===void 0?void 0:d.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(m=I?.signal)===null||m===void 0||m.throwIfAborted();let E=this._requestMessageId++,R={...e,jsonrpc:"2.0",id:E};I?.onprogress&&(this._progressHandlers.set(E,I.onprogress),R.params={...e.params,_meta:{...((b=e.params)===null||b===void 0?void 0:b._meta)||{},progressToken:E}});let w=S=>{var U;this._responseHandlers.delete(E),this._progressHandlers.delete(E),this._cleanupTimeout(E),(U=this._transport)===null||U===void 0||U.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,reason:String(S)}},{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`))),o(S)};this._responseHandlers.set(E,S=>{var U;if(!(!((U=I?.signal)===null||U===void 0)&&U.aborted)){if(S instanceof Error)return o(S);try{let P=l.parse(S.result);s(P)}catch(P){o(P)}}}),(p=I?.signal)===null||p===void 0||p.addEventListener("abort",()=>{var S;w((S=I?.signal)===null||S===void 0?void 0:S.reason)});let v=(A=I?.timeout)!==null&&A!==void 0?A:gql,J=()=>w(new GE(uE.RequestTimeout,"Request timed out",{timeout:v}));this._setupTimeout(E,v,I?.maxTotalTimeout,J,(W=I?.resetTimeoutOnProgress)!==null&&W!==void 0?W:!1),this._transport.send(R,{relatedRequestId:n,resumptionToken:r,onresumptiontoken:a}).catch(S=>{this._cleanupTimeout(E),o(S)})})}async notification(e,l){var I,n;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((n=(I=this._options)===null||I===void 0?void 0:I.debouncedNotificationMethods)!==null&&n!==void 0?n:[]).includes(e.method)&&!e.params&&!l?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var o;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let d={...e,jsonrpc:"2.0"};(o=this._transport)===null||o===void 0||o.send(d,l).catch(m=>this._onerror(m))});return}let s={...e,jsonrpc:"2.0"};await this._transport.send(s,l)}setRequestHandler(e,l){let I=e.shape.method.value;this.assertRequestHandlerCapability(I),this._requestHandlers.set(I,(n,r)=>Promise.resolve(l(e.parse(n),r)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,l){this._notificationHandlers.set(e.shape.method.value,I=>Promise.resolve(l(e.parse(I))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function UCt(t,e){return Object.entries(e).reduce((l,[I,n])=>(n&&typeof n=="object"?l[I]=l[I]?{...l[I],...n}:n:l[I]=n,l),{...t})}var EHt=mt(yHt(),1),PEe=class extends GEe{constructor(e,l){var I;super(l),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(I=l?.capabilities)!==null&&I!==void 0?I:{},this._ajv=new EHt.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=UCt(this._capabilities,e)}assertCapability(e,l){var I;if(!(!((I=this._serverCapabilities)===null||I===void 0)&&I[e]))throw new Error(`Server does not support ${e} (required for ${l})`)}async connect(e,l){if(await super.connect(e),e.sessionId===void 0)try{let I=await this.request({method:"initialize",params:{protocolVersion:_j,capabilities:this._capabilities,clientInfo:this._clientInfo}},aTe,l);if(I===void 0)throw new Error(`Server sent invalid initialize result: ${I}`);if(!YCt.includes(I.protocolVersion))throw new Error(`Server's protocol version is not supported: ${I.protocolVersion}`);this._serverCapabilities=I.capabilities,this._serverVersion=I.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(I.protocolVersion),this._instructions=I.instructions,await this.notification({method:"notifications/initialized"})}catch(I){throw this.close(),I}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var l,I,n,r,a;switch(e){case"logging/setLevel":if(!(!((l=this._serverCapabilities)===null||l===void 0)&&l.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((I=this._serverCapabilities)===null||I===void 0)&&I.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var l;switch(e){case"notifications/roots/list_changed":if(!(!((l=this._capabilities.roots)===null||l===void 0)&&l.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},YS,e)}async complete(e,l){return this.request({method:"completion/complete",params:e},hTe,l)}async setLoggingLevel(e,l){return this.request({method:"logging/setLevel",params:{level:e}},YS,l)}async getPrompt(e,l){return this.request({method:"prompts/get",params:e},bTe,l)}async listPrompts(e,l){return this.request({method:"prompts/list",params:e},dTe,l)}async listResources(e,l){return this.request({method:"resources/list",params:e},oTe,l)}async listResourceTemplates(e,l){return this.request({method:"resources/templates/list",params:e},cTe,l)}async readResource(e,l){return this.request({method:"resources/read",params:e},iTe,l)}async subscribeResource(e,l){return this.request({method:"resources/subscribe",params:e},YS,l)}async unsubscribeResource(e,l){return this.request({method:"resources/unsubscribe",params:e},YS,l)}async callTool(e,l=uEe,I){let n=await this.request({method:"tools/call",params:e},l,I),r=this.getToolOutputValidator(e.name);if(r){if(!n.structuredContent&&!n.isError)throw new GE(uE.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{if(!r(n.structuredContent))throw new GE(uE.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(r.errors)}`)}catch(a){throw a instanceof GE?a:new GE(uE.InvalidParams,`Failed to validate structured content: ${a instanceof Error?a.message:String(a)}`)}}return n}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let l of e)if(l.outputSchema)try{let I=this._ajv.compile(l.outputSchema);this._cachedToolOutputValidators.set(l.name,I)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,l){let I=await this.request({method:"tools/list",params:e},pTe,l);return this.cacheToolOutputSchemas(I.tools),I}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var jEe=class{createClient(e,l){return new PEe(e,l)}};c();c();c();c();var KEe=class extends Error{constructor(e,l){super(e),this.name="ParseError",this.type=l.type,this.field=l.field,this.value=l.value,this.line=l.line}};function tMe(t){}function qEe(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=tMe,onError:l=tMe,onRetry:I=tMe,onComment:n}=t,r="",a=!0,s,o="",d="";function m(E){let R=a?E.replace(/^\xEF\xBB\xBF/,""):E,[w,v]=_lI(`${r}${R}`);for(let J of w)b(J);r=v,a=!1}function b(E){if(E===""){A();return}if(E.startsWith(":")){n&&n(E.slice(E.startsWith(": ")?2:1));return}let R=E.indexOf(":");if(R!==-1){let w=E.slice(0,R),v=E[R+1]===" "?2:1,J=E.slice(R+v);p(w,J,E);return}p(E,"",E)}function p(E,R,w){switch(E){case"event":d=R;break;case"data":o=`${o}${R}
1722
1722
  `;break;case"id":s=R.includes("\0")?void 0:R;break;case"retry":/^\d+$/.test(R)?I(parseInt(R,10)):l(new KEe(`Invalid \`retry\` value: "${R}"`,{type:"invalid-retry",value:R,line:w}));break;default:l(new KEe(`Unknown field "${E.length>20?`${E.slice(0,20)}\u2026`:E}"`,{type:"unknown-field",field:E,value:R,line:w}));break}}function A(){o.length>0&&e({id:s,event:d||void 0,data:o.endsWith(`
1723
1723
  `)?o.slice(0,-1):o}),s=void 0,o="",d=""}function W(E={}){r&&E.consume&&b(r),a=!0,s=void 0,o="",d="",r=""}return{feed:m,reset:W}}function _lI(t){let e=[],l="",I=0;for(;I<t.length;){let n=t.indexOf("\r",I),r=t.indexOf(`
1724
1724
  `,I),a=-1;if(n!==-1&&r!==-1?a=Math.min(n,r):n!==-1?a=n:r!==-1&&(a=r),a===-1){l=t.slice(I);break}else{let s=t.slice(I,a);e.push(s),I=a+1,t[I-1]==="\r"&&t[I]===`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@github/copilot",
3
3
  "description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.",
4
- "version": "0.0.336-3",
4
+ "version": "0.0.336-4",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  "sdk/**/*"
34
34
  ],
35
35
  "buildMetadata": {
36
- "gitCommit": "70e2aa6"
36
+ "gitCommit": "74f707e"
37
37
  },
38
38
  "dependencies": {
39
39
  "node-pty": "npm:@devm33/node-pty@^1.0.8",