Commit Graph

1440 Commits

Author SHA1 Message Date
Jakub Dobry 1fa99a3d20 feat: devcontainer template support (#988) 2025-10-24 14:20:29 -07:00
github-actions[bot] cb7464d2e4 [skip ci] Release new versions 2025-10-22 19:31:53 +00:00
Mish Ushakov c432805161 Promote beta MCP features to main (#986)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Promotes MCP to stable across JS/Python SDKs: add `mcp` config to
sandbox creation, auto-select MCP template, start gateway with token,
rename beta APIs to stable (`getMcpUrl`/`getMcpToken`, `addMcpServer`).
> 
> - **JS SDK**:
> - **Sandbox creation**: `Sandbox.create` now accepts `opts.mcp`;
auto-selects `defaultMcpTemplate`, starts `mcp-gateway` with generated
token, and returns initialized sandbox.
> - **API opts**: Move `mcp` from `SandboxBetaCreateOpts` to
`SandboxOpts`; pass `mcp` through `SandboxApi.createSandbox`.
> - **Stable MCP APIs**: Rename `betaGetMcpUrl` -> `getMcpUrl`,
`betaGetMcpToken` -> `getMcpToken`.
>   - **Template builder**: Rename `betaAddMcpServer` -> `addMcpServer`.
>   - **Tests**: Update stacktrace tests to new method names.
> - **Python SDK**:
> - **Sandbox creation**: `AsyncSandbox.create`/`Sandbox.create` accept
`mcp`; auto-select MCP template when unset, start `mcp-gateway`, store
token.
> - **Stable MCP APIs**: Add `get_mcp_url`; rename `beta_get_mcp_token`
-> `get_mcp_token`.
> - **Types**: Minor signature tweaks (e.g., `secure` default handling).
>   - **Tests**: Update stacktrace tests to new method names.
> - **Release**:
>   - Changeset: minor version bumps for `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9c673f80eee37e530d05c6becf5a4a3c492ac9f3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-22 21:22:02 +02:00
github-actions[bot] 115e73b5a1 [skip ci] Release new versions 2025-10-22 09:44:35 +00:00
Mish Ushakov 818e8c2647 Add force option to make symlink method (#984)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds a force option to makeSymlink that passes -f to ln, with
typings/docs and tests across JS and Python SDKs.
> 
> - **Template symlink enhancement**
>   - **JS SDK (`packages/js-sdk`)**:
> - `makeSymlink(src, dest, options)` now accepts `{ user?: string;
force?: boolean }` and appends `-f` when `force` is true in
`src/template/index.ts`.
> - Types updated in `src/template/types.ts`, including example usage
with `{ force: true }`.
> - Tests added in `tests/template/methods/makeSymlink.test.ts` (regular
and forced).
>   - **Python SDK (`packages/python-sdk`)**:
> - `make_symlink(src, dest, user=None, force=False)` now supports
`force` and appends `-f` when true in `e2b/template/main.py`.
>     - Docstring examples updated to include `force=True`.
> - Tests added for async and sync in
`tests/async/template_async/methods/test_make_symlink.py` and
`tests/sync/template_sync/methods/test_make_symlink.py`.
> - **Release**:
>   - Changeset added for patch releases of `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6c5bbf9edfc7234b703046f387d11b8f10a002ab. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-22 00:48:11 +02:00
Mish Ushakov de2a922aa5 Make no install recommends optional (#983)
This was causing some unexpected issues if users were trying to
apt-install some packages that needed recommended dependencies.

<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds an option to `aptInstall`/`apt_install` to toggle
`--no-install-recommends`, updates typings/docs, and adds tests for both
modes.
> 
> - **Template APIs**:
>   - **JS SDK (`packages/js-sdk`)**:
> - `aptInstall` now accepts `options?: { noInstallRecommends?: boolean
}` and conditionally includes `--no-install-recommends`.
>     - Types updated in `src/template/types.ts` with example usage.
>   - **Python SDK (`packages/python-sdk`)**:
> - `apt_install` now accepts `no_install_recommends: bool = False` and
conditionally includes `--no-install-recommends`.
> - **Tests**:
> - JS: Add `aptInstall` tests (with and without `noInstallRecommends`);
refactor `npmInstall` tests to use `buildTemplateTest` helper.
> - Python: Add async and sync tests for `apt_install` with and without
`no_install_recommends`.
> - **Changeset**:
> - Patch bumps for `@e2b/python-sdk` and `e2b` with note on making
`--no-install-recommends` optional.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
3963b7daca73f1cfb99f405b09fbfb86c40c4b4f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-21 14:59:57 -07:00
github-actions[bot] eb2dfd4bff [skip ci] Release new versions 2025-10-21 14:59:48 +00:00
Mish Ushakov d4619f641b Fixes ubuntu default image tag and added tests (#982)
The "lts" tag was unavailable on Docker Hub

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Switch default Ubuntu image tag from 'lts' to 'latest' across
JS/Python SDKs and expand/refactor template tests and test config.
> 
> - **SDKs**:
> - **Ubuntu default**: Change `fromUbuntuImage`/`from_ubuntu_image`
default variant from `'lts'` to `'latest'` in
`packages/js-sdk/src/template/index.ts` and
`packages/python-sdk/e2b/template/main.py`; update TS docs in
`packages/js-sdk/src/template/types.ts`.
> - **Tests**:
> - **JS**: Refactor template tests to use `buildTemplateTest`, add
`tests/template/methods/fromMethods.test.ts`, adjust npm/pip/runCmd
tests (include user install with `g: false`), and remove per-test
timeouts where not needed.
> - **Python (async/sync)**: Add comprehensive tests for from* methods,
npm/pip installs (including user installs), and runCmd behaviors; switch
to shared build fixtures.
> - **Vitest config**: Exclude `tests/template/**` from the main suite
and include all template tests in a dedicated project in
`vitest.workspace.mts`.
> - **Changeset**:
>   - Patch bumps for `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0bf3a7c15122d28cbc99b8faa44e7e217f634377. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-21 16:47:09 +02:00
Mish Ushakov 314bc14143 Test setup: append "e2b-test" to templates generated in tests (#981)
So that we ca distinguish templates in our team account that are built
from the CI tests.
2025-10-21 12:29:58 +00:00
Joseph Lombrozo ee8ec18829 Add a 'pretest' step to install chromium (#977)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Install Playwright Chromium via a new js-sdk pretest script and remove
redundant Playwright installs from CI workflows.
> 
> - **CI Workflows**:
> - Remove `npx playwright install --with-deps` from
`github/workflows/js_sdk_tests.yml` and
`github/workflows/release_candidates.yml` JS test steps.
> - **JS SDK (`packages/js-sdk/package.json`)**:
> - Add `pretest` script: `npx playwright install --with-deps chromium`
to handle Playwright installation automatically.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
e05fc4d5ff2edf96c62633c302775dc8a218c050. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-20 19:36:35 -07:00
github-actions[bot] 5df9090f57 [skip ci] Release new versions 2025-10-20 22:16:19 +00:00
Jonas Scholz 68abd92c40 Add mcp server prepull (#975)
Adds prepulling mcp server images to the SDK.

```typescript
export const template = Template()
    .fromTemplate("mcp-gateway")
    .betaAddMcpServer("arxiv")

await Template.build(template, {
    alias: "arxiv-mcp-gateway",
    cpuCount: 1,
    memoryMB: 1024,
    onBuildLogs: console.log,
});

```


```python
template = Template().from_template("mcp-gateway").beta_add_mcp_server("arxiv")

Template.build(
    template,
    alias="arxiv-mcp-gateway-v1",
    cpu_count=1,
    memory_mb=1024,
)

```


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduce beta methods to prepull MCP servers via mcp-gateway in JS
and Python templates, with typing, validation, and stacktrace-tested
errors.
> 
> - **Template SDKs**
>   - **JS**:
> - Add `Template.betaAddMcpServer(servers: McpServerName |
McpServerName[])` to run `mcp-gateway pull ...`.
> - Enforce base template check (`'mcp-gateway'`), throwing `BuildError`
with stack trace.
> - Introduce and export `McpServerName` type (from `../sandbox/mcp`).
>   - **Python**:
> - Add `Template.beta_add_mcp_server(servers: Union[str, List[str]])`
to run `mcp-gateway pull ...`.
> - Enforce `'mcp-gateway'` base template; raise `BuildException` with
captured traceback.
> - **Tests**
> - Add stacktrace tests for `betaAddMcpServer` (JS) and
`beta_add_mcp_server` (Python async/sync).
> - **Release**
>   - Changeset: patch bumps for `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
43b4a01ce3c856dff7def5ba6b706ee00eda0f84. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Joseph Lombrozo <joe.lombrozo@e2b.dev>
2025-10-20 14:52:30 -07:00
Joseph Lombrozo 3e430f66a1 support overriding apiUrl directly (#948)
This allows you to set E2B_API_URL and override the entire API URL in
the CLI and the SDK

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds API URL override to the JS SDK `ConnectionConfig` (via `apiUrl`
option or `E2B_API_URL`), with tests and test config updates.
> 
> - **JS SDK**:
> - **ConnectionConfig**: Add `apiUrl` option and resolve priority
`opts.apiUrl` → `E2B_API_URL` → `debug ? http://localhost:3000 :
https://api.${domain}`; add static `apiUrl` env getter.
> - **Tests**:
> - Add `tests/connectionConfig.test.ts` covering defaults, arg/env
override, and priority.
> - Update `vitest.workspace.mts` to exclude this test from the main
suite and run it in an isolated project with its own timeout.
> - **Release**:
>   - Add changeset for patch bumps (`e2b`, `@e2b/cli`).
> - **Misc**:
>   - Remove `packages/python-sdk/.tool-versions`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
46a86cba18865bd34ed5561a040af7736955c4ea. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Tomas Valenta <valenta.and.thomas@gmail.com>
2025-10-20 14:45:04 -07:00
Mish Ushakov 83243d5b43 Add user option to fs methods in Template (#976)
(no tests as nothin was breaking)


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds an optional `user` parameter to fs-related template methods and
`gitClone`, with tests for running commands as specific users.
> 
> - **SDKs**:
>   - **JS (`packages/js-sdk`)**:
> - Add `user` option to `TemplateBuilder` methods: `remove`, `rename`,
`makeDir`, `makeSymlink`, and `gitClone`; pass through to `runCmd`.
>     - Update type defs and examples in `src/template/types.ts`.
>   - **Python (`packages/python-sdk`)**:
> - Add `user` arg to `TemplateBuilder` methods: `remove`, `rename`,
`make_dir`, `make_symlink`, and `git_clone`; forward to `run_cmd`.
>     - Update docstrings/examples.
> - **Tests**:
> - JS: add `runCmd` tests for default, specific `user`, and invalid
user in `packages/js-sdk/tests/template/methods/runCmd.test.ts`.
> - Python: add async and sync `run_cmd` tests (default, specific
`user`, invalid user) in
`packages/python-sdk/tests/async/.../test_run_cmd.py` and
`packages/python-sdk/tests/sync/.../test_run_cmd.py`.
> - **Release**:
> - Add changeset (`.changeset/warm-seals-design.md`) marking patch
bumps for `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b0cbedc1d5c136367155c5646859842bd666b0d9. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-20 23:44:05 +02:00
Jonas Scholz 12daca8b39 Add custom MCP to SDK (#974)
This adds (experimantal) support to add arbitrary MCP server from
Github.
```python
sbx = await AsyncSandbox.beta_create(timeout=600, mcp={
    "github/modelcontextprotocol/servers": {
        "install_cmd": "npm install",
        "run_cmd": "sudo npx -y @modelcontextprotocol/server-filesystem /root",
    },
})
```

or in TS with better typing:

```typescript
const sandbox = await Sandbox.betaCreate({
    mcp: {
        duckduckgo: {},        
        'github/modelcontextprotocol/servers': {
            installCmd: 'npm install',
            runCmd: `sudo npx -y @modelcontextprotocol/server-filesystem /root`,
        },
    },
    timeoutMs: 600_000,
});
```


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds beta support to launch custom MCP servers (including
GitHub-defined ones) and updates MCP schemas/types; also switches
default MCP template to `mcp-gateway`.
> 
> - **SDK (JS & Python)**:
> - Add beta support for `mcp` config, including dynamic GitHub-based
servers with custom `runCmd/installCmd/envs` and automatic `mcp-gateway`
startup with token.
>   - Send `UNSET`/omit when `mcp` not provided to avoid API noise.
> - Change default MCP template from `mcp-gateway-v0-2` to
`mcp-gateway`.
> - **Types/Schema**:
> - Extend `McpServer` typings (JS `mcp.d.ts`, Python type hints) to
include many servers and descriptive metadata.
> - Introduce GitHub MCP types (TS `GitHubMcpServer`, Python
`GitHubMcpServerConfig`) and export in SDK surfaces.
> - Regenerate and enrich `spec/mcp-server.json` with
titles/descriptions and new server entries.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f3139b8fc2f1246c72734d8048ba277a13e3949d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-20 14:38:18 -07:00
Joseph Lombrozo 8c77cb04db Support overriding the api_url directly (#946)
This will help for local development

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Add support to override the API base URL via `api_url` parameter or
`E2B_API_URL` env var with clear precedence.
> 
> - **Python SDK**:
>   - **ConnectionConfig**:
> - Add `api_url` parameter and `_api_url()` env lookup (`E2B_API_URL`).
> - Resolve `api_url` in order: constructor arg > `E2B_API_URL` >
`debug` localhost or `https://api.<domain>`.
>   - **API Params**:
> - Include `api_url` in `ApiParams` and propagate via `get_api_params`.
>   - **Tests** (`packages/python-sdk/tests/test_connection_config.py`):
>     - Verify default, arg override, env override, and precedence.
> - **Changeset**: Patch release for `@e2b/python-sdk`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9be6d4e85bb0ad8ea52ad61c77530ac72f231c54. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-20 11:53:19 -07:00
Jonas Scholz cc595f3fc8 Revert timeout changes in tests (#973) 2025-10-20 00:25:50 +02:00
github-actions[bot] 04f3a1e036 [skip ci] Release new versions 2025-10-18 17:46:41 +00:00
Mish Ushakov c47927f1d0 Fix .toDocker RUN and COPY handling (#972)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Fix Dockerfile generation to properly render `RUN` and `COPY`
instructions using only relevant args, and add patch changesets.
> 
> - **Template to Dockerfile generation**:
> - JS (`packages/js-sdk/src/template/index.ts`): Special-case `RUN` and
`COPY` so Dockerfile emits `RUN <cmd>` and `COPY <src> <dest>` instead
of joining all args.
> - Python (`packages/python-sdk/e2b/template/main.py`): Same
special-casing for `RUN` and `COPY` during Dockerfile rendering.
> - **Release**:
> - Changeset: patch bumps for `@e2b/python-sdk` and `e2b` with note
"fix RUN and COPY handling in to_dockerfile".
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
04b2dbbda34f0845f3d4ec9963cc478b7b7b7f01. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-18 19:35:22 +02:00
github-actions[bot] 538283691d [skip ci] Release new versions 2025-10-17 23:46:29 +00:00
Jonas Scholz 1a51777cc0 Fix mcp gateway race condition (#971)
Previously the gateway was just fire and forget which lead to a race
condition when you immediately tried to access the mcp server, changed
the template to launch a daemon with healthcheck.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Start MCP gateway synchronously with error checks and bump default MCP
template to `mcp-gateway-v0-2` across JS and Python SDKs.
> 
> - **MCP Gateway startup**:
> - JS (`packages/js-sdk/src/sandbox/index.ts`): Start `mcp-gateway`
without background mode; validate exit code and throw on failure.
> - Python Async (`packages/python-sdk/e2b/sandbox_async/main.py`):
Await `mcp-gateway` start, remove background/timeout flags; raise on
non-zero exit.
> - Python Sync (`packages/python-sdk/e2b/sandbox_sync/main.py`): Run
`mcp-gateway` synchronously; check exit code and raise on failure.
> - **Defaults**:
> - Update `default_mcp_template` from `mcp-gateway-v0-1` to
`mcp-gateway-v0-2` in JS and Python SDKs.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
79e431c78bf384c970a5b1fede55071116a089c5. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-17 16:21:32 -07:00
Jonas Scholz d7d55df930 Add mcp to request body (#961)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds `mcp` config support for sandbox creation across API, JS, and
Python SDKs, and updates timeout tests to use explicit request timeouts.
> 
> - **API/OpenAPI**:
> - Add `McpConfig` schema and `mcp` field to `NewSandbox` in
`spec/openapi.yml` and generated TS `schema.gen.ts`.
> - **JS SDK**:
> - `SandboxApi.createSandbox` sends `mcp` in POST body
(`packages/js-sdk/src/sandbox/sandboxApi.ts`).
>   - Types updated to include `components["schemas"]["McpConfig"]`.
> - **Python SDK**:
> - Extend `NewSandbox` model and sandbox create flow to accept/pass
`mcp`; async/sync APIs propagate `mcp` to POST `/sandboxes`.
> - **Tests**:
> - Increase `is_running` request timeouts in timeout tests to reduce
flakiness (JS and Python).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
04ad4e6d4947e33523b74aba2f703fa1e9c05e72. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-17 12:31:32 -07:00
github-actions[bot] 546a2282fa [skip ci] Release new versions 2025-10-17 17:08:22 +00:00
Jonas Scholz 057f9027f0 Fix e2b tpl publish/delete --config flag (#968) 2025-10-17 10:04:21 -07:00
Jakub Dobry c2cc1469f6 fix: CLI tests setup (#969) 2025-10-17 05:03:18 -07:00
github-actions[bot] d009507128 [skip ci] Release new versions 2025-10-16 23:25:59 +00:00
Mish Ushakov 7358b6120b Fix global packages permissions error (#967)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Global installs for pip/npm now run as root; pip gains an option to
install per-user instead.
> 
> - **Template SDKs**:
>   - **JavaScript (`packages/js-sdk/src/template`)**:
> - `pipInstall` now supports `options: { g?: boolean }` (default
`true`); when `g` is `true`, runs as `root`, when `false`, adds `--user`
and runs as current user.
>     - `npmInstall` runs as `root` when `options.g` is `true`.
>   - **Python (`packages/python-sdk/e2b/template/main.py`)**:
> - `pip_install` now accepts `g: bool = True`; when `True`, runs as
`root`, when `False`, adds `--user` and runs as current user.
>     - `npm_install` runs as `root` when `g` is `True`.
> - **Changeset**: patch bump for `@e2b/python-sdk` and `e2b` with note:
install global packages as sudo.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6be5ba211f7d200d50ffca50c1751d455b3e2cfa. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-16 22:30:13 +02:00
github-actions[bot] ace327e948 [skip ci] Release new versions 2025-10-16 11:50:51 +00:00
Jakub Dobry c05c8c6f24 Build System v2 Introduction (#957) 2025-10-16 04:41:21 -07:00
Mish Ushakov b0aeeb5222 Revert "Add a postinstall that downloads chromium" (#964) 2025-10-16 11:40:28 +00:00
Mish Ushakov 48acc022f3 SDK reference: display submodules in the sidebar (#960) 2025-10-16 11:32:39 +00:00
Mish Ushakov 1d0d404dc0 Move template exceptions to shared (#953)
Co-authored-by: Jakub Dobry <jakub.dobry8@gmail.com>
2025-10-16 03:57:00 -07:00
Joseph Lombrozo 5377b855cb Add a postinstall that downloads chromium (#962)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Move Playwright installation to JS SDK postinstall (Chromium) and
remove explicit installs from CI workflows.
> 
> - **Workflows**:
> - Remove `npx playwright install --with-deps` from
`/.github/workflows/js_sdk_tests.yml` and
`/.github/workflows/release_candidates.yml`.
> - **JS SDK (`packages/js-sdk/package.json`)**:
>   - Add `postinstall` script: `pnpm exec playwright install chromium`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6bc96ae4b8da0e03d98e99e6ecdc4e952d530866. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-15 16:12:16 -07:00
Mish Ushakov d877205874 Implement stack traces override context for fromDockerfile (#959)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds a stack trace override context so fromDockerfile errors point to
the caller; enables related tests and bumps patch versions.
> 
> - **Template stack traces**:
>   - JS (`packages/js-sdk/src/template/index.ts`):
>     - Add `stackTracesOverride` and `runInStackTraceOverrideContext`.
> - `fromDockerfile` parses within override using
`getCallerFrame(STACK_TRACE_DEPTH - 1)`.
>     - `collectStackTrace` respects override.
>   - Python (`packages/python-sdk/e2b/template/main.py`):
> - Add `_stack_traces_override` and
`_run_in_stack_trace_override_context`.
> - `from_dockerfile` parses within override using caller frame-derived
`TracebackType`.
>     - `_collect_stack_trace` respects override.
> - **Tests**:
> - Enable stack trace expectations for `fromTemplate` and
`fromDockerfile` in JS and Python (sync/async) stacktrace tests.
> - **Release**:
>   - Patch bumps for `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
ef0db209ea968b2cedb39cd56b82f637ede3e4e0. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-15 09:31:50 -07:00
Jakub Dobry 3046491ea9 feat: set default user and workdir when using Dockerfile (#954)
Set default user for Dockerfiles. Includes also small migrate fixes.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Defaults Dockerfile-based templates to user 'user' and workdir
'/home/user', updates CLI templates (sudo start/ready, relative Python
import), and allows template migration without a config file.
> 
> - **SDKs (Dockerfile parsing)**:
> - JS (`packages/js-sdk/src/template/dockerfileParser.ts`) and Python
(`packages/python-sdk/e2b/template/dockerfile_parser.py`): after
parsing, set defaults `setUser('user')` and `setWorkdir('/home/user')`.
> - **CLI Templates**:
> - Python build scripts: switch to relative import `from .template
import template`.
> - Generated template hbs: start/ready commands now prefixed with
`sudo`; removed explicit root/workdir before start/ready.
> - **CLI Migrate**:
> - Supports migration without `e2b.toml`; uses default config values
and prints a warning instead of exiting.
> - Initializes default config when missing; success messaging adjusted.
> - **Tests**:
> - Update fixtures to reflect new defaults (`set_user('user')`,
`set_workdir('/home/user')`, `sudo` start/ready, relative imports).
>   - Relax error case to succeed with warning when config is missing.
> - Comment out stacktrace tests for `fromDockerfile` in JS/Python until
fixed.
> - **Changesets**: Patch bumps for `@e2b/cli`, `@e2b/python-sdk`, and
`e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
934dc3b23b5607f70d4a4f5b7a9413a9d04df28a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-15 05:51:40 -07:00
Jakub Dobry 86786e578f fix: template tests after infra update (#956)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Updates stacktrace tests to use root-owned paths for workdir/dir ops
and a more explicit failing set_user command in JS and Python
(async/sync) SDKs.
> 
> - **Tests (stacktrace)**:
>   - **JS SDK (`packages/js-sdk/tests/template/stacktrace.test.ts`)**:
> - `setWorkdir`: set user to `root` and change path to `/root/.bashrc`.
>     - `setUser`: use `; exit 1` as the failing command.
>   - **Python SDK**:
> - Async
(`packages/python-sdk/tests/async/template_async/test_stacktrace.py`):
> - `make_dir`, `set_workdir`: set user to `root` and target
`/root/.bashrc`.
>       - `set_user`: use `; exit 1` as the failing command.
> - Sync
(`packages/python-sdk/tests/sync/template_sync/test_stacktrace.py`):
> - `make_dir`, `set_workdir`: set user to `root` and target
`/root/.bashrc`.
>       - `set_user`: use `; exit 1` as the failing command.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
780023b3819f19ba908ccd794195e630bab2741b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-15 03:26:35 -07:00
Jakub Dobry de771ea3eb feat: keep user and workdir from the template in the sandbox (#944) 2025-10-15 00:23:01 -07:00
github-actions[bot] 75f5a473e5 [skip ci] Release new versions 2025-10-14 21:05:31 +00:00
Jonas Scholz 5943485644 Add auth to MCP (#950)
Changed to use commands instead of API and added auth.


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Introduce MCP auth by launching mcp-gateway with an access token and
exposing a token getter; replace HTTP config with command execution and
bump default MCP template to v0-1.
> 
> - **SDKs**:
>   - **MCP auth**:
> - Launch `mcp-gateway` via `commands.run` with `GATEWAY_ACCESS_TOKEN`
set to a generated token (JS/TS and Python, async/sync).
> - Expose token retrieval: `betaGetMcpToken()` (JS) and
`beta_get_mcp_token()` (Python) reading `/etc/mcp-gateway/.token` if
needed.
>   - **Configuration flow**:
> - Replace HTTP `POST /config` setup with command-based startup; remove
retry logic (JS and Python).
>   - **Defaults**:
> - Update `defaultMcpTemplate`/`default_mcp_template` to
`mcp-gateway-v0-1` (JS and Python).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4456a1822d87fa32110f6659c3bf9135bff71045. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-14 12:39:17 -07:00
Mish Ushakov 73114272e0 Add docstrings to public-facing template methods (#943)
(Feel free to just suggest edits so it's faster)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds extensive docstrings across JS/Python template APIs, updates
default base image versions, and adjusts JS SDK exports and logger
internals.
> 
> - **Docs/Comments**:
> - Add comprehensive docstrings and examples across `template` modules
(JS and Python): `consts`, `errors/exceptions`, `index/main`, `logger`,
`readycmd`, `types`, `utils`, and async/sync builders.
> - **JS SDK**:
> - Re-export `BuildOptions`, `CopyItem`, `TemplateBuilder`,
`TemplateClass` from `template/types` via `src/index.ts`.
>   - Simplify `template` exports to `Template` and `type TemplateBase`.
> - Rename internal build logger to `DefaultBuildLogger` (used by
`defaultBuildLogger`).
> - **Defaults**:
> - Change `fromDebianImage()` default variant to `stable` and
`fromPythonImage()` default to `3` (JS and Python).
> - **Misc**:
> - Add internal documentation for stack tracing, hashing, ready checks;
minor wording/consistency tweaks.
>   - Add changeset for patch releases of `@e2b/python-sdk` and `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
37d21d8543e1e9c6b61c0b7ad7cd254774767524. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-14 09:04:07 -07:00
github-actions[bot] ff1f37ce9c [skip ci] Release new versions 2025-10-14 12:46:58 +00:00
Jakub Novák bec5b140c8 Update openapi fetch (#929)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Upgrade openapi-fetch to v0.14 and openapi-typescript to v7.9 with
required API/middleware changes, adjust multipart upload, and extend Bun
test with file I/O.
> 
> - **JS SDK**:
> - **Dependencies**: Bump `openapi-fetch` to `^0.14.1` and
`openapi-typescript` to `^7.9.1`.
>   - **API Client (`src/envd/api.ts`)**:
> - Update `handleEnvdApiError` to accept `{ error, response }` per new
client response shape; remove `FetchResponse` generic import.
>   - **Logging (`src/logs.ts`)**:
> - Update `Middleware` usage to new signatures: `onRequest({ request
})` and `onResponse({ response })` and return `request`/`response`.
>   - **Filesystem (`src/sandbox/filesystem/index.ts`)**:
> - Adjust `POST /files` multipart upload: use `bodySerializer()` with
`FormData`; remove manual `Content-Type` headers; minor comment typo
fix.
>   - **Tests**:
>     - Extend Bun runtime test to write/read a file via `sbx.files`.
>   - **Release**: Add patch changeset.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
03afbac2fdcf761368bc91040f1d715711994c6c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-14 05:31:06 -07:00
github-actions[bot] ebb3f08039 [skip ci] Release new versions 2025-10-14 10:07:23 +00:00
Jakub Dobry f12291272d fix: set correct Dockerfile user workdir defaults (#941) 2025-10-14 09:59:00 +00:00
Joseph Lombrozo 5014ee2609 Upgrade to latest 1.8.x version of poetry (#947)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Update CI to use Poetry 1.8.3 across workflows and add
`.tool-versions` (Python 3.9.24, Poetry 1.8.3) for the Python SDK.
> 
> - **CI/Workflows**:
> - Bump Poetry from `1.5.1` to `1.8.3` in
`/.github/workflows/{lint.yml,publish_packages.yml,python_sdk_tests.yml,release_candidates.yml}`.
> - **Tooling**:
> - Add `packages/python-sdk/.tool-versions` specifying `python 3.9.24`
and `poetry 1.8.3`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
9ae519772a9cd62333313dcc594edcc90a591c0a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-13 17:35:02 -07:00
github-actions[bot] 5be42d11a5 [skip ci] Release new versions 2025-10-10 12:36:03 +00:00
Mish Ushakov c40eeaac38 Improve regex for fileContextPath (#939)
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Improve stack-trace path parsing for caller directory and add
JS/Python tests; publish as patch.
> 
> - **Template utils (JS SDK)**:
> - Add `matchFileDir` to robustly extract file directory from
stack-trace lines (handles anonymous frames).
> - Refactor `getCallerDirectory` to use `matchFileDir` for path
parsing.
> - **Tests**:
>   - Add JS tests for `getCallerDirectory` and `matchFileDir`.
>   - Add Python async/sync tests for `get_caller_directory`.
> - **Release**:
>   - Add changeset marking a patch for `e2b`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6bd8aa7353479c1657f63c99c732faee042f4c06. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Jakub Dobry <jakub.dobry8@gmail.com>
2025-10-10 12:27:40 +00:00
github-actions[bot] 5b7b3f6a25 [skip ci] Release new versions 2025-10-09 20:55:56 +00:00
Tomas Valenta 498edd876c Remove log in MCP init (#940) 2025-10-09 20:49:17 +00:00
github-actions[bot] 263f680bab [skip ci] Release new versions 2025-10-09 16:34:42 +00:00