da85b1e33c
Client-side counterpart to [e2b-dev/infra#2930](https://github.com/e2b-dev/infra/pull/2930): adds an `includeEntry`/`include_entry` option to filesystem directory watching across the JS and Python (sync + async) SDKs, so each `FilesystemEvent` can carry the affected entry's `EntryInfo` (best-effort — unset for remove/rename-away events where the path no longer exists). This regenerates the filesystem proto code from the updated spec, threads the flag through `watchDir`/`watch_dir` (streaming `WatchDir` and polling `CreateWatcher`), maps the new `entry` field onto the event, and extracts a shared entry-mapping helper reused by `list`/`getInfo`/`rename`. The option degrades gracefully: older sandboxes (< envd 0.6.2) ignore it and leave `entry` unset, so there's no hard version gate. Includes new watch tests for all three SDKs and a minor-bump changeset for `e2b` and `@e2b/python-sdk`. > Note: the entry-info tests require envd 0.6.2 (shipped by the infra PR), so this should land with/after that deploy. ### Usage **JavaScript** ```ts const handle = await sandbox.files.watchDir( 'my-dir', (event) => { console.log(event.type, event.name, event.entry?.path, event.entry?.type) }, { includeEntry: true } ) ``` **Python (async)** ```python def on_event(e): print(e.type, e.name, e.entry.path if e.entry else None) handle = await sandbox.files.watch_dir("my-dir", on_event=on_event, include_entry=True) ``` **Python (sync)** ```python handle = sandbox.files.watch_dir("my-dir", include_entry=True) for e in handle.get_new_events(): print(e.type, e.name, e.entry.path if e.entry else None) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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
2. Get your E2B API key
E2B_API_KEY=e2b_***
3. Start a sandbox and run commands
import Sandbox from 'e2b'
const sandbox = await Sandbox.create()
const result = await sandbox.commands.run('echo "Hello from E2B!"')
console.log(result.stdout) // Hello from E2B!
4. Code execution with Code Interpreter
If you need runCode(), install the Code Interpreter SDK:
npm i @e2b/code-interpreter
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
const execution = await sandbox.runCode('x = 1; x += 1; x')
console.log(execution.text) // outputs 2
5. Check docs
Visit E2B documentation.
6. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.
