eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 828 B
JavaScript
import{getVercelSandboxCredentials,getVercelSandboxFetch}from"#execution/sandbox/bindings/vercel-credentials.js";import{isVercelSandboxMissingError}from"#execution/sandbox/bindings/vercel-errors.js";import{errorMessage}from"#execution/sandbox/bindings/vercel-options.js";async function getNamedVercelSandbox(e){try{return await e.sandboxModule.Sandbox.get(await getVercelSandboxGetOptions(e))}catch(t){if(isVercelSandboxMissingError(t))return null;throw Error(`Failed to look up Vercel sandbox "${e.sandboxName}": ${errorMessage(t)}`,{cause:t})}}async function getVercelSandboxGetOptions(e){let t={fetch:getVercelSandboxFetch(e.createOptions),name:e.sandboxName,resume:!1};try{let n=await getVercelSandboxCredentials(e.createOptions);return{...t,...n,signal:e.createOptions.signal}}catch{return t}}export{getNamedVercelSandbox};