eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 679 B
JavaScript
import{SandboxKey}from"#context/keys.js";import{loadContext}from"#context/container.js";async function requireSandboxSession(){let t=loadContext().get(SandboxKey);if(t===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 n=await t.get();if(n===null)throw Error(`The sandbox is not available in the current runtime context.`);return n}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};