UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

4 lines 303 kB
import{a as e,i as t,n,r,t as i}from"./chunk-BTyA9uPd.js";var a=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{VercelOidcTokenError:()=>u}),t.exports=c(l);var u=class extends Error{constructor(e,t){super(e),this.name=`VercelOidcTokenError`,this.cause=t}toString(){return this.cause?`${this.name}: ${this.message}: ${this.cause}`:`${this.name}: ${this.message}`}};0&&(t.exports={VercelOidcTokenError:u})})),o=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{AccessTokenMissingError:()=>u,RefreshAccessTokenFailedError:()=>d}),t.exports=c(l);var u=class extends Error{constructor(){super(`No authentication found. Please log in with the Vercel CLI (vercel login).`),this.name=`AccessTokenMissingError`}},d=class extends Error{constructor(e){super(`Failed to refresh authentication token.`),this.name=`RefreshAccessTokenFailedError`,e!==void 0&&(this.cause=e)}};0&&(t.exports={AccessTokenMissingError:u,RefreshAccessTokenFailedError:d})})),s=i(((e,n)=>{var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},c=(e,t,n,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!o.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(s=i(t,c))||s.enumerable});return e},l=e=>c(r({},`__esModule`,{value:!0}),e),u={};s(u,{VercelCliError:()=>f,assertValidCwd:()=>m,getCliNotFoundMessage:()=>p,toVercelCliError:()=>h}),n.exports=l(u);var d=t(`node:fs/promises`),f=class extends Error{constructor(e){super(e.message),this.name=`VercelCliError`,this.code=e.code,this.invocation=e.invocation,this.stdout=e.stdout,this.stderr=e.stderr,this.exitCode=e.exitCode,e.cause!==void 0&&(this.cause=e.cause)}};function p(e){let t=[],{localBinSearch:n}=e;n.stopReason===`project-root-marker`?t.push(`Local bin lookup stopped at ${JSON.stringify(n.stoppedAt)} (${JSON.stringify(n.markerPath)}).`):n.stopReason===`filesystem-root`&&t.push(`No project root marker was found from ${JSON.stringify(n.searchRoot)}; local bin lookup reached the filesystem root.`);for(let e of n.skippedNodeModules)t.push(`Skipped ${JSON.stringify(e.directory)}: ${e.reason}.`);for(let n of e.skippedLocalBins)t.push(`Skipped ${JSON.stringify(n.candidate)}: ${n.reason}.`);return t.length===0?`Unable to find a usable Vercel CLI installation.`:[`Unable to find a usable Vercel CLI installation.`,...t].join(` `)}async function m(e){try{if(!(await(0,d.stat)(e)).isDirectory())throw Error(`not a directory`)}catch{throw new f({code:`VERCEL_CLI_INVALID_CWD`,message:`Working directory ${JSON.stringify(e)} does not exist or is not a directory.`})}}function h(e,t){if(typeof t==`object`&&t){let n=t;if(n.code===`ENOENT`)return new f({code:`VERCEL_CLI_NOT_FOUND`,message:`Unable to find Vercel CLI command ${JSON.stringify(e.command)}.`,invocation:e,cause:t});if(n.code===`EACCES`||n.code===`EPERM`)return new f({code:`VERCEL_CLI_PERMISSION_DENIED`,message:`Permission denied while executing Vercel CLI command ${JSON.stringify(e.command)}.`,invocation:e,cause:t});if(n.timedOut)return new f({code:`VERCEL_CLI_TIMED_OUT`,message:`Timed out while executing Vercel CLI command ${JSON.stringify(e.command)}.`,invocation:e,stdout:n.stdout,stderr:n.stderr,cause:t});if(n.isCanceled)return new f({code:`VERCEL_CLI_CANCELED`,message:`Canceled while executing Vercel CLI command ${JSON.stringify(e.command)}.`,invocation:e,stdout:n.stdout,stderr:n.stderr,cause:t});if(n.signal)return new f({code:`VERCEL_CLI_SIGNALED`,message:`Vercel CLI command ${JSON.stringify(e.command)} exited due to signal ${n.signal}.`,invocation:e,stdout:n.stdout,stderr:n.stderr,cause:t});if(typeof n.exitCode==`number`)return new f({code:`VERCEL_CLI_ERRORED`,message:n.shortMessage??n.message??`Vercel CLI command ${JSON.stringify(e.command)} exited with code ${n.exitCode}.`,invocation:e,stdout:n.stdout,stderr:n.stderr,exitCode:n.exitCode,cause:t})}return new f({code:`VERCEL_CLI_EXEC_FAILED`,message:`Could not execute Vercel CLI command ${JSON.stringify(e.command)}.`,invocation:e,cause:t})}0&&(n.exports={VercelCliError:f,assertValidCwd:m,getCliNotFoundMessage:p,toVercelCliError:h})})),c=i(((e,n)=>{n.exports=o,o.sync=s;var r=t(`fs`);function i(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function a(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:i(t,n)}function o(e,t,n){r.stat(e,function(r,i){n(r,r?!1:a(i,e,t))})}function s(e,t){return a(r.statSync(e),e,t)}})),l=i(((e,n)=>{n.exports=i,i.sync=a;var r=t(`fs`);function i(e,t,n){r.stat(e,function(e,r){n(e,e?!1:o(r,t))})}function a(e,t){return o(r.statSync(e),t)}function o(e,t){return e.isFile()&&s(e,t)}function s(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}})),u=i(((e,n)=>{t(`fs`);var r=process.platform===`win32`||global.TESTING_WINDOWS?c():l();n.exports=i,i.sync=a;function i(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}})),d=i(((e,n)=>{let r=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,i=t(`path`),a=r?`;`:`:`,o=u(),s=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),c=(e,t)=>{let n=t.colon||a,i=e.match(/\//)||r&&e.match(/\\/)?[``]:[...r?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(n)],o=r?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=r?o.split(n):[``];return r&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:i,pathExt:s,pathExtExe:o}},l=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:r,pathExt:a,pathExtExe:l}=c(e,t),u=[],d=n=>new Promise((a,o)=>{if(n===r.length)return t.all&&u.length?a(u):o(s(e));let c=r[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,s)=>{if(r===a.length)return i(d(n+1));let c=a[r];o(e+c,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+c);else return i(e+c);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};n.exports=l,l.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:r,pathExtExe:a}=c(e,t),l=[];for(let s=0;s<n.length;s++){let c=n[s],u=/^".*"$/.test(c)?c.slice(1,-1):c,d=i.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<r.length;e++){let n=f+r[e];try{if(o.sync(n,{pathExt:a}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw s(e)}})),f=i(((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n})),p=i(((e,n)=>{let r=t(`path`),i=d(),a=f();function o(e,t){let n=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=i.sync(e.command,{path:n[a({env:n})],pathExt:t?r.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=r.resolve(s?e.options.cwd:``,l),l}function s(e){return o(e)||o(e,!0)}n.exports=s})),m=i(((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i})),h=i(((e,t)=>{t.exports=/^#!(.*)/})),g=i(((e,t)=>{let n=h();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}})),_=i(((e,n)=>{let r=t(`fs`),i=g();function a(e){let t=Buffer.alloc(150),n;try{n=r.openSync(e,`r`),r.readSync(n,t,0,150,0),r.closeSync(n)}catch{}return i(t.toString())}n.exports=a})),v=i(((e,n)=>{let r=t(`path`),i=p(),a=m(),o=_(),s=process.platform===`win32`,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(e){e.file=i(e);let t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}function d(e){if(!s)return e;let t=u(e),n=!c.test(t);if(e.options.forceShell||n){let n=l.test(t);e.command=r.normalize(e.command),e.command=a.command(e.command),e.args=e.args.map(e=>a.argument(e,n)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function f(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:d(r)}n.exports=f})),y=i(((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}})),b=i(((e,n)=>{let r=t(`child_process`),i=v(),a=y();function o(e,t,n){let o=i(e,t,n),s=r.spawn(o.command,o.args,o.options);return a.hookChildProcess(s,o),s}function s(e,t,n){let o=i(e,t,n),s=r.spawnSync(o.command,o.args,o.options);return s.error=s.error||a.verifyENOENTSync(s.status,o),s}n.exports=o,n.exports.spawn=o,n.exports.sync=s,n.exports._parse=i,n.exports._enoent=a})),x=i(((e,t)=>{t.exports=e=>{let t=typeof e==`string`?` `:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}})),S=i(((e,n)=>{let r=t(`path`),i=f(),a=e=>{e={cwd:process.cwd(),path:process.env[i()],execPath:process.execPath,...e};let t,n=r.resolve(e.cwd),a=[];for(;t!==n;)a.push(r.join(n,`node_modules/.bin`)),t=n,n=r.resolve(n,`..`);let o=r.resolve(e.cwd,e.execPath,`..`);return a.push(o),a.concat(e.path).join(r.delimiter)};n.exports=a,n.exports.default=a,n.exports.env=e=>{e={env:process.env,...e};let t={...e.env},r=i({env:t});return e.path=t[r],t[r]=n.exports(e),t}})),C=i(((e,t)=>{let n=(e,t)=>{for(let n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};t.exports=n,t.exports.default=n})),ee=i(((e,t)=>{let n=C(),r=new WeakMap,i=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let i,a=0,o=e.displayName||e.name||`<anonymous>`,s=function(...n){if(r.set(s,++a),a===1)i=e.apply(this,n),e=null;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return i};return n(s,e),r.set(s,a),s};t.exports=i,t.exports.default=i,t.exports.callCount=e=>{if(!r.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return r.get(e)}})),w=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGNALS=void 0,e.SIGNALS=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}]})),T=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGRTMAX=e.getRealtimeSignals=void 0,e.getRealtimeSignals=function(){let e=r-n+1;return Array.from({length:e},t)};let t=function(e,t){return{name:`SIGRT${t+1}`,number:n+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}},n=34,r=64;e.SIGRTMAX=64})),te=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSignals=void 0;var n=t(`os`),r=w(),i=T();e.getSignals=function(){let e=(0,i.getRealtimeSignals)();return[...r.SIGNALS,...e].map(a)};let a=function({name:e,number:t,description:r,action:i,forced:a=!1,standard:o}){let{signals:{[e]:s}}=n.constants,c=s!==void 0;return{name:e,number:c?s:t,description:r,supported:c,action:i,forced:a,standard:o}}})),E=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.signalsByNumber=e.signalsByName=void 0;var n=t(`os`),r=te(),i=T();let a=function(){return(0,r.getSignals)().reduce(o,{})},o=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}};e.signalsByName=a();let s=function(){let e=(0,r.getSignals)(),t=i.SIGRTMAX+1,n=Array.from({length:t},(t,n)=>c(n,e));return Object.assign({},...n)},c=function(e,t){let n=l(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},l=function(e,t){let r=t.find(({name:t})=>n.constants.signals[t]===e);return r===void 0?t.find(t=>t.number===e):r};e.signalsByNumber=s()})),ne=i(((e,t)=>{let{signalsByName:n}=E(),r=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`;t.exports=({stdout:e,stderr:t,all:i,error:a,signal:o,exitCode:s,command:c,escapedCommand:l,timedOut:u,isCanceled:d,killed:f,parsed:{options:{timeout:p}}})=>{s=s===null?void 0:s,o=o===null?void 0:o;let m=o===void 0?void 0:n[o].description,h=`Command ${r({timedOut:u,timeout:p,errorCode:a&&a.code,signal:o,signalDescription:m,exitCode:s,isCanceled:d})}: ${c}`,g=Object.prototype.toString.call(a)===`[object Error]`,_=g?`${h}\n${a.message}`:h,v=[_,t,e].filter(Boolean).join(` `);return g?(a.originalMessage=a.message,a.message=v):a=Error(v),a.shortMessage=_,a.command=c,a.escapedCommand=l,a.exitCode=s,a.signal=o,a.signalDescription=m,a.stdout=e,a.stderr=t,i!==void 0&&(a.all=i),`bufferedData`in a&&delete a.bufferedData,a.failed=!0,a.timedOut=!!u,a.isCanceled=d,a.killed=f&&!u,a}})),re=i(((e,t)=>{let n=[`stdin`,`stdout`,`stderr`],r=e=>n.some(t=>e[t]!==void 0),i=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return n.map(t=>e[t]);if(r(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let i=Math.max(t.length,n.length);return Array.from({length:i},(e,n)=>t[n])};t.exports=i,t.exports.node=e=>{let t=i(e);return t===`ipc`?`ipc`:t===void 0||typeof t==`string`?[t,t,t,`ipc`]:t.includes(`ipc`)?t:[...t,`ipc`]}})),ie=i(((e,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)})),D=i(((e,n)=>{var r=global.process;let i=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!i(r))n.exports=function(){return function(){}};else{var a=t(`assert`),o=ie(),s=/^win/i.test(r.platform),c=t(`events`);typeof c!=`function`&&(c=c.EventEmitter);var l;r.__signal_exit_emitter__?l=r.__signal_exit_emitter__:(l=r.__signal_exit_emitter__=new c,l.count=0,l.emitted={}),l.infinite||(l.setMaxListeners(1/0),l.infinite=!0),n.exports=function(e,t){if(!i(global.process))return function(){};a.equal(typeof e,`function`,`a callback must be provided for exit handler`),p===!1&&m();var n=`exit`;return t&&t.alwaysLast&&(n=`afterexit`),l.on(n,e),function(){l.removeListener(n,e),l.listeners(`exit`).length===0&&l.listeners(`afterexit`).length===0&&u()}};var u=function(){!p||!i(global.process)||(p=!1,o.forEach(function(e){try{r.removeListener(e,f[e])}catch{}}),r.emit=_,r.reallyExit=h,--l.count)};n.exports.unload=u;var d=function(e,t,n){l.emitted[e]||(l.emitted[e]=!0,l.emit(e,t,n))},f={};o.forEach(function(e){f[e]=function(){i(global.process)&&r.listeners(e).length===l.count&&(u(),d(`exit`,null,e),d(`afterexit`,null,e),s&&e===`SIGHUP`&&(e=`SIGINT`),r.kill(r.pid,e))}}),n.exports.signals=function(){return o};var p=!1,m=function(){p||!i(global.process)||(p=!0,l.count+=1,o=o.filter(function(e){try{return r.on(e,f[e]),!0}catch{return!1}}),r.emit=v,r.reallyExit=g)};n.exports.load=m;var h=r.reallyExit,g=function(e){i(global.process)&&(r.exitCode=e||0,d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),h.call(r,r.exitCode))},_=r.emit,v=function(e,t){if(e===`exit`&&i(global.process)){t!==void 0&&(r.exitCode=t);var n=_.apply(this,arguments);return d(`exit`,r.exitCode,null),d(`afterexit`,r.exitCode,null),n}else return _.apply(this,arguments)}}})),ae=i(((e,n)=>{let r=t(`os`),i=D(),a=(e,t=`SIGTERM`,n={})=>{let r=e(t);return o(e,t,n,r),r},o=(e,t,n,r)=>{if(!s(t,n,r))return;let i=l(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},s=(e,{forceKillAfterTimeout:t},n)=>c(e)&&t!==!1&&n,c=e=>e===r.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,l=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},u=(e,t)=>{e.kill()&&(t.isCanceled=!0)},d=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))};n.exports={spawnedKill:a,spawnedCancel:u,setupTimeout:(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{d(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},validateTimeout:({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},setExitHandler:async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let a=i(()=>{e.kill()});return r.finally(()=>{a()})}}})),O=i(((e,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n})),oe=i(((e,n)=>{let{PassThrough:r}=t(`stream`);n.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,i=n===`buffer`,a=!1;t?a=!(n||i):n||=`utf8`,i&&(n=null);let o=new r({objectMode:a});n&&o.setEncoding(n);let s=0,c=[];return o.on(`data`,e=>{c.push(e),a?s=c.length:s+=e.length}),o.getBufferedValue=()=>t?c:i?Buffer.concat(c,s):c.join(``),o.getBufferedLength=()=>s,o}})),se=i(((e,n)=>{let{constants:r}=t(`buffer`),i=t(`stream`),{promisify:a}=t(`util`),o=oe(),s=a(i.pipeline);var c=class extends Error{constructor(){super(`maxBuffer exceeded`),this.name=`MaxBufferError`}};async function l(e,t){if(!e)throw Error(`Expected a stream`);t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,i=o(t);return await new Promise((t,a)=>{let o=e=>{e&&i.getBufferedLength()<=r.MAX_LENGTH&&(e.bufferedData=i.getBufferedValue()),a(e)};(async()=>{try{await s(e,i),t()}catch(e){o(e)}})(),i.on(`data`,()=>{i.getBufferedLength()>n&&o(new c)})}),i.getBufferedValue()}n.exports=l,n.exports.buffer=(e,t)=>l(e,{...t,encoding:`buffer`}),n.exports.array=(e,t)=>l(e,{...t,array:!0}),n.exports.MaxBufferError=c})),ce=i(((e,n)=>{let{PassThrough:r}=t(`stream`);n.exports=function(){var e=[],t=new r({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=i,t.on(`unpipe`,a),Array.prototype.slice.call(arguments).forEach(n),t;function n(r){return Array.isArray(r)?(r.forEach(n),this):(e.push(r),r.once(`end`,a.bind(null,r)),r.once(`error`,t.emit.bind(t,`error`)),r.pipe(t,{end:!1}),this)}function i(){return e.length==0}function a(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}})),le=i(((e,t)=>{let n=O(),r=se(),i=ce(),a=(e,t)=>{t===void 0||e.stdin===void 0||(n(t)?t.pipe(e.stdin):e.stdin.end(t))},o=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=i();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},s=async(e,t)=>{if(e){e.destroy();try{return await t}catch(e){return e.bufferedData}}},c=(e,{encoding:t,buffer:n,maxBuffer:i})=>{if(!(!e||!n))return t?r(e,{encoding:t,maxBuffer:i}):r.buffer(e,{maxBuffer:i})};t.exports={handleInput:a,makeAllStream:o,getSpawnedResult:async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let l=c(e,{encoding:r,buffer:i,maxBuffer:a}),u=c(t,{encoding:r,buffer:i,maxBuffer:a}),d=c(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,l,u,d])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},s(e,l),s(t,u),s(n,d)])}},validateInputSync:({input:e})=>{if(n(e))throw TypeError("The `input` option cannot be a stream in sync mode")}}})),ue=i(((e,t)=>{let n=(async()=>{})().constructor.prototype,r=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(n,e)]);t.exports={mergePromise:(e,t)=>{for(let[n,i]of r){let r=typeof t==`function`?(...e)=>Reflect.apply(i.value,t(),e):i.value.bind(t);Reflect.defineProperty(e,n,{...i,value:r})}return e},getSpawnedPromise:e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})})}})),de=i(((e,t)=>{let n=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],r=/^[\w.-]+$/,i=/"/g,a=e=>typeof e!=`string`||r.test(e)?e:`"${e.replace(i,`\\"`)}"`,o=(e,t)=>n(e,t).join(` `),s=(e,t)=>n(e,t).map(e=>a(e)).join(` `),c=/ +/g;t.exports={joinCommand:o,getEscapedCommand:s,parseCommand:e=>{let t=[];for(let n of e.trim().split(c)){let e=t[t.length-1];e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t}}})),fe=i(((e,n)=>{let r=t(`path`),i=t(`child_process`),a=b(),o=x(),s=S(),c=ee(),l=ne(),u=re(),{spawnedKill:d,spawnedCancel:f,setupTimeout:p,validateTimeout:m,setExitHandler:h}=ae(),{handleInput:g,getSpawnedResult:_,makeAllStream:v,validateInputSync:y}=le(),{mergePromise:C,getSpawnedPromise:w}=ue(),{joinCommand:T,parseCommand:te,getEscapedCommand:E}=de(),ie=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...process.env,...e}:e;return n?s.env({env:a,cwd:r,execPath:i}):a},D=(e,t,n={})=>{let i=a._parse(e,t,n);return e=i.command,t=i.args,n=i.options,n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=ie(n),n.stdio=u(n),process.platform===`win32`&&r.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:n,parsed:i}},O=(e,t,n)=>typeof t!=`string`&&!Buffer.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?o(t):t,oe=(e,t,n)=>{let r=D(e,t,n),a=T(e,t),o=E(e,t);m(r.options);let s;try{s=i.spawn(r.file,r.args,r.options)}catch(e){return C(new i.ChildProcess,Promise.reject(l({error:e,stdout:``,stderr:``,all:``,command:a,escapedCommand:o,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})))}let u=w(s),y=p(s,r.options,u),b=h(s,r.options,y),x={isCanceled:!1};s.kill=d.bind(null,s.kill.bind(s)),s.cancel=f.bind(null,s,x);let S=c(async()=>{let[{error:e,exitCode:t,signal:n,timedOut:i},c,u,d]=await _(s,r.options,b),f=O(r.options,c),p=O(r.options,u),m=O(r.options,d);if(e||t!==0||n!==null){let c=l({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:a,escapedCommand:o,parsed:r,timedOut:i,isCanceled:x.isCanceled,killed:s.killed});if(!r.options.reject)return c;throw c}return{command:a,escapedCommand:o,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return g(s,r.options.input),s.all=v(s,r.options),C(s,S)};n.exports=oe,n.exports.sync=(e,t,n)=>{let r=D(e,t,n),a=T(e,t),o=E(e,t);y(r.options);let s;try{s=i.spawnSync(r.file,r.args,r.options)}catch(e){throw l({error:e,stdout:``,stderr:``,all:``,command:a,escapedCommand:o,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=O(r.options,s.stdout,s.error),u=O(r.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let e=l({stdout:c,stderr:u,error:s.error,signal:s.signal,exitCode:s.status,command:a,escapedCommand:o,parsed:r,timedOut:s.error&&s.error.code===`ETIMEDOUT`,isCanceled:!1,killed:s.signal!==null});if(!r.options.reject)return e;throw e}return{command:a,escapedCommand:o,exitCode:0,stdout:c,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},n.exports.command=(e,t)=>{let[n,...r]=te(e);return oe(n,r,t)},n.exports.commandSync=(e,t)=>{let[n,...r]=te(e);return oe.sync(n,r,t)},n.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t==`object`&&(n=t,t=[]);let r=u.node(n),i=process.execArgv.filter(e=>!e.startsWith(`--inspect`)),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return oe(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}})),pe=i(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{getEnvPath:()=>_,prependPathEntries:()=>h,setEnvPath:()=>v,splitPath:()=>g}),n.exports=f(p);var m=d(t(`node:path`));function h(e,t){let n=e.split(m.default.delimiter).filter(Boolean),r=[];for(let e of t)!n.includes(e)&&!r.includes(e)&&r.push(e);return r.length===0?e:e===``||e===m.default.delimiter?`${r.join(m.default.delimiter)}${e}`:[...r,e].join(m.default.delimiter)}function g(e){return e.split(m.default.delimiter).filter(Boolean)}function _(e=process.env){if(process.platform!==`win32`)return e.PATH??``;let t=Object.keys(e).filter(e=>e.toLowerCase()===`path`);for(let n=t.length-1;n>=0;n--){let r=e[t[n]];if(r!==void 0)return r}return``}function v(e=process.env,t){if(process.platform!==`win32`)return{...e,PATH:t};let n={...e};for(let e of Object.keys(n))e!==`PATH`&&e.toLowerCase()===`path`&&delete n[e];return n.PATH=t,n}0&&(n.exports={getEnvPath:_,prependPathEntries:h,setEnvPath:v,splitPath:g})})),me=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},s=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},c=e=>s(n({},`__esModule`,{value:!0}),e),l={};o(l,{getErrorMessage:()=>u,isMissingPathError:()=>d}),t.exports=c(l);function u(e){return e instanceof Error?e.message:String(e)}function d(e){return typeof e==`object`&&!!e&&`code`in e&&(e.code===`ENOENT`||e.code===`ENOTDIR`)}0&&(t.exports={getErrorMessage:u,isMissingPathError:d})})),he=i(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{getCanonicalPath:()=>_,getCommandBase:()=>S,getDirectoriesBetween:()=>v,isNodeScript:()=>b,isSubpath:()=>x,statIfExists:()=>y}),n.exports=f(p);var m=t(`node:fs/promises`),h=d(t(`node:path`)),g=me();async function _(e){try{return await(0,m.realpath)(e)}catch{return e}}function v(e,t){let n=[],r=h.default.resolve(t),i=h.default.resolve(e);for(;;){if(n.push(r),r===i)return n.reverse();let e=h.default.dirname(r);if(e===r)return[];r=e}}async function y(e){try{return{stats:await(0,m.stat)(e)}}catch(e){return(0,g.isMissingPathError)(e)?{missing:!0}:{reason:`could not inspect: ${(0,g.getErrorMessage)(e)}`}}}function b(e){return[`.js`,`.cjs`,`.mjs`].includes(h.default.extname(e))}function x(e,t){let n=h.default.relative(e,t);return n===``||n!==``&&!n.startsWith(`..`)&&!h.default.isAbsolute(n)}function S(e){let t=h.default.extname(e).toLowerCase();return process.platform===`win32`&&[`.cmd`,`.exe`].includes(t)?h.default.basename(e,t):h.default.basename(e)}0&&(n.exports={getCanonicalPath:_,getCommandBase:S,getDirectoriesBetween:v,isNodeScript:b,isSubpath:x,statIfExists:y})})),ge=i(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{getSkippedNodeModulesReason:()=>v,getUnsafeDirectoryReason:()=>C,getUnsafePackageBinReason:()=>b,getUnsafePackageDirectoryReason:()=>x,getUnsafePackageFileReason:()=>S,getUnsafeStatsReason:()=>w}),n.exports=f(p);var m=t(`node:fs/promises`),h=d(t(`node:path`)),g=me(),_=he();async function v(e,t){let n=h.default.dirname(e);t??=[n];for(let e of t){let t;try{t=await C(e)}catch(e){t=`could not inspect: ${(0,g.getErrorMessage)(e)}`}if(t)return`${e} is ${t}`}let r=await(0,_.statIfExists)(e);return`missing`in r?null:`reason`in r?r.reason:r.stats.isDirectory()?w(r.stats)||await y(h.default.join(e,`.bin`)):`not a directory`}async function y(e){let t=await(0,_.statIfExists)(e);if(`missing`in t)return null;if(`reason`in t)return`${e} ${t.reason}`;if(!t.stats.isDirectory())return`${e} is not a directory`;let n=w(t.stats);return n?`${e} is ${n}`:null}async function b(e,t,n){return await x(e,t)||await S(t,n)}async function x(e,t){let n=(0,_.getDirectoriesBetween)(e,t);if(n.length===0)return`${t} resolves outside local node_modules`;for(let e of n){let t=await C(e);if(t)return`${e} is ${t}`}return null}async function S(e,t){let n=(0,_.getDirectoriesBetween)(e,h.default.dirname(t));if(n.length===0)return`${t} resolves outside package`;for(let e of n){let t=await C(e);if(t)return`${e} is ${t}`}let r=await ee(t);return r?`${t} is ${r}`:null}async function C(e){let t=await(0,m.stat)(e);return t.isDirectory()?w(t):`not a directory`}async function ee(e){let t=await(0,m.stat)(e);return t.isFile()?w(t):`not a file`}function w(e){let t=process.geteuid??process.getuid;if(typeof t!=`function`)return null;let n=t();return e.mode&18?e.mode&2?`world-writable`:`group-writable`:e.uid===n?null:`owned by uid ${e.uid}, current uid is ${n}`}0&&(n.exports={getSkippedNodeModulesReason:v,getUnsafeDirectoryReason:C,getUnsafePackageBinReason:b,getUnsafePackageDirectoryReason:x,getUnsafePackageFileReason:S,getUnsafeStatsReason:w})})),_e=i(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{clearCachedCliInvocation:()=>w,clearVercelCliLookupCache:()=>ee,findVercelCli:()=>x,getLocalBinSearch:()=>O,resolveCachedCliInvocation:()=>S,toVercelCliInvocation:()=>C}),n.exports=f(p);var m=t(`node:fs/promises`),h=d(t(`node:path`)),g=pe(),_=me(),v=he(),y=ge();let b=new Map;async function x(e={}){let t=await S(h.default.resolve(e.cwd??process.cwd()),e.path??(0,g.getEnvPath)(process.env));return t.found?C(t):null}function S(e,t){let n=be(e,t);if(b.has(n))return b.get(n);let r=T(e,t).catch(e=>{throw b.delete(n),e});return b.set(n,r),r}function C(e){return{command:e.command,commandArgs:e.commandArgs,source:e.source}}function ee(){b.clear()}function w(e,t){b.delete(be(e,t))}async function T(e,t){let n=await O(e),r={localBinSearch:n.diagnostics,skippedLocalBins:[]},i=(0,g.prependPathEntries)(t,n.directories);for(let t of ae()){let a=await te(t,i,e,n,r);if(a)return(0,v.isNodeScript)(a.realPath)?{found:!0,command:process.execPath,commandArgs:[a.realPath],source:a.source,diagnostics:r}:{found:!0,command:a.realPath,commandArgs:[],source:a.source,diagnostics:r}}return{found:!1,diagnostics:r}}async function te(e,t,n,r,i){for(let a of(0,g.splitPath)(t)){let t=E(a,e,n);try{if(await ne(t,r,i)){let n=await ie(e,t,r,i);if(n)return n}}catch{}}return null}function E(e,t,n){let r=h.default.isAbsolute(e)?e:h.default.resolve(n,e);return h.default.join(r,t)}async function ne(e,t,n){try{return await(0,m.access)(e,process.platform===`win32`?m.constants.F_OK:m.constants.F_OK|m.constants.X_OK),!0}catch(r){return(0,_.isMissingPathError)(r)||await re(e,r,t,n),!1}}async function re(e,t,n,r){let i=await ue(e,n.directories);i&&D(r,e,`reason`in i?i.reason:`local bin is not accessible: ${(0,_.getErrorMessage)(t)}`)}async function ie(e,t,n,r){if(!(await(0,m.stat)(t)).isFile())return null;let i=await(0,m.realpath)(t),a=await ue(t,n.directories);if(!a)return{realPath:i,source:`path`};if(`reason`in a)return D(r,t,a.reason),null;let o=await de(e,a.directory);return`reason`in o?(D(r,t,o.reason),null):{realPath:o.binPath,source:`local-bin`}}function D(e,t,n){e.skippedLocalBins.push({candidate:t,reason:n})}function ae(){let e=[`vercel`];if(process.platform!==`win32`)return e;let t=[`.cmd`,`.exe`,``];return e.flatMap(e=>t.map(t=>`${e}${t}`))}async function O(e){let t=await(0,v.getCanonicalPath)(h.default.resolve(e)),n=await oe(t),r=[],i=[];for(let e of n.directories){let a=h.default.join(e,`node_modules`),o=n.stopReason===`project-root-marker`?(0,v.getDirectoriesBetween)(n.stoppedAt,e):(0,v.getDirectoriesBetween)(e,t),s=await(0,y.getSkippedNodeModulesReason)(a,o);if(s){r.push({directory:a,reason:s});continue}i.push(h.default.join(a,`.bin`))}return{directories:i,diagnostics:{searchRoot:t,stoppedAt:n.stoppedAt,stopReason:n.stopReason,markerPath:n.markerPath,skippedNodeModules:r}}}async function oe(e){let t=[],n=h.default.resolve(e);for(;;){t.push(n);let e=await se(n);if(e)return{directories:t,stoppedAt:n,stopReason:`project-root-marker`,markerPath:e.path};let r=h.default.dirname(n);if(r===n)return{directories:t,stoppedAt:n,stopReason:`filesystem-root`};n=r}}async function se(e){let t=h.default.join(e,`.git`);try{return await(0,m.stat)(t),{path:t}}catch{}return null}async function ce(e,t){let n=h.default.resolve(e),r=n;try{r=h.default.join(await(0,m.realpath)(h.default.dirname(n)),h.default.basename(n))}catch{}for(let e of t){try{e=await(0,m.realpath)(e)}catch{}if(r.startsWith(`${e}${h.default.sep}`))return e}return null}async function le(e){let t=h.default.resolve(h.default.dirname(e)),n=[t];try{let e=await(0,m.realpath)(t);n.includes(e)||n.push(e)}catch{}for(let e of n)if(h.default.basename(e)===`.bin`&&h.default.basename(h.default.dirname(e))===`node_modules`)return e;return null}async function ue(e,t){let n=await ce(e,t);if(n)return{directory:n};let r=await le(e);if(!r)return null;let i=h.default.dirname(r),a=await(0,y.getSkippedNodeModulesReason)(i);return a?{reason:`local node_modules is ${a}`}:{reason:`local bin is outside project lookup boundary`}}async function de(e,t){let n=(0,v.getCommandBase)(e),r=h.default.dirname(t);if(n!==`vercel`||h.default.basename(r)!==`node_modules`)return{reason:`not a local vercel bin`};try{let e=await fe(r);if(`reason`in e)return e;let t=await _e(e.realPackageDirectory);return`reason`in t?t:(e.packageJson=t.packageJson,await ve(e,n))}catch(e){return{reason:`could not validate local vercel package: ${(0,_.getErrorMessage)(e)}`}}}async function fe(e){let t=h.default.join(e,`vercel`),n=await(0,m.realpath)(e),r=await(0,m.realpath)(t);if(!(0,v.isSubpath)(n,r))return{reason:`local vercel package resolves outside local node_modules`};let i=await(0,y.getUnsafePackageDirectoryReason)(n,r);return i?{reason:`local vercel package is unsafe: ${i}`}:{realNodeModulesDirectory:n,realPackageDirectory:r,packageJson:{}}}async function _e(e){let t=h.default.join(e,`package.json`),n=await(0,m.realpath)(t);if(!(0,v.isSubpath)(e,n))return{reason:`local vercel package.json resolves outside package`};let r=await(0,y.getUnsafePackageFileReason)(e,n);if(r)return{reason:`local vercel package.json is unsafe: ${r}`};let i=JSON.parse(await(0,m.readFile)(n,`utf8`));return i.name===`vercel`?{packageJson:i}:{reason:`local vercel package.json does not have name "vercel"`}}async function ve(e,t){let{packageJson:n,realNodeModulesDirectory:r,realPackageDirectory:i}=e,a=ye(n,t);if(!a)return{reason:`local vercel package does not declare bin.vercel`};let o=h.default.resolve(i,a),s=await(0,m.realpath)(o);if(!(0,v.isSubpath)(i,s))return{reason:`local vercel package bin resolves outside package`};let c=await(0,y.getUnsafePackageBinReason)(r,i,s);if(c)return{reason:`local vercel package bin is unsafe: ${c}`};if(process.platform!==`win32`&&!(0,v.isNodeScript)(s))try{await(0,m.access)(s,m.constants.F_OK|m.constants.X_OK)}catch(e){return{reason:`local vercel package bin is not executable: ${(0,_.getErrorMessage)(e)}`}}return{binPath:s}}function ye(e,t){let n=e.bin;if(typeof n==`string`)return t===`vercel`?n:null;if(n&&typeof n==`object`){let e=n[t];if(typeof e==`string`)return e}return null}function be(e,t){return`${e}\0${t}`}0&&(n.exports={clearCachedCliInvocation:w,clearVercelCliLookupCache:ee,findVercelCli:x,getLocalBinSearch:O,resolveCachedCliInvocation:S,toVercelCliInvocation:C})})),ve=i(((e,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!l.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:r(c(e)),d(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(i({},`__esModule`,{value:!0}),e),m={};u(m,{execVercelCli:()=>b}),n.exports=p(m);var h=f(t(`node:path`)),g=f(fe()),_=pe(),v=s(),y=_e();async function b(e,t={}){let n=h.default.resolve(t.cwd??process.cwd());await(0,v.assertValidCwd)(n);let r=C(t.env),i=(0,_.getEnvPath)(r);try{return await x(e,t,n,r,i)}catch(a){if(a instanceof v.VercelCliError&&a.code===`VERCEL_CLI_NOT_FOUND`)return(0,y.clearCachedCliInvocation)(n,i),await x(e,t,n,r,i);throw a}}async function x(e,t,n,r,i){let a=await S(n,i);try{let i={input:t.input,stdio:t.stdio,stdin:t.stdin,stdout:t.stdout,stderr:t.stderr,timeout:t.timeout,cwd:n,env:await ee(n,r),windowsHide:!0};t.signal&&(i.signal=t.signal);let{stdout:o,stderr:s}=await(0,g.default)(a.command,[...a.commandArgs,...e],i);return{stdout:o,stderr:s,invocation:a}}catch(e){throw(0,v.toVercelCliError)(a,e)}}async function S(e,t){let n=await(0,y.resolveCachedCliInvocation)(e,t);if(!n.found)throw new v.VercelCliError({code:`VERCEL_CLI_NOT_FOUND`,message:(0,v.getCliNotFoundMessage)(n.diagnostics)});return(0,y.toVercelCliInvocation)(n)}function C(e){return e?{...process.env,...e}:process.env}async function ee(e,t=process.env){let n=await w(e,(0,_.getEnvPath)(t));return(0,_.setEnvPath)(t,(0,_.prependPathEntries)(n,[h.default.dirname(process.execPath)]))}async function w(e,t=``){return(0,_.prependPathEntries)(t,(await(0,y.getLocalBinSearch)(e)).directories)}0&&(n.exports={execVercelCli:b})})),ye=i(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};o(u,{VercelCliError:()=>d.VercelCliError,clearVercelCliLookupCache:()=>p.clearVercelCliLookupCache,execVercelCli:()=>f.execVercelCli,findVercelCli:()=>p.findVercelCli}),t.exports=l(u);var d=s(),f=ve(),p=_e();0&&(t.exports={VercelCliError,clearVercelCliLookupCache,execVercelCli,findVercelCli})})),be=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_CRED_STORAGE=e.CRED_STORAGE_VALUES=e.CRED_STORAGE_CONFIG_VALUES=void 0,e.CRED_STORAGE_CONFIG_VALUES=[`auto`,`file`,`keyring`],e.CRED_STORAGE_VALUES=e.CRED_STORAGE_CONFIG_VALUES.filter(e=>e!==`auto`),e.DEFAULT_CRED_STORAGE=`file`}));function k(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}function A(e){return e&&Object.assign(we,e),we}var xe,Se,j,Ce,we,Te=n((()=>{xe=Object.freeze({status:`aborted`}),Se=Symbol(`zod_brand`),j=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ce=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},we={}})),Ee=r({BIGINT_FORMAT_RANGES:()=>wt,Class:()=>Tt,NUMBER_FORMAT_RANGES:()=>Ct,aborted:()=>at,allowsEval:()=>yt,assert:()=>je,assertEqual:()=>De,assertIs:()=>ke,assertNever:()=>Ae,assertNotEqual:()=>Oe,assignProp:()=>ze,base64ToUint8Array:()=>dt,base64urlToUint8Array:()=>pt,cached:()=>Pe,captureStackTrace:()=>vt,cleanEnum:()=>ut,cleanRegex:()=>Ie,clone:()=>F,cloneDef:()=>Be,createTransparentProxy:()=>Xe,defineLazy:()=>N,esc:()=>We,escapeRegex:()=>Ye,extend:()=>et,finalizeIssue:()=>z,floatSafeRemainder:()=>Le,getElementAtPath:()=>Ve,getEnumValues:()=>Me,getLengthableOrigin:()=>ct,getParsedType:()=>bt,getSizableOrigin:()=>st,hexToUint8Array:()=>ht,isObject:()=>Ge,isPlainObject:()=>Ke,issue:()=>lt,joinValues:()=>M,jsonStringifyReplacer:()=>Ne,merge:()=>nt,mergeDefs:()=>P,normalizeParams:()=>I,nullish:()=>Fe,numKeys:()=>Je,objectClone:()=>Re,omit:()=>$e,optionalKeys:()=>Ze,partial:()=>rt,pick:()=>Qe,prefixIssues:()=>R,primitiveTypes:()=>St,promiseAllObject:()=>He,propertyKeyTypes:()=>xt,randomString:()=>Ue,required:()=>it,safeExtend:()=>tt,shallowClone:()=>qe,stringifyPrimitive:()=>L,uint8ArrayToBase64:()=>ft,uint8ArrayToBase64url:()=>mt,uint8ArrayToHex:()=>gt,unwrapMessage:()=>ot});function De(e){return e}function Oe(e){return e}function ke(e){}function Ae(e){throw Error()}function je(e){}function Me(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function M(e,t=`|`){return e.map(e=>L(e)).join(t)}function Ne(e,t){return typeof t==`bigint`?t.toString():t}function Pe(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Fe(e){return e==null}function Ie(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Le(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}function N(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==_t)return r===void 0&&(r=_t,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Re(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ze(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function P(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Be(e){return P(e._zod.def)}function Ve(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function He(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function Ue(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function We(e){return JSON.stringify(e)}function Ge(e){return typeof e==`object`&