UNPKG

eve

Version:

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

1 lines 797 B
import{SandboxKey}from"#context/keys.js";import{loadContext}from"#context/container.js";import{bindSandboxAbortSignal}from"#execution/sandbox/abort-bound-session.js";async function requireSandboxSession(t){let n=loadContext().get(SandboxKey);if(n===void 0)throw Error(`This tool requires sandbox access on the runtime context. Ensure the step is running inside a managed runtime context with sandbox support.`);let r=await n.get();if(r===null)throw Error(`The sandbox is not available in the current runtime context.`);return t===void 0?r:bindSandboxAbortSignal(r,t)}function validateAbsoluteFilePath(e){if(!e.startsWith(`/`))throw Error(`filePath must be an absolute path. Received: "${e}". Use an absolute path such as /workspace/foo.ts.`)}export{requireSandboxSession,validateAbsoluteFilePath};