Skip to content

Commit bad19a5

Browse files
Version Packages
1 parent 7edbfa9 commit bad19a5

File tree

12 files changed

+60
-54
lines changed

12 files changed

+60
-54
lines changed

.changeset/chilly-pugs-cross.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/docker-layer-caching.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/giant-paths-enjoy.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/claude-code/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM docker.io/cloudflare/sandbox:0.4.13
1+
FROM docker.io/cloudflare/sandbox:0.4.14
22
RUN npm install -g @anthropic-ai/claude-code
33
ENV COMMAND_TIMEOUT_MS=300000
44
EXPOSE 3000
55

66
# On a Mac with Apple Silicon, you might need to specify the platform:
7-
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.13
7+
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.14
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This image is unique to this repo, and you'll never need it.
22
# Whenever you're integrating with sandbox SDK in your own project,
33
# you should use the official image instead:
4-
# FROM docker.io/cloudflare/sandbox:0.4.13
5-
FROM cloudflare/sandbox-test:0.4.13
4+
# FROM docker.io/cloudflare/sandbox:0.4.14
5+
FROM cloudflare/sandbox-test:0.4.14
66

77
# On a mac, you might need to actively pick up the
88
# arm64 build of the image.
9-
# FROM --platform=linux/arm64 cloudflare/sandbox-test:0.4.13
9+
# FROM --platform=linux/arm64 cloudflare/sandbox-test:0.4.14

examples/minimal/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM docker.io/cloudflare/sandbox:0.4.13
1+
FROM docker.io/cloudflare/sandbox:0.4.14
22

33
# On a Mac with Apple Silicon, you might need to specify the platform:
4-
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.13
4+
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.14
55

66
# Required during local development to access exposed ports
77
EXPOSE 8080

package-lock.json

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sandbox/CHANGELOG.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# @cloudflare/sandbox
22

3+
## 0.4.14
4+
5+
### Patch Changes
6+
7+
- [#172](https://github.com/cloudflare/sandbox-sdk/pull/172) [`1bf3576`](https://github.com/cloudflare/sandbox-sdk/commit/1bf35768b02532c77df6f30a2f2eb08cb2b12115) Thanks [@threepointone](https://github.com/threepointone)! - Update dependencies
8+
9+
- [#176](https://github.com/cloudflare/sandbox-sdk/pull/176) [`7edbfa9`](https://github.com/cloudflare/sandbox-sdk/commit/7edbfa906668d75f540527f50b52483dc787192c) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Add cache mounts to Dockerfile for faster builds
10+
11+
Adds cache mounts for npm, apt, and pip package managers in the Dockerfile. This speeds up Docker image builds when dependencies change, particularly beneficial for users building from source.
12+
13+
- [#172](https://github.com/cloudflare/sandbox-sdk/pull/172) [`1bf3576`](https://github.com/cloudflare/sandbox-sdk/commit/1bf35768b02532c77df6f30a2f2eb08cb2b12115) Thanks [@threepointone](https://github.com/threepointone)! - Fix type generation
14+
15+
We inline types from `@repo/shared` so that it includes the types we reexport. Fixes #165
16+
317
## 0.4.13
418

519
### Patch Changes
@@ -37,7 +51,6 @@
3751
This adds a new `exists()` method to the SDK that checks whether a file or directory exists at a given path. The method returns a boolean indicating existence, similar to Python's `os.path.exists()` and JavaScript's `fs.existsSync()`.
3852

3953
The implementation is end-to-end:
40-
4154
- New `FileExistsResult` and `FileExistsRequest` types in shared package
4255
- Handler endpoint at `/api/exists` in container layer
4356
- Client method in `FileClient` and `Sandbox` classes
@@ -136,50 +149,47 @@
136149
Implements PID namespace isolation to protect control plane processes (Jupyter, Bun) from sandboxed code. Commands executed via `exec()` now run in isolated namespaces that cannot see or interact with system processes.
137150

138151
**Key security improvements:**
139-
140152
- Control plane processes are hidden from sandboxed commands
141153
- Platform secrets in `/proc/1/environ` are inaccessible
142154
- Ports 8888 (Jupyter) and 3000 (Bun) are protected from hijacking
143155

144156
**Breaking changes:**
145-
146157
1. **Removed `sessionId` parameter**: The `sessionId` parameter has been removed from all methods (`exec()`, `execStream()`, `startProcess()`, etc.). Each sandbox now maintains its own persistent session automatically.
147158

148159
```javascript
149160
// Before: manual session management
150-
await sandbox.exec("cd /app", { sessionId: "my-session" });
161+
await sandbox.exec('cd /app', { sessionId: 'my-session' });
151162

152163
// After: automatic session per sandbox
153-
await sandbox.exec("cd /app");
164+
await sandbox.exec('cd /app');
154165
```
155166

156167
2. **Commands now maintain state**: Commands within the same sandbox now share state (working directory, environment variables, background processes). Previously each command was stateless.
157168

158169
```javascript
159170
// Before: each exec was independent
160-
await sandbox.exec("cd /app");
161-
await sandbox.exec("pwd"); // Output: /workspace
171+
await sandbox.exec('cd /app');
172+
await sandbox.exec('pwd'); // Output: /workspace
162173
163174
// After: state persists in session
164-
await sandbox.exec("cd /app");
165-
await sandbox.exec("pwd"); // Output: /app
175+
await sandbox.exec('cd /app');
176+
await sandbox.exec('pwd'); // Output: /app
166177
```
167178

168179
**Migration guide:**
169-
170180
- Remove `sessionId` from all method calls - each sandbox maintains its own session
171181
- If you need isolated execution contexts within the same sandbox, use `sandbox.createSession()`:
172182
```javascript
173183
// Create independent sessions with different environments
174184
const buildSession = await sandbox.createSession({
175-
name: "build",
176-
env: { NODE_ENV: "production" },
177-
cwd: "/build",
185+
name: 'build',
186+
env: { NODE_ENV: 'production' },
187+
cwd: '/build'
178188
});
179189
const testSession = await sandbox.createSession({
180-
name: "test",
181-
env: { NODE_ENV: "test" },
182-
cwd: "/test",
190+
name: 'test',
191+
env: { NODE_ENV: 'test' },
192+
cwd: '/test'
183193
});
184194
```
185195
- Environment variables set in one command persist to the next

packages/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cloudflare/sandbox",
3-
"version": "0.4.13",
3+
"version": "0.4.14",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/cloudflare/sandbox-sdk"

packages/sandbox/src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
* This file is auto-updated by .github/changeset-version.ts during releases
44
* DO NOT EDIT MANUALLY - Changes will be overwritten on the next version bump
55
*/
6-
export const SDK_VERSION = '0.4.13';
6+
export const SDK_VERSION = '0.4.14';

0 commit comments

Comments
 (0)