@smithery/cli 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -60,9 +60,9 @@ Calls to async() callback can have unexpected results.`),f=!0,function(y,m){y?c(
|
|
|
60
60
|
`;return}let o=a-n===e,s=(o?Cse.pointer+" ":" ")+i.name;o&&(s=ra.cyan(s)),t+=s+`
|
|
61
61
|
`}),t.replace(/\n$/,"")}function Tse(r){return typeof r=="object"&&typeof r.then=="function"}_F.exports=Gv});var wF=l((EF,DF)=>{(function(){var r=this,e={};typeof EF<"u"?DF.exports=e:r.fuzzy=e,e.simpleFilter=function(t,n){return n.filter(function(i){return e.test(t,i)})},e.test=function(t,n){return e.match(t,n)!==null},e.match=function(t,n,i){i=i||{};var a=0,o=[],s=n.length,u=0,c=0,f=i.pre||"",p=i.post||"",v=i.caseSensitive&&n||n.toLowerCase(),b;t=i.caseSensitive&&t||t.toLowerCase();for(var y=0;y<s;y++)b=n[y],v[y]===t[a]?(b=f+b+p,a+=1,c+=1+c):c=0,u+=c,o[o.length]=b;return a===t.length?(u=v===t?1/0:u,{rendered:o.join(""),score:u}):null},e.filter=function(t,n,i){return!n||n.length===0?[]:typeof t!="string"?n:(i=i||{},n.reduce(function(a,o,s,u){var c=o;i.extract&&(c=i.extract(o));var f=e.match(t,c,i);return f!=null&&(a[a.length]={string:f.rendered,score:f.score,index:s,original:o}),a},[]).sort(function(a,o){var s=o.score-a.score;return s||a.index-o.index}))}})()});function $se(){try{return nm.default.statSync("/.dockerenv"),!0}catch{return!1}}function Vse(){try{return nm.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function im(){return tm===void 0&&(tm=$se()||Vse()),tm}var nm,tm,TF=Ye(()=>{nm=I(require("node:fs"),1)});function ta(){return am===void 0&&(am=zse()||im()),am}var kF,am,zse,om=Ye(()=>{kF=I(require("node:fs"),1);TF();zse=()=>{try{return kF.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var sm,RF,BF,IF,Eo,MF=Ye(()=>{sm=I(require("node:process"),1),RF=I(require("node:os"),1),BF=I(require("node:fs"),1);om();IF=()=>{if(sm.default.platform!=="linux")return!1;if(RF.default.release().toLowerCase().includes("microsoft"))return!ta();try{return BF.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ta():!1}catch{return!1}},Eo=sm.default.env.__IS_WSL_TEST__?IF:IF()});function Xt(r,e,t){let n=i=>Object.defineProperty(r,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get(){let i=t();return n(i),i},set(i){n(i)}}),r}var LF=Ye(()=>{});async function um(){if(UF.default.platform!=="darwin")throw new Error("macOS only");let{stdout:r}=await Kse("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),e=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(r);return(e==null?void 0:e.groups.id)??"com.apple.Safari"}var NF,UF,WF,Kse,$F=Ye(()=>{NF=require("node:util"),UF=I(require("node:process"),1),WF=require("node:child_process"),Kse=(0,NF.promisify)(WF.execFile)});async function KF(r,{humanReadableOutput:e=!0}={}){if(VF.default.platform!=="darwin")throw new Error("macOS only");let t=e?[]:["-ss"],{stdout:n}=await Gse("osascript",["-e",r,t]);return n.trim()}var VF,zF,cm,Gse,GF=Ye(()=>{VF=I(require("node:process"),1),zF=require("node:util"),cm=require("node:child_process"),Gse=(0,zF.promisify)(cm.execFile)});async function lm(r){return KF(`tell application "Finder" to set app_path to application file id "${r}" as string
|
|
62
62
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var HF=Ye(()=>{GF()});async function fm(r=Hse){let{stdout:e}=await r("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),t=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!t)throw new Nl(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=t.groups,i=Zse[n];if(!i)throw new Nl(`Unknown browser ID: ${n}`);return i}var ZF,YF,Hse,Zse,Nl,JF=Ye(()=>{ZF=require("node:util"),YF=require("node:child_process"),Hse=(0,ZF.promisify)(YF.execFile),Zse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Nl=class extends Error{}});async function dm(){if(Ul.default.platform==="darwin"){let r=await um();return{name:await lm(r),id:r}}if(Ul.default.platform==="linux"){let{stdout:r}=await Yse("xdg-mime",["query","default","x-scheme-handler/http"]),e=r.trim();return{name:Jse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Ul.default.platform==="win32")return fm();throw new Error("Only macOS, Linux, and Windows are supported")}var QF,Ul,XF,Yse,Jse,eS=Ye(()=>{QF=require("node:util"),Ul=I(require("node:process"),1),XF=require("node:child_process");$F();HF();JF();Yse=(0,QF.promisify)(XF.execFile),Jse=r=>r.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var uS={};JS(uS,{apps:()=>rn,default:()=>rue,openApp:()=>eue});function iS(r){if(typeof r=="string"||Array.isArray(r))return r;let{[tS]:e}=r;if(!e)throw new Error(`${tS} is not supported`);return e}function xm({[na]:r},{wsl:e}){if(e&&Eo)return iS(e);if(!r)throw new Error(`${na} is not supported`);return iS(r)}var Do,aS,pm,oS,sS,en,tue,hm,rS,na,tS,Qse,nS,wo,Xse,eue,rn,rue,cS=Ye(()=>{Do=I(require("node:process"),1),aS=require("node:buffer"),pm=I(require("node:path"),1),oS=require("node:url"),sS=I(require("node:child_process"),1),en=I(require("node:fs/promises"),1);MF();LF();eS();om();tue={},hm=pm.default.dirname((0,oS.fileURLToPath)(tue.url)),rS=pm.default.join(hm,"xdg-open"),{platform:na,arch:tS}=Do.default,Qse=(()=>{let r="/mnt/",e;return async function(){if(e)return e;let t="/etc/wsl.conf",n=!1;try{await en.default.access(t,en.constants.F_OK),n=!0}catch{}if(!n)return r;let i=await en.default.readFile(t,{encoding:"utf8"}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return a?(e=a.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):r}})(),nS=async(r,e)=>{let t;for(let n of r)try{return await e(n)}catch(i){t=i}throw t},wo=async r=>{if(r={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...r},Array.isArray(r.app))return nS(r.app,s=>wo({...r,app:s}));let{name:e,arguments:t=[]}=r.app??{};if(t=[...t],Array.isArray(e))return nS(e,s=>wo({...r,app:{name:s,arguments:t}}));if(e==="browser"||e==="browserPrivate"){let s={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await dm();if(c.id in s){let f=s[c.id];return e==="browserPrivate"&&t.push(u[f]),wo({...r,app:{name:rn[f],arguments:t}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],a={};if(na==="darwin")n="open",r.wait&&i.push("--wait-apps"),r.background&&i.push("--background"),r.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(na==="win32"||Eo&&!ta()&&!e){let s=await Qse();n=Eo?`${s}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Do.default.env.SYSTEMROOT||Do.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Eo||(a.windowsVerbatimArguments=!0);let u=["Start"];r.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),r.target&&t.push(r.target)):r.target&&u.push(`"${r.target}"`),t.length>0&&(t=t.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",t.join(","))),r.target=aS.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let s=!hm||hm==="/",u=!1;try{await en.default.access(rS,en.constants.X_OK),u=!0}catch{}n=Do.default.versions.electron??(na==="android"||s||!u)?"xdg-open":rS}t.length>0&&i.push(...t),r.wait||(a.stdio="ignore",a.detached=!0)}na==="darwin"&&t.length>0&&i.push("--args",...t),r.target&&i.push(r.target);let o=sS.default.spawn(n,i,a);return r.wait?new Promise((s,u)=>{o.once("error",u),o.once("close",c=>{if(!r.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}s(o)})}):(o.unref(),o)},Xse=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a `target`");return wo({...e,target:r})},eue=(r,e)=>{if(typeof r!="string"&&!Array.isArray(r))throw new TypeError("Expected a valid `name`");let{arguments:t=[]}=e??{};if(t!=null&&!Array.isArray(t))throw new TypeError("Expected `appArguments` as Array type");return wo({...e,app:{name:r,arguments:t}})};rn={};Xt(rn,"chrome",()=>xm({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Xt(rn,"firefox",()=>xm({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Xt(rn,"edge",()=>xm({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Xt(rn,"browser",()=>"browser");Xt(rn,"browserPrivate",()=>"browserPrivate");rue=Xse});var Wl=I(K()),vm=I(pr());var Re=I(K()),sF=I(pr());async function bt(r){console.log(`
|
|
63
|
-
${Re.default.bold.cyan("Package Details:")}`),console.log(Re.default.bold("ID: ")+r.id),console.log(Re.default.bold("Name: ")+r.name),console.log(Re.default.bold("Description: ")+r.description),console.log(Re.default.bold("Vendor: ")+r.vendor),console.log(Re.default.bold("License: ")+r.license),console.log(Re.default.bold("Source: ")+(r.sourceUrl||"Not available")),console.log(Re.default.bold("Homepage: ")+(r.homepage||"Not available")),console.log(Re.default.bold("Status: ")+(r.isInstalled?Re.default.green("Installed"):"Not installed")+(r.isVerified?"":Re.default.yellow(" (Unverified package)")));let e=[{name:r.isInstalled?"\u{1F504} Reinstall this package":"\u{1F4E6} Install this package",value:"install"},...r.isInstalled?[{name:"\u{1F5D1}\uFE0F Uninstall this package",value:"uninstall"}]:[],...r.sourceUrl?[{name:"\u{1F517} Open source URL",value:"open"}]:[],{name:"\u2B05\uFE0F Back to list",value:"back"},{name:"\u274C Exit",value:"exit"}],{action:t}=await sF.default.prompt([{type:"list",name:"action",message:"What would you like to do?",choices:e}]);return t}var Ke=I(require("node:fs")),Tl=I(require("node:os")),De=I(require("node:path")),Q=class Q{static getConfigPath(e){let t=De.default.dirname(Q.configPath);return!e||e.toLowerCase()==="claude"?Q.configPath:De.default.join(t,"..",e,`${e.toLowerCase()}_config.json`)}static readConfig(e){try{let t=Q.getConfigPath(e);return Ke.default.existsSync(t)?{mcpServers:JSON.parse(Ke.default.readFileSync(t,"utf8")).mcpServers||{}}:{mcpServers:{}}}catch(t){return console.error("Error reading config:",t),{mcpServers:{}}}}static writeConfig(e,t){try{let n=Q.getConfigPath(t),i=De.default.dirname(n);if(Ke.default.existsSync(i)||Ke.default.mkdirSync(i,{recursive:!0}),!e.mcpServers||typeof e.mcpServers!="object")throw new Error("Invalid config structure");Ke.default.writeFileSync(n,JSON.stringify(e,null,2))}catch(n){throw console.error("Error writing config:",n),n}}static readPreferences(){try{return Ke.default.existsSync(Q.preferencesPath)?JSON.parse(Ke.default.readFileSync(Q.preferencesPath,"utf8")):{}}catch{return{}}}static writePreferences(e){try{let t=De.default.dirname(Q.preferencesPath);Ke.default.existsSync(t)||Ke.default.mkdirSync(t,{recursive:!0}),Ke.default.writeFileSync(Q.preferencesPath,JSON.stringify(e,null,2))}catch(t){throw console.error("Error writing preferences:",t),t}}static isPackageInstalled(e,t){let n=Q.readConfig(t);return e in n.mcpServers}static async installPackage(e,t,n){try{let i=Q.readConfig(n);i.mcpServers[e]=t,Q.writeConfig(i,n)}catch(i){throw console.error("Error installing server:",i),i}}static async uninstallPackage(e,t){let n=Q.readConfig(t);if(!n.mcpServers[e]){console.log(`Server ${e} is not installed.`);return}delete n.mcpServers[e],Q.writeConfig(n,t)}static getServerConfig(e,t){return Q.readConfig(t).mcpServers[e]||null}};(()=>{if(process.platform==="win32"){let e=process.env.APPDATA||De.default.join(Tl.default.homedir(),"AppData","Roaming");Q.configPath=De.default.join(e,"Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,"smithery-cli","preferences.json")}else if(process.platform==="darwin"){let e=Tl.default.homedir();Q.configPath=De.default.join(e,"Library","Application Support","Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,".smithery-cli","preferences.json")}else{let e=Tl.default.homedir(),t=process.env.XDG_CONFIG_HOME||De.default.join(e,".config");Q.configPath=De.default.join(t,"Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,".smithery-cli","preferences.json")}})();var ge=Q;var pF=I(dF());pF.default.config();var yo=process.env.REGISTRY_ENDPOINT||"https://registry.smithery.ai";function _se(r){return ge.isPackageInstalled(r)}async function Xi(r){try{let e=await fetch(`${yo}/servers/`);if(!e.ok)throw new Error(`Failed to fetch packages: ${e.statusText} (${e.status})`);let t=await e.text();if(!t)throw new Error("Empty response received from registry");let n;try{n=JSON.parse(t)}catch(u){let c=u instanceof Error?u.message:"Unknown parsing error";throw new Error(`Invalid JSON response from registry: ${c}`)}let i=new Map;for(let u of n)i.set(u.id,{id:u.id||"",name:u.name||"",description:u.description||"",vendor:u.vendor||"",sourceUrl:u.sourceUrl||"",license:u.license||"",connections:u.connections||[],homepage:u.homepage||"",isInstalled:!1,isVerified:!0,client:r});let a=ge.readConfig(),o=Object.keys(a.mcpServers||{}),s=a.mcpServers||{};for(let u of o){let c=s[u],f=i.get(u);f?i.set(u,{...f,isInstalled:!0,client:r||f.client}):i.set(u,{...c,id:u||"",name:u||"",description:"Local package",vendor:"Local",sourceUrl:"",license:"",connections:[],homepage:"",isInstalled:!0,isVerified:!1,client:r})}return Array.from(i.values())}catch(e){throw new Error(`Failed to resolve packages: ${e instanceof Error?e.message:String(e)}`)}}function hF(r){if(r.startsWith("@")){let e=r.indexOf("/");if(e!==-1)return
|
|
63
|
+
${Re.default.bold.cyan("Package Details:")}`),console.log(Re.default.bold("ID: ")+r.id),console.log(Re.default.bold("Name: ")+r.name),console.log(Re.default.bold("Description: ")+r.description),console.log(Re.default.bold("Vendor: ")+r.vendor),console.log(Re.default.bold("License: ")+r.license),console.log(Re.default.bold("Source: ")+(r.sourceUrl||"Not available")),console.log(Re.default.bold("Homepage: ")+(r.homepage||"Not available")),console.log(Re.default.bold("Status: ")+(r.isInstalled?Re.default.green("Installed"):"Not installed")+(r.isVerified?"":Re.default.yellow(" (Unverified package)")));let e=[{name:r.isInstalled?"\u{1F504} Reinstall this package":"\u{1F4E6} Install this package",value:"install"},...r.isInstalled?[{name:"\u{1F5D1}\uFE0F Uninstall this package",value:"uninstall"}]:[],...r.sourceUrl?[{name:"\u{1F517} Open source URL",value:"open"}]:[],{name:"\u2B05\uFE0F Back to list",value:"back"},{name:"\u274C Exit",value:"exit"}],{action:t}=await sF.default.prompt([{type:"list",name:"action",message:"What would you like to do?",choices:e}]);return t}var Ke=I(require("node:fs")),Tl=I(require("node:os")),De=I(require("node:path")),Q=class Q{static getConfigPath(e){let t=De.default.dirname(Q.configPath);return!e||e.toLowerCase()==="claude"?Q.configPath:De.default.join(t,"..",e,`${e.toLowerCase()}_config.json`)}static readConfig(e){try{let t=Q.getConfigPath(e);return Ke.default.existsSync(t)?{mcpServers:JSON.parse(Ke.default.readFileSync(t,"utf8")).mcpServers||{}}:{mcpServers:{}}}catch(t){return console.error("Error reading config:",t),{mcpServers:{}}}}static writeConfig(e,t){try{let n=Q.getConfigPath(t),i=De.default.dirname(n);if(Ke.default.existsSync(i)||Ke.default.mkdirSync(i,{recursive:!0}),!e.mcpServers||typeof e.mcpServers!="object")throw new Error("Invalid config structure");Ke.default.writeFileSync(n,JSON.stringify(e,null,2))}catch(n){throw console.error("Error writing config:",n),n}}static readPreferences(){try{return Ke.default.existsSync(Q.preferencesPath)?JSON.parse(Ke.default.readFileSync(Q.preferencesPath,"utf8")):{}}catch{return{}}}static writePreferences(e){try{let t=De.default.dirname(Q.preferencesPath);Ke.default.existsSync(t)||Ke.default.mkdirSync(t,{recursive:!0}),Ke.default.writeFileSync(Q.preferencesPath,JSON.stringify(e,null,2))}catch(t){throw console.error("Error writing preferences:",t),t}}static isPackageInstalled(e,t){let n=Q.readConfig(t);return e in n.mcpServers}static async installPackage(e,t,n){try{let i=Q.readConfig(n);i.mcpServers[e]=t,Q.writeConfig(i,n)}catch(i){throw console.error("Error installing server:",i),i}}static async uninstallPackage(e,t){let n=Q.readConfig(t);if(!n.mcpServers[e]){console.log(`Server ${e} is not installed.`);return}delete n.mcpServers[e],Q.writeConfig(n,t)}static getServerConfig(e,t){return Q.readConfig(t).mcpServers[e]||null}};(()=>{if(process.platform==="win32"){let e=process.env.APPDATA||De.default.join(Tl.default.homedir(),"AppData","Roaming");Q.configPath=De.default.join(e,"Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,"smithery-cli","preferences.json")}else if(process.platform==="darwin"){let e=Tl.default.homedir();Q.configPath=De.default.join(e,"Library","Application Support","Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,".smithery-cli","preferences.json")}else{let e=Tl.default.homedir(),t=process.env.XDG_CONFIG_HOME||De.default.join(e,".config");Q.configPath=De.default.join(t,"Claude","claude_desktop_config.json"),Q.preferencesPath=De.default.join(e,".smithery-cli","preferences.json")}})();var ge=Q;var pF=I(dF());pF.default.config();var yo=process.env.REGISTRY_ENDPOINT||"https://registry.smithery.ai";function _se(r){return ge.isPackageInstalled(r)}async function Xi(r){try{let e=await fetch(`${yo}/servers/`);if(!e.ok)throw new Error(`Failed to fetch packages: ${e.statusText} (${e.status})`);let t=await e.text();if(!t)throw new Error("Empty response received from registry");let n;try{n=JSON.parse(t)}catch(u){let c=u instanceof Error?u.message:"Unknown parsing error";throw new Error(`Invalid JSON response from registry: ${c}`)}let i=new Map;for(let u of n)i.set(u.id,{id:u.id||"",name:u.name||"",description:u.description||"",vendor:u.vendor||"",sourceUrl:u.sourceUrl||"",license:u.license||"",connections:u.connections||[],homepage:u.homepage||"",isInstalled:!1,isVerified:!0,client:r});let a=ge.readConfig(),o=Object.keys(a.mcpServers||{}),s=a.mcpServers||{};for(let u of o){let c=s[u],f=i.get(u);f?i.set(u,{...f,isInstalled:!0,client:r||f.client}):i.set(u,{...c,id:u||"",name:u||"",description:"Local package",vendor:"Local",sourceUrl:"",license:"",connections:[],homepage:"",isInstalled:!0,isVerified:!1,client:r})}return Array.from(i.values())}catch(e){throw new Error(`Failed to resolve packages: ${e instanceof Error?e.message:String(e)}`)}}function hF(r){if(r.startsWith("@")){let e=r.indexOf("/");if(e!==-1)return`${r.substring(0,e)}-${r.substring(e+1)}`}return r}async function ea(r,e){var t;try{let n=await fetch(`${yo}/servers/${r}`);if(!n.ok){let o=ge.readConfig(),s=hF(r);return((t=o.mcpServers)==null?void 0:t[s])?{id:s,name:r,description:"Local package",vendor:"Local",sourceUrl:"",license:"",connections:[],homepage:"",isInstalled:!0,isVerified:!1,client:e}:null}let i=await n.json();return{id:hF(i.id),name:i.name,description:i.description,vendor:i.vendor,sourceUrl:i.sourceUrl,license:i.license,connections:i.connections,homepage:i.homepage,isInstalled:_se(i.id),isVerified:!0,client:e}}catch(n){return console.error("Error resolving package:",n),null}}async function xF(r,e){try{let t=await fetch(`${yo}/servers/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionType:"stdio",config:e})});if(!t.ok){if(t.status===404)return null;throw new Error(`Failed to get server configuration: ${t.statusText} (${t.status})`)}let n=await t.text();if(!n)throw new Error("Empty response received from registry");try{return JSON.parse(n)}catch(i){let a=i instanceof Error?i.message:"Unknown parsing error";throw new Error(`Invalid JSON response from registry: ${a}`)}}catch(t){return console.error("Error getting server configuration:",t),null}}var lS=I(Hv());var CF=I(pr()),FF=I(wF()),Zv=I(K());function kse(r,e=!1){let t=e?r.isInstalled?"\u2713 ":" ":"",n=(r.name||"").toString(),i=(r.description||"").toString(),a=(r.vendor||"").toString(),o=(r.id||"").toString(),s=20,u=15,c=45,f=15,p=(g,_)=>g.length<=_?g.padEnd(_):`${g.slice(0,_-3).padEnd(_-3)}...`,v=p(n,s),b=p(o,u),y=p(i,c),m=p(a,f);return{name:`${t}${v} \u2502 ${b} \u2502 ${y} \u2502 ${m}`,value:r,short:n}}function Bl(r,e={}){let t=r.map(n=>kse(n,e.showInstallStatus));return{type:"autocomplete",name:"selectedPackage",message:e.message||"Search and select a package:",source:async(n,i)=>i?FF.default.filter(i.toLowerCase(),t,{extract:a=>`${a.value.name} ${a.value.description} ${a.value.vendor}`.toLowerCase()}).map(a=>a.original):t,pageSize:10}}async function SF(r){let{confirmUninstall:e}=await CF.default.prompt([{type:"confirm",name:"confirmUninstall",message:`Are you sure you want to uninstall ${r}?`,default:!1}]);return e}function Ml(r,e="all"){console.log(Zv.default.bold.cyan(`
|
|
64
64
|
\u{1F4E6} ${e==="installed"?"Installed Packages":"Available Packages"}`)),console.log(Zv.default.gray(`Found ${r} ${e==="installed"?"installed ":""}packages
|
|
65
|
-
`))}var Co=I(K());var AF=require("node:child_process"),go=I(pr()),PF=require("node:util");var Jv=require("node:crypto");async function Ise(){let r=ge.readPreferences();return r.clientId||(r.clientId=(0,Jv.randomUUID)(),ge.writePreferences(r)),r.clientId}var Yv=class{constructor(){this.sessionId=(0,Jv.randomUUID)()}async trackInstallation(e,t){let n=await Ise(),i=await fetch(`${yo}/track`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_name:"server_install",localUserId:n,payload:{serverId:e,platform:process.platform,nodeVersion:process.version,sessionId:this.sessionId,clientType:t}})});if(!i.ok)throw new Error(`Failed to track installation: ${i.statusText} (${i.status})`)}},OF=new Yv;var rm=I(K());function em(r,e){let t=new Map;if(e!=null&&e.properties){let o=new Set(e.required||[]);Object.entries(e.properties).forEach(([s,u])=>{let c=u;t.set(s,{key:s,description:c.description||`Enter value for ${s}`,required:o.has(s),default:c.default,source:"schema"})})}let n=(o,s)=>{let u=o.replace(/\$|{|}/g,"");t.has(u)||t.set(u,{key:u,description:`Enter value for ${u}`,required:!1,source:s})};Qv(r.command||"",o=>n(o,"args")),(r.args||[]).forEach(o=>{Qv(o,s=>n(s,"args"))}),r.env&&Object.values(r.env).forEach(o=>{Qv(o,s=>n(s,"env"))});function i(){return Array.from(t.values())}return{getPrompts:i,fillTemplate:o=>{let s={},u=new Set;if(r.env){for(let[p,v]of Object.entries(r.env))(v.match(/\${([^}]+)}/g)||[]).forEach(y=>{let m=y.replace(/\${|}/g,"");u.add(m)});for(let[p,v]of Object.entries(r.env)){let b=qF(v,o);Xv(b)||(s[p]=b)}}let c=r.args||[],f=[];for(let p=0;p<c.length;p++){let v=c[p];if(!Xv(v)){f.push(v);continue}if((v.match(/\${([^}]+)}/g)||[]).some(g=>{let _=g.replace(/\${|}/g,"");return u.has(_)})){p>0&&f[f.length-1].startsWith("--")&&f.pop();continue}let m=qF(v,o);Xv(m)?p>0&&f[f.length-1].startsWith("--")&&f.pop():f.push(m)}return{command:r.command,args:f,env:Object.keys(s).length>0?s:void 0}}}}function Qv(r,e){(r.match(/\${([^}]+)}/g)||[]).forEach(e)}function qF(r,e){let t=r;for(let[n,i]of Object.entries(e))t=t.replace(new RegExp(`\\\${${n}}`,"g"),i);return t}function Xv(r){return r.includes("${")}var jr=(0,PF.promisify)(AF.exec);async function Rse(){let r=ge.readPreferences();if(typeof r.allowAnalytics=="boolean")return r.allowAnalytics;let{allowAnalytics:e}=await go.default.prompt([{type:"confirm",name:"allowAnalytics",message:"Would you like to help improve Smithery by sharing installation analytics?",default:!0}]);return ge.writePreferences({...r,allowAnalytics:e}),e}async function Bse(r,e){return OF.trackInstallation(r,e)}function Mse(r){var t;let e=(t=r.connections)==null?void 0:t[0];if(!(e!=null&&e.stdio))throw new Error("Invalid connection configuration");return e}async function Lse(r){var i,a;let{getPrompts:e,fillTemplate:t}=em(r.stdio,r.configSchema),n={};for(let o of e()){if(process.env[o.key]&&!o.required){let{reuseExisting:c}=await go.default.prompt([{type:"confirm",name:"reuseExisting",message:`Found ${o.key} in environment. Use it?`,default:!0}]);if(c){n[o.key]=process.env[o.key];continue}}let s=o.required?rm.default.red(" (required)"):rm.default.gray(" (optional)"),{value:u}=await go.default.prompt([{type:"input",name:"value",message:`${o.description}${s}`,default:(i=o.default)==null?void 0:i.toString(),validate:c=>o.required?!!c:!0}]);(u||o.default)&&(n[o.key]=u||((a=o.default)==null?void 0:a.toString())||"")}return n}async function Nse(r){let e=Mse(r),t=await Lse(e);console.log("
|
|
65
|
+
`))}var Co=I(K());var AF=require("node:child_process"),go=I(pr()),PF=require("node:util");var Jv=require("node:crypto");async function Ise(){let r=ge.readPreferences();return r.clientId||(r.clientId=(0,Jv.randomUUID)(),ge.writePreferences(r)),r.clientId}var Yv=class{constructor(){this.sessionId=(0,Jv.randomUUID)()}async trackInstallation(e,t){let n=await Ise(),i=await fetch(`${yo}/track`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_name:"server_install",localUserId:n,payload:{serverId:e,platform:process.platform,nodeVersion:process.version,sessionId:this.sessionId,clientType:t}})});if(!i.ok)throw new Error(`Failed to track installation: ${i.statusText} (${i.status})`)}},OF=new Yv;var rm=I(K());function em(r,e){let t=new Map;if(e!=null&&e.properties){let o=new Set(e.required||[]);Object.entries(e.properties).forEach(([s,u])=>{let c=u;t.set(s,{key:s,description:c.description||`Enter value for ${s}`,required:o.has(s),default:c.default,source:"schema"})})}let n=(o,s)=>{let u=o.replace(/\$|{|}/g,"");t.has(u)||t.set(u,{key:u,description:`Enter value for ${u}`,required:!1,source:s})};Qv(r.command||"",o=>n(o,"args")),(r.args||[]).forEach(o=>{Qv(o,s=>n(s,"args"))}),r.env&&Object.values(r.env).forEach(o=>{Qv(o,s=>n(s,"env"))});function i(){return Array.from(t.values())}return{getPrompts:i,fillTemplate:o=>{let s={},u=new Set;if(r.env){for(let[p,v]of Object.entries(r.env))(v.match(/\${([^}]+)}/g)||[]).forEach(y=>{let m=y.replace(/\${|}/g,"");u.add(m)});for(let[p,v]of Object.entries(r.env)){let b=qF(v,o);Xv(b)||(s[p]=b)}}let c=r.args||[],f=[];for(let p=0;p<c.length;p++){let v=c[p];if(!Xv(v)){f.push(v);continue}if((v.match(/\${([^}]+)}/g)||[]).some(g=>{let _=g.replace(/\${|}/g,"");return u.has(_)})){p>0&&f[f.length-1].startsWith("--")&&f.pop();continue}let m=qF(v,o);Xv(m)?p>0&&f[f.length-1].startsWith("--")&&f.pop():f.push(m)}return{command:r.command,args:f,env:Object.keys(s).length>0?s:void 0}}}}function Qv(r,e){(r.match(/\${([^}]+)}/g)||[]).forEach(e)}function qF(r,e){let t=r;for(let[n,i]of Object.entries(e))t=t.replace(new RegExp(`\\\${${n}}`,"g"),i);return t}function Xv(r){return r.includes("${")}var jr=(0,PF.promisify)(AF.exec);async function Rse(){let r=ge.readPreferences();if(typeof r.allowAnalytics=="boolean")return r.allowAnalytics;let{allowAnalytics:e}=await go.default.prompt([{type:"confirm",name:"allowAnalytics",message:"Would you like to help improve Smithery by sharing installation analytics?",default:!0}]);return ge.writePreferences({...r,allowAnalytics:e}),e}async function Bse(r,e){return OF.trackInstallation(r,e)}function Mse(r){var t;let e=(t=r.connections)==null?void 0:t[0];if(!(e!=null&&e.stdio))throw new Error("Invalid connection configuration");return e}async function Lse(r){var i,a;let{getPrompts:e,fillTemplate:t}=em(r.stdio,r.configSchema),n={};for(let o of e()){if(process.env[o.key]&&!o.required){let{reuseExisting:c}=await go.default.prompt([{type:"confirm",name:"reuseExisting",message:`Found ${o.key} in environment. Use it?`,default:!0}]);if(c){n[o.key]=process.env[o.key];continue}}let s=o.required?rm.default.red(" (required)"):rm.default.gray(" (optional)"),{value:u}=await go.default.prompt([{type:"input",name:"value",message:`${o.description}${s}`,default:(i=o.default)==null?void 0:i.toString(),validate:c=>o.required?!!c:!0}]);(u||o.default)&&(n[o.key]=u||((a=o.default)==null?void 0:a.toString())||"")}return n}async function Nse(r){let e=Mse(r),t=await Lse(e);console.log("Pulling configuration for:",r.id);let n=await xF(r.id,t);if(n)return{env:n.env||{},args:n.args||[]};console.log("\u26A0\uFE0F Falling back to local command generation");let{fillTemplate:i}=em(e.stdio,e.configSchema),a=i(t);return console.log("Local generation result:",{args:a.args,env:a.env?Object.keys(a.env):[]}),{env:a.env||{},args:a.args||[]}}async function Use(r){if(!r)return!1;try{let e=process.platform,t={claude:"Claude"}[r]||r;if(e==="win32"){let{stdout:n}=await jr(`tasklist /FI "IMAGENAME eq ${t}.exe" /NH`);return n.includes(`${t}.exe`)}else if(e==="darwin"){let{stdout:n}=await jr(`pgrep -x "${t}"`);return!!n.trim()}else if(e==="linux"){let{stdout:n}=await jr(`pgrep -f "${t.toLowerCase()}"`);return!!n.trim()}return!1}catch{return!1}}async function Wse(r){let e={claude:"Claude",jan:"Jan"}[r]||r;try{let t=process.platform;t==="win32"?await jr(`taskkill /F /IM "${e}.exe" && start "" "${e}.exe"`):t==="darwin"?await jr(`killall "${e}" && open -a "${e}"`):t==="linux"&&await jr(`pkill -f "${e.toLowerCase()}" && ${e.toLowerCase()}`),await new Promise(n=>setTimeout(n,2e3)),t==="win32"?await jr(`start "" "${e}.exe"`):t==="darwin"?await jr(`open -a "${e}"`):t==="linux"&&await jr(e.toLowerCase()),console.log(`${e} has been restarted.`)}catch(t){console.error(`Failed to restart ${e}:`,t)}}async function jF(r){if(!r||!await Use(r))return!1;let{shouldRestart:t}=await go.default.prompt([{type:"confirm",name:"shouldRestart",message:`Would you like to restart the ${r} app to apply changes?`,default:!0}]);return t&&(console.log(`Restarting ${r} app...`),await Wse(r)),t}async function _o(r){var e;try{let{env:t,args:n}=await Nse(r),a={command:((e=r.connections)==null?void 0:e[0]).stdio.command,args:n,env:Object.keys(t).length>0?t:void 0};await ge.installPackage(r.id,a,r.client),console.log(`Updated ${r.client||"default"} configuration`),await Rse()&&await Bse(r.id,r.client),await jF(r.client)}catch(t){throw console.error("Failed to install package:",t),t}}async function Ll(r,e){try{await ge.uninstallPackage(r),console.log(`
|
|
66
66
|
Uninstalled ${r}`),await jF(e)}catch(t){throw console.error("Failed to uninstall package:",t),t}}async function tn(r,e,t,n=!0){switch(e){case"install":console.log(Co.default.cyan(`
|
|
67
67
|
Preparing to install ${r.name}...`)),await _o(r),r.isInstalled=!0,t.onInstall&&await t.onInstall(r);break;case"uninstall":if(await SF(r.name)){if(await Ll(r.id),console.log(Co.default.green(`Successfully uninstalled ${r.name}`)),r.isInstalled=!1,t.onUninstall){await t.onUninstall(r);return}}else console.log("Uninstallation cancelled.");break;case"open":if(r.sourceUrl){let i=(await Promise.resolve().then(()=>(cS(),uS))).default;await i(r.sourceUrl),console.log(Co.default.green(`
|
|
68
68
|
Opened ${r.sourceUrl} in your browser`))}else console.log(Co.default.yellow(`
|
|
@@ -72,7 +72,7 @@ Successfully uninstalled ${r}`)),console.log(yt.default.yellow(`
|
|
|
72
72
|
Note: Please restart Claude for the changes to take effect.`))}catch(e){console.error(yt.default.red("Failed to uninstall package:")),console.error(yt.default.red(e instanceof Error?e.message:String(e))),process.exit(1)}}var gm=I(pr()),pS=I(K());var xS=I(Hv());gm.default.registerPrompt("autocomplete",xS.default);async function $l(){let e=(await Xi()).filter(a=>a.isInstalled);if(e.length===0){console.log(pS.default.yellow(`
|
|
73
73
|
No MCP servers are currently installed.`));return}Ml(e.length,"installed");let t=Bl(e,{message:"Search and select a package:"}),n=await gm.default.prompt([t]);if(!n.selectedPackage)return;let i=await bt(n.selectedPackage);await tn(n.selectedPackage,i,{onUninstall:()=>$l(),onBack:$l})}var So=I(K());async function vS(r){try{let e=await ea(r);if(!e){console.log(So.default.yellow(`No package found with ID: ${r}`));return}let t=await bt(e);await tn(e,t,{})}catch(e){console.error(So.default.red("Error loading package:")),e instanceof Error&&e.message.includes("fetch")?console.error(So.default.red("Failed to connect to the package registry. Please check your internet connection.")):console.error(So.default.red(e instanceof Error?e.message:String(e))),process.exit(1)}}var Im=I(pr()),En=I(K());var M;(function(r){r.assertEqual=i=>i;function e(i){}r.assertIs=e;function t(i){throw new Error}r.assertNever=t,r.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},r.getValidEnumValues=i=>{let a=r.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return r.objectValues(o)},r.objectValues=i=>r.objectKeys(i).map(function(a){return i[a]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},r.find=(i,a)=>{for(let o of i)if(a(o))return o},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(M||(M={}));var Em;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Em||(Em={}));var C=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kr=r=>{switch(typeof r){case"undefined":return C.undefined;case"string":return C.string;case"number":return isNaN(r)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(r)?C.array:r===null?C.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?C.promise:typeof Map<"u"&&r instanceof Map?C.map:typeof Set<"u"&&r instanceof Set?C.set:typeof Date<"u"&&r instanceof Date?C.date:C.object;default:return C.unknown}},E=M.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"]),aue=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),we=class r 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 t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let s=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(o))):s[c]=s[c]||{_errors:[]},s=s[c],u++}}};return i(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};we.create=r=>new we(r);var oa=(r,e)=>{let t;switch(r.code){case E.invalid_type:r.received===C.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case E.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,M.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:t=`Unrecognized key(s) in object: ${M.joinValues(r.keys,", ")}`;break;case E.invalid_union:t="Invalid input";break;case E.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${M.joinValues(r.options)}`;break;case E.invalid_enum_value:t=`Invalid enum value. Expected ${M.joinValues(r.options)}, received '${r.received}'`;break;case E.invalid_arguments:t="Invalid function arguments";break;case E.invalid_return_type:t="Invalid function return type";break;case E.invalid_date:t="Invalid date";break;case E.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:M.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case E.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case E.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case E.custom:t="Invalid input";break;case E.invalid_intersection_types:t="Intersection results could not be merged";break;case E.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case E.not_finite:t="Number must be finite";break;default:t=e.defaultError,M.assertNever(r)}return{message:t}},yS=oa;function oue(r){yS=r}function Vl(){return yS}var zl=r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,a=[...t,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)s=c(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}},sue=[];function D(r,e){let t=Vl(),n=zl({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===oa?void 0:oa].filter(i=>!!i)});r.common.issues.push(n)}var he=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return A;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return A;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},A=Object.freeze({status:"aborted"}),aa=r=>({status:"dirty",value:r}),pe=r=>({status:"valid",value:r}),Dm=r=>r.status==="aborted",wm=r=>r.status==="dirty",nn=r=>r.status==="valid",Ao=r=>typeof Promise<"u"&&r instanceof Promise;function Kl(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function gS(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}var O;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(O||(O={}));var Oo,qo,Me=class{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},mS=(r,e)=>{if(nn(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new we(r.common.issues);return this._error=t,this._error}}};function j(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||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:(o,s)=>{var u,c;let{message:f}=r;return o.code==="invalid_enum_value"?{message:f??s.defaultError}:typeof s.data>"u"?{message:(u=f??n)!==null&&u!==void 0?u:s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:(c=f??t)!==null&&c!==void 0?c:s.defaultError}},description:i}}var T=class{get description(){return this._def.description}_getType(e){return kr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:kr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new he,ctx:{common:e.parent.common,data:e.data,parsedType:kr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ao(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kr(e)},a=this._parseSync({data:e,path:i.path,parent:i});return mS(i,a)}"~validate"(e){var t,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kr(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:i});return nn(a)?{value:a.value}:{issues:i.common.issues}}catch(a){!((n=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(a=>nn(a)?{value:a.value}:{issues:i.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kr(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Ao(i)?i:Promise.resolve(i));return mS(n,a)}refine(e,t){let n=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:E.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Ce({schema:this,typeName:q.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:t=>this["~validate"](t)}}optional(){return Be.create(this,this._def)}nullable(){return vr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rr.create(this)}promise(){return Et.create(this,this._def)}or(e){return fn.create([this,e],this._def)}and(e){return dn.create(this,e,this._def)}transform(e){return new Ce({...j(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new mn({...j(this._def),innerType:this,defaultValue:t,typeName:q.ZodDefault})}brand(){return new Po({typeName:q.ZodBranded,type:this,...j(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new bn({...j(this._def),innerType:this,catchValue:t,typeName:q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return jo.create(this,e)}readonly(){return yn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},uue=/^c[^\s-]{8,}$/i,cue=/^[0-9a-z]+$/,lue=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fue=/^[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,due=/^[a-z0-9_-]{21}$/i,hue=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pue=/^[-+]?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)?)??$/,xue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vue="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_m,mue=/^(?:(?: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])$/,bue=/^(?:(?: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])$/,yue=/^(([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]))$/,gue=/^(([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])$/,_ue=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Eue=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_S="((\\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])))",Due=new RegExp(`^${_S}$`);function ES(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function wue(r){return new RegExp(`^${ES(r)}$`)}function DS(r){let e=`${_S}T${ES(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Cue(r,e){return!!((e==="v4"||!e)&&mue.test(r)||(e==="v6"||!e)&&yue.test(r))}function Fue(r,e){if(!hue.test(r))return!1;try{let[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function Sue(r,e){return!!((e==="v4"||!e)&&bue.test(r)||(e==="v6"||!e)&&gue.test(r))}var gt=class r extends T{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==C.string){let a=this._getOrReturnCtx(e);return D(a,{code:E.invalid_type,expected:C.string,received:a.parsedType}),A}let n=new he,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),D(i,{code:E.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),D(i,{code:E.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?D(i,{code:E.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&D(i,{code:E.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")xue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"email",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")_m||(_m=new RegExp(vue,"u")),_m.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"emoji",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")fue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"uuid",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")due.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"nanoid",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")uue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"cuid",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")cue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"cuid2",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")lue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"ulid",code:E.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),D(i,{validation:"url",code:E.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),D(i,{validation:"regex",code:E.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),D(i,{code:E.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),D(i,{code:E.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),D(i,{code:E.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?DS(a).test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{code:E.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Due.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{code:E.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?wue(a).test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{code:E.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?pue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"duration",code:E.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Cue(e.data,a.version)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"ip",code:E.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Fue(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"jwt",code:E.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Sue(e.data,a.version)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"cidr",code:E.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?_ue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"base64",code:E.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Eue.test(e.data)||(i=this._getOrReturnCtx(e,i),D(i,{validation:"base64url",code:E.invalid_string,message:a.message}),n.dirty()):M.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:E.invalid_string,...O.errToObj(n)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...O.errToObj(e)})}url(e){return this._addCheck({kind:"url",...O.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...O.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...O.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...O.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...O.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...O.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...O.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...O.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...O.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...O.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...O.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...O.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...O.errToObj(e==null?void 0: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==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...O.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...O.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...O.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...O.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...O.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...O.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...O.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...O.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...O.errToObj(t)})}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};gt.create=r=>{var e;return new gt({checks:[],typeName:q.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...j(r)})};function Oue(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,a=parseInt(r.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return a%o/Math.pow(10,i)}var an=class r extends T{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)!==C.number){let a=this._getOrReturnCtx(e);return D(a,{code:E.invalid_type,expected:C.number,received:a.parsedType}),A}let n,i=new he;for(let a of this._def.checks)a.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:E.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),D(n,{code:E.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),D(n,{code:E.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Oue(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),D(n,{code:E.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:E.not_finite,message:a.message}),i.dirty()):M.assertNever(a);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,O.toString(t))}gt(e,t){return this.setLimit("min",e,!1,O.toString(t))}lte(e,t){return this.setLimit("max",e,!0,O.toString(t))}lt(e,t){return this.setLimit("max",e,!1,O.toString(t))}setLimit(e,t,n,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:O.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};an.create=r=>new an({checks:[],typeName:q.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...j(r)});var on=class r extends T{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)!==C.bigint)return this._getInvalidInput(e);let n,i=new he;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),D(n,{code:E.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),D(n,{code:E.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),D(n,{code:E.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):M.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return D(t,{code:E.invalid_type,expected:C.bigint,received:t.parsedType}),A}gte(e,t){return this.setLimit("min",e,!0,O.toString(t))}gt(e,t){return this.setLimit("min",e,!1,O.toString(t))}lte(e,t){return this.setLimit("max",e,!0,O.toString(t))}lt(e,t){return this.setLimit("max",e,!1,O.toString(t))}setLimit(e,t,n,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:O.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};on.create=r=>{var e;return new on({checks:[],typeName:q.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...j(r)})};var sn=class extends T{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==C.boolean){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.boolean,received:n.parsedType}),A}return pe(e.data)}};sn.create=r=>new sn({typeName:q.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...j(r)});var un=class r extends T{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==C.date){let a=this._getOrReturnCtx(e);return D(a,{code:E.invalid_type,expected:C.date,received:a.parsedType}),A}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return D(a,{code:E.invalid_date}),A}let n=new he,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),D(i,{code:E.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),D(i,{code:E.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):M.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};un.create=r=>new un({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:q.ZodDate,...j(r)});var sa=class extends T{_parse(e){if(this._getType(e)!==C.symbol){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.symbol,received:n.parsedType}),A}return pe(e.data)}};sa.create=r=>new sa({typeName:q.ZodSymbol,...j(r)});var cn=class extends T{_parse(e){if(this._getType(e)!==C.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.undefined,received:n.parsedType}),A}return pe(e.data)}};cn.create=r=>new cn({typeName:q.ZodUndefined,...j(r)});var ln=class extends T{_parse(e){if(this._getType(e)!==C.null){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.null,received:n.parsedType}),A}return pe(e.data)}};ln.create=r=>new ln({typeName:q.ZodNull,...j(r)});var _t=class extends T{constructor(){super(...arguments),this._any=!0}_parse(e){return pe(e.data)}};_t.create=r=>new _t({typeName:q.ZodAny,...j(r)});var Ir=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pe(e.data)}};Ir.create=r=>new Ir({typeName:q.ZodUnknown,...j(r)});var Ge=class extends T{_parse(e){let t=this._getOrReturnCtx(e);return D(t,{code:E.invalid_type,expected:C.never,received:t.parsedType}),A}};Ge.create=r=>new Ge({typeName:q.ZodNever,...j(r)});var ua=class extends T{_parse(e){if(this._getType(e)!==C.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.void,received:n.parsedType}),A}return pe(e.data)}};ua.create=r=>new ua({typeName:q.ZodVoid,...j(r)});var Rr=class r extends T{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==C.array)return D(t,{code:E.invalid_type,expected:C.array,received:t.parsedType}),A;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,s=t.data.length<i.exactLength.value;(o||s)&&(D(t,{code:o?E.too_big:E.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(D(t,{code:E.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(D(t,{code:E.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new Me(t,o,t.path,s)))).then(o=>he.mergeArray(n,o));let a=[...t.data].map((o,s)=>i.type._parseSync(new Me(t,o,t.path,s)));return he.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:O.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:O.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:O.toString(t)}})}nonempty(e){return this.min(1,e)}};Rr.create=(r,e)=>new Rr({type:r,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...j(e)});function ia(r){if(r instanceof _e){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Be.create(ia(n))}return new _e({...r._def,shape:()=>e})}else return r instanceof Rr?new Rr({...r._def,type:ia(r.element)}):r instanceof Be?Be.create(ia(r.unwrap())):r instanceof vr?vr.create(ia(r.unwrap())):r instanceof xr?xr.create(r.items.map(e=>ia(e))):r}var _e=class r extends T{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(),t=M.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==C.object){let c=this._getOrReturnCtx(e);return D(c,{code:E.invalid_type,expected:C.object,received:c.parsedType}),A}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Ge&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||s.push(c);let u=[];for(let c of o){let f=a[c],p=i.data[c];u.push({key:{status:"valid",value:c},value:f._parse(new Me(i,p,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ge){let c=this._def.unknownKeys;if(c==="passthrough")for(let f of s)u.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(c==="strict")s.length>0&&(D(i,{code:E.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let f of s){let p=i.data[f];u.push({key:{status:"valid",value:f},value:c._parse(new Me(i,p,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let f of u){let p=await f.key,v=await f.value;c.push({key:p,value:v,alwaysSet:f.alwaysSet})}return c}).then(c=>he.mergeObjectSync(n,c)):he.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,a,o,s;let u=(o=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(s=O.errToObj(e).message)!==null&&s!==void 0?s:u}:{message:u}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};return M.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new r({...this._def,shape:()=>t})}omit(e){let t={};return M.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new r({...this._def,shape:()=>t})}deepPartial(){return ia(this)}partial(e){let t={};return M.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new r({...this._def,shape:()=>t})}required(e){let t={};return M.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Be;)a=a._def.innerType;t[n]=a}}),new r({...this._def,shape:()=>t})}keyof(){return wS(M.objectKeys(this.shape))}};_e.create=(r,e)=>new _e({shape:()=>r,unknownKeys:"strip",catchall:Ge.create(),typeName:q.ZodObject,...j(e)});_e.strictCreate=(r,e)=>new _e({shape:()=>r,unknownKeys:"strict",catchall:Ge.create(),typeName:q.ZodObject,...j(e)});_e.lazycreate=(r,e)=>new _e({shape:r,unknownKeys:"strip",catchall:Ge.create(),typeName:q.ZodObject,...j(e)});var fn=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new we(s.ctx.common.issues));return D(t,{code:E.invalid_union,unionErrors:o}),A}if(t.common.async)return Promise.all(n.map(async a=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let u of n){let c={...t,common:{...t.common,issues:[]},parent:null},f=u._parseSync({data:t.data,path:t.path,parent:c});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(u=>new we(u));return D(t,{code:E.invalid_union,unionErrors:s}),A}}get options(){return this._def.options}};fn.create=(r,e)=>new fn({options:r,typeName:q.ZodUnion,...j(e)});var Tr=r=>r instanceof hn?Tr(r.schema):r instanceof Ce?Tr(r.innerType()):r instanceof pn?[r.value]:r instanceof xn?r.options:r instanceof vn?M.objectValues(r.enum):r instanceof mn?Tr(r._def.innerType):r instanceof cn?[void 0]:r instanceof ln?[null]:r instanceof Be?[void 0,...Tr(r.unwrap())]:r instanceof vr?[null,...Tr(r.unwrap())]:r instanceof Po||r instanceof yn?Tr(r.unwrap()):r instanceof bn?Tr(r._def.innerType):[],Gl=class r extends T{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==C.object)return D(t,{code:E.invalid_type,expected:C.object,received:t.parsedType}),A;let n=this.discriminator,i=t.data[n],a=this.optionsMap.get(i);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(D(t,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let a of t){let o=Tr(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new r({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...j(n)})}};function Cm(r,e){let t=kr(r),n=kr(e);if(r===e)return{valid:!0,data:r};if(t===C.object&&n===C.object){let i=M.objectKeys(e),a=M.objectKeys(r).filter(s=>i.indexOf(s)!==-1),o={...r,...e};for(let s of a){let u=Cm(r[s],e[s]);if(!u.valid)return{valid:!1};o[s]=u.data}return{valid:!0,data:o}}else if(t===C.array&&n===C.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<r.length;a++){let o=r[a],s=e[a],u=Cm(o,s);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===C.date&&n===C.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var dn=class extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(Dm(a)||Dm(o))return A;let s=Cm(a.value,o.value);return s.valid?((wm(a)||wm(o))&&t.dirty(),{status:t.value,value:s.data}):(D(n,{code:E.invalid_intersection_types}),A)};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,o])=>i(a,o)):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}))}};dn.create=(r,e,t)=>new dn({left:r,right:e,typeName:q.ZodIntersection,...j(t)});var xr=class r extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.array)return D(n,{code:E.invalid_type,expected:C.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return D(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...n.data].map((o,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new Me(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>he.mergeArray(t,o)):he.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};xr.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xr({items:r,typeName:q.ZodTuple,rest:null,...j(e)})};var Hl=class r extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.object)return D(n,{code:E.invalid_type,expected:C.object,received:n.parsedType}),A;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new Me(n,s,n.path,s)),value:o._parse(new Me(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?he.mergeObjectAsync(t,i):he.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof T?new r({keyType:e,valueType:t,typeName:q.ZodRecord,...j(n)}):new r({keyType:gt.create(),valueType:e,typeName:q.ZodRecord,...j(t)})}},ca=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.map)return D(n,{code:E.invalid_type,expected:C.map,received:n.parsedType}),A;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,u],c)=>({key:i._parse(new Me(n,s,n.path,[c,"key"])),value:a._parse(new Me(n,u,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,f=await u.value;if(c.status==="aborted"||f.status==="aborted")return A;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),s.set(c.value,f.value)}return{status:t.value,value:s}})}else{let s=new Map;for(let u of o){let c=u.key,f=u.value;if(c.status==="aborted"||f.status==="aborted")return A;(c.status==="dirty"||f.status==="dirty")&&t.dirty(),s.set(c.value,f.value)}return{status:t.value,value:s}}}};ca.create=(r,e,t)=>new ca({valueType:e,keyType:r,typeName:q.ZodMap,...j(t)});var la=class r extends T{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==C.set)return D(n,{code:E.invalid_type,expected:C.set,received:n.parsedType}),A;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(D(n,{code:E.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(D(n,{code:E.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let a=this._def.valueType;function o(u){let c=new Set;for(let f of u){if(f.status==="aborted")return A;f.status==="dirty"&&t.dirty(),c.add(f.value)}return{status:t.value,value:c}}let s=[...n.data.values()].map((u,c)=>a._parse(new Me(n,u,n.path,c)));return n.common.async?Promise.all(s).then(u=>o(u)):o(s)}min(e,t){return new r({...this._def,minSize:{value:e,message:O.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:O.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};la.create=(r,e)=>new la({valueType:r,minSize:null,maxSize:null,typeName:q.ZodSet,...j(e)});var Zl=class r extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==C.function)return D(t,{code:E.invalid_type,expected:C.function,received:t.parsedType}),A;function n(s,u){return zl({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Vl(),oa].filter(c=>!!c),issueData:{code:E.invalid_arguments,argumentsError:u}})}function i(s,u){return zl({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Vl(),oa].filter(c=>!!c),issueData:{code:E.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Et){let s=this;return pe(async function(...u){let c=new we([]),f=await s._def.args.parseAsync(u,a).catch(b=>{throw c.addIssue(n(u,b)),c}),p=await Reflect.apply(o,this,f);return await s._def.returns._def.type.parseAsync(p,a).catch(b=>{throw c.addIssue(i(p,b)),c})})}else{let s=this;return pe(function(...u){let c=s._def.args.safeParse(u,a);if(!c.success)throw new we([n(u,c.error)]);let f=Reflect.apply(o,this,c.data),p=s._def.returns.safeParse(f,a);if(!p.success)throw new we([i(f,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:xr.create(e).rest(Ir.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r({args:e||xr.create([]).rest(Ir.create()),returns:t||Ir.create(),typeName:q.ZodFunction,...j(n)})}},hn=class extends T{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};hn.create=(r,e)=>new hn({getter:r,typeName:q.ZodLazy,...j(e)});var pn=class extends T{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return D(t,{received:t.data,code:E.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};pn.create=(r,e)=>new pn({value:r,typeName:q.ZodLiteral,...j(e)});function wS(r,e){return new xn({values:r,typeName:q.ZodEnum,...j(e)})}var xn=class r extends T{constructor(){super(...arguments),Oo.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return D(t,{expected:M.joinValues(n),received:t.parsedType,code:E.invalid_type}),A}if(Kl(this,Oo,"f")||gS(this,Oo,new Set(this._def.values),"f"),!Kl(this,Oo,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return D(t,{received:t.data,code:E.invalid_enum_value,options:n}),A}return pe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};Oo=new WeakMap;xn.create=wS;var vn=class extends T{constructor(){super(...arguments),qo.set(this,void 0)}_parse(e){let t=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==C.string&&n.parsedType!==C.number){let i=M.objectValues(t);return D(n,{expected:M.joinValues(i),received:n.parsedType,code:E.invalid_type}),A}if(Kl(this,qo,"f")||gS(this,qo,new Set(M.getValidEnumValues(this._def.values)),"f"),!Kl(this,qo,"f").has(e.data)){let i=M.objectValues(t);return D(n,{received:n.data,code:E.invalid_enum_value,options:i}),A}return pe(e.data)}get enum(){return this._def.values}};qo=new WeakMap;vn.create=(r,e)=>new vn({values:r,typeName:q.ZodNativeEnum,...j(e)});var Et=class extends T{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==C.promise&&t.common.async===!1)return D(t,{code:E.invalid_type,expected:C.promise,received:t.parsedType}),A;let n=t.parsedType===C.promise?t.data:Promise.resolve(t.data);return pe(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Et.create=(r,e)=>new Et({type:r,typeName:q.ZodPromise,...j(e)});var Ce=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{D(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(t.value==="aborted")return A;let u=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return u.status==="aborted"?A:u.status==="dirty"||t.value==="dirty"?aa(u.value):u});{if(t.value==="aborted")return A;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?A:s.status==="dirty"||t.value==="dirty"?aa(s.value):s}}if(i.type==="refinement"){let o=s=>{let u=i.refinement(s,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 s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?A:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?A:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!nn(o))return o;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>nn(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:t.value,value:s})):o);M.assertNever(i)}};Ce.create=(r,e,t)=>new Ce({schema:r,typeName:q.ZodEffects,effect:e,...j(t)});Ce.createWithPreprocess=(r,e,t)=>new Ce({schema:e,effect:{type:"preprocess",transform:r},typeName:q.ZodEffects,...j(t)});var Be=class extends T{_parse(e){return this._getType(e)===C.undefined?pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Be.create=(r,e)=>new Be({innerType:r,typeName:q.ZodOptional,...j(e)});var vr=class extends T{_parse(e){return this._getType(e)===C.null?pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};vr.create=(r,e)=>new vr({innerType:r,typeName:q.ZodNullable,...j(e)});var mn=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===C.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};mn.create=(r,e)=>new mn({innerType:r,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var bn=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ao(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new we(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new we(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};bn.create=(r,e)=>new bn({innerType:r,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var fa=class extends T{_parse(e){if(this._getType(e)!==C.nan){let n=this._getOrReturnCtx(e);return D(n,{code:E.invalid_type,expected:C.nan,received:n.parsedType}),A}return{status:"valid",value:e.data}}};fa.create=r=>new fa({typeName:q.ZodNaN,...j(r)});var que=Symbol("zod_brand"),Po=class extends T{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},jo=class r extends T{_parse(e){let{status:t,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"?A:a.status==="dirty"?(t.dirty(),aa(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"?A:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:q.ZodPipeline})}},yn=class extends T{_parse(e){let t=this._def.innerType._parse(e),n=i=>(nn(i)&&(i.value=Object.freeze(i.value)),i);return Ao(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};yn.create=(r,e)=>new yn({innerType:r,typeName:q.ZodReadonly,...j(e)});function CS(r,e={},t){return r?_t.create().superRefine((n,i)=>{var a,o;if(!r(n)){let s=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(a=s.fatal)!==null&&a!==void 0?a:t)!==null&&o!==void 0?o:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:u})}}):_t.create()}var Aue={object:_e.lazycreate},q;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(q||(q={}));var Pue=(r,e={message:`Input not instance of ${r.name}`})=>CS(t=>t instanceof r,e),FS=gt.create,SS=an.create,jue=fa.create,Tue=on.create,OS=sn.create,kue=un.create,Iue=sa.create,Rue=cn.create,Bue=ln.create,Mue=_t.create,Lue=Ir.create,Nue=Ge.create,Uue=ua.create,Wue=Rr.create,$ue=_e.create,Vue=_e.strictCreate,zue=fn.create,Kue=Gl.create,Gue=dn.create,Hue=xr.create,Zue=Hl.create,Yue=ca.create,Jue=la.create,Que=Zl.create,Xue=hn.create,ece=pn.create,rce=xn.create,tce=vn.create,nce=Et.create,bS=Ce.create,ice=Be.create,ace=vr.create,oce=Ce.createWithPreprocess,sce=jo.create,uce=()=>FS().optional(),cce=()=>SS().optional(),lce=()=>OS().optional(),fce={string:r=>gt.create({...r,coerce:!0}),number:r=>an.create({...r,coerce:!0}),boolean:r=>sn.create({...r,coerce:!0}),bigint:r=>on.create({...r,coerce:!0}),date:r=>un.create({...r,coerce:!0})},dce=A,h=Object.freeze({__proto__:null,defaultErrorMap:oa,setErrorMap:oue,getErrorMap:Vl,makeIssue:zl,EMPTY_PATH:sue,addIssueToContext:D,ParseStatus:he,INVALID:A,DIRTY:aa,OK:pe,isAborted:Dm,isDirty:wm,isValid:nn,isAsync:Ao,get util(){return M},get objectUtil(){return Em},ZodParsedType:C,getParsedType:kr,ZodType:T,datetimeRegex:DS,ZodString:gt,ZodNumber:an,ZodBigInt:on,ZodBoolean:sn,ZodDate:un,ZodSymbol:sa,ZodUndefined:cn,ZodNull:ln,ZodAny:_t,ZodUnknown:Ir,ZodNever:Ge,ZodVoid:ua,ZodArray:Rr,ZodObject:_e,ZodUnion:fn,ZodDiscriminatedUnion:Gl,ZodIntersection:dn,ZodTuple:xr,ZodRecord:Hl,ZodMap:ca,ZodSet:la,ZodFunction:Zl,ZodLazy:hn,ZodLiteral:pn,ZodEnum:xn,ZodNativeEnum:vn,ZodPromise:Et,ZodEffects:Ce,ZodTransformer:Ce,ZodOptional:Be,ZodNullable:vr,ZodDefault:mn,ZodCatch:bn,ZodNaN:fa,BRAND:que,ZodBranded:Po,ZodPipeline:jo,ZodReadonly:yn,custom:CS,Schema:T,ZodSchema:T,late:Aue,get ZodFirstPartyTypeKind(){return q},coerce:fce,any:Mue,array:Wue,bigint:Tue,boolean:OS,date:kue,discriminatedUnion:Kue,effect:bS,enum:rce,function:Que,instanceof:Pue,intersection:Gue,lazy:Xue,literal:ece,map:Yue,nan:jue,nativeEnum:tce,never:Nue,null:Bue,nullable:ace,number:SS,object:$ue,oboolean:lce,onumber:cce,optional:ice,ostring:uce,pipeline:sce,preprocess:oce,promise:nce,record:Zue,set:Jue,strictObject:Vue,string:FS,symbol:Iue,transformer:bS,tuple:Hue,undefined:Rue,union:zue,unknown:Lue,void:Uue,NEVER:dce,ZodIssueCode:E,quotelessJson:aue,ZodError:we});var Fm="2024-11-05",qS=[Fm,"2024-10-07"],Yl="2.0",AS=h.union([h.string(),h.number().int()]),PS=h.string(),He=h.object({_meta:h.optional(h.object({progressToken:h.optional(AS)}).passthrough())}).passthrough(),Fe=h.object({method:h.string(),params:h.optional(He)}),To=h.object({_meta:h.optional(h.object({}).passthrough())}).passthrough(),mr=h.object({method:h.string(),params:h.optional(To)}),Ze=h.object({_meta:h.optional(h.object({}).passthrough())}).passthrough(),Jl=h.union([h.string(),h.number().int()]),hce=h.object({jsonrpc:h.literal(Yl),id:Jl}).merge(Fe).strict(),pce=h.object({jsonrpc:h.literal(Yl)}).merge(mr).strict(),xce=h.object({jsonrpc:h.literal(Yl),id:Jl,result:Ze}).strict(),gn;(function(r){r[r.ConnectionClosed=-1]="ConnectionClosed",r[r.RequestTimeout=-2]="RequestTimeout",r[r.ParseError=-32700]="ParseError",r[r.InvalidRequest=-32600]="InvalidRequest",r[r.MethodNotFound=-32601]="MethodNotFound",r[r.InvalidParams=-32602]="InvalidParams",r[r.InternalError=-32603]="InternalError"})(gn||(gn={}));var vce=h.object({jsonrpc:h.literal(Yl),id:Jl,error:h.object({code:h.number().int(),message:h.string(),data:h.optional(h.unknown())})}).strict(),jS=h.union([hce,pce,xce,vce]),_n=Ze.strict(),Ql=mr.extend({method:h.literal("notifications/cancelled"),params:To.extend({requestId:Jl,reason:h.string().optional()})}),TS=h.object({name:h.string(),version:h.string()}).passthrough(),mce=h.object({experimental:h.optional(h.object({}).passthrough()),sampling:h.optional(h.object({}).passthrough()),roots:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough())}).passthrough(),bce=Fe.extend({method:h.literal("initialize"),params:He.extend({protocolVersion:h.string(),capabilities:mce,clientInfo:TS})}),yce=h.object({experimental:h.optional(h.object({}).passthrough()),logging:h.optional(h.object({}).passthrough()),prompts:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough()),resources:h.optional(h.object({subscribe:h.optional(h.boolean()),listChanged:h.optional(h.boolean())}).passthrough()),tools:h.optional(h.object({listChanged:h.optional(h.boolean())}).passthrough())}).passthrough(),Sm=Ze.extend({protocolVersion:h.string(),capabilities:yce,serverInfo:TS}),gce=mr.extend({method:h.literal("notifications/initialized")}),Xl=Fe.extend({method:h.literal("ping")}),_ce=h.object({progress:h.number(),total:h.optional(h.number())}).passthrough(),ef=mr.extend({method:h.literal("notifications/progress"),params:To.merge(_ce).extend({progressToken:AS})}),rf=Fe.extend({params:He.extend({cursor:h.optional(PS)}).optional()}),tf=Ze.extend({nextCursor:h.optional(PS)}),kS=h.object({uri:h.string(),mimeType:h.optional(h.string())}).passthrough(),IS=kS.extend({text:h.string()}),RS=kS.extend({blob:h.string().base64()}),Ece=h.object({uri:h.string(),name:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string())}).passthrough(),Dce=h.object({uriTemplate:h.string(),name:h.string(),description:h.optional(h.string()),mimeType:h.optional(h.string())}).passthrough(),wce=rf.extend({method:h.literal("resources/list")}),Om=tf.extend({resources:h.array(Ece)}),Cce=rf.extend({method:h.literal("resources/templates/list")}),qm=tf.extend({resourceTemplates:h.array(Dce)}),Fce=Fe.extend({method:h.literal("resources/read"),params:He.extend({uri:h.string()})}),Am=Ze.extend({contents:h.array(h.union([IS,RS]))}),Sce=mr.extend({method:h.literal("notifications/resources/list_changed")}),Oce=Fe.extend({method:h.literal("resources/subscribe"),params:He.extend({uri:h.string()})}),qce=Fe.extend({method:h.literal("resources/unsubscribe"),params:He.extend({uri:h.string()})}),Ace=mr.extend({method:h.literal("notifications/resources/updated"),params:To.extend({uri:h.string()})}),Pce=h.object({name:h.string(),description:h.optional(h.string()),required:h.optional(h.boolean())}).passthrough(),jce=h.object({name:h.string(),description:h.optional(h.string()),arguments:h.optional(h.array(Pce))}).passthrough(),Tce=rf.extend({method:h.literal("prompts/list")}),Pm=tf.extend({prompts:h.array(jce)}),kce=Fe.extend({method:h.literal("prompts/get"),params:He.extend({name:h.string(),arguments:h.optional(h.record(h.string()))})}),nf=h.object({type:h.literal("text"),text:h.string()}).passthrough(),af=h.object({type:h.literal("image"),data:h.string().base64(),mimeType:h.string()}).passthrough(),BS=h.object({type:h.literal("resource"),resource:h.union([IS,RS])}).passthrough(),Ice=h.object({role:h.enum(["user","assistant"]),content:h.union([nf,af,BS])}).passthrough(),jm=Ze.extend({description:h.optional(h.string()),messages:h.array(Ice)}),Rce=mr.extend({method:h.literal("notifications/prompts/list_changed")}),Bce=h.object({name:h.string(),description:h.optional(h.string()),inputSchema:h.object({type:h.literal("object"),properties:h.optional(h.object({}).passthrough())}).passthrough()}).passthrough(),Mce=rf.extend({method:h.literal("tools/list")}),Tm=tf.extend({tools:h.array(Bce)}),of=Ze.extend({content:h.array(h.union([nf,af,BS])),isError:h.boolean().default(!1).optional()}),$2e=of.or(Ze.extend({toolResult:h.unknown()})),Lce=Fe.extend({method:h.literal("tools/call"),params:He.extend({name:h.string(),arguments:h.optional(h.record(h.unknown()))})}),Nce=mr.extend({method:h.literal("notifications/tools/list_changed")}),MS=h.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Uce=Fe.extend({method:h.literal("logging/setLevel"),params:He.extend({level:MS})}),Wce=mr.extend({method:h.literal("notifications/message"),params:To.extend({level:MS,logger:h.optional(h.string()),data:h.unknown()})}),$ce=h.object({name:h.string().optional()}).passthrough(),Vce=h.object({hints:h.optional(h.array($ce)),costPriority:h.optional(h.number().min(0).max(1)),speedPriority:h.optional(h.number().min(0).max(1)),intelligencePriority:h.optional(h.number().min(0).max(1))}).passthrough(),zce=h.object({role:h.enum(["user","assistant"]),content:h.union([nf,af])}).passthrough(),Kce=Fe.extend({method:h.literal("sampling/createMessage"),params:He.extend({messages:h.array(zce),systemPrompt:h.optional(h.string()),includeContext:h.optional(h.enum(["none","thisServer","allServers"])),temperature:h.optional(h.number()),maxTokens:h.number().int(),stopSequences:h.optional(h.array(h.string())),metadata:h.optional(h.object({}).passthrough()),modelPreferences:h.optional(Vce)})}),Gce=Ze.extend({model:h.string(),stopReason:h.optional(h.enum(["endTurn","stopSequence","maxTokens"]).or(h.string())),role:h.enum(["user","assistant"]),content:h.discriminatedUnion("type",[nf,af])}),Hce=h.object({type:h.literal("ref/resource"),uri:h.string()}).passthrough(),Zce=h.object({type:h.literal("ref/prompt"),name:h.string()}).passthrough(),Yce=Fe.extend({method:h.literal("completion/complete"),params:He.extend({ref:h.union([Zce,Hce]),argument:h.object({name:h.string(),value:h.string()}).passthrough()})}),km=Ze.extend({completion:h.object({values:h.array(h.string()).max(100),total:h.optional(h.number().int()),hasMore:h.optional(h.boolean())}).passthrough()}),Jce=h.object({uri:h.string().startsWith("file://"),name:h.optional(h.string())}).passthrough(),Qce=Fe.extend({method:h.literal("roots/list")}),Xce=Ze.extend({roots:h.array(Jce)}),e0e=mr.extend({method:h.literal("notifications/roots/list_changed")}),V2e=h.union([Xl,bce,Yce,Uce,kce,Tce,wce,Cce,Fce,Oce,qce,Lce,Mce]),z2e=h.union([Ql,ef,gce,e0e]),K2e=h.union([_n,Gce,Xce]),G2e=h.union([Xl,Kce,Qce]),H2e=h.union([Ql,ef,Wce,Ace,Sce,Nce,Rce]),Z2e=h.union([_n,Sm,km,jm,Pm,Om,qm,Am,of,Tm]),da=class extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n}};var r0e=6e4,sf=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this.setNotificationHandler(Ql,t=>{let n=this._requestHandlerAbortControllers.get(t.params.requestId);n==null||n.abort(t.params.reason)}),this.setNotificationHandler(ef,t=>{this._onprogress(t)}),this.setRequestHandler(Xl,t=>({}))}async connect(e){this._transport=e,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=t=>{this._onerror(t)},this._transport.onmessage=t=>{"method"in t?"id"in t?this._onrequest(t):this._onnotification(t):this._onresponse(t)},await this._transport.start()}_onclose(){var e;let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let n=new da(gn.ConnectionClosed,"Connection closed");for(let i of t.values())i(n)}_onerror(e){var t;(t=this.onerror)===null||t===void 0||t.call(this,e)}_onnotification(e){var t;let n=(t=this._notificationHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e){var t,n;let i=(t=this._requestHandlers.get(e.method))!==null&&t!==void 0?t:this.fallbackRequestHandler;if(i===void 0){(n=this._transport)===null||n===void 0||n.send({jsonrpc:"2.0",id:e.id,error:{code:gn.MethodNotFound,message:"Method not found"}}).catch(o=>this._onerror(new Error(`Failed to send an error response: ${o}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a),Promise.resolve().then(()=>i(e,{signal:a.signal})).then(o=>{var s;if(!a.signal.aborted)return(s=this._transport)===null||s===void 0?void 0:s.send({result:o,jsonrpc:"2.0",id:e.id})},o=>{var s,u;if(!a.signal.aborted)return(s=this._transport)===null||s===void 0?void 0:s.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(o.code)?o.code:gn.InternalError,message:(u=o.message)!==null&&u!==void 0?u:"Internal error"}})}).catch(o=>this._onerror(new Error(`Failed to send response: ${o}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progress:t,total:n,progressToken:i}=e.params,a=this._progressHandlers.get(Number(i));if(a===void 0){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}a({progress:t,total:n})}_onresponse(e){let t=e.id,n=this._responseHandlers.get(Number(t));if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(Number(t)),this._progressHandlers.delete(Number(t)),"result"in e)n(e);else{let i=new da(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,t,n){return new Promise((i,a)=>{var o,s,u,c;if(!this._transport){a(new Error("Not connected"));return}((o=this._options)===null||o===void 0?void 0:o.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(s=n==null?void 0:n.signal)===null||s===void 0||s.throwIfAborted();let f=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:f};n!=null&&n.onprogress&&(this._progressHandlers.set(f,n.onprogress),p.params={...e.params,_meta:{progressToken:f}});let v;this._responseHandlers.set(f,m=>{var g;if(v!==void 0&&clearTimeout(v),!(!((g=n==null?void 0:n.signal)===null||g===void 0)&&g.aborted)){if(m instanceof Error)return a(m);try{let _=t.parse(m.result);i(_)}catch(_){a(_)}}});let b=m=>{var g;this._responseHandlers.delete(f),this._progressHandlers.delete(f),(g=this._transport)===null||g===void 0||g.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(m)}}).catch(_=>this._onerror(new Error(`Failed to send cancellation: ${_}`))),a(m)};(u=n==null?void 0:n.signal)===null||u===void 0||u.addEventListener("abort",()=>{var m;v!==void 0&&clearTimeout(v),b((m=n==null?void 0:n.signal)===null||m===void 0?void 0:m.reason)});let y=(c=n==null?void 0:n.timeout)!==null&&c!==void 0?c:r0e;v=setTimeout(()=>b(new da(gn.RequestTimeout,"Request timed out",{timeout:y})),y),this._transport.send(p).catch(m=>{v!==void 0&&clearTimeout(v),a(m)})})}async notification(e){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let t={...e,jsonrpc:"2.0"};await this._transport.send(t)}setRequestHandler(e,t){let n=e.shape.method.value;this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>Promise.resolve(t(e.parse(i),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,n=>Promise.resolve(t(e.parse(n))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};var uf=class extends sf{constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t.capabilities}assertCapability(e,t){var n;if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e){await super.connect(e);try{let t=await this.request({method:"initialize",params:{protocolVersion:Fm,capabilities:this._capabilities,clientInfo:this._clientInfo}},Sm);if(t===void 0)throw new Error(`Server sent invalid initialize result: ${t}`);if(!qS.includes(t.protocolVersion))throw new Error(`Server's protocol version is not supported: ${t.protocolVersion}`);this._serverCapabilities=t.capabilities,this._serverVersion=t.serverInfo,await this.notification({method:"notifications/initialized"})}catch(t){throw this.close(),t}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}assertCapabilityForMethod(e){var t,n,i,a,o;switch(e){case"logging/setLevel":if(!(!((t=this._serverCapabilities)===null||t===void 0)&&t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((i=this._serverCapabilities)===null||i===void 0)&&i.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var t;switch(e){case"notifications/roots/list_changed":if(!(!((t=this._capabilities.roots)===null||t===void 0)&&t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},_n,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},km,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},_n,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},jm,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Pm,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},Om,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},qm,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Am,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},_n,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},_n,t)}async callTool(e,t=of,n){return this.request({method:"tools/call",params:e},t,n)}async listTools(e,t){return this.request({method:"tools/list",params:e},Tm,t)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};var NS=require("node:child_process"),ko=I(require("node:process"),1);var cf=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
74
74
|
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e);return this._buffer=this._buffer.subarray(e+1),t0e(t)}clear(){this._buffer=void 0}};function t0e(r){return jS.parse(JSON.parse(r))}function LS(r){return JSON.stringify(r)+`
|
|
75
|
-
`}var n0e=ko.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function i0e(){let r={};for(let e of n0e){let t=ko.default.env[e];t!==void 0&&(t.startsWith("()")||(r[e]=t))}return r}var lf=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new cf,this._serverParams=e}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{var n,i,a,o,s,u;this._process=(0,NS.spawn)(this._serverParams.command,(n=this._serverParams.args)!==null&&n!==void 0?n:[],{env:(i=this._serverParams.env)!==null&&i!==void 0?i:i0e(),stdio:["pipe","pipe",(a=this._serverParams.stderr)!==null&&a!==void 0?a:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:ko.default.platform==="win32"&&a0e()}),this._process.on("error",c=>{var f,p;if(c.name==="AbortError"){(f=this.onclose)===null||f===void 0||f.call(this);return}t(c),(p=this.onerror)===null||p===void 0||p.call(this,c)}),this._process.on("spawn",()=>{e()}),this._process.on("close",c=>{var f;this._process=void 0,(f=this.onclose)===null||f===void 0||f.call(this)}),(o=this._process.stdin)===null||o===void 0||o.on("error",c=>{var f;(f=this.onerror)===null||f===void 0||f.call(this,c)}),(s=this._process.stdout)===null||s===void 0||s.on("data",c=>{this._readBuffer.append(c),this.processReadBuffer()}),(u=this._process.stdout)===null||u===void 0||u.on("error",c=>{var f;(f=this.onerror)===null||f===void 0||f.call(this,c)})})}get stderr(){var e,t;return(t=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&t!==void 0?t:null}processReadBuffer(){for(var e,t;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,n)}catch(n){(t=this.onerror)===null||t===void 0||t.call(this,n)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(t=>{var n;if(!(!((n=this._process)===null||n===void 0)&&n.stdin))throw new Error("Not connected");let i=LS(e);this._process.stdin.write(i)?t():this._process.stdin.once("drain",t)})}};function a0e(){return"type"in ko.default}var ff=I(pr()),br=I(K());async function US(r){if(!r.connections||r.connections.length===0)throw new Error(`No connections defined for package ${r.id}`);let e=r.connections[0].stdio,t=e.command==="npx"?process.platform==="win32"?"npx.cmd":"/usr/local/bin/npx":e.command,n=new lf({command:t,args:e.args||[],env:{...process.env,...e.env||{}}}),i=new uf({name:"mcp-cli",version:"1.0.0"},{capabilities:{}});return await i.connect(n),i}async function o0e(r){let e=r.getServerCapabilities()||{},t=[],n=[];return e.resources&&n.push(r.listResources().then(({resources:i})=>{i.forEach(a=>t.push({type:"resource",value:a}))})),e.tools&&n.push(r.listTools().then(({tools:i})=>{i.forEach(a=>t.push({type:"tool",value:a}))})),e.prompts&&n.push(r.listPrompts().then(({prompts:i})=>{i.forEach(a=>t.push({type:"prompt",value:a}))})),await Promise.all(n),t}async function s0e(r){let e=(i,a=100)=>i?i.length>a
|
|
75
|
+
`}var n0e=ko.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function i0e(){let r={};for(let e of n0e){let t=ko.default.env[e];t!==void 0&&(t.startsWith("()")||(r[e]=t))}return r}var lf=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new cf,this._serverParams=e}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,t)=>{var n,i,a,o,s,u;this._process=(0,NS.spawn)(this._serverParams.command,(n=this._serverParams.args)!==null&&n!==void 0?n:[],{env:(i=this._serverParams.env)!==null&&i!==void 0?i:i0e(),stdio:["pipe","pipe",(a=this._serverParams.stderr)!==null&&a!==void 0?a:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:ko.default.platform==="win32"&&a0e()}),this._process.on("error",c=>{var f,p;if(c.name==="AbortError"){(f=this.onclose)===null||f===void 0||f.call(this);return}t(c),(p=this.onerror)===null||p===void 0||p.call(this,c)}),this._process.on("spawn",()=>{e()}),this._process.on("close",c=>{var f;this._process=void 0,(f=this.onclose)===null||f===void 0||f.call(this)}),(o=this._process.stdin)===null||o===void 0||o.on("error",c=>{var f;(f=this.onerror)===null||f===void 0||f.call(this,c)}),(s=this._process.stdout)===null||s===void 0||s.on("data",c=>{this._readBuffer.append(c),this.processReadBuffer()}),(u=this._process.stdout)===null||u===void 0||u.on("error",c=>{var f;(f=this.onerror)===null||f===void 0||f.call(this,c)})})}get stderr(){var e,t;return(t=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&t!==void 0?t:null}processReadBuffer(){for(var e,t;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,n)}catch(n){(t=this.onerror)===null||t===void 0||t.call(this,n)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(t=>{var n;if(!(!((n=this._process)===null||n===void 0)&&n.stdin))throw new Error("Not connected");let i=LS(e);this._process.stdin.write(i)?t():this._process.stdin.once("drain",t)})}};function a0e(){return"type"in ko.default}var ff=I(pr()),br=I(K());async function US(r){if(!r.connections||r.connections.length===0)throw new Error(`No connections defined for package ${r.id}`);let e=r.connections[0].stdio,t=e.command==="npx"?process.platform==="win32"?"npx.cmd":"/usr/local/bin/npx":e.command,n=new lf({command:t,args:e.args||[],env:{...process.env,...e.env||{}}}),i=new uf({name:"mcp-cli",version:"1.0.0"},{capabilities:{}});return await i.connect(n),i}async function o0e(r){let e=r.getServerCapabilities()||{},t=[],n=[];return e.resources&&n.push(r.listResources().then(({resources:i})=>{i.forEach(a=>t.push({type:"resource",value:a}))})),e.tools&&n.push(r.listTools().then(({tools:i})=>{i.forEach(a=>t.push({type:"tool",value:a}))})),e.prompts&&n.push(r.listPrompts().then(({prompts:i})=>{i.forEach(a=>t.push({type:"prompt",value:a}))})),await Promise.all(n),t}async function s0e(r){let e=(i,a=100)=>i?i.length>a?`${i.slice(0,a)}...`:i:"No description",t=[...r.map(i=>({name:`${br.default.green(`${i.type}(${i.value.name})`)} - ${br.default.gray(e(i.value.description||""))}`,value:i,description:i.value.description})),new ff.default.Separator,{name:br.default.yellow("\u21A9 Back"),value:"back"},{name:br.default.red("\u2716 Exit"),value:"exit"}],{selected:n}=await ff.default.prompt([{type:"list",name:"selected",message:"Pick a primitive",choices:t,pageSize:10}]);return n}async function WS(r){var t,n,i;let e=await o0e(r);for(;;){let a=await s0e(e);if(a==="back")return null;if(a==="exit")return"exit";let o={type:a.type,value:{name:a.value.name,description:a.value.description,...a.type==="tool"&&{inputSchema:(i=(n=(t=await r.listTools({name:a.value.name}))==null?void 0:t.tools)==null?void 0:n[0])==null?void 0:i.inputSchema},...a.value.uri&&{uri:a.value.uri}}};console.log(`
|
|
76
76
|
`,br.default.cyan(JSON.stringify(o,null,2).replace(/"(\w+)":/g,u=>br.default.green(u)).replace(/"([^"]+)"(?=,|\n|\})/g,u=>br.default.yellow(u))));let{action:s}=await ff.default.prompt([{type:"list",name:"action",message:"What would you like to do?",choices:[{name:br.default.yellow("\u21A9 Back to primitives"),value:"back"},{name:br.default.red("\u2716 Exit"),value:"exit"}]}]);if(s==="exit")return"exit"}}async function $S(){try{let e=(await Xi()).filter(t=>t.isInstalled);if(e.length===0){console.log(En.default.yellow(`
|
|
77
77
|
No MCP servers are currently installed.`));return}for(;;){let t={type:"list",name:"selectedPackage",message:"Select a server to inspect:",choices:[...e.map(o=>({name:o.name,value:o})),new Im.default.Separator,{name:En.default.yellow("\u21A9 Back"),value:"back"},{name:En.default.red("\u2716 Exit"),value:"exit"}]},{selectedPackage:n}=await Im.default.prompt([t]);if(n==="exit"&&process.exit(0),!n||n==="back")return;console.log(En.default.blue(`
|
|
78
78
|
Connecting to server...`));let i=await US(n);await WS(i)==="exit"&&process.exit(0)}}catch(r){console.error(En.default.red("Error during inspection:")),console.error(En.default.red(r instanceof Error?r.message:String(r))),process.exit(1)}}var u0e=process.argv[2],Io=process.argv[3],VS=process.argv.indexOf("--client"),c0e=VS!==-1?process.argv[VS+1]:void 0;async function l0e(){switch(u0e){case"inspect":await $S();break;case"list":await mm();break;case"install":Io||(console.error("Please provide a package name to install"),process.exit(1)),await fS(Io,c0e);break;case"uninstall":await hS(Io);break;case"installed":await $l();break;case"get":Io||(console.error("Please provide a package ID to get details"),process.exit(1)),await vS(Io);break;default:console.log("Available commands:"),console.log(" list List all available packages"),console.log(" install <package> Install a package"),console.log(" --client <name> Specify the AI client"),console.log(" uninstall [package] Uninstall a package"),console.log(" installed List installed packages"),console.log(" get <package> Get details for a specific package"),console.log(" inspect Inspect installed servers"),process.exit(1)}}l0e();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithery/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://smithery.ai/",
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.mjs --watch",
|
|
23
23
|
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.mjs --coverage",
|
|
24
24
|
"prepare": "npm run build",
|
|
25
|
-
"
|
|
26
|
-
"format": "npx @biomejs/biome format --write"
|
|
25
|
+
"check": "npx @biomejs/biome check --write --unsafe"
|
|
27
26
|
},
|
|
28
27
|
"bin": {
|
|
29
28
|
"cli": "dist/index.js"
|