470de917ad
I have added tests, but here also a screenshot from Windows machine correctly matching current directory from the caller: <img width="1097" height="501" alt="Screenshot 2025-11-07 at 19 37 41" src="https://github.com/user-attachments/assets/95e3f7e2-efd2-44f9-867e-6de54400c07a" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Enhances `matchFileDir` to parse Windows and file:// stack trace paths and adds tests; include changeset for patch release. > > - **packages/js-sdk**: > - **Template utils (`src/template/utils.ts`)**: > - Update `matchFileDir` regex and normalization to support Windows drive letters, backslashes, and `file:///` URIs; strip `:line:column` and trailing `)`. > - **Tests (`tests/template/utils/matchFileDir.test.ts`)**: > - Add cases for Windows paths (with/without anonymous), `file:///` URIs, and paths containing parentheses. > - **Release**: > - Add changeset (`.changeset/every-wolves-brake.md`) marking a patch for `e2b`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eb5303399e051878a125cef4ee6e92e21edd1867. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
What is E2B?
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.
Run your first Sandbox
1. Install SDK
npm i @e2b/code-interpreter
2. Get your E2B API key
E2B_API_KEY=e2b_***
3. Execute code with code interpreter inside Sandbox
import { Sandbox } from '@e2b/code-interpreter'
const sbx = await Sandbox.create()
await sbx.runCode('x = 1')
const execution = await sbx.runCode('x+=1; x')
console.log(execution.text) // outputs 2
4. Check docs
Visit E2B documentation.
5. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.
