{"_id":"@ai-code-agents/vercel-sandbox","name":"@ai-code-agents/vercel-sandbox","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@ai-code-agents/vercel-sandbox","version":"0.1.0","description":"Execution environment for coding agents using Vercel Sandbox.","license":"MIT","type":"module","sideEffects":false,"main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"engines":{"node":">=20.0.0"},"homepage":"https://github.com/felixarntz/ai-code-agents/tree/main/packages/vercel-sandbox#readme","repository":{"type":"git","url":"git+https://github.com/felixarntz/ai-code-agents.git","directory":"packages/vercel-sandbox"},"bugs":{"url":"https://github.com/felixarntz/ai-code-agents/issues"},"keywords":["ai","sdk","coding","code","agent","agentic","tools","tool-calling","environment","sandbox","execution","vercel","vercel-sandbox"],"dependencies":{"@vercel/sandbox":"^1.0.10","@ai-code-agents/environment-utils":"0.1.0"},"devDependencies":{"tsup":"^8.5.0","typescript":"^5.3.3","vitest":"^3.1.1"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","lint":"eslint .","lint:fix":"eslint . --fix","lint:ci":"eslint . --max-warnings 0","format":"prettier --check .","format:fix":"prettier --write .","test":"vitest run","test:ci":"vitest run --coverage","typecheck":"tsc --noEmit"},"_id":"@ai-code-agents/vercel-sandbox@0.1.0","_integrity":"sha512-WMsY1I7roIb9uFElYEOD4M4WIvKD/aCHf6NkEcY9sBwABoRhf1u3iJTEX7hvCPa29RajQI+UiTs609Hj5itNyA==","_resolved":"/private/var/folders/m7/0v_3y4yj3s53_k8gx9k6smlh0000gn/T/133235ebdf06fd500a5f5e1694fb82b0/ai-code-agents-vercel-sandbox-0.1.0.tgz","_from":"file:ai-code-agents-vercel-sandbox-0.1.0.tgz","_nodeVersion":"20.19.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-WMsY1I7roIb9uFElYEOD4M4WIvKD/aCHf6NkEcY9sBwABoRhf1u3iJTEX7hvCPa29RajQI+UiTs609Hj5itNyA==","shasum":"a51e8d6f801b78c5f412659cc843f47ed244cc28","tarball":"https://registry.npmjs.org/@ai-code-agents/vercel-sandbox/-/vercel-sandbox-0.1.0.tgz","fileCount":10,"unpackedSize":137670,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD2DjeTmBy0tehxRFXhbOa4mG+3ISHYrCilW1ykTvIMVwIgZAMryURVthrpkc9Z8KILImRjmIuhaXzmz8cllfQ/Q9s="}]},"_npmUser":{"name":"felixarntz","email":"flixos90@gmail.com"},"directories":{},"maintainers":[{"name":"felixarntz","email":"flixos90@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vercel-sandbox_0.1.0_1767589252861_0.051688762790463416"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-05T05:00:52.761Z","0.1.0":"2026-01-05T05:00:53.021Z","modified":"2026-01-05T05:00:53.392Z"},"maintainers":[{"name":"felixarntz","email":"flixos90@gmail.com"}],"description":"Execution environment for coding agents using Vercel Sandbox.","homepage":"https://github.com/felixarntz/ai-code-agents/tree/main/packages/vercel-sandbox#readme","keywords":["ai","sdk","coding","code","agent","agentic","tools","tool-calling","environment","sandbox","execution","vercel","vercel-sandbox"],"repository":{"type":"git","url":"git+https://github.com/felixarntz/ai-code-agents.git","directory":"packages/vercel-sandbox"},"bugs":{"url":"https://github.com/felixarntz/ai-code-agents/issues"},"license":"MIT","readme":"# @ai-code-agents/vercel-sandbox\n\nExecution environment for AI coding agents using [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox).\n\nThis package integrates with the [ai-code-agents](https://www.npmjs.com/package/ai-code-agents) SDK to provide isolated code execution in ephemeral Linux VMs powered by Firecracker MicroVMs.\n\n## Installation\n\n```bash\nnpm install @ai-code-agents/vercel-sandbox ai-code-agents ai zod\n```\n\n## Quick Start\n\nCreate an AI coding agent with a Vercel Sandbox environment:\n\n```typescript\nimport { openai } from '@ai-sdk/openai';\nimport { createCodeAgent } from 'ai-code-agents';\nimport { VercelSandboxEnvironment } from '@ai-code-agents/vercel-sandbox';\n\n// Create a Vercel Sandbox environment.\nconst environment = await VercelSandboxEnvironment.create({\n  createOptions: { runtime: 'node22' },\n  directoryPath: '/app',\n});\n\n// Create an agent with all tools.\nconst agent = createCodeAgent({\n  model: openai('gpt-5'),\n  environment,\n  environmentToolsDefinition: 'all',\n  maxSteps: 10,\n  logStep: (log) => console.log(log),\n});\n\n// Run the agent.\nconst result = await agent.generate({\n  prompt: 'Create a simple Express server in server.js',\n});\n\nconsole.log(result.text);\n\n// Stop the sandbox when done.\nawait environment.shutdown();\n```\n\nFor more information on how to authenticate with Vercel Sandbox, consult [its documentation](https://vercel.com/docs/vercel-sandbox).\n\n## Advanced Usage\n\n### Using an Existing Sandbox Instance\n\nIf you want to manage the sandbox lifecycle yourself:\n\n```typescript\nimport { Sandbox } from '@vercel/sandbox';\nimport { VercelSandboxEnvironment } from '@ai-code-agents/vercel-sandbox';\n\n// Create sandbox externally.\nconst sandbox = await Sandbox.create({ runtime: 'node22' });\n\n// Pass it to the environment.\nconst environment = new VercelSandboxEnvironment({\n  sandbox,\n  directoryPath: '/app',\n});\n\n// Use the environment with createCodeAgent()...\n\n// Stop the sandbox when done.\nawait environment.shutdown();\n```\n\n### Direct Environment Usage\n\nUse the environment directly without an agent:\n\n```typescript\nimport { VercelSandboxEnvironment } from '@ai-code-agents/vercel-sandbox';\n\nconst env = await VercelSandboxEnvironment.create({\n  createOptions: { runtime: 'node22' },\n  directoryPath: '/app',\n  env: { NODE_ENV: 'development' },\n});\n\n// Run commands.\nconst result = await env.runCommand('node --version');\nconsole.log(result.stdout);\n\n// Read/write files.\nawait env.writeFile('hello.js', 'console.log(\"Hello!\");');\nconst content = await env.readFile('hello.js');\nconsole.log(content);\n\n// Stop the sandbox when done.\nawait env.shutdown();\n```\n\n## Configuration\n\n### Constructor Config (`VercelSandboxEnvironmentConfig`)\n\nUse this when you have an existing sandbox instance:\n\n| Option          | Type                     | Description                                                               |\n| --------------- | ------------------------ | ------------------------------------------------------------------------- |\n| `sandbox`       | `Sandbox`                | **Required.** An existing Vercel Sandbox instance to use.                 |\n| `directoryPath` | `string`                 | Working directory path within the sandbox. Defaults to `/vercel/sandbox`. |\n| `env`           | `Record<string, string>` | Environment variables to set when running commands.                       |\n\n### Factory Options (`VercelSandboxEnvironmentCreateFactoryOptions`)\n\nUse this with `VercelSandboxEnvironment.create()`:\n\n| Option          | Type                     | Description                                                               |\n| --------------- | ------------------------ | ------------------------------------------------------------------------- |\n| `createOptions` | `SandboxOpts`            | Options for creating a new sandbox. Defaults to `{}`.                     |\n| `directoryPath` | `string`                 | Working directory path within the sandbox. Defaults to `/vercel/sandbox`. |\n| `env`           | `Record<string, string>` | Environment variables to set when running commands.                       |\n\n## Contributing\n\nContributions to the AI Code Agents SDK are welcome and highly appreciated. Please review the [contributing guidelines](https://github.com/felixarntz/ai-code-agents/blob/main/CONTRIBUTING.md) to learn more about how you can contribute.\n","readmeFilename":"README.md","_rev":"1-e9ad22b53c346530150d442c36064dd2"}