@smithery/cli 1.6.2 → 1.6.3

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -183,7 +183,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
183
183
  `?(a&&(n+=eG("")),i&&m&&(n+=ZW(m))):h===`
184
184
  `&&(i&&m&&(n+=ZW(i)),a&&(n+=eG(a))),p+=h.length}return n}});import n3 from"node:process";function lA(t,e){if(e={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",...e},e.align&&(e.textAlignment=e.align),e.borderColor&&!sG(e.borderColor))throw new Error(`${e.borderColor} is not a valid borderColor`);if(e.backgroundColor&&!sG(e.backgroundColor))throw new Error(`${e.backgroundColor} is not a valid backgroundColor`);return e.padding=iG(e.padding),e.margin=iG(e.margin),e=NIe(t,e),t=PIe(t,e),BIe(t,e.width,e)}var oG,uA,LIe,Yc,ma,O2,uG,iG,I2,OIe,IIe,PIe,BIe,RIe,aG,NIe,cA,sG,kIe,qIe,cG=_e(()=>{A2();AW();FW();oG=ke(ZS(),1);NW();uA=ke(HW(),1);nG();LIe=ke(ZS(),1),Yc=`
185
185
  `,ma=" ",O2="none",uG=()=>{let{env:t,stdout:e,stderr:r}=n3;return e?.columns?e.columns:r?.columns?r.columns:t.COLUMNS?Number.parseInt(t.COLUMNS,10):80},iG=t=>typeof t=="number"?{top:t,right:t*3,bottom:t,left:t*3}:{top:0,right:0,bottom:0,left:0,...t},I2=t=>t===O2?0:2,OIe=t=>{let e=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],r;if(t===O2){t={};for(let n of e)t[n]=""}if(typeof t=="string"){if(r=oG.default[t],!r)throw new TypeError(`Invalid border style: ${t}`)}else{typeof t?.vertical=="string"&&(t.left=t.vertical,t.right=t.vertical),typeof t?.horizontal=="string"&&(t.top=t.horizontal,t.bottom=t.horizontal);for(let n of e)if(t[n]===null||typeof t[n]!="string")throw new TypeError(`Invalid border style: ${n}`);r=t}return r},IIe=(t,e,r)=>{let n="",i=Yn(t);switch(r){case"left":{n=t+e.slice(i);break}case"right":{n=e.slice(i)+t;break}default:{e=e.slice(i),e.length%2===1?(e=e.slice(Math.floor(e.length/2)),n=e.slice(1)+t+e):(e=e.slice(e.length/2),n=e+t+e);break}}return n},PIe=(t,{padding:e,width:r,textAlignment:n,height:i})=>{t=(0,uA.default)(t,{align:n});let a=t.split(Yc),s=X8(t),o=r-e.left-e.right;if(s>o){let p=[];for(let d of a){let h=r3(d,o,{hard:!0}),v=(0,uA.default)(h,{align:n}).split(`
186
- `),g=Math.max(...v.map(b=>Yn(b)));for(let b of v){let D;switch(n){case"center":{D=ma.repeat((o-g)/2)+b;break}case"right":{D=ma.repeat(o-g)+b;break}default:{D=b;break}}p.push(D)}}a=p}n==="center"&&s<o?a=a.map(p=>ma.repeat((o-s)/2)+p):n==="right"&&s<o&&(a=a.map(p=>ma.repeat(o-s)+p));let u=ma.repeat(e.left),c=ma.repeat(e.right);return a=a.map(p=>{let d=u+p+c;return d+ma.repeat(r-Yn(d))}),e.top>0&&(a=[...Array.from({length:e.top}).fill(ma.repeat(r)),...a]),e.bottom>0&&(a=[...a,...Array.from({length:e.bottom}).fill(ma.repeat(r))]),i&&a.length>i?a=a.slice(0,i):i&&a.length<i&&(a=[...a,...Array.from({length:i-a.length}).fill(ma.repeat(r))]),a.join(Yc)},BIe=(t,e,r)=>{let n=p=>{let d=r.borderColor?kIe(r.borderColor)(p):p;return r.dimBorder?Qp.dim(d):d},i=p=>r.backgroundColor?qIe(r.backgroundColor)(p):p,a=OIe(r.borderStyle),s=uG(),o=ma.repeat(r.margin.left);if(r.float==="center"){let p=Math.max((s-e-I2(r.borderStyle))/2,0);o=ma.repeat(p)}else if(r.float==="right"){let p=Math.max(s-e-r.margin.right-I2(r.borderStyle),0);o=ma.repeat(p)}let u="";r.margin.top&&(u+=Yc.repeat(r.margin.top)),(r.borderStyle!==O2||r.title)&&(u+=n(o+a.topLeft+(r.title?IIe(r.title,a.top.repeat(e),r.titleAlignment):a.top.repeat(e))+a.topRight)+Yc);let c=t.split(Yc);return u+=c.map(p=>o+n(a.left)+i(p)+n(a.right)).join(Yc),r.borderStyle!==O2&&(u+=Yc+n(o+a.bottomLeft+a.bottom.repeat(e)+a.bottomRight)),r.margin.bottom&&(u+=Yc.repeat(r.margin.bottom)),u},RIe=t=>{if(t.fullscreen&&n3?.stdout){let e=[n3.stdout.columns,n3.stdout.rows];typeof t.fullscreen=="function"&&(e=t.fullscreen(...e)),t.width||=e[0],t.height||=e[1]}return t.width&&=Math.max(1,t.width-I2(t.borderStyle)),t.height&&=Math.max(1,t.height-I2(t.borderStyle)),t},aG=(t,e)=>e===O2?t:` ${t} `,NIe=(t,e)=>{e=RIe(e);let r=e.width!==void 0,n=uG(),i=I2(e.borderStyle),a=n-e.margin.left-e.margin.right-i,s=X8(r3(t,n-i,{hard:!0,trim:!1}))+e.padding.left+e.padding.right;if(e.title&&r?(e.title=e.title.slice(0,Math.max(0,e.width-2)),e.title&&=aG(e.title,e.borderStyle)):e.title&&(e.title=e.title.slice(0,Math.max(0,a-2)),e.title&&(e.title=aG(e.title,e.borderStyle),Yn(e.title)>s&&(e.width=Yn(e.title)))),e.width||=s,!r){if(e.margin.left&&e.margin.right&&e.width>a){let u=(n-e.width-i)/(e.margin.left+e.margin.right);e.margin.left=Math.max(0,Math.floor(e.margin.left*u)),e.margin.right=Math.max(0,Math.floor(e.margin.right*u))}e.width=Math.min(e.width,n-i-e.margin.left-e.margin.right)}return e.width-(e.padding.left+e.padding.right)<=0&&(e.padding.left=0,e.padding.right=0),e.height&&e.height-(e.padding.top+e.padding.bottom)<=0&&(e.padding.top=0,e.padding.bottom=0),e},cA=t=>t.match(/^#(?:[0-f]{3}){1,2}$/i),sG=t=>typeof t=="string"&&(Qp[t]??cA(t)),kIe=t=>cA(t)?Qp.hex(t):Qp[t],qIe=t=>cA(t)?Qp.bgHex(t):Qp[tA(["bg",t])]});function lG(t){let{name:e,...r}=t,n=Buffer.from(JSON.stringify(r)).toString("base64"),i=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(e)}&config=${encodeURIComponent(n)}`,a=`cursor://anysphere.cursor-deeplink/mcp/install?name=${e}&config=...`;return{url:i,displayText:a}}function pG(t){let e=`vscode:mcp/install?${encodeURIComponent(JSON.stringify(t))}`,r=`vscode:mcp/install?{"name":"${t.name}","type":"${t.type}",...}`;return{url:e,displayText:r}}function pA(t,e){return`\x1B]8;;${t}\x1B\\${e}\x1B]8;;\x1B\\`}var dG=_e(()=>{"use strict"});import{exec as MIe}from"node:child_process";import{promisify as jIe}from"node:util";async function fG(t,e,r){let n=`https://smithery.ai/playground?mcp=${encodeURIComponent(`${t}/mcp`)}`;try{let i=process.platform,a;switch(i){case"darwin":a=`open "${n}"`;break;case"win32":a=`start "" "${n}"`;break;default:a=`xdg-open "${n}"`;break}await UIe(a)}catch{console.log(dA.default.yellow("Could not open browser automatically")),console.log(dA.default.gray("Please open the link manually"))}}var dA,UIe,hG=_e(()=>{"use strict";dA=ke(qt(),1),UIe=jIe(MIe)});function gG(t){mG=t}function yG(t){vG=t}function Q(t){mG&&console.log(fA.default.gray(`[verbose] ${t}`))}function Us(t){vG&&console.debug(fA.default.blue(`[debug] ${t}`))}var fA,mG,vG,va=_e(()=>{"use strict";fA=ke(qt(),1),mG=!1,vG=!1});async function $Ie(t){try{let r=await fetch("https://registry.smithery.ai/uplink/token",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw r.status===401?new Error("Unauthorized: Invalid API key"):new Error(`Failed to get tunnel token: ${r.statusText}`);return await r.json()}catch(e){throw new Error(`Failed to connect to Smithery API: ${e instanceof Error?e.message:e}`)}}function xG(t){let e=[/(?:localhost|127\.0\.0\.1):(\d+)/g,/port\s+(\d+)/gi,/running.*?(\d{4,5})/gi,/server.*?(\d{4,5})/gi,/http:\/\/.*?:(\d+)/gi];for(let r of e){let n=r.exec(t);if(n?.[1]){let i=Number.parseInt(n[1],10);if(i>1e3&&i<65536)return n[1]}}return null}async function bG(t,e){Us(hA.default.blue(`\u{1F680} Starting tunnel for localhost:${t}...`)),Us(hA.default.gray("Getting tunnel credentials..."));let{authtoken:r,domain:n}=await $Ie(e),a=await(await import("@ngrok/ngrok")).default.forward({addr:t,authtoken:r,domain:n}),s=a.url();if(!s)throw new Error("Failed to get tunnel URL");return{listener:a,url:s}}var hA,mA=_e(()=>{"use strict";hA=ke(qt(),1);va()});async function _o(t,e,r=!0,n){let{listener:i,url:a}=await bG(t,e),s=`https://smithery.ai/playground?mcp=${encodeURIComponent(`${a}/mcp`)}`,u={name:"smithery-dev",type:"http",url:`${a}/mcp`,headers:{}},c=lG(u),p=pA(c.url,c.displayText),d=pG(u),h=pA(d.url,d.displayText);console.log(""),console.log(` ${kr.default.bold.italic.hex("#ea580c")("SMITHERY")} ${kr.default.bold.italic.hex("#ea580c")("v1.6.2")} ready`),console.log(""),console.log(` ${kr.default.green(kr.default.dim("\u279C"))} ${kr.default.bold(kr.default.dim("Local:"))} ${kr.default.cyan(`http://localhost:${t}/`)}`),console.log(` ${kr.default.green(kr.default.dim("\u279C"))} ${kr.default.bold(kr.default.dim("Remote:"))} ${kr.default.cyan(a)}`),console.log(` ${kr.default.green("\u279C")} ${kr.default.bold("Playground")}: ${kr.default.cyan(s)}`),console.log("");let m=[`${kr.default.bold("Cursor")}: ${kr.default.cyan(p)}`,`${kr.default.bold("VS Code")}: ${kr.default.cyan(h)}`,"",`${kr.default.dim("Note: If required config needed, attach using URL params")}`,`${kr.default.dim("e.g.")} ${kr.default.dim.cyan("https://server.com/mcp")}${kr.default.cyan("?weatherApiKey=abc123")}`].join(`
186
+ `),g=Math.max(...v.map(b=>Yn(b)));for(let b of v){let D;switch(n){case"center":{D=ma.repeat((o-g)/2)+b;break}case"right":{D=ma.repeat(o-g)+b;break}default:{D=b;break}}p.push(D)}}a=p}n==="center"&&s<o?a=a.map(p=>ma.repeat((o-s)/2)+p):n==="right"&&s<o&&(a=a.map(p=>ma.repeat(o-s)+p));let u=ma.repeat(e.left),c=ma.repeat(e.right);return a=a.map(p=>{let d=u+p+c;return d+ma.repeat(r-Yn(d))}),e.top>0&&(a=[...Array.from({length:e.top}).fill(ma.repeat(r)),...a]),e.bottom>0&&(a=[...a,...Array.from({length:e.bottom}).fill(ma.repeat(r))]),i&&a.length>i?a=a.slice(0,i):i&&a.length<i&&(a=[...a,...Array.from({length:i-a.length}).fill(ma.repeat(r))]),a.join(Yc)},BIe=(t,e,r)=>{let n=p=>{let d=r.borderColor?kIe(r.borderColor)(p):p;return r.dimBorder?Qp.dim(d):d},i=p=>r.backgroundColor?qIe(r.backgroundColor)(p):p,a=OIe(r.borderStyle),s=uG(),o=ma.repeat(r.margin.left);if(r.float==="center"){let p=Math.max((s-e-I2(r.borderStyle))/2,0);o=ma.repeat(p)}else if(r.float==="right"){let p=Math.max(s-e-r.margin.right-I2(r.borderStyle),0);o=ma.repeat(p)}let u="";r.margin.top&&(u+=Yc.repeat(r.margin.top)),(r.borderStyle!==O2||r.title)&&(u+=n(o+a.topLeft+(r.title?IIe(r.title,a.top.repeat(e),r.titleAlignment):a.top.repeat(e))+a.topRight)+Yc);let c=t.split(Yc);return u+=c.map(p=>o+n(a.left)+i(p)+n(a.right)).join(Yc),r.borderStyle!==O2&&(u+=Yc+n(o+a.bottomLeft+a.bottom.repeat(e)+a.bottomRight)),r.margin.bottom&&(u+=Yc.repeat(r.margin.bottom)),u},RIe=t=>{if(t.fullscreen&&n3?.stdout){let e=[n3.stdout.columns,n3.stdout.rows];typeof t.fullscreen=="function"&&(e=t.fullscreen(...e)),t.width||=e[0],t.height||=e[1]}return t.width&&=Math.max(1,t.width-I2(t.borderStyle)),t.height&&=Math.max(1,t.height-I2(t.borderStyle)),t},aG=(t,e)=>e===O2?t:` ${t} `,NIe=(t,e)=>{e=RIe(e);let r=e.width!==void 0,n=uG(),i=I2(e.borderStyle),a=n-e.margin.left-e.margin.right-i,s=X8(r3(t,n-i,{hard:!0,trim:!1}))+e.padding.left+e.padding.right;if(e.title&&r?(e.title=e.title.slice(0,Math.max(0,e.width-2)),e.title&&=aG(e.title,e.borderStyle)):e.title&&(e.title=e.title.slice(0,Math.max(0,a-2)),e.title&&(e.title=aG(e.title,e.borderStyle),Yn(e.title)>s&&(e.width=Yn(e.title)))),e.width||=s,!r){if(e.margin.left&&e.margin.right&&e.width>a){let u=(n-e.width-i)/(e.margin.left+e.margin.right);e.margin.left=Math.max(0,Math.floor(e.margin.left*u)),e.margin.right=Math.max(0,Math.floor(e.margin.right*u))}e.width=Math.min(e.width,n-i-e.margin.left-e.margin.right)}return e.width-(e.padding.left+e.padding.right)<=0&&(e.padding.left=0,e.padding.right=0),e.height&&e.height-(e.padding.top+e.padding.bottom)<=0&&(e.padding.top=0,e.padding.bottom=0),e},cA=t=>t.match(/^#(?:[0-f]{3}){1,2}$/i),sG=t=>typeof t=="string"&&(Qp[t]??cA(t)),kIe=t=>cA(t)?Qp.hex(t):Qp[t],qIe=t=>cA(t)?Qp.bgHex(t):Qp[tA(["bg",t])]});function lG(t){let{name:e,...r}=t,n=Buffer.from(JSON.stringify(r)).toString("base64"),i=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(e)}&config=${encodeURIComponent(n)}`,a=`cursor://anysphere.cursor-deeplink/mcp/install?name=${e}&config=...`;return{url:i,displayText:a}}function pG(t){let e=`vscode:mcp/install?${encodeURIComponent(JSON.stringify(t))}`,r=`vscode:mcp/install?{"name":"${t.name}","type":"${t.type}",...}`;return{url:e,displayText:r}}function pA(t,e){return`\x1B]8;;${t}\x1B\\${e}\x1B]8;;\x1B\\`}var dG=_e(()=>{"use strict"});import{exec as MIe}from"node:child_process";import{promisify as jIe}from"node:util";async function fG(t,e,r){let n=`https://smithery.ai/playground?mcp=${encodeURIComponent(`${t}/mcp`)}`;try{let i=process.platform,a;switch(i){case"darwin":a=`open "${n}"`;break;case"win32":a=`start "" "${n}"`;break;default:a=`xdg-open "${n}"`;break}await UIe(a)}catch{console.log(dA.default.yellow("Could not open browser automatically")),console.log(dA.default.gray("Please open the link manually"))}}var dA,UIe,hG=_e(()=>{"use strict";dA=ke(qt(),1),UIe=jIe(MIe)});function gG(t){mG=t}function yG(t){vG=t}function Q(t){mG&&console.log(fA.default.gray(`[verbose] ${t}`))}function Us(t){vG&&console.debug(fA.default.blue(`[debug] ${t}`))}var fA,mG,vG,va=_e(()=>{"use strict";fA=ke(qt(),1),mG=!1,vG=!1});async function $Ie(t){try{let r=await fetch("https://registry.smithery.ai/uplink/token",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!r.ok)throw r.status===401?new Error("Unauthorized: Invalid API key"):new Error(`Failed to get tunnel token: ${r.statusText}`);return await r.json()}catch(e){throw new Error(`Failed to connect to Smithery API: ${e instanceof Error?e.message:e}`)}}function xG(t){let e=[/(?:localhost|127\.0\.0\.1):(\d+)/g,/port\s+(\d+)/gi,/running.*?(\d{4,5})/gi,/server.*?(\d{4,5})/gi,/http:\/\/.*?:(\d+)/gi];for(let r of e){let n=r.exec(t);if(n?.[1]){let i=Number.parseInt(n[1],10);if(i>1e3&&i<65536)return n[1]}}return null}async function bG(t,e){Us(hA.default.blue(`\u{1F680} Starting tunnel for localhost:${t}...`)),Us(hA.default.gray("Getting tunnel credentials..."));let{authtoken:r,domain:n}=await $Ie(e),a=await(await import("@ngrok/ngrok")).default.forward({addr:t,authtoken:r,domain:n}),s=a.url();if(!s)throw new Error("Failed to get tunnel URL");return{listener:a,url:s}}var hA,mA=_e(()=>{"use strict";hA=ke(qt(),1);va()});async function _o(t,e,r=!0,n){let{listener:i,url:a}=await bG(t,e),s=`https://smithery.ai/playground?mcp=${encodeURIComponent(`${a}/mcp`)}`,u={name:"smithery-dev",type:"http",url:`${a}/mcp`,headers:{}},c=lG(u),p=pA(c.url,c.displayText),d=pG(u),h=pA(d.url,d.displayText);console.log(""),console.log(` ${kr.default.bold.italic.hex("#ea580c")("SMITHERY")} ${kr.default.bold.italic.hex("#ea580c")("v1.6.3")} ready`),console.log(""),console.log(` ${kr.default.green(kr.default.dim("\u279C"))} ${kr.default.bold(kr.default.dim("Local:"))} ${kr.default.cyan(`http://localhost:${t}/mcp`)}`),console.log(` ${kr.default.green(kr.default.dim("\u279C"))} ${kr.default.bold(kr.default.dim("Remote:"))} ${kr.default.cyan(`${a}/mcp`)}`),console.log(` ${kr.default.green("\u279C")} ${kr.default.bold("Playground")}: ${kr.default.cyan(s)}`),console.log("");let m=[`${kr.default.bold("Cursor")}: ${kr.default.cyan(p)}`,`${kr.default.bold("VS Code")}: ${kr.default.cyan(h)}`,"",`${kr.default.dim("Note: If required config needed, attach using URL params")}`,`${kr.default.dim("e.g.")} ${kr.default.dim.cyan("https://server.com/mcp")}${kr.default.cyan("?weatherApiKey=abc123")}`].join(`
187
187
  `);return console.log(lA(m,{title:"Add to Client",padding:{left:1,right:1,top:0,bottom:0},margin:{left:2},borderStyle:"round",borderColor:"dim"})),console.log(""),r&&await fG(a,t,n),{listener:i,url:a}}var kr,_f=_e(()=>{"use strict";cG();kr=ke(qt(),1);dG();hG();mA()});var CG=x((fBt,_G)=>{_G.exports=EG;EG.sync=HIe;var DG=pe("fs");function zIe(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function wG(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:zIe(e,r)}function EG(t,e,r){DG.stat(t,function(n,i){r(n,n?!1:wG(i,t,e))})}function HIe(t,e){return wG(DG.statSync(t),t,e)}});var OG=x((hBt,TG)=>{TG.exports=AG;AG.sync=KIe;var SG=pe("fs");function AG(t,e,r){SG.stat(t,function(n,i){r(n,n?!1:FG(i,e))})}function KIe(t,e){return FG(SG.statSync(t),e)}function FG(t,e){return t.isFile()&&WIe(t,e)}function WIe(t,e){var r=t.mode,n=t.uid,i=t.gid,a=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),o=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),p=o|u,d=r&c||r&u&&i===s||r&o&&n===a||r&p&&a===0;return d}});var PG=x((vBt,IG)=>{var mBt=pe("fs"),o3;process.platform==="win32"||global.TESTING_WINDOWS?o3=CG():o3=OG();IG.exports=vA;vA.sync=GIe;function vA(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){vA(t,e||{},function(a,s){a?i(a):n(s)})})}o3(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function GIe(t,e){try{return o3.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var MG=x((gBt,LG)=>{var Cf=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",BG=pe("path"),YIe=Cf?";":":",RG=PG(),NG=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),kG=(t,e)=>{let r=e.colon||YIe,n=t.match(/\//)||Cf&&t.match(/\\/)?[""]:[...Cf?[process.cwd()]:[],...(e.path||"/home/runner/work/cli/cli/node_modules/.bin:/home/runner/work/cli/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.5/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/cli/cli/node_modules/.bin:/home/runner/work/cli/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.5/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/20.19.5/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r)],i=Cf?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=Cf?i.split(r):[""];return Cf&&t.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:i}},qG=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:a}=kG(t,e),s=[],o=c=>new Promise((p,d)=>{if(c===n.length)return e.all&&s.length?p(s):d(NG(t));let h=n[c],m=/^".*"$/.test(h)?h.slice(1,-1):h,v=BG.join(m,t),g=!m&&/^\.[\\\/]/.test(t)?t.slice(0,2)+v:v;p(u(g,c,0))}),u=(c,p,d)=>new Promise((h,m)=>{if(d===i.length)return h(o(p+1));let v=i[d];RG(c+v,{pathExt:a},(g,b)=>{if(!g&&b)if(e.all)s.push(c+v);else return h(c+v);return h(u(c,p,d+1))})});return r?o(0).then(c=>r(null,c),r):o(0)},JIe=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=kG(t,e),a=[];for(let s=0;s<r.length;s++){let o=r[s],u=/^".*"$/.test(o)?o.slice(1,-1):o,c=BG.join(u,t),p=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let d=0;d<n.length;d++){let h=p+n[d];try{if(RG.sync(h,{pathExt:i}))if(e.all)a.push(h);else return h}catch{}}}if(e.all&&a.length)return a;if(e.nothrow)return null;throw NG(t)};LG.exports=qG;qG.sync=JIe});var UG=x((yBt,gA)=>{"use strict";var jG=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};gA.exports=jG;gA.exports.default=jG});var HG=x((xBt,zG)=>{"use strict";var $G=pe("path"),QIe=MG(),XIe=UG();function VG(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(t.options.cwd)}catch{}let s;try{s=QIe.sync(t.command,{path:r[XIe({env:r})],pathExt:e?$G.delimiter:void 0})}catch{}finally{a&&process.chdir(n)}return s&&(s=$G.resolve(i?t.options.cwd:"",s)),s}function ZIe(t){return VG(t)||VG(t,!0)}zG.exports=ZIe});var KG=x((bBt,xA)=>{"use strict";var yA=/([()\][%!^"`<>&|;, *?])/g;function ePe(t){return t=t.replace(yA,"^$1"),t}function tPe(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(yA,"^$1"),e&&(t=t.replace(yA,"^$1")),t}xA.exports.command=ePe;xA.exports.argument=tPe});var GG=x((DBt,WG)=>{"use strict";WG.exports=/^#!(.*)/});var JG=x((wBt,YG)=>{"use strict";var rPe=GG();YG.exports=(t="")=>{let e=t.match(rPe);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var XG=x((EBt,QG)=>{"use strict";var bA=pe("fs"),nPe=JG();function iPe(t){let r=Buffer.alloc(150),n;try{n=bA.openSync(t,"r"),bA.readSync(n,r,0,150,0),bA.closeSync(n)}catch{}return nPe(r.toString())}QG.exports=iPe});var rY=x((_Bt,tY)=>{"use strict";var aPe=pe("path"),ZG=HG(),eY=KG(),sPe=XG(),oPe=process.platform==="win32",uPe=/\.(?:com|exe)$/i,cPe=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function lPe(t){t.file=ZG(t);let e=t.file&&sPe(t.file);return e?(t.args.unshift(t.file),t.command=e,ZG(t)):t.file}function pPe(t){if(!oPe)return t;let e=lPe(t),r=!uPe.test(e);if(t.options.forceShell||r){let n=cPe.test(e);t.command=aPe.normalize(t.command),t.command=eY.command(t.command),t.args=t.args.map(a=>eY.argument(a,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function dPe(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:pPe(n)}tY.exports=dPe});var aY=x((CBt,iY)=>{"use strict";var DA=process.platform==="win32";function wA(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function fPe(t,e){if(!DA)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let a=nY(i,e);if(a)return r.call(t,"error",a)}return r.apply(t,arguments)}}function nY(t,e){return DA&&t===1&&!e.file?wA(e.original,"spawn"):null}function hPe(t,e){return DA&&t===1&&!e.file?wA(e.original,"spawnSync"):null}iY.exports={hookChildProcess:fPe,verifyENOENT:nY,verifyENOENTSync:hPe,notFoundError:wA}});var uY=x((SBt,Sf)=>{"use strict";var sY=pe("child_process"),EA=rY(),_A=aY();function oY(t,e,r){let n=EA(t,e,r),i=sY.spawn(n.command,n.args,n.options);return _A.hookChildProcess(i,n),i}function mPe(t,e,r){let n=EA(t,e,r),i=sY.spawnSync(n.command,n.args,n.options);return i.error=i.error||_A.verifyENOENTSync(i.status,n),i}Sf.exports=oY;Sf.exports.spawn=oY;Sf.exports.sync=mPe;Sf.exports._parse=EA;Sf.exports._enoent=_A});var Ft,CA,Ie,Co,P2=_e(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let s of i)a[s]=s;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(let o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(let s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(Ft||(Ft={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(CA||(CA={}));Ie=Ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Co=t=>{switch(typeof t){case"undefined":return Ie.undefined;case"string":return Ie.string;case"number":return Number.isNaN(t)?Ie.nan:Ie.number;case"boolean":return Ie.boolean;case"function":return Ie.function;case"bigint":return Ie.bigint;case"symbol":return Ie.symbol;case"object":return Array.isArray(t)?Ie.array:t===null?Ie.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ie.promise:typeof Map<"u"&&t instanceof Map?Ie.map:typeof Set<"u"&&t instanceof Set?Ie.set:typeof Date<"u"&&t instanceof Date?Ie.date:Ie.object;default:return Ie.unknown}}});var xe,vPe,Tn,u3=_e(()=>{P2();xe=Ft.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"]),vPe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tn=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let o=n,u=0;for(;u<s.path.length;){let c=s.path[u];u===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(r(s))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return i(this),n}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,Ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Tn.create=t=>new Tn(t)});var gPe,qu,SA=_e(()=>{u3();P2();gPe=(t,e)=>{let r;switch(t.code){case xe.invalid_type:t.received===Ie.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case xe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ft.jsonStringifyReplacer)}`;break;case xe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ft.joinValues(t.keys,", ")}`;break;case xe.invalid_union:r="Invalid input";break;case xe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ft.joinValues(t.options)}`;break;case xe.invalid_enum_value:r=`Invalid enum value. Expected ${Ft.joinValues(t.options)}, received '${t.received}'`;break;case xe.invalid_arguments:r="Invalid function arguments";break;case xe.invalid_return_type:r="Invalid function return type";break;case xe.invalid_date:r="Invalid date";break;case xe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ft.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case xe.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case xe.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case xe.custom:r="Invalid input";break;case xe.invalid_intersection_types:r="Intersection results could not be merged";break;case xe.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case xe.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ft.assertNever(t)}return{message:r}},qu=gPe});function yPe(t){cY=t}function Af(){return cY}var cY,c3=_e(()=>{SA();cY=qu});function Se(t,e){let r=Af(),n=B2({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qu?void 0:qu].filter(i=>!!i)});t.common.issues.push(n)}var B2,xPe,Jn,Ke,e0,vi,l3,p3,Jc,Ff,AA=_e(()=>{c3();SA();B2=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)o=c(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}},xPe=[];Jn=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ke;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,s=await i.value;n.push({key:a,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Ke;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[a.value]=s.value)}return{status:e.value,value:n}}},Ke=Object.freeze({status:"aborted"}),e0=t=>({status:"dirty",value:t}),vi=t=>({status:"valid",value:t}),l3=t=>t.status==="aborted",p3=t=>t.status==="dirty",Jc=t=>t.status==="valid",Ff=t=>typeof Promise<"u"&&t instanceof Promise});var lY=_e(()=>{});var Le,pY=_e(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Le||(Le={}))});function vt(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:u??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:u??r??o.defaultError}},description:i}}function mY(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function kPe(t){return new RegExp(`^${mY(t)}$`)}function vY(t){let e=`${hY}T${mY(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function qPe(t,e){return!!((e==="v4"||!e)&&TPe.test(t)||(e==="v6"||!e)&&IPe.test(t))}function LPe(t,e){if(!CPe.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function MPe(t,e){return!!((e==="v4"||!e)&&OPe.test(t)||(e==="v6"||!e)&&PPe.test(t))}function jPe(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}function Tf(t){if(t instanceof Wi){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Ga.create(Tf(n))}return new Wi({...t._def,shape:()=>e})}else return t instanceof ju?new ju({...t._def,type:Tf(t.element)}):t instanceof Ga?Ga.create(Tf(t.unwrap())):t instanceof Ao?Ao.create(Tf(t.unwrap())):t instanceof So?So.create(t.items.map(e=>Tf(e))):t}function TA(t,e){let r=Co(t),n=Co(e);if(t===e)return{valid:!0,data:t};if(r===Ie.object&&n===Ie.object){let i=Ft.objectKeys(e),a=Ft.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(let o of a){let u=TA(t[o],e[o]);if(!u.valid)return{valid:!1};s[o]=u.data}return{valid:!0,data:s}}else if(r===Ie.array&&n===Ie.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let s=t[a],o=e[a],u=TA(s,o);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===Ie.date&&n===Ie.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function gY(t,e){return new p0({values:t,typeName:Qe.ZodEnum,...vt(e)})}function fY(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function yY(t,e={},r){return t?Xc.create().superRefine((n,i)=>{let a=t(n);if(a instanceof Promise)return a.then(s=>{if(!s){let o=fY(e,n),u=o.fatal??r??!0;i.addIssue({code:"custom",...o,fatal:u})}});if(!a){let s=fY(e,n),o=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:o})}}):Xc.create()}var Ya,dY,Dt,bPe,DPe,wPe,EPe,_Pe,CPe,SPe,APe,FPe,FA,TPe,OPe,IPe,PPe,BPe,RPe,hY,NPe,Qc,t0,r0,n0,i0,Of,a0,s0,Xc,Mu,$s,If,ju,Wi,o0,Lu,d3,u0,So,f3,Pf,Bf,h3,c0,l0,p0,d0,Zc,Ja,Ga,Ao,f0,h0,Rf,UPe,R2,N2,m0,$Pe,Qe,gi,Z,ur,VPe,zPe,cr,OA,HPe,KPe,WPe,Uu,GPe,YPe,JPe,ir,$e,ga,v0,QPe,XPe,ZPe,On,eBe,tBe,rBe,g0,nBe,Vs,Nf,iBe,aBe,sBe,yi,oBe,uBe,cBe,lBe,pBe,IA,dBe,xY=_e(()=>{u3();c3();pY();AA();P2();Ya=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}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}},dY=(t,e)=>{if(Jc(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 r=new Tn(t.common.issues);return this._error=r,this._error}}};Dt=class{get description(){return this._def.description}_getType(e){return Co(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Co(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Jn,ctx:{common:e.parent.common,data:e.data,parsedType:Co(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ff(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Co(e)},i=this._parseSync({data:e,path:n.path,parent:n});return dY(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Co(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Jc(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Jc(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Co(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Ff(i)?i:Promise.resolve(i));return dY(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let s=e(i),o=()=>a.addIssue({code:xe.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ja({schema:this,typeName:Qe.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:r=>this["~validate"](r)}}optional(){return Ga.create(this,this._def)}nullable(){return Ao.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ju.create(this)}promise(){return Zc.create(this,this._def)}or(e){return o0.create([this,e],this._def)}and(e){return u0.create(this,e,this._def)}transform(e){return new Ja({...vt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new f0({...vt(this._def),innerType:this,defaultValue:r,typeName:Qe.ZodDefault})}brand(){return new R2({typeName:Qe.ZodBranded,type:this,...vt(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new h0({...vt(this._def),innerType:this,catchValue:r,typeName:Qe.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return N2.create(this,e)}readonly(){return m0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bPe=/^c[^\s-]{8,}$/i,DPe=/^[0-9a-z]+$/,wPe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,EPe=/^[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,_Pe=/^[a-z0-9_-]{21}$/i,CPe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,SPe=/^[-+]?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)?)??$/,APe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FPe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",TPe=/^(?:(?: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])$/,OPe=/^(?:(?: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])$/,IPe=/^(([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]))$/,PPe=/^(([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])$/,BPe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,RPe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hY="((\\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])))",NPe=new RegExp(`^${hY}$`);Qc=class t extends Dt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ie.string){let a=this._getOrReturnCtx(e);return Se(a,{code:xe.invalid_type,expected:Ie.string,received:a.parsedType}),Ke}let n=new Jn,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?Se(i,{code:xe.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Se(i,{code:xe.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")APe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"email",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")FA||(FA=new RegExp(FPe,"u")),FA.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"emoji",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")EPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"uuid",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")_Pe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"nanoid",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")bPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cuid",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")DPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cuid2",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")wPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"ulid",code:xe.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Se(i,{validation:"url",code:xe.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"regex",code:xe.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?vY(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?NPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?kPe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?SPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"duration",code:xe.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?qPe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"ip",code:xe.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?LPe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"jwt",code:xe.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?MPe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"cidr",code:xe.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?BPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"base64",code:xe.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?RPe.test(e.data)||(i=this._getOrReturnCtx(e,i),Se(i,{validation:"base64url",code:xe.invalid_string,message:a.message}),n.dirty()):Ft.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:xe.invalid_string,...Le.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Le.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Le.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Le.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Le.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Le.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Le.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Le.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Le.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Le.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Le.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Le.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Le.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Le.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,...Le.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,...Le.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Le.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Le.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Le.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Le.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Le.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Le.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Le.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Le.errToObj(r)})}nonempty(e){return this.min(1,Le.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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Qc.create=t=>new Qc({checks:[],typeName:Qe.ZodString,coerce:t?.coerce??!1,...vt(t)});t0=class t extends Dt{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)!==Ie.number){let a=this._getOrReturnCtx(e);return Se(a,{code:xe.invalid_type,expected:Ie.number,received:a.parsedType}),Ke}let n,i=new Jn;for(let a of this._def.checks)a.kind==="int"?Ft.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?jPe(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.not_finite,message:a.message}),i.dirty()):Ft.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Le.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Le.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Le.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Le.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Le.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Le.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Le.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Le.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Le.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Le.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Le.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ft.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};t0.create=t=>new t0({checks:[],typeName:Qe.ZodNumber,coerce:t?.coerce||!1,...vt(t)});r0=class t extends Dt{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)!==Ie.bigint)return this._getInvalidInput(e);let n,i=new Jn;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Se(n,{code:xe.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):Ft.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return Se(r,{code:xe.invalid_type,expected:Ie.bigint,received:r.parsedType}),Ke}gte(e,r){return this.setLimit("min",e,!0,Le.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Le.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Le.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Le.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Le.toString(i)}]})}_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:Le.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Le.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Le.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Le.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Le.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};r0.create=t=>new r0({checks:[],typeName:Qe.ZodBigInt,coerce:t?.coerce??!1,...vt(t)});n0=class extends Dt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ie.boolean){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.boolean,received:n.parsedType}),Ke}return vi(e.data)}};n0.create=t=>new n0({typeName:Qe.ZodBoolean,coerce:t?.coerce||!1,...vt(t)});i0=class t extends Dt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ie.date){let a=this._getOrReturnCtx(e);return Se(a,{code:xe.invalid_type,expected:Ie.date,received:a.parsedType}),Ke}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return Se(a,{code:xe.invalid_date}),Ke}let n=new Jn,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Se(i,{code:xe.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Ft.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Le.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Le.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};i0.create=t=>new i0({checks:[],coerce:t?.coerce||!1,typeName:Qe.ZodDate,...vt(t)});Of=class extends Dt{_parse(e){if(this._getType(e)!==Ie.symbol){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.symbol,received:n.parsedType}),Ke}return vi(e.data)}};Of.create=t=>new Of({typeName:Qe.ZodSymbol,...vt(t)});a0=class extends Dt{_parse(e){if(this._getType(e)!==Ie.undefined){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.undefined,received:n.parsedType}),Ke}return vi(e.data)}};a0.create=t=>new a0({typeName:Qe.ZodUndefined,...vt(t)});s0=class extends Dt{_parse(e){if(this._getType(e)!==Ie.null){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.null,received:n.parsedType}),Ke}return vi(e.data)}};s0.create=t=>new s0({typeName:Qe.ZodNull,...vt(t)});Xc=class extends Dt{constructor(){super(...arguments),this._any=!0}_parse(e){return vi(e.data)}};Xc.create=t=>new Xc({typeName:Qe.ZodAny,...vt(t)});Mu=class extends Dt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vi(e.data)}};Mu.create=t=>new Mu({typeName:Qe.ZodUnknown,...vt(t)});$s=class extends Dt{_parse(e){let r=this._getOrReturnCtx(e);return Se(r,{code:xe.invalid_type,expected:Ie.never,received:r.parsedType}),Ke}};$s.create=t=>new $s({typeName:Qe.ZodNever,...vt(t)});If=class extends Dt{_parse(e){if(this._getType(e)!==Ie.undefined){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.void,received:n.parsedType}),Ke}return vi(e.data)}};If.create=t=>new If({typeName:Qe.ZodVoid,...vt(t)});ju=class t extends Dt{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==Ie.array)return Se(r,{code:xe.invalid_type,expected:Ie.array,received:r.parsedType}),Ke;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(s||o)&&(Se(r,{code:s?xe.too_big:xe.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Se(r,{code:xe.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Se(r,{code:xe.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,o)=>i.type._parseAsync(new Ya(r,s,r.path,o)))).then(s=>Jn.mergeArray(n,s));let a=[...r.data].map((s,o)=>i.type._parseSync(new Ya(r,s,r.path,o)));return Jn.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Le.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Le.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Le.toString(r)}})}nonempty(e){return this.min(1,e)}};ju.create=(t,e)=>new ju({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...vt(e)});Wi=class t extends Dt{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(),r=Ft.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Ie.object){let c=this._getOrReturnCtx(e);return Se(c,{code:xe.invalid_type,expected:Ie.object,received:c.parsedType}),Ke}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof $s&&this._def.unknownKeys==="strip"))for(let c in i.data)s.includes(c)||o.push(c);let u=[];for(let c of s){let p=a[c],d=i.data[c];u.push({key:{status:"valid",value:c},value:p._parse(new Ya(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof $s){let c=this._def.unknownKeys;if(c==="passthrough")for(let p of o)u.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(c==="strict")o.length>0&&(Se(i,{code:xe.unrecognized_keys,keys:o}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let p of o){let d=i.data[p];u.push({key:{status:"valid",value:p},value:c._parse(new Ya(i,d,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let p of u){let d=await p.key,h=await p.value;c.push({key:d,value:h,alwaysSet:p.alwaysSet})}return c}).then(c=>Jn.mergeObjectSync(n,c)):Jn.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Le.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Le.errToObj(e).message??i}:{message:i}}}:{}})}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:Qe.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of Ft.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of Ft.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Tf(this)}partial(e){let r={};for(let n of Ft.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of Ft.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Ga;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return gY(Ft.objectKeys(this.shape))}};Wi.create=(t,e)=>new Wi({shape:()=>t,unknownKeys:"strip",catchall:$s.create(),typeName:Qe.ZodObject,...vt(e)});Wi.strictCreate=(t,e)=>new Wi({shape:()=>t,unknownKeys:"strict",catchall:$s.create(),typeName:Qe.ZodObject,...vt(e)});Wi.lazycreate=(t,e)=>new Wi({shape:t,unknownKeys:"strip",catchall:$s.create(),typeName:Qe.ZodObject,...vt(e)});o0=class extends Dt{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(o=>new Tn(o.ctx.common.issues));return Se(r,{code:xe.invalid_union,unionErrors:s}),Ke}if(r.common.async)return Promise.all(n.map(async a=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let a,s=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},p=u._parseSync({data:r.data,path:r.path,parent:c});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(u=>new Tn(u));return Se(r,{code:xe.invalid_union,unionErrors:o}),Ke}}get options(){return this._def.options}};o0.create=(t,e)=>new o0({options:t,typeName:Qe.ZodUnion,...vt(e)});Lu=t=>t instanceof c0?Lu(t.schema):t instanceof Ja?Lu(t.innerType()):t instanceof l0?[t.value]:t instanceof p0?t.options:t instanceof d0?Ft.objectValues(t.enum):t instanceof f0?Lu(t._def.innerType):t instanceof a0?[void 0]:t instanceof s0?[null]:t instanceof Ga?[void 0,...Lu(t.unwrap())]:t instanceof Ao?[null,...Lu(t.unwrap())]:t instanceof R2||t instanceof m0?Lu(t.unwrap()):t instanceof h0?Lu(t._def.innerType):[],d3=class t extends Dt{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ie.object)return Se(r,{code:xe.invalid_type,expected:Ie.object,received:r.parsedType}),Ke;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(Se(r,{code:xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let s=Lu(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new t({typeName:Qe.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...vt(n)})}};u0=class extends Dt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,s)=>{if(l3(a)||l3(s))return Ke;let o=TA(a.value,s.value);return o.valid?((p3(a)||p3(s))&&r.dirty(),{status:r.value,value:o.data}):(Se(n,{code:xe.invalid_intersection_types}),Ke)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};u0.create=(t,e,r)=>new u0({left:t,right:e,typeName:Qe.ZodIntersection,...vt(r)});So=class t extends Dt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ie.array)return Se(n,{code:xe.invalid_type,expected:Ie.array,received:n.parsedType}),Ke;if(n.data.length<this._def.items.length)return Se(n,{code:xe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ke;!this._def.rest&&n.data.length>this._def.items.length&&(Se(n,{code:xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((s,o)=>{let u=this._def.items[o]||this._def.rest;return u?u._parse(new Ya(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(a).then(s=>Jn.mergeArray(r,s)):Jn.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};So.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new So({items:t,typeName:Qe.ZodTuple,rest:null,...vt(e)})};f3=class t extends Dt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ie.object)return Se(n,{code:xe.invalid_type,expected:Ie.object,received:n.parsedType}),Ke;let i=[],a=this._def.keyType,s=this._def.valueType;for(let o in n.data)i.push({key:a._parse(new Ya(n,o,n.path,o)),value:s._parse(new Ya(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?Jn.mergeObjectAsync(r,i):Jn.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Dt?new t({keyType:e,valueType:r,typeName:Qe.ZodRecord,...vt(n)}):new t({keyType:Qc.create(),valueType:e,typeName:Qe.ZodRecord,...vt(r)})}},Pf=class extends Dt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ie.map)return Se(n,{code:xe.invalid_type,expected:Ie.map,received:n.parsedType}),Ke;let i=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map(([o,u],c)=>({key:i._parse(new Ya(n,o,n.path,[c,"key"])),value:a._parse(new Ya(n,u,n.path,[c,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let u of s){let c=await u.key,p=await u.value;if(c.status==="aborted"||p.status==="aborted")return Ke;(c.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(c.value,p.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let u of s){let c=u.key,p=u.value;if(c.status==="aborted"||p.status==="aborted")return Ke;(c.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(c.value,p.value)}return{status:r.value,value:o}}}};Pf.create=(t,e,r)=>new Pf({valueType:e,keyType:t,typeName:Qe.ZodMap,...vt(r)});Bf=class t extends Dt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ie.set)return Se(n,{code:xe.invalid_type,expected:Ie.set,received:n.parsedType}),Ke;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(Se(n,{code:xe.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(Se(n,{code:xe.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function s(u){let c=new Set;for(let p of u){if(p.status==="aborted")return Ke;p.status==="dirty"&&r.dirty(),c.add(p.value)}return{status:r.value,value:c}}let o=[...n.data.values()].map((u,c)=>a._parse(new Ya(n,u,n.path,c)));return n.common.async?Promise.all(o).then(u=>s(u)):s(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:Le.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Le.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Bf.create=(t,e)=>new Bf({valueType:t,minSize:null,maxSize:null,typeName:Qe.ZodSet,...vt(e)});h3=class t extends Dt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ie.function)return Se(r,{code:xe.invalid_type,expected:Ie.function,received:r.parsedType}),Ke;function n(o,u){return B2({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),qu].filter(c=>!!c),issueData:{code:xe.invalid_arguments,argumentsError:u}})}function i(o,u){return B2({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),qu].filter(c=>!!c),issueData:{code:xe.invalid_return_type,returnTypeError:u}})}let a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof Zc){let o=this;return vi(async function(...u){let c=new Tn([]),p=await o._def.args.parseAsync(u,a).catch(m=>{throw c.addIssue(n(u,m)),c}),d=await Reflect.apply(s,this,p);return await o._def.returns._def.type.parseAsync(d,a).catch(m=>{throw c.addIssue(i(d,m)),c})})}else{let o=this;return vi(function(...u){let c=o._def.args.safeParse(u,a);if(!c.success)throw new Tn([n(u,c.error)]);let p=Reflect.apply(s,this,c.data),d=o._def.returns.safeParse(p,a);if(!d.success)throw new Tn([i(p,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:So.create(e).rest(Mu.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,r,n){return new t({args:e||So.create([]).rest(Mu.create()),returns:r||Mu.create(),typeName:Qe.ZodFunction,...vt(n)})}},c0=class extends Dt{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};c0.create=(t,e)=>new c0({getter:t,typeName:Qe.ZodLazy,...vt(e)});l0=class extends Dt{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Se(r,{received:r.data,code:xe.invalid_literal,expected:this._def.value}),Ke}return{status:"valid",value:e.data}}get value(){return this._def.value}};l0.create=(t,e)=>new l0({value:t,typeName:Qe.ZodLiteral,...vt(e)});p0=class t extends Dt{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return Se(r,{expected:Ft.joinValues(n),received:r.parsedType,code:xe.invalid_type}),Ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return Se(r,{received:r.data,code:xe.invalid_enum_value,options:n}),Ke}return vi(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};p0.create=gY;d0=class extends Dt{_parse(e){let r=Ft.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ie.string&&n.parsedType!==Ie.number){let i=Ft.objectValues(r);return Se(n,{expected:Ft.joinValues(i),received:n.parsedType,code:xe.invalid_type}),Ke}if(this._cache||(this._cache=new Set(Ft.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=Ft.objectValues(r);return Se(n,{received:n.data,code:xe.invalid_enum_value,options:i}),Ke}return vi(e.data)}get enum(){return this._def.values}};d0.create=(t,e)=>new d0({values:t,typeName:Qe.ZodNativeEnum,...vt(e)});Zc=class extends Dt{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Ie.promise&&r.common.async===!1)return Se(r,{code:xe.invalid_type,expected:Ie.promise,received:r.parsedType}),Ke;let n=r.parsedType===Ie.promise?r.data:Promise.resolve(r.data);return vi(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Zc.create=(t,e)=>new Zc({type:t,typeName:Qe.ZodPromise,...vt(e)});Ja=class extends Dt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{Se(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let s=i.transform(n.data,a);if(n.common.async)return Promise.resolve(s).then(async o=>{if(r.value==="aborted")return Ke;let u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?Ke:u.status==="dirty"?e0(u.value):r.value==="dirty"?e0(u.value):u});{if(r.value==="aborted")return Ke;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?Ke:o.status==="dirty"?e0(o.value):r.value==="dirty"?e0(o.value):o}}if(i.type==="refinement"){let s=o=>{let u=i.refinement(o,a);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ke:(o.status==="dirty"&&r.dirty(),s(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?Ke:(o.status==="dirty"&&r.dirty(),s(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Jc(s))return Ke;let o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Jc(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:r.value,value:o})):Ke);Ft.assertNever(i)}};Ja.create=(t,e,r)=>new Ja({schema:t,typeName:Qe.ZodEffects,effect:e,...vt(r)});Ja.createWithPreprocess=(t,e,r)=>new Ja({schema:e,effect:{type:"preprocess",transform:t},typeName:Qe.ZodEffects,...vt(r)});Ga=class extends Dt{_parse(e){return this._getType(e)===Ie.undefined?vi(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ga.create=(t,e)=>new Ga({innerType:t,typeName:Qe.ZodOptional,...vt(e)});Ao=class extends Dt{_parse(e){return this._getType(e)===Ie.null?vi(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ao.create=(t,e)=>new Ao({innerType:t,typeName:Qe.ZodNullable,...vt(e)});f0=class extends Dt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Ie.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};f0.create=(t,e)=>new f0({innerType:t,typeName:Qe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...vt(e)});h0=class extends Dt{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ff(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Tn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Tn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};h0.create=(t,e)=>new h0({innerType:t,typeName:Qe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...vt(e)});Rf=class extends Dt{_parse(e){if(this._getType(e)!==Ie.nan){let n=this._getOrReturnCtx(e);return Se(n,{code:xe.invalid_type,expected:Ie.nan,received:n.parsedType}),Ke}return{status:"valid",value:e.data}}};Rf.create=t=>new Rf({typeName:Qe.ZodNaN,...vt(t)});UPe=Symbol("zod_brand"),R2=class extends Dt{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},N2=class t extends Dt{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ke:a.status==="dirty"?(r.dirty(),e0(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ke:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Qe.ZodPipeline})}},m0=class extends Dt{_parse(e){let r=this._def.innerType._parse(e),n=i=>(Jc(i)&&(i.value=Object.freeze(i.value)),i);return Ff(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};m0.create=(t,e)=>new m0({innerType:t,typeName:Qe.ZodReadonly,...vt(e)});$Pe={object:Wi.lazycreate};(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"})(Qe||(Qe={}));gi=(t,e={message:`Input not instance of ${t.name}`})=>yY(r=>r instanceof t,e),Z=Qc.create,ur=t0.create,VPe=Rf.create,zPe=r0.create,cr=n0.create,OA=i0.create,HPe=Of.create,KPe=a0.create,WPe=s0.create,Uu=Xc.create,GPe=Mu.create,YPe=$s.create,JPe=If.create,ir=ju.create,$e=Wi.create,ga=Wi.strictCreate,v0=o0.create,QPe=d3.create,XPe=u0.create,ZPe=So.create,On=f3.create,eBe=Pf.create,tBe=Bf.create,rBe=h3.create,g0=c0.create,nBe=l0.create,Vs=p0.create,Nf=d0.create,iBe=Zc.create,aBe=Ja.create,sBe=Ga.create,yi=Ao.create,oBe=Ja.createWithPreprocess,uBe=N2.create,cBe=()=>Z().optional(),lBe=()=>ur().optional(),pBe=()=>cr().optional(),IA={string:(t=>Qc.create({...t,coerce:!0})),number:(t=>t0.create({...t,coerce:!0})),boolean:(t=>n0.create({...t,coerce:!0})),bigint:(t=>r0.create({...t,coerce:!0})),date:(t=>i0.create({...t,coerce:!0}))},dBe=Ke});var E={};Mg(E,{BRAND:()=>UPe,DIRTY:()=>e0,EMPTY_PATH:()=>xPe,INVALID:()=>Ke,NEVER:()=>dBe,OK:()=>vi,ParseStatus:()=>Jn,Schema:()=>Dt,ZodAny:()=>Xc,ZodArray:()=>ju,ZodBigInt:()=>r0,ZodBoolean:()=>n0,ZodBranded:()=>R2,ZodCatch:()=>h0,ZodDate:()=>i0,ZodDefault:()=>f0,ZodDiscriminatedUnion:()=>d3,ZodEffects:()=>Ja,ZodEnum:()=>p0,ZodError:()=>Tn,ZodFirstPartyTypeKind:()=>Qe,ZodFunction:()=>h3,ZodIntersection:()=>u0,ZodIssueCode:()=>xe,ZodLazy:()=>c0,ZodLiteral:()=>l0,ZodMap:()=>Pf,ZodNaN:()=>Rf,ZodNativeEnum:()=>d0,ZodNever:()=>$s,ZodNull:()=>s0,ZodNullable:()=>Ao,ZodNumber:()=>t0,ZodObject:()=>Wi,ZodOptional:()=>Ga,ZodParsedType:()=>Ie,ZodPipeline:()=>N2,ZodPromise:()=>Zc,ZodReadonly:()=>m0,ZodRecord:()=>f3,ZodSchema:()=>Dt,ZodSet:()=>Bf,ZodString:()=>Qc,ZodSymbol:()=>Of,ZodTransformer:()=>Ja,ZodTuple:()=>So,ZodType:()=>Dt,ZodUndefined:()=>a0,ZodUnion:()=>o0,ZodUnknown:()=>Mu,ZodVoid:()=>If,addIssueToContext:()=>Se,any:()=>Uu,array:()=>ir,bigint:()=>zPe,boolean:()=>cr,coerce:()=>IA,custom:()=>yY,date:()=>OA,datetimeRegex:()=>vY,defaultErrorMap:()=>qu,discriminatedUnion:()=>QPe,effect:()=>aBe,enum:()=>Vs,function:()=>rBe,getErrorMap:()=>Af,getParsedType:()=>Co,instanceof:()=>gi,intersection:()=>XPe,isAborted:()=>l3,isAsync:()=>Ff,isDirty:()=>p3,isValid:()=>Jc,late:()=>$Pe,lazy:()=>g0,literal:()=>nBe,makeIssue:()=>B2,map:()=>eBe,nan:()=>VPe,nativeEnum:()=>Nf,never:()=>YPe,null:()=>WPe,nullable:()=>yi,number:()=>ur,object:()=>$e,objectUtil:()=>CA,oboolean:()=>pBe,onumber:()=>lBe,optional:()=>sBe,ostring:()=>cBe,pipeline:()=>uBe,preprocess:()=>oBe,promise:()=>iBe,quotelessJson:()=>vPe,record:()=>On,set:()=>tBe,setErrorMap:()=>yPe,strictObject:()=>ga,string:()=>Z,symbol:()=>HPe,transformer:()=>aBe,tuple:()=>ZPe,undefined:()=>KPe,union:()=>v0,unknown:()=>GPe,util:()=>Ft,void:()=>JPe});var PA=_e(()=>{c3();AA();lY();P2();xY();u3()});var Qr=_e(()=>{PA();PA()});var kf,bY,m3,DY,wY,fBe,Xa,Gi,k2,Fo,Za,v3,EY,g3,_Y,CY,SY,q2,Xr,AY,FY,qf,y0,y3,hBe,L2,M2,TY,mBe,vBe,gBe,BA,OY,IY,x3,yBe,b3,D3,w3,PY,BY,RA,RY,NY,xBe,bBe,NA,DBe,kA,wBe,qA,EBe,_Be,CBe,SBe,ABe,FBe,TBe,LA,OBe,MA,jA,UA,IBe,PBe,kY,BBe,$A,RBe,NBe,kBe,qBe,VA,E3,ZBt,zA,LBe,qY,MBe,HA,jBe,UBe,$Be,VBe,zBe,HBe,KBe,WBe,GBe,YBe,JBe,QBe,XBe,ZBe,eRe,KA,tRe,rRe,nRe,iRe,eRt,tRt,rRt,nRt,iRt,aRt,Qa,$u=_e(()=>{Qr();kf="2025-06-18",bY=[kf,"2025-03-26","2024-11-05","2024-10-07"],m3="2.0",DY=E.union([E.string(),E.number().int()]),wY=E.string(),fBe=E.object({progressToken:E.optional(DY)}).passthrough(),Xa=E.object({_meta:E.optional(fBe)}).passthrough(),Gi=E.object({method:E.string(),params:E.optional(Xa)}),k2=E.object({_meta:E.optional(E.object({}).passthrough())}).passthrough(),Fo=E.object({method:E.string(),params:E.optional(k2)}),Za=E.object({_meta:E.optional(E.object({}).passthrough())}).passthrough(),v3=E.union([E.string(),E.number().int()]),EY=E.object({jsonrpc:E.literal(m3),id:v3}).merge(Gi).strict(),g3=t=>EY.safeParse(t).success,_Y=E.object({jsonrpc:E.literal(m3)}).merge(Fo).strict(),CY=t=>_Y.safeParse(t).success,SY=E.object({jsonrpc:E.literal(m3),id:v3,result:Za}).strict(),q2=t=>SY.safeParse(t).success;(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"})(Xr||(Xr={}));AY=E.object({jsonrpc:E.literal(m3),id:v3,error:E.object({code:E.number().int(),message:E.string(),data:E.optional(E.unknown())})}).strict(),FY=t=>AY.safeParse(t).success,qf=E.union([EY,_Y,SY,AY]),y0=Za.strict(),y3=Fo.extend({method:E.literal("notifications/cancelled"),params:k2.extend({requestId:v3,reason:E.string().optional()})}),hBe=E.object({src:E.string(),mimeType:E.optional(E.string()),sizes:E.optional(E.array(E.string()))}).passthrough(),L2=E.object({icons:E.array(hBe).optional()}).passthrough(),M2=E.object({name:E.string(),title:E.optional(E.string())}).passthrough(),TY=M2.extend({version:E.string(),websiteUrl:E.optional(E.string())}).merge(L2),mBe=E.object({experimental:E.optional(E.object({}).passthrough()),sampling:E.optional(E.object({}).passthrough()),elicitation:E.optional(E.object({}).passthrough()),roots:E.optional(E.object({listChanged:E.optional(E.boolean())}).passthrough())}).passthrough(),vBe=Gi.extend({method:E.literal("initialize"),params:Xa.extend({protocolVersion:E.string(),capabilities:mBe,clientInfo:TY})}),gBe=E.object({experimental:E.optional(E.object({}).passthrough()),logging:E.optional(E.object({}).passthrough()),completions:E.optional(E.object({}).passthrough()),prompts:E.optional(E.object({listChanged:E.optional(E.boolean())}).passthrough()),resources:E.optional(E.object({subscribe:E.optional(E.boolean()),listChanged:E.optional(E.boolean())}).passthrough()),tools:E.optional(E.object({listChanged:E.optional(E.boolean())}).passthrough())}).passthrough(),BA=Za.extend({protocolVersion:E.string(),capabilities:gBe,serverInfo:TY,instructions:E.optional(E.string())}),OY=Fo.extend({method:E.literal("notifications/initialized")}),IY=t=>OY.safeParse(t).success,x3=Gi.extend({method:E.literal("ping")}),yBe=E.object({progress:E.number(),total:E.optional(E.number()),message:E.optional(E.string())}).passthrough(),b3=Fo.extend({method:E.literal("notifications/progress"),params:k2.merge(yBe).extend({progressToken:DY})}),D3=Gi.extend({params:Xa.extend({cursor:E.optional(wY)}).optional()}),w3=Za.extend({nextCursor:E.optional(wY)}),PY=E.object({uri:E.string(),mimeType:E.optional(E.string()),_meta:E.optional(E.object({}).passthrough())}).passthrough(),BY=PY.extend({text:E.string()}),RA=E.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),RY=PY.extend({blob:RA}),NY=M2.extend({uri:E.string(),description:E.optional(E.string()),mimeType:E.optional(E.string()),_meta:E.optional(E.object({}).passthrough())}).merge(L2),xBe=M2.extend({uriTemplate:E.string(),description:E.optional(E.string()),mimeType:E.optional(E.string()),_meta:E.optional(E.object({}).passthrough())}).merge(L2),bBe=D3.extend({method:E.literal("resources/list")}),NA=w3.extend({resources:E.array(NY)}),DBe=D3.extend({method:E.literal("resources/templates/list")}),kA=w3.extend({resourceTemplates:E.array(xBe)}),wBe=Gi.extend({method:E.literal("resources/read"),params:Xa.extend({uri:E.string()})}),qA=Za.extend({contents:E.array(E.union([BY,RY]))}),EBe=Fo.extend({method:E.literal("notifications/resources/list_changed")}),_Be=Gi.extend({method:E.literal("resources/subscribe"),params:Xa.extend({uri:E.string()})}),CBe=Gi.extend({method:E.literal("resources/unsubscribe"),params:Xa.extend({uri:E.string()})}),SBe=Fo.extend({method:E.literal("notifications/resources/updated"),params:k2.extend({uri:E.string()})}),ABe=E.object({name:E.string(),description:E.optional(E.string()),required:E.optional(E.boolean())}).passthrough(),FBe=M2.extend({description:E.optional(E.string()),arguments:E.optional(E.array(ABe)),_meta:E.optional(E.object({}).passthrough())}).merge(L2),TBe=D3.extend({method:E.literal("prompts/list")}),LA=w3.extend({prompts:E.array(FBe)}),OBe=Gi.extend({method:E.literal("prompts/get"),params:Xa.extend({name:E.string(),arguments:E.optional(E.record(E.string()))})}),MA=E.object({type:E.literal("text"),text:E.string(),_meta:E.optional(E.object({}).passthrough())}).passthrough(),jA=E.object({type:E.literal("image"),data:RA,mimeType:E.string(),_meta:E.optional(E.object({}).passthrough())}).passthrough(),UA=E.object({type:E.literal("audio"),data:RA,mimeType:E.string(),_meta:E.optional(E.object({}).passthrough())}).passthrough(),IBe=E.object({type:E.literal("resource"),resource:E.union([BY,RY]),_meta:E.optional(E.object({}).passthrough())}).passthrough(),PBe=NY.extend({type:E.literal("resource_link")}),kY=E.union([MA,jA,UA,PBe,IBe]),BBe=E.object({role:E.enum(["user","assistant"]),content:kY}).passthrough(),$A=Za.extend({description:E.optional(E.string()),messages:E.array(BBe)}),RBe=Fo.extend({method:E.literal("notifications/prompts/list_changed")}),NBe=E.object({title:E.optional(E.string()),readOnlyHint:E.optional(E.boolean()),destructiveHint:E.optional(E.boolean()),idempotentHint:E.optional(E.boolean()),openWorldHint:E.optional(E.boolean())}).passthrough(),kBe=M2.extend({description:E.optional(E.string()),inputSchema:E.object({type:E.literal("object"),properties:E.optional(E.object({}).passthrough()),required:E.optional(E.array(E.string()))}).passthrough(),outputSchema:E.optional(E.object({type:E.literal("object"),properties:E.optional(E.object({}).passthrough()),required:E.optional(E.array(E.string()))}).passthrough()),annotations:E.optional(NBe),_meta:E.optional(E.object({}).passthrough())}).merge(L2),qBe=D3.extend({method:E.literal("tools/list")}),VA=w3.extend({tools:E.array(kBe)}),E3=Za.extend({content:E.array(kY).default([]),structuredContent:E.object({}).passthrough().optional(),isError:E.optional(E.boolean())}),ZBt=E3.or(Za.extend({toolResult:E.unknown()})),zA=Gi.extend({method:E.literal("tools/call"),params:Xa.extend({name:E.string(),arguments:E.optional(E.record(E.unknown()))})}),LBe=Fo.extend({method:E.literal("notifications/tools/list_changed")}),qY=E.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),MBe=Gi.extend({method:E.literal("logging/setLevel"),params:Xa.extend({level:qY})}),HA=Fo.extend({method:E.literal("notifications/message"),params:k2.extend({level:qY,logger:E.optional(E.string()),data:E.unknown()})}),jBe=E.object({name:E.string().optional()}).passthrough(),UBe=E.object({hints:E.optional(E.array(jBe)),costPriority:E.optional(E.number().min(0).max(1)),speedPriority:E.optional(E.number().min(0).max(1)),intelligencePriority:E.optional(E.number().min(0).max(1))}).passthrough(),$Be=E.object({role:E.enum(["user","assistant"]),content:E.union([MA,jA,UA])}).passthrough(),VBe=Gi.extend({method:E.literal("sampling/createMessage"),params:Xa.extend({messages:E.array($Be),systemPrompt:E.optional(E.string()),includeContext:E.optional(E.enum(["none","thisServer","allServers"])),temperature:E.optional(E.number()),maxTokens:E.number().int(),stopSequences:E.optional(E.array(E.string())),metadata:E.optional(E.object({}).passthrough()),modelPreferences:E.optional(UBe)})}),zBe=Za.extend({model:E.string(),stopReason:E.optional(E.enum(["endTurn","stopSequence","maxTokens"]).or(E.string())),role:E.enum(["user","assistant"]),content:E.discriminatedUnion("type",[MA,jA,UA])}),HBe=E.object({type:E.literal("boolean"),title:E.optional(E.string()),description:E.optional(E.string()),default:E.optional(E.boolean())}).passthrough(),KBe=E.object({type:E.literal("string"),title:E.optional(E.string()),description:E.optional(E.string()),minLength:E.optional(E.number()),maxLength:E.optional(E.number()),format:E.optional(E.enum(["email","uri","date","date-time"]))}).passthrough(),WBe=E.object({type:E.enum(["number","integer"]),title:E.optional(E.string()),description:E.optional(E.string()),minimum:E.optional(E.number()),maximum:E.optional(E.number())}).passthrough(),GBe=E.object({type:E.literal("string"),title:E.optional(E.string()),description:E.optional(E.string()),enum:E.array(E.string()),enumNames:E.optional(E.array(E.string()))}).passthrough(),YBe=E.union([HBe,KBe,WBe,GBe]),JBe=Gi.extend({method:E.literal("elicitation/create"),params:Xa.extend({message:E.string(),requestedSchema:E.object({type:E.literal("object"),properties:E.record(E.string(),YBe),required:E.optional(E.array(E.string()))}).passthrough()})}),QBe=Za.extend({action:E.enum(["accept","decline","cancel"]),content:E.optional(E.record(E.string(),E.unknown()))}),XBe=E.object({type:E.literal("ref/resource"),uri:E.string()}).passthrough(),ZBe=E.object({type:E.literal("ref/prompt"),name:E.string()}).passthrough(),eRe=Gi.extend({method:E.literal("completion/complete"),params:Xa.extend({ref:E.union([ZBe,XBe]),argument:E.object({name:E.string(),value:E.string()}).passthrough(),context:E.optional(E.object({arguments:E.optional(E.record(E.string(),E.string()))}))})}),KA=Za.extend({completion:E.object({values:E.array(E.string()).max(100),total:E.optional(E.number().int()),hasMore:E.optional(E.boolean())}).passthrough()}),tRe=E.object({uri:E.string().startsWith("file://"),name:E.optional(E.string()),_meta:E.optional(E.object({}).passthrough())}).passthrough(),rRe=Gi.extend({method:E.literal("roots/list")}),nRe=Za.extend({roots:E.array(tRe)}),iRe=Fo.extend({method:E.literal("notifications/roots/list_changed")}),eRt=E.union([x3,vBe,eRe,MBe,OBe,TBe,bBe,DBe,wBe,_Be,CBe,zA,qBe]),tRt=E.union([y3,b3,OY,iRe]),rRt=E.union([y0,zBe,QBe,nRe]),nRt=E.union([x3,VBe,JBe,rRe]),iRt=E.union([y3,b3,HA,SBe,EBe,LBe,RBe]),aRt=E.union([y0,BA,KA,$A,LA,NA,kA,qA,E3,VA]),Qa=class extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}}});var UY=x((fRt,jY)=>{"use strict";var cRe=/[|\\{}()[\]^$+*?.]/g;jY.exports=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(cRe,"\\$&")}});var j2=x((hRt,A3)=>{"use strict";var lRe=UY(),{platform:$Y}=process,To={tick:"\u2714",cross:"\u2716",star:"\u2605",square:"\u2587",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",play:"\u25B6",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",circleQuestionMark:"?\u20DD",bullet:"\u25CF",dot:"\u2024",line:"\u2500",ellipsis:"\u2026",pointer:"\u276F",pointerSmall:"\u203A",info:"\u2139",warning:"\u26A0",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",heart:"\u2665",nodejs:"\u2B22",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",questionMarkPrefix:"?\u20DD",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneSeventh:"\u2150",oneEighth:"\u215B",oneNinth:"\u2151",oneTenth:"\u2152",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E"},VY={tick:"\u221A",cross:"\xD7",star:"*",square:"\u2588",squareSmall:"[ ]",squareSmallFilled:"[\u2588]",play:"\u25BA",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",circleQuestionMark:"(?)",bullet:"*",dot:".",line:"\u2500",ellipsis:"...",pointer:">",pointerSmall:"\xBB",info:"i",warning:"\u203C",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",heart:To.heart,nodejs:"\u2666",arrowUp:To.arrowUp,arrowDown:To.arrowDown,arrowLeft:To.arrowLeft,arrowRight:To.arrowRight,radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",questionMarkPrefix:"\uFF1F",oneHalf:"1/2",oneThird:"1/3",oneQuarter:"1/4",oneFifth:"1/5",oneSixth:"1/6",oneSeventh:"1/7",oneEighth:"1/8",oneNinth:"1/9",oneTenth:"1/10",twoThirds:"2/3",twoFifths:"2/5",threeQuarters:"3/4",threeFifths:"3/5",threeEighths:"3/8",fourFifths:"4/5",fiveSixths:"5/6",fiveEighths:"5/8",sevenEighths:"7/8"};$Y==="linux"&&(To.questionMarkPrefix="?");var S3=$Y==="win32"?VY:To,pRe=t=>{if(S3===To)return t;for(let[e,r]of Object.entries(To))r!==S3[e]&&(t=t.replace(new RegExp(lRe(r),"g"),S3[e]));return t};A3.exports=Object.assign(pRe,S3);A3.exports.main=To;A3.exports.windows=VY});var U2=x((mRt,zY)=>{"use strict";var dRe=qt(),fRe=j2(),F3=class{constructor(e){this.type="separator",this.line=dRe.dim(e||new Array(15).join(fRe.line))}toString(){return this.line}};F3.exclude=function(t){return t.type!=="separator"};zY.exports=F3});var WY=x((HY,KY)=>{var hRe=pe("stream");HY=KY.exports=GA;GA.through=GA;function GA(t,e,r){t=t||function(p){this.queue(p)},e=e||function(){this.queue(null)};var n=!1,i=!1,a=[],s=!1,o=new hRe;o.readable=o.writable=!0,o.paused=!1,o.autoDestroy=!(r&&r.autoDestroy===!1),o.write=function(p){return t.call(this,p),!o.paused};function u(){for(;a.length&&!o.paused;){var p=a.shift();if(p===null)return o.emit("end");o.emit("data",p)}}o.queue=o.push=function(p){return s||(p===null&&(s=!0),a.push(p),u()),o},o.on("end",function(){o.readable=!1,!o.writable&&o.autoDestroy&&process.nextTick(function(){o.destroy()})});function c(){o.writable=!1,e.call(o),!o.readable&&o.autoDestroy&&o.destroy()}return o.end=function(p){if(!n)return n=!0,arguments.length&&o.write(p),c(),o},o.destroy=function(){if(!i)return i=!0,n=!0,a.length=0,o.writable=o.readable=!1,o.emit("close"),o},o.pause=function(){if(!o.paused)return o.paused=!0,o},o.resume=function(){return o.paused&&(o.paused=!1,o.emit("resume")),u(),o.paused||o.emit("drain"),o},o}});var YY=x((vRt,GY)=>{var YA=pe("stream");GY.exports=Pn;function Pn(t){YA.apply(this),t=t||{},this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}Pn.prototype=Object.create(YA.prototype);Object.defineProperty(Pn.prototype,"constructor",{value:Pn,enumerable:!1});Pn.prototype.mute=function(){this.muted=!0};Pn.prototype.unmute=function(){this.muted=!1};Object.defineProperty(Pn.prototype,"_onpipe",{value:mRe,enumerable:!1,writable:!0,configurable:!0});function mRe(t){this._src=t}Object.defineProperty(Pn.prototype,"isTTY",{get:vRe,set:gRe,enumerable:!0,configurable:!0});function vRe(){return this._dest?this._dest.isTTY:this._src?this._src.isTTY:!1}function gRe(t){Object.defineProperty(this,"isTTY",{value:t,enumerable:!0,writable:!0,configurable:!0})}Object.defineProperty(Pn.prototype,"rows",{get:function(){return this._dest?this._dest.rows:this._src?this._src.rows:void 0},enumerable:!0,configurable:!0});Object.defineProperty(Pn.prototype,"columns",{get:function(){return this._dest?this._dest.columns:this._src?this._src.columns:void 0},enumerable:!0,configurable:!0});Pn.prototype.pipe=function(t,e){return this._dest=t,YA.prototype.pipe.call(this,t,e)};Pn.prototype.pause=function(){if(this._src)return this._src.pause()};Pn.prototype.resume=function(){if(this._src)return this._src.resume()};Pn.prototype.write=function(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.substr(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.substr(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)};Pn.prototype.end=function(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")};function JA(t){return function(){var e=this._dest,r=this._src;e&&e[t]&&e[t].apply(e,arguments),r&&r[t]&&r[t].apply(r,arguments)}}Pn.prototype.destroy=JA("destroy");Pn.prototype.destroySoon=JA("destroySoon");Pn.prototype.close=JA("close")});var XA=x((gRt,JY)=>{"use strict";var yRe=YY(),xRe=pe("readline"),QA=class{constructor(e){this.rl||(this.rl=xRe.createInterface(bRe(e))),this.rl.resume(),this.onForceClose=this.onForceClose.bind(this),process.on("exit",this.onForceClose),this.rl.on("SIGINT",this.onForceClose)}onForceClose(){this.close(),process.kill(process.pid,"SIGINT"),console.log("")}close(){this.rl.removeListener("SIGINT",this.onForceClose),process.removeListener("exit",this.onForceClose),this.rl.output.unmute(),this.activePrompt&&typeof this.activePrompt.close=="function"&&this.activePrompt.close(),this.rl.output.end(),this.rl.pause(),this.rl.close()}};function bRe(t={}){t.skipTTYChecks=t.skipTTYChecks===void 0?!0:t.skipTTYChecks;let e=t.input||process.stdin;if(!t.skipTTYChecks&&!e.isTTY){let i=new Error("Prompts can not be meaningfully rendered in non-TTY environments");throw i.isTtyError=!0,i}let r=new yRe;return r.pipe(t.output||process.stdout),{terminal:!0,...t,input:e,output:r}}JY.exports=QA});var eF=x((yRt,ZA)=>{"use strict";var Ut=ZA.exports;ZA.exports.default=Ut;var lr="\x1B[",$2="\x1B]",Lf="\x07",T3=";",QY=process.env.TERM_PROGRAM==="Apple_Terminal";Ut.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?lr+(t+1)+"G":lr+(e+1)+";"+(t+1)+"H"};Ut.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=lr+-t+"D":t>0&&(r+=lr+t+"C"),e<0?r+=lr+-e+"A":e>0&&(r+=lr+e+"B"),r};Ut.cursorUp=(t=1)=>lr+t+"A";Ut.cursorDown=(t=1)=>lr+t+"B";Ut.cursorForward=(t=1)=>lr+t+"C";Ut.cursorBackward=(t=1)=>lr+t+"D";Ut.cursorLeft=lr+"G";Ut.cursorSavePosition=QY?"\x1B7":lr+"s";Ut.cursorRestorePosition=QY?"\x1B8":lr+"u";Ut.cursorGetPosition=lr+"6n";Ut.cursorNextLine=lr+"E";Ut.cursorPrevLine=lr+"F";Ut.cursorHide=lr+"?25l";Ut.cursorShow=lr+"?25h";Ut.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=Ut.eraseLine+(r<t-1?Ut.cursorUp():"");return t&&(e+=Ut.cursorLeft),e};Ut.eraseEndLine=lr+"K";Ut.eraseStartLine=lr+"1K";Ut.eraseLine=lr+"2K";Ut.eraseDown=lr+"J";Ut.eraseUp=lr+"1J";Ut.eraseScreen=lr+"2J";Ut.scrollUp=lr+"S";Ut.scrollDown=lr+"T";Ut.clearScreen="\x1Bc";Ut.clearTerminal=process.platform==="win32"?`${Ut.eraseScreen}${lr}0f`:`${Ut.eraseScreen}${lr}3J${lr}H`;Ut.beep=Lf;Ut.link=(t,e)=>[$2,"8",T3,T3,e,Lf,t,$2,"8",T3,T3,Lf].join("");Ut.image=(t,e={})=>{let r=`${$2}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+t.toString("base64")+Lf};Ut.iTerm={setCwd:(t=process.cwd())=>`${$2}50;CurrentDir=${t}${Lf}`,annotation:(t,e={})=>{let r=`${$2}1337;`,n=typeof e.x<"u",i=typeof e.y<"u";if((n||i)&&!(n&&i&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(n?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,r+Lf}}});var O3=x(Mf=>{"use strict";var V2=eF();Mf.left=function(t,e){t.output.write(V2.cursorBackward(e))};Mf.right=function(t,e){t.output.write(V2.cursorForward(e))};Mf.up=function(t,e){t.output.write(V2.cursorUp(e))};Mf.down=function(t,e){t.output.write(V2.cursorDown(e))};Mf.clearLine=function(t,e){t.output.write(V2.eraseLines(e))}});var ZY=x((bRt,XY)=>{"use strict";var DRe=WY(),wRe=XA(),tF=O3(),rF=class extends wRe{constructor(e={}){super(e),this.log=DRe(this.writeLog.bind(this)),this.bottomBar=e.bottomBar||"",this.render()}render(){return this.write(this.bottomBar),this}clean(){return tF.clearLine(this.rl,this.bottomBar.split(`
188
188
  `).length),this}updateBottomBar(e){return tF.clearLine(this.rl,1),this.rl.output.unmute(),this.clean(),this.bottomBar=e,this.render(),this.rl.output.mute(),this}writeLog(e){return this.rl.output.unmute(),this.clean(),this.rl.output.write(this.enforceLF(e.toString())),this.render(),this.rl.output.mute(),this}enforceLF(e){return e.match(/[\r\n]$/)?e:e+`
189
189
  `}write(e){let r=e.split(/\n/);this.height=r.length,this.rl.setPrompt(r[r.length-1]),this.rl.output.rows===0&&this.rl.output.columns===0&&tF.left(this.rl,e.length+this.rl.line.length),this.rl.output.write(e)}};XY.exports=rF});var nF=x((DRt,eJ)=>{var ERe=typeof global=="object"&&global&&global.Object===Object&&global;eJ.exports=ERe});var zs=x((wRt,tJ)=>{var _Re=nF(),CRe=typeof self=="object"&&self&&self.Object===Object&&self,SRe=_Re||CRe||Function("return this")();tJ.exports=SRe});var jf=x((ERt,rJ)=>{var ARe=zs(),FRe=ARe.Symbol;rJ.exports=FRe});var sJ=x((_Rt,aJ)=>{var nJ=jf(),iJ=Object.prototype,TRe=iJ.hasOwnProperty,ORe=iJ.toString,z2=nJ?nJ.toStringTag:void 0;function IRe(t){var e=TRe.call(t,z2),r=t[z2];try{t[z2]=void 0;var n=!0}catch{}var i=ORe.call(t);return n&&(e?t[z2]=r:delete t[z2]),i}aJ.exports=IRe});var uJ=x((CRt,oJ)=>{var PRe=Object.prototype,BRe=PRe.toString;function RRe(t){return BRe.call(t)}oJ.exports=RRe});var x0=x((SRt,pJ)=>{var cJ=jf(),NRe=sJ(),kRe=uJ(),qRe="[object Null]",LRe="[object Undefined]",lJ=cJ?cJ.toStringTag:void 0;function MRe(t){return t==null?t===void 0?LRe:qRe:lJ&&lJ in Object(t)?NRe(t):kRe(t)}pJ.exports=MRe});var iF=x((ARt,dJ)=>{function jRe(t,e){return function(r){return t(e(r))}}dJ.exports=jRe});var I3=x((FRt,fJ)=>{var URe=iF(),$Re=URe(Object.getPrototypeOf,Object);fJ.exports=$Re});var Vu=x((TRt,hJ)=>{function VRe(t){return t!=null&&typeof t=="object"}hJ.exports=VRe});var gJ=x((ORt,vJ)=>{var zRe=x0(),HRe=I3(),KRe=Vu(),WRe="[object Object]",GRe=Function.prototype,YRe=Object.prototype,mJ=GRe.toString,JRe=YRe.hasOwnProperty,QRe=mJ.call(Object);function XRe(t){if(!KRe(t)||zRe(t)!=WRe)return!1;var e=HRe(t);if(e===null)return!0;var r=JRe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&mJ.call(r)==QRe}vJ.exports=XRe});var es=x((IRt,yJ)=>{var ZRe=Array.isArray;yJ.exports=ZRe});var P3=x((PRt,xJ)=>{var eNe=x0(),tNe=Vu(),rNe="[object Symbol]";function nNe(t){return typeof t=="symbol"||tNe(t)&&eNe(t)==rNe}xJ.exports=nNe});var B3=x((BRt,bJ)=>{var iNe=es(),aNe=P3(),sNe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oNe=/^\w*$/;function uNe(t,e){if(iNe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||aNe(t)?!0:oNe.test(t)||!sNe.test(t)||e!=null&&t in Object(e)}bJ.exports=uNe});var zu=x((RRt,DJ)=>{function cNe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}DJ.exports=cNe});var aF=x((NRt,wJ)=>{var lNe=x0(),pNe=zu(),dNe="[object AsyncFunction]",fNe="[object Function]",hNe="[object GeneratorFunction]",mNe="[object Proxy]";function vNe(t){if(!pNe(t))return!1;var e=lNe(t);return e==fNe||e==hNe||e==dNe||e==mNe}wJ.exports=vNe});var _J=x((kRt,EJ)=>{var gNe=zs(),yNe=gNe["__core-js_shared__"];EJ.exports=yNe});var AJ=x((qRt,SJ)=>{var sF=_J(),CJ=(function(){var t=/[^.]+$/.exec(sF&&sF.keys&&sF.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function xNe(t){return!!CJ&&CJ in t}SJ.exports=xNe});var oF=x((LRt,FJ)=>{var bNe=Function.prototype,DNe=bNe.toString;function wNe(t){if(t!=null){try{return DNe.call(t)}catch{}try{return t+""}catch{}}return""}FJ.exports=wNe});var OJ=x((MRt,TJ)=>{var ENe=aF(),_Ne=AJ(),CNe=zu(),SNe=oF(),ANe=/[\\^$.*+?()[\]{}|]/g,FNe=/^\[object .+?Constructor\]$/,TNe=Function.prototype,ONe=Object.prototype,INe=TNe.toString,PNe=ONe.hasOwnProperty,BNe=RegExp("^"+INe.call(PNe).replace(ANe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RNe(t){if(!CNe(t)||_Ne(t))return!1;var e=ENe(t)?BNe:FNe;return e.test(SNe(t))}TJ.exports=RNe});var PJ=x((jRt,IJ)=>{function NNe(t,e){return t?.[e]}IJ.exports=NNe});var tl=x((URt,BJ)=>{var kNe=OJ(),qNe=PJ();function LNe(t,e){var r=qNe(t,e);return kNe(r)?r:void 0}BJ.exports=LNe});var H2=x(($Rt,RJ)=>{var MNe=tl(),jNe=MNe(Object,"create");RJ.exports=jNe});var qJ=x((VRt,kJ)=>{var NJ=H2();function UNe(){this.__data__=NJ?NJ(null):{},this.size=0}kJ.exports=UNe});var MJ=x((zRt,LJ)=>{function $Ne(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}LJ.exports=$Ne});var UJ=x((HRt,jJ)=>{var VNe=H2(),zNe="__lodash_hash_undefined__",HNe=Object.prototype,KNe=HNe.hasOwnProperty;function WNe(t){var e=this.__data__;if(VNe){var r=e[t];return r===zNe?void 0:r}return KNe.call(e,t)?e[t]:void 0}jJ.exports=WNe});var VJ=x((KRt,$J)=>{var GNe=H2(),YNe=Object.prototype,JNe=YNe.hasOwnProperty;function QNe(t){var e=this.__data__;return GNe?e[t]!==void 0:JNe.call(e,t)}$J.exports=QNe});var HJ=x((WRt,zJ)=>{var XNe=H2(),ZNe="__lodash_hash_undefined__";function eke(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=XNe&&e===void 0?ZNe:e,this}zJ.exports=eke});var WJ=x((GRt,KJ)=>{var tke=qJ(),rke=MJ(),nke=UJ(),ike=VJ(),ake=HJ();function Uf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Uf.prototype.clear=tke;Uf.prototype.delete=rke;Uf.prototype.get=nke;Uf.prototype.has=ike;Uf.prototype.set=ake;KJ.exports=Uf});var YJ=x((YRt,GJ)=>{function ske(){this.__data__=[],this.size=0}GJ.exports=ske});var $f=x((JRt,JJ)=>{function oke(t,e){return t===e||t!==t&&e!==e}JJ.exports=oke});var K2=x((QRt,QJ)=>{var uke=$f();function cke(t,e){for(var r=t.length;r--;)if(uke(t[r][0],e))return r;return-1}QJ.exports=cke});var ZJ=x((XRt,XJ)=>{var lke=K2(),pke=Array.prototype,dke=pke.splice;function fke(t){var e=this.__data__,r=lke(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():dke.call(e,r,1),--this.size,!0}XJ.exports=fke});var tQ=x((ZRt,eQ)=>{var hke=K2();function mke(t){var e=this.__data__,r=hke(e,t);return r<0?void 0:e[r][1]}eQ.exports=mke});var nQ=x((eNt,rQ)=>{var vke=K2();function gke(t){return vke(this.__data__,t)>-1}rQ.exports=gke});var aQ=x((tNt,iQ)=>{var yke=K2();function xke(t,e){var r=this.__data__,n=yke(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}iQ.exports=xke});var W2=x((rNt,sQ)=>{var bke=YJ(),Dke=ZJ(),wke=tQ(),Eke=nQ(),_ke=aQ();function Vf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Vf.prototype.clear=bke;Vf.prototype.delete=Dke;Vf.prototype.get=wke;Vf.prototype.has=Eke;Vf.prototype.set=_ke;sQ.exports=Vf});var R3=x((nNt,oQ)=>{var Cke=tl(),Ske=zs(),Ake=Cke(Ske,"Map");oQ.exports=Ake});var lQ=x((iNt,cQ)=>{var uQ=WJ(),Fke=W2(),Tke=R3();function Oke(){this.size=0,this.__data__={hash:new uQ,map:new(Tke||Fke),string:new uQ}}cQ.exports=Oke});var dQ=x((aNt,pQ)=>{function Ike(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}pQ.exports=Ike});var G2=x((sNt,fQ)=>{var Pke=dQ();function Bke(t,e){var r=t.__data__;return Pke(e)?r[typeof e=="string"?"string":"hash"]:r.map}fQ.exports=Bke});var mQ=x((oNt,hQ)=>{var Rke=G2();function Nke(t){var e=Rke(this,t).delete(t);return this.size-=e?1:0,e}hQ.exports=Nke});var gQ=x((uNt,vQ)=>{var kke=G2();function qke(t){return kke(this,t).get(t)}vQ.exports=qke});var xQ=x((cNt,yQ)=>{var Lke=G2();function Mke(t){return Lke(this,t).has(t)}yQ.exports=Mke});var DQ=x((lNt,bQ)=>{var jke=G2();function Uke(t,e){var r=jke(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}bQ.exports=Uke});var N3=x((pNt,wQ)=>{var $ke=lQ(),Vke=mQ(),zke=gQ(),Hke=xQ(),Kke=DQ();function zf(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}zf.prototype.clear=$ke;zf.prototype.delete=Vke;zf.prototype.get=zke;zf.prototype.has=Hke;zf.prototype.set=Kke;wQ.exports=zf});var CQ=x((dNt,_Q)=>{var EQ=N3(),Wke="Expected a function";function uF(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Wke);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(uF.Cache||EQ),r}uF.Cache=EQ;_Q.exports=uF});var AQ=x((fNt,SQ)=>{var Gke=CQ(),Yke=500;function Jke(t){var e=Gke(t,function(n){return r.size===Yke&&r.clear(),n}),r=e.cache;return e}SQ.exports=Jke});var TQ=x((hNt,FQ)=>{var Qke=AQ(),Xke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zke=/\\(\\)?/g,eqe=Qke(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Xke,function(r,n,i,a){e.push(i?a.replace(Zke,"$1"):n||r)}),e});FQ.exports=eqe});var cF=x((mNt,OQ)=>{function tqe(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}OQ.exports=tqe});var kQ=x((vNt,NQ)=>{var IQ=jf(),rqe=cF(),nqe=es(),iqe=P3(),aqe=1/0,PQ=IQ?IQ.prototype:void 0,BQ=PQ?PQ.toString:void 0;function RQ(t){if(typeof t=="string")return t;if(nqe(t))return rqe(t,RQ)+"";if(iqe(t))return BQ?BQ.call(t):"";var e=t+"";return e=="0"&&1/t==-aqe?"-0":e}NQ.exports=RQ});var LQ=x((gNt,qQ)=>{var sqe=kQ();function oqe(t){return t==null?"":sqe(t)}qQ.exports=oqe});var k3=x((yNt,MQ)=>{var uqe=es(),cqe=B3(),lqe=TQ(),pqe=LQ();function dqe(t,e){return uqe(t)?t:cqe(t,e)?[t]:lqe(pqe(t))}MQ.exports=dqe});var Hf=x((xNt,jQ)=>{var fqe=P3(),hqe=1/0;function mqe(t){if(typeof t=="string"||fqe(t))return t;var e=t+"";return e=="0"&&1/t==-hqe?"-0":e}jQ.exports=mqe});var lF=x((bNt,UQ)=>{var vqe=k3(),gqe=Hf();function yqe(t,e){e=vqe(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[gqe(e[r++])];return r&&r==n?t:void 0}UQ.exports=yqe});var pF=x((DNt,$Q)=>{var xqe=lF();function bqe(t,e,r){var n=t==null?void 0:xqe(t,e);return n===void 0?r:n}$Q.exports=bqe});var dF=x((wNt,VQ)=>{var Dqe=tl(),wqe=(function(){try{var t=Dqe(Object,"defineProperty");return t({},"",{}),t}catch{}})();VQ.exports=wqe});var fF=x((ENt,HQ)=>{var zQ=dF();function Eqe(t,e,r){e=="__proto__"&&zQ?zQ(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}HQ.exports=Eqe});var q3=x((_Nt,KQ)=>{var _qe=fF(),Cqe=$f(),Sqe=Object.prototype,Aqe=Sqe.hasOwnProperty;function Fqe(t,e,r){var n=t[e];(!(Aqe.call(t,e)&&Cqe(n,r))||r===void 0&&!(e in t))&&_qe(t,e,r)}KQ.exports=Fqe});var Y2=x((CNt,WQ)=>{var Tqe=9007199254740991,Oqe=/^(?:0|[1-9]\d*)$/;function Iqe(t,e){var r=typeof t;return e=e??Tqe,!!e&&(r=="number"||r!="symbol"&&Oqe.test(t))&&t>-1&&t%1==0&&t<e}WQ.exports=Iqe});var JQ=x((SNt,YQ)=>{var Pqe=q3(),Bqe=k3(),Rqe=Y2(),GQ=zu(),Nqe=Hf();function kqe(t,e,r,n){if(!GQ(t))return t;e=Bqe(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var u=Nqe(e[i]),c=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var p=o[u];c=n?n(p,u,o):void 0,c===void 0&&(c=GQ(p)?p:Rqe(e[i+1])?[]:{})}Pqe(o,u,c),o=o[u]}return t}YQ.exports=kqe});var XQ=x((ANt,QQ)=>{var qqe=JQ();function Lqe(t,e,r){return t==null?t:qqe(t,e,r)}QQ.exports=Lqe});var pr=x(L3=>{"use strict";Object.defineProperty(L3,"__esModule",{value:!0});L3.isFunction=void 0;function Mqe(t){return typeof t=="function"}L3.isFunction=Mqe});var rl=x(M3=>{"use strict";Object.defineProperty(M3,"__esModule",{value:!0});M3.createErrorClass=void 0;function jqe(t){var e=function(n){Error.call(n),n.stack=new Error().stack},r=t(e);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}M3.createErrorClass=jqe});var hF=x(j3=>{"use strict";Object.defineProperty(j3,"__esModule",{value:!0});j3.UnsubscriptionError=void 0;var Uqe=rl();j3.UnsubscriptionError=Uqe.createErrorClass(function(t){return function(r){t(this),this.message=r?r.length+` errors occurred during unsubscription:
@@ -407,7 +407,7 @@ Fix this by either:
407
407
  Expected file does not exist: ${a}`)}console.log(xf.default.dim("\u2713 Widget project structure validated"))}function LOe(t){if(t){let a=HS(process.cwd(),t);if(!bf(a))throw new Error(`Entry file not found at ${a}`);return a}let e=qOe(process.cwd(),"package.json");if(!bf(e))throw new Error("No package.json found in current directory. Please run this command from your project root or specify an entry file.");let r;try{let a=NOe(e,"utf-8");r=JSON.parse(a)}catch(a){throw new Error(`Failed to parse package.json: ${a}`)}if(!r.module||typeof r.module!="string")throw new Error(`No entry point found in package.json. Please define the "module" field:
408
408
  "module": "./src/index.ts"
409
409
  Or specify an entry file directly with the command.`);let n=r.module,i=HS(process.cwd(),n);if(!bf(i))throw new Error(`Entry file specified in package.json not found at ${i}.
410
- Check that the file exists or update your package.json`);return i}async function MOe(t){let e=t?[t]:["smithery.config.js","smithery.config.mjs","smithery.config.cjs"];for(let r of e){let n=HS(process.cwd(),r);if(bf(n))try{let i=await import(n),a=i.default??i;return a.esbuild||a||{}}catch(i){console.warn(`Failed to load config from ${r}:`,i)}}return{}}async function jOe(t,e){let r=performance.now(),n=t.outFile||".smithery/index.cjs",i=t.transport??"shttp",a=eW(n);bf(a)||ROe(a,{recursive:!0});let s=i==="shttp"?"streamable http":i;console.log(Ti.default.dim(`${Ti.default.bold.italic.hex("#ea580c")("SMITHERY")} ${Ti.default.bold.italic.hex("#ea580c")("v1.6.2")} Building MCP server with ${Ti.default.cyan(s)} transport...`));let o=()=>({name:"smithery-bootstrap-plugin",setup(h){h.onResolve({filter:/^virtual:bootstrap$/},()=>({path:"virtual:bootstrap",namespace:"bootstrap"})),h.onLoad({filter:/.*/,namespace:"bootstrap"},()=>({contents:(i==="stdio"?`// src/runtime/stdio-bootstrap.ts
410
+ Check that the file exists or update your package.json`);return i}async function MOe(t){let e=t?[t]:["smithery.config.js","smithery.config.mjs","smithery.config.cjs"];for(let r of e){let n=HS(process.cwd(),r);if(bf(n))try{let i=await import(n),a=i.default??i;return a.esbuild||a||{}}catch(i){console.warn(`Failed to load config from ${r}:`,i)}}return{}}async function jOe(t,e){let r=performance.now(),n=t.outFile||".smithery/index.cjs",i=t.transport??"shttp",a=eW(n);bf(a)||ROe(a,{recursive:!0});let s=i==="shttp"?"streamable http":i;console.log(Ti.default.dim(`${Ti.default.bold.italic.hex("#ea580c")("SMITHERY")} ${Ti.default.bold.italic.hex("#ea580c")("v1.6.3")} Building MCP server with ${Ti.default.cyan(s)} transport...`));let o=()=>({name:"smithery-bootstrap-plugin",setup(h){h.onResolve({filter:/^virtual:bootstrap$/},()=>({path:"virtual:bootstrap",namespace:"bootstrap"})),h.onLoad({filter:/.*/,namespace:"bootstrap"},()=>({contents:(i==="stdio"?`// src/runtime/stdio-bootstrap.ts
411
411
  import * as _entry from "virtual:user-module";
412
412
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
413
413
  import chalk from "chalk";
@@ -638,7 +638,7 @@ ${F4.default.blue("\u2B06 One-click cloud deploy: https://smithery.ai/new")}
638
638
  ${U4.default.rgb(234,88,12)("Thanks for using Smithery Uplink!")}
639
639
  ${U4.default.blue("\u2B06 One-click cloud deploy: https://smithery.ai/new")}
640
640
 
641
- `)};return process.on("SIGINT",m),process.on("SIGTERM",m),process.on("beforeExit",m),process.on("exit",()=>{J("[Uplink Runner] Final cleanup on exit")}),process.stdin.on("end",()=>{J("[Uplink Runner] STDIN closed (client disconnected)"),m().catch(C=>{J(`[Uplink Runner] Error during stdin close cleanup: ${C}`),process.exit(1)})}),process.stdin.on("error",C=>{J(`[Uplink Runner] STDIN error: ${C.message}`),m().catch(F=>{J(`[Uplink Runner] Error during stdin error cleanup: ${F}`),process.exit(1)})}),process.stdin.on("data",C=>b(C).catch(F=>h(F,"[Uplink Runner] Error processing message"))),await D(),_};async function u9e(t,e,r,n,i){try{let a=await Ho();a.success||J(`[Runner] Settings initialization warning: ${a.error}`);let s=await Ah(t,r,"run");if(!s)throw new Error(`Could not resolve server: ${t}`);J(`[Runner] Connecting to server: ${JSON.stringify({id:s.qualifiedName,connectionTypes:s.connections.map(u=>u.type)})}`);let o=await Lb();await vTt(s,e,o,r,n,i)}catch(a){J(`[Runner] Error: ${a instanceof Error?a.message:a}`),process.exit(1)}}async function vTt(t,e,r,n,i,a){if(!t.connections?.length)throw new Error("No connection configuration found for server");let s=t.connections[0];if(s.type==="http"){if(!s.deploymentUrl)throw new Error("Missing deployment URL");if(!n)throw new Error("API key is required for remote connections");a?.playground?await o9e(s.deploymentUrl,n,e,i,{open:a.open!==!1,initialMessage:a.initialMessage||"Say hello to the world!"}):await a9e(s.deploymentUrl,n,e,i)}else if(s.type==="stdio"){let o=await y6e(t,s,e,n,i);if(a?.playground){if(!n)throw new Error("API key is required for playground connections");await Uxe(o.command,o.args,o.env,o.qualifiedName,n,{open:a.open!==!1,initialMessage:a.initialMessage||"Say hello to the world!"})}else await zxe(o.command,o.args,o.env,o.qualifiedName,n,r)}else throw new Error(`Unsupported connection type: ${s.type}`)}var xm=ke(qt(),1);zl();A6();process.removeAllListeners("warning");process.on("warning",t=>{t.name==="DeprecationWarning"&&t.message.includes("punycode")||console.warn(t)});async function c9e(t,e){try{if(xs(e).installType==="command"){console.log(xm.default.yellow(`Uninstallation is currently not supported for ${e}`));return}let n=sd(e);if(!n.mcpServers[t]){console.log(xm.default.red(`${t} is not installed for ${e}`));return}delete n.mcpServers[t],S6(n,e),console.log(xm.default.green(`\u2713 ${t} successfully uninstalled from ${e}`)),await V7(e)}catch(r){r instanceof Error?console.error(xm.default.red(`Error: ${r.message}`)):console.error(xm.default.red("An unexpected error occurred during uninstallation")),process.exit(1)}}zl();va();var dn=ke(qt(),1);zl();async function mE(t,e="Working with"){if(t)return t;console.log(dn.default.cyan("*"),`${e} MCP server`),console.log();let r=(await Promise.resolve().then(()=>ke(xa(),1))).default,n=(await Promise.resolve().then(()=>ke($4(),1))).default;r.registerPrompt("autocomplete",n);let{client:i}=await r.prompt([{type:"autocomplete",name:"client",message:"Select client:",source:(a,s)=>{let o=Yo.filter(u=>u.toLowerCase().includes((s||"").toLowerCase()));return Promise.resolve(o)}}]);return i}function vE(t){Yo.includes(t)||(console.error(dn.default.yellow(`Invalid client "${t}". Valid options are: ${Yo.join(", ")}`)),process.exit(1))}function nU(t){try{let e=t;e.startsWith("'")&&e.endsWith("'")&&(e=e.slice(1,-1));let r=JSON.parse(e);return typeof r=="string"&&(r=JSON.parse(r)),r}catch(e){let r=e instanceof Error?e.message:String(e);console.error(dn.default.red(`Error parsing config: ${r}`)),process.exit(1)}}async function TTt(){let t=(await Promise.resolve().then(()=>ke(xa(),1))).default,{inputMethod:e}=await t.prompt([{type:"list",name:"inputMethod",message:"How would you like to specify the server?",choices:[{name:"Search for servers",value:"search"},{name:"Enter server id",value:"direct"}]}]);return e}async function OTt(t){let e=(await Promise.resolve().then(()=>ke(xa(),1))).default,{searchTerm:r}=await e.prompt([{type:"input",name:"searchTerm",message:"Search for servers:",validate:n=>n.trim().length>0||"Please enter a search term"}]);try{let n=await fs(t),i=(await Promise.resolve().then(()=>(H0(),Bb))).default,a=i(`Searching for "${r}"...`).start(),s=await UN(r,n);s.length===0&&(a.fail(`No servers found for "${r}"`),process.exit(0)),a.succeed(`Found ${s.length} server${s.length===1?"":"s"}`),console.log();let o=(await Promise.resolve().then(()=>ke($4(),1))).default;e.registerPrompt("autocomplete",o);let{serverChoice:u}=await e.prompt([{type:"autocomplete",name:"serverChoice",message:"Select server to install:",source:(c,p)=>{let d=s.filter(h=>h.qualifiedName.toLowerCase().includes((p||"").toLowerCase())||h.displayName?.toLowerCase().includes((p||"").toLowerCase())||h.description?.toLowerCase().includes((p||"").toLowerCase())).map(h=>{let m=h.displayName||h.qualifiedName,v=`${h.useCount.toLocaleString()} tool calls`,g=h.qualifiedName!==m?` \u2022 ${h.qualifiedName}`:"";return{name:`${m} \u2022 ${v}${g}`,value:h.qualifiedName}});return Promise.resolve(d)}}]);return u}catch(n){let i=(await Promise.resolve().then(()=>(H0(),Bb))).default;i().start().fail("Failed to search servers"),console.error(dn.default.red(n instanceof Error?n.message:String(n))),process.exit(1)}}async function ITt(){let t=(await Promise.resolve().then(()=>ke(xa(),1))).default,{serverId:e}=await t.prompt([{type:"input",name:"serverId",message:"Enter server ID:",validate:r=>{let n=r.trim();return n.length===0?"Please enter a server ID":/^[a-zA-Z0-9._/-]+$/.test(n)?!0:"Server ID should only contain letters, numbers, dots, underscores, hyphens, and forward slashes"}}]);return e.trim()}async function v9e(t,e,r){if(t)return t;if(console.log(dn.default.cyan("*"),"Installing MCP server for",dn.default.cyan(e)),console.log(),await TTt()==="search")return await OTt(r);{let i=await ITt();return console.log(),i}}async function g9e(t,e,r){if(t)return t;console.log(dn.default.cyan("*"),"Uninstalling server from",dn.default.cyan(e)),console.log(),r.length===0&&(console.log(dn.default.yellow(`No servers installed for ${e}`)),process.exit(0));let n=(await Promise.resolve().then(()=>ke(xa(),1))).default,i=(await Promise.resolve().then(()=>ke($4(),1))).default;n.registerPrompt("autocomplete",i);let{serverName:a}=await n.prompt([{type:"autocomplete",name:"serverName",message:`Select server to uninstall from ${e}:`,source:(s,o)=>{let u=r.filter(c=>c.toLowerCase().includes((o||"").toLowerCase()));return Promise.resolve(u)}}]);return a}async function rU(t){if(t)return t;let r=await(await Promise.resolve().then(()=>ke(xa(),1))).default.prompt([{type:"input",name:"searchTerm",message:"Search for servers:",validate:n=>n.trim().length>0||"Please enter a search term"}]);return console.log(),r.searchTerm}async function y9e(t,e){let r=await rU(e);try{for(;;){let n=(await Promise.resolve().then(()=>(H0(),Bb))).default,i=n(`Searching for "${r}"...`).start(),a=await UN(r,t);if(a.length===0){i.fail(`No servers found for "${r}"`);return}i.succeed(`\u2600 ${a.length<10?`Found ${a.length} result${a.length===1?"":"s"}:`:`Showing top (${a.length}) results:`}`),console.log(dn.default.dim(`${dn.default.cyan("\u2192 View more")} at smithery.ai/search?q=${r.replace(/\s+/g,"+")}`)),console.log();let s=(await Promise.resolve().then(()=>ke(xa(),1))).default,o=(await Promise.resolve().then(()=>ke($4(),1))).default;s.registerPrompt("autocomplete",o);let{selectedServer:u}=await s.prompt([{type:"autocomplete",name:"selectedServer",message:"Select server for details (or search again):",source:(p,d)=>{let h=[{name:dn.default.dim("\u2190 Search again"),value:"__SEARCH_AGAIN__"},{name:dn.default.dim("Exit"),value:"__EXIT__"}],m=a.filter(v=>v.qualifiedName.toLowerCase().includes((d||"").toLowerCase())||v.displayName?.toLowerCase().includes((d||"").toLowerCase())).map(v=>{let g=v.displayName||v.qualifiedName,b=v.useCount>0?dn.default.dim(` (${v.useCount.toLocaleString()} calls/month)`):"";return{name:`${g}${b}`,value:v.qualifiedName}});return Promise.resolve([...h,...m])}}]);if(u==="__EXIT__")return;if(u==="__SEARCH_AGAIN__"){r=await rU();continue}console.log();let c=a.find(p=>p.qualifiedName===u);if(c){let p=c.displayName||c.qualifiedName;console.log(`${dn.default.bold.cyan(p)}`),console.log(`${dn.default.dim("Qualified name:")} ${c.qualifiedName}`),c.description&&console.log(`${dn.default.dim("Description:")} ${c.description}`),console.log(`${dn.default.dim("Usage:")} ${c.useCount.toLocaleString()} calls/month`),console.log(),console.log(dn.default.dim(`Use 'smithery install ${c.qualifiedName}' to install`));let{action:d}=await s.prompt([{type:"list",name:"action",message:"What would you like to do?",choices:[{name:"\u2190 Back to server list",value:"back"},{name:"\u2190 Search again",value:"search"},{name:"Exit",value:"exit"}]}]);if(d==="back")console.log();else if(d==="search")r=await rU();else return}}}catch(n){console.error(dn.default.red("Error searching servers:"),n instanceof Error?n.message:String(n)),process.exit(1)}}var Ia=new oz;Ia.name("smithery").version("1.6.2").description(`${Mi.default.bold.italic.hex("#ea580c")("SMITHERY CLI")} ${Mi.default.bold.italic.hex("#ea580c")("v1.6.2")} - Manage and run MCP servers`).option("--verbose","Show detailed logs").option("--debug","Show debug logs").hook("preAction",(t,e)=>{let r=t.opts();r.verbose&&gG(!0),r.debug&&yG(!0)});Ia.command("install [server]").description("install a server").option("-c, --client <name>",`Specify the AI client (${Yo.join(", ")})`).option("--config <json>","Provide configuration data as JSON (skips prompts)").option("--key <apikey>","Provide an API key").option("--profile <name>","Use a specific profile").action(async(t,e)=>{let r=await mE(e.client,"Install"),n=await v9e(t,r,e.key);vE(r);let i=e.config?nU(e.config):{};await Zfe(n,r,i,e.key,e.profile)});Ia.command("uninstall [server]").description("uninstall a server").option("-c, --client <name>",`Specify the AI client (${Yo.join(", ")})`).action(async(t,e)=>{let{readConfig:r}=await Promise.resolve().then(()=>(A6(),Xfe)),n=await mE(e.client,"Uninstall");vE(n);let i=r(n),a=Object.keys(i.mcpServers),s=await g9e(t,n,a);await c9e(s,n)});Ia.command("inspect <server>").description("Inspect server from registry").option("--key <apikey>","Provide an API key").action(async(t,e)=>{await jfe(t,await fs(e.key))});Ia.command("run <server>").description("run a server").option("--config <json>","Provide configuration as JSON").option("--key <apikey>","Provide an API key").option("--profile <name>","Use a specific profile").option("--playground","Create playground tunnel and open playground").option("--no-open","Don't automatically open the playground (when using --playground)").option("--prompt <prompt>","Initial message to start the playground with (when using --playground)").action(async(t,e)=>{let r=e.config?nU(e.config):{};await u9e(t,r,await fs(e.key),e.profile,{playground:e.playground,open:e.open,initialMessage:e.prompt})});Ia.command("dev [entryFile]").description("Start development server with hot-reload and tunnel").option("--port <port>",`Port to run the server on (default: ${8081})`).option("--key <apikey>","Provide an API key").option("--no-tunnel","Don't start the tunnel").option("--no-open","Don't automatically open the playground").option("--prompt <prompt>","Initial message to start the playground with").option("-c, --config <path>","Path to config file (default: auto-detect smithery.config.js)").option("--no-minify","Build widgets without minification for easier debugging").action(async(t,e)=>{await wle({entryFile:t,port:e.port,key:e.key,tunnel:e.tunnel,open:e.open,initialMessage:e.prompt,configFile:e.config,minify:e.minify})});Ia.command("build [entryFile]").description("build MCP server for production").option("-o, --out <outfile>","Output file path (default: .smithery/index.cjs)").option("--transport <type>","Transport type: shttp or stdio (default: shttp)").option("-c, --config <path>","Path to config file (default: auto-detect smithery.config.js)").action(async(t,e)=>{let r=e.transport||"shttp";["shttp","stdio"].includes(r)||(console.error(Mi.default.red(`Invalid transport type "${r}". Valid options are: shttp, stdio`)),process.exit(1)),await tW({entryFile:t,outFile:e.out,transport:r,configFile:e.config,bundleAll:e.bundleAll})});Ia.command("playground").description("open MCP playground in browser").option("--port <port>",`Port to expose (default: ${8081})`).option("--key <apikey>","Provide an API key").allowUnknownOption().allowExcessArguments().action(async t=>{let e,r=process.argv,n=r.indexOf("--");n!==-1&&n+1<r.length&&(e=r.slice(n+1).join(" ")),await r1e({port:t.port,command:e,apiKey:await fs(t.key)})});Ia.command("playground-stdio").description("Run arbitrary command as stdio MCP server in playground").option("--port <port>","Port for HTTP server (default: 6969)").option("--key <apikey>","Provide an API key").option("--no-open","Don't automatically open the playground").option("--prompt <prompt>","Initial message to start the playground with").allowUnknownOption().allowExcessArguments().action(async t=>{let e,r=process.argv,n=r.indexOf("--");n!==-1&&n+1<r.length&&(e=r.slice(n+1).join(" ")),e||(console.error(Mi.default.red("\u274C Command is required.")),console.error(Mi.default.yellow("Usage: smithery playground-stdio -- <command>")),console.error(Mi.default.gray("Example: smithery playground-stdio -- python my_mcp_server.py")),process.exit(1));let{createArbitraryCommandRunner:i}=await Promise.resolve().then(()=>(D9e(),b9e)),a=await i(e,await fs(t.key),{port:t.port?Number.parseInt(t.port,10):6969,open:t.open!==!1,initialMessage:t.prompt});process.stdin.resume(),await new Promise(()=>{})});Ia.command("list").description("list installed servers").option("-c, --client <name>",`Specify the client (${Yo.join(", ")})`).action(async t=>{let e=await mE(t.client,"List");vE(e),await e1e("servers",e)});Ia.command("search [term]").description("Search for servers in the Smithery registry").action(async t=>{let e=await fs();await y9e(e,t)});Ia.command("login").description("Login with an API key").action(async()=>{console.log(Mi.default.cyan("Login to Smithery")),console.log(Mi.default.gray("Get your API key from: https://smithery.ai/account/api-keys")),console.log();try{let t=await CR();await Bfe(t),(await Mb(t)).success?(console.log(Mi.default.green("\u2713 API key saved successfully")),console.log(Mi.default.gray("You can now use Smithery CLI commands"))):(console.error(Mi.default.red("\u2717 Failed to save API key")),console.error(Mi.default.gray("You may need to enter it again next time")))}catch(t){console.error(Mi.default.red("\u2717 Login failed"));let e=t instanceof Error?t.message:String(t);console.error(Mi.default.gray(e)),process.exit(1)}});Ia.parse(process.argv);
641
+ `)};return process.on("SIGINT",m),process.on("SIGTERM",m),process.on("beforeExit",m),process.on("exit",()=>{J("[Uplink Runner] Final cleanup on exit")}),process.stdin.on("end",()=>{J("[Uplink Runner] STDIN closed (client disconnected)"),m().catch(C=>{J(`[Uplink Runner] Error during stdin close cleanup: ${C}`),process.exit(1)})}),process.stdin.on("error",C=>{J(`[Uplink Runner] STDIN error: ${C.message}`),m().catch(F=>{J(`[Uplink Runner] Error during stdin error cleanup: ${F}`),process.exit(1)})}),process.stdin.on("data",C=>b(C).catch(F=>h(F,"[Uplink Runner] Error processing message"))),await D(),_};async function u9e(t,e,r,n,i){try{let a=await Ho();a.success||J(`[Runner] Settings initialization warning: ${a.error}`);let s=await Ah(t,r,"run");if(!s)throw new Error(`Could not resolve server: ${t}`);J(`[Runner] Connecting to server: ${JSON.stringify({id:s.qualifiedName,connectionTypes:s.connections.map(u=>u.type)})}`);let o=await Lb();await vTt(s,e,o,r,n,i)}catch(a){J(`[Runner] Error: ${a instanceof Error?a.message:a}`),process.exit(1)}}async function vTt(t,e,r,n,i,a){if(!t.connections?.length)throw new Error("No connection configuration found for server");let s=t.connections[0];if(s.type==="http"){if(!s.deploymentUrl)throw new Error("Missing deployment URL");if(!n)throw new Error("API key is required for remote connections");a?.playground?await o9e(s.deploymentUrl,n,e,i,{open:a.open!==!1,initialMessage:a.initialMessage||"Say hello to the world!"}):await a9e(s.deploymentUrl,n,e,i)}else if(s.type==="stdio"){let o=await y6e(t,s,e,n,i);if(a?.playground){if(!n)throw new Error("API key is required for playground connections");await Uxe(o.command,o.args,o.env,o.qualifiedName,n,{open:a.open!==!1,initialMessage:a.initialMessage||"Say hello to the world!"})}else await zxe(o.command,o.args,o.env,o.qualifiedName,n,r)}else throw new Error(`Unsupported connection type: ${s.type}`)}var xm=ke(qt(),1);zl();A6();process.removeAllListeners("warning");process.on("warning",t=>{t.name==="DeprecationWarning"&&t.message.includes("punycode")||console.warn(t)});async function c9e(t,e){try{if(xs(e).installType==="command"){console.log(xm.default.yellow(`Uninstallation is currently not supported for ${e}`));return}let n=sd(e);if(!n.mcpServers[t]){console.log(xm.default.red(`${t} is not installed for ${e}`));return}delete n.mcpServers[t],S6(n,e),console.log(xm.default.green(`\u2713 ${t} successfully uninstalled from ${e}`)),await V7(e)}catch(r){r instanceof Error?console.error(xm.default.red(`Error: ${r.message}`)):console.error(xm.default.red("An unexpected error occurred during uninstallation")),process.exit(1)}}zl();va();var dn=ke(qt(),1);zl();async function mE(t,e="Working with"){if(t)return t;console.log(dn.default.cyan("*"),`${e} MCP server`),console.log();let r=(await Promise.resolve().then(()=>ke(xa(),1))).default,n=(await Promise.resolve().then(()=>ke($4(),1))).default;r.registerPrompt("autocomplete",n);let{client:i}=await r.prompt([{type:"autocomplete",name:"client",message:"Select client:",source:(a,s)=>{let o=Yo.filter(u=>u.toLowerCase().includes((s||"").toLowerCase()));return Promise.resolve(o)}}]);return i}function vE(t){Yo.includes(t)||(console.error(dn.default.yellow(`Invalid client "${t}". Valid options are: ${Yo.join(", ")}`)),process.exit(1))}function nU(t){try{let e=t;e.startsWith("'")&&e.endsWith("'")&&(e=e.slice(1,-1));let r=JSON.parse(e);return typeof r=="string"&&(r=JSON.parse(r)),r}catch(e){let r=e instanceof Error?e.message:String(e);console.error(dn.default.red(`Error parsing config: ${r}`)),process.exit(1)}}async function TTt(){let t=(await Promise.resolve().then(()=>ke(xa(),1))).default,{inputMethod:e}=await t.prompt([{type:"list",name:"inputMethod",message:"How would you like to specify the server?",choices:[{name:"Search for servers",value:"search"},{name:"Enter server id",value:"direct"}]}]);return e}async function OTt(t){let e=(await Promise.resolve().then(()=>ke(xa(),1))).default,{searchTerm:r}=await e.prompt([{type:"input",name:"searchTerm",message:"Search for servers:",validate:n=>n.trim().length>0||"Please enter a search term"}]);try{let n=await fs(t),i=(await Promise.resolve().then(()=>(H0(),Bb))).default,a=i(`Searching for "${r}"...`).start(),s=await UN(r,n);s.length===0&&(a.fail(`No servers found for "${r}"`),process.exit(0)),a.succeed(`Found ${s.length} server${s.length===1?"":"s"}`),console.log();let o=(await Promise.resolve().then(()=>ke($4(),1))).default;e.registerPrompt("autocomplete",o);let{serverChoice:u}=await e.prompt([{type:"autocomplete",name:"serverChoice",message:"Select server to install:",source:(c,p)=>{let d=s.filter(h=>h.qualifiedName.toLowerCase().includes((p||"").toLowerCase())||h.displayName?.toLowerCase().includes((p||"").toLowerCase())||h.description?.toLowerCase().includes((p||"").toLowerCase())).map(h=>{let m=h.displayName||h.qualifiedName,v=`${h.useCount.toLocaleString()} tool calls`,g=h.qualifiedName!==m?` \u2022 ${h.qualifiedName}`:"";return{name:`${m} \u2022 ${v}${g}`,value:h.qualifiedName}});return Promise.resolve(d)}}]);return u}catch(n){let i=(await Promise.resolve().then(()=>(H0(),Bb))).default;i().start().fail("Failed to search servers"),console.error(dn.default.red(n instanceof Error?n.message:String(n))),process.exit(1)}}async function ITt(){let t=(await Promise.resolve().then(()=>ke(xa(),1))).default,{serverId:e}=await t.prompt([{type:"input",name:"serverId",message:"Enter server ID:",validate:r=>{let n=r.trim();return n.length===0?"Please enter a server ID":/^[a-zA-Z0-9._/-]+$/.test(n)?!0:"Server ID should only contain letters, numbers, dots, underscores, hyphens, and forward slashes"}}]);return e.trim()}async function v9e(t,e,r){if(t)return t;if(console.log(dn.default.cyan("*"),"Installing MCP server for",dn.default.cyan(e)),console.log(),await TTt()==="search")return await OTt(r);{let i=await ITt();return console.log(),i}}async function g9e(t,e,r){if(t)return t;console.log(dn.default.cyan("*"),"Uninstalling server from",dn.default.cyan(e)),console.log(),r.length===0&&(console.log(dn.default.yellow(`No servers installed for ${e}`)),process.exit(0));let n=(await Promise.resolve().then(()=>ke(xa(),1))).default,i=(await Promise.resolve().then(()=>ke($4(),1))).default;n.registerPrompt("autocomplete",i);let{serverName:a}=await n.prompt([{type:"autocomplete",name:"serverName",message:`Select server to uninstall from ${e}:`,source:(s,o)=>{let u=r.filter(c=>c.toLowerCase().includes((o||"").toLowerCase()));return Promise.resolve(u)}}]);return a}async function rU(t){if(t)return t;let r=await(await Promise.resolve().then(()=>ke(xa(),1))).default.prompt([{type:"input",name:"searchTerm",message:"Search for servers:",validate:n=>n.trim().length>0||"Please enter a search term"}]);return console.log(),r.searchTerm}async function y9e(t,e){let r=await rU(e);try{for(;;){let n=(await Promise.resolve().then(()=>(H0(),Bb))).default,i=n(`Searching for "${r}"...`).start(),a=await UN(r,t);if(a.length===0){i.fail(`No servers found for "${r}"`);return}i.succeed(`\u2600 ${a.length<10?`Found ${a.length} result${a.length===1?"":"s"}:`:`Showing top (${a.length}) results:`}`),console.log(dn.default.dim(`${dn.default.cyan("\u2192 View more")} at smithery.ai/search?q=${r.replace(/\s+/g,"+")}`)),console.log();let s=(await Promise.resolve().then(()=>ke(xa(),1))).default,o=(await Promise.resolve().then(()=>ke($4(),1))).default;s.registerPrompt("autocomplete",o);let{selectedServer:u}=await s.prompt([{type:"autocomplete",name:"selectedServer",message:"Select server for details (or search again):",source:(p,d)=>{let h=[{name:dn.default.dim("\u2190 Search again"),value:"__SEARCH_AGAIN__"},{name:dn.default.dim("Exit"),value:"__EXIT__"}],m=a.filter(v=>v.qualifiedName.toLowerCase().includes((d||"").toLowerCase())||v.displayName?.toLowerCase().includes((d||"").toLowerCase())).map(v=>{let g=v.displayName||v.qualifiedName,b=v.useCount>0?dn.default.dim(` (${v.useCount.toLocaleString()} calls/month)`):"";return{name:`${g}${b}`,value:v.qualifiedName}});return Promise.resolve([...h,...m])}}]);if(u==="__EXIT__")return;if(u==="__SEARCH_AGAIN__"){r=await rU();continue}console.log();let c=a.find(p=>p.qualifiedName===u);if(c){let p=c.displayName||c.qualifiedName;console.log(`${dn.default.bold.cyan(p)}`),console.log(`${dn.default.dim("Qualified name:")} ${c.qualifiedName}`),c.description&&console.log(`${dn.default.dim("Description:")} ${c.description}`),console.log(`${dn.default.dim("Usage:")} ${c.useCount.toLocaleString()} calls/month`),console.log(),console.log(dn.default.dim(`Use 'smithery install ${c.qualifiedName}' to install`));let{action:d}=await s.prompt([{type:"list",name:"action",message:"What would you like to do?",choices:[{name:"\u2190 Back to server list",value:"back"},{name:"\u2190 Search again",value:"search"},{name:"Exit",value:"exit"}]}]);if(d==="back")console.log();else if(d==="search")r=await rU();else return}}}catch(n){console.error(dn.default.red("Error searching servers:"),n instanceof Error?n.message:String(n)),process.exit(1)}}var Ia=new oz;Ia.name("smithery").version("1.6.3").description(`${Mi.default.bold.italic.hex("#ea580c")("SMITHERY CLI")} ${Mi.default.bold.italic.hex("#ea580c")("v1.6.3")} - Manage and run MCP servers`).option("--verbose","Show detailed logs").option("--debug","Show debug logs").hook("preAction",(t,e)=>{let r=t.opts();r.verbose&&gG(!0),r.debug&&yG(!0)});Ia.command("install [server]").description("install a server").option("-c, --client <name>",`Specify the AI client (${Yo.join(", ")})`).option("--config <json>","Provide configuration data as JSON (skips prompts)").option("--key <apikey>","Provide an API key").option("--profile <name>","Use a specific profile").action(async(t,e)=>{let r=await mE(e.client,"Install"),n=await v9e(t,r,e.key);vE(r);let i=e.config?nU(e.config):{};await Zfe(n,r,i,e.key,e.profile)});Ia.command("uninstall [server]").description("uninstall a server").option("-c, --client <name>",`Specify the AI client (${Yo.join(", ")})`).action(async(t,e)=>{let{readConfig:r}=await Promise.resolve().then(()=>(A6(),Xfe)),n=await mE(e.client,"Uninstall");vE(n);let i=r(n),a=Object.keys(i.mcpServers),s=await g9e(t,n,a);await c9e(s,n)});Ia.command("inspect <server>").description("Inspect server from registry").option("--key <apikey>","Provide an API key").action(async(t,e)=>{await jfe(t,await fs(e.key))});Ia.command("run <server>").description("run a server").option("--config <json>","Provide configuration as JSON").option("--key <apikey>","Provide an API key").option("--profile <name>","Use a specific profile").option("--playground","Create playground tunnel and open playground").option("--no-open","Don't automatically open the playground (when using --playground)").option("--prompt <prompt>","Initial message to start the playground with (when using --playground)").action(async(t,e)=>{let r=e.config?nU(e.config):{};await u9e(t,r,await fs(e.key),e.profile,{playground:e.playground,open:e.open,initialMessage:e.prompt})});Ia.command("dev [entryFile]").description("Start development server with hot-reload and tunnel").option("--port <port>",`Port to run the server on (default: ${8081})`).option("--key <apikey>","Provide an API key").option("--no-tunnel","Don't start the tunnel").option("--no-open","Don't automatically open the playground").option("--prompt <prompt>","Initial message to start the playground with").option("-c, --config <path>","Path to config file (default: auto-detect smithery.config.js)").option("--no-minify","Build widgets without minification for easier debugging").action(async(t,e)=>{await wle({entryFile:t,port:e.port,key:e.key,tunnel:e.tunnel,open:e.open,initialMessage:e.prompt,configFile:e.config,minify:e.minify})});Ia.command("build [entryFile]").description("build MCP server for production").option("-o, --out <outfile>","Output file path (default: .smithery/index.cjs)").option("--transport <type>","Transport type: shttp or stdio (default: shttp)").option("-c, --config <path>","Path to config file (default: auto-detect smithery.config.js)").action(async(t,e)=>{let r=e.transport||"shttp";["shttp","stdio"].includes(r)||(console.error(Mi.default.red(`Invalid transport type "${r}". Valid options are: shttp, stdio`)),process.exit(1)),await tW({entryFile:t,outFile:e.out,transport:r,configFile:e.config,bundleAll:e.bundleAll})});Ia.command("playground").description("open MCP playground in browser").option("--port <port>",`Port to expose (default: ${8081})`).option("--key <apikey>","Provide an API key").allowUnknownOption().allowExcessArguments().action(async t=>{let e,r=process.argv,n=r.indexOf("--");n!==-1&&n+1<r.length&&(e=r.slice(n+1).join(" ")),await r1e({port:t.port,command:e,apiKey:await fs(t.key)})});Ia.command("playground-stdio").description("Run arbitrary command as stdio MCP server in playground").option("--port <port>","Port for HTTP server (default: 6969)").option("--key <apikey>","Provide an API key").option("--no-open","Don't automatically open the playground").option("--prompt <prompt>","Initial message to start the playground with").allowUnknownOption().allowExcessArguments().action(async t=>{let e,r=process.argv,n=r.indexOf("--");n!==-1&&n+1<r.length&&(e=r.slice(n+1).join(" ")),e||(console.error(Mi.default.red("\u274C Command is required.")),console.error(Mi.default.yellow("Usage: smithery playground-stdio -- <command>")),console.error(Mi.default.gray("Example: smithery playground-stdio -- python my_mcp_server.py")),process.exit(1));let{createArbitraryCommandRunner:i}=await Promise.resolve().then(()=>(D9e(),b9e)),a=await i(e,await fs(t.key),{port:t.port?Number.parseInt(t.port,10):6969,open:t.open!==!1,initialMessage:t.prompt});process.stdin.resume(),await new Promise(()=>{})});Ia.command("list").description("list installed servers").option("-c, --client <name>",`Specify the client (${Yo.join(", ")})`).action(async t=>{let e=await mE(t.client,"List");vE(e),await e1e("servers",e)});Ia.command("search [term]").description("Search for servers in the Smithery registry").action(async t=>{let e=await fs();await y9e(e,t)});Ia.command("login").description("Login with an API key").action(async()=>{console.log(Mi.default.cyan("Login to Smithery")),console.log(Mi.default.gray("Get your API key from: https://smithery.ai/account/api-keys")),console.log();try{let t=await CR();await Bfe(t),(await Mb(t)).success?(console.log(Mi.default.green("\u2713 API key saved successfully")),console.log(Mi.default.gray("You can now use Smithery CLI commands"))):(console.error(Mi.default.red("\u2717 Failed to save API key")),console.error(Mi.default.gray("You may need to enter it again next time")))}catch(t){console.error(Mi.default.red("\u2717 Login failed"));let e=t instanceof Error?t.message:String(t);console.error(Mi.default.gray(e)),process.exit(1)}});Ia.parse(process.argv);
642
642
  /*! Bundled license information:
643
643
 
644
644
  safe-buffer/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithery/cli",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://smithery.ai/",