Skip to content

Commit b0c4c97

Browse files
Version Packages (#174)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 77cb937 commit b0c4c97

File tree

13 files changed

+62
-59
lines changed

13 files changed

+62
-59
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.

.changeset/hot-pans-warn.md

Lines changed: 0 additions & 5 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: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
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+
17+
- [#175](https://github.com/cloudflare/sandbox-sdk/pull/175) [`77cb937`](https://github.com/cloudflare/sandbox-sdk/commit/77cb93762a619523758f769a10509e665ca819fe) Thanks [@ghostwriternr](https://github.com/ghostwriternr)! - Move .connect to .wsConnect within DO stub
18+
319
## 0.4.13
420

521
### Patch Changes
@@ -37,7 +53,6 @@
3753
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()`.
3854

3955
The implementation is end-to-end:
40-
4156
- New `FileExistsResult` and `FileExistsRequest` types in shared package
4257
- Handler endpoint at `/api/exists` in container layer
4358
- Client method in `FileClient` and `Sandbox` classes
@@ -136,50 +151,47 @@
136151
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.
137152

138153
**Key security improvements:**
139-
140154
- Control plane processes are hidden from sandboxed commands
141155
- Platform secrets in `/proc/1/environ` are inaccessible
142156
- Ports 8888 (Jupyter) and 3000 (Bun) are protected from hijacking
143157

144158
**Breaking changes:**
145-
146159
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.
147160

148161
```javascript
149162
// Before: manual session management
150-
await sandbox.exec("cd /app", { sessionId: "my-session" });
163+
await sandbox.exec('cd /app', { sessionId: 'my-session' });
151164

152165
// After: automatic session per sandbox
153-
await sandbox.exec("cd /app");
166+
await sandbox.exec('cd /app');
154167
```
155168

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

158171
```javascript
159172
// Before: each exec was independent
160-
await sandbox.exec("cd /app");
161-
await sandbox.exec("pwd"); // Output: /workspace
173+
await sandbox.exec('cd /app');
174+
await sandbox.exec('pwd'); // Output: /workspace
162175
163176
// After: state persists in session
164-
await sandbox.exec("cd /app");
165-
await sandbox.exec("pwd"); // Output: /app
177+
await sandbox.exec('cd /app');
178+
await sandbox.exec('pwd'); // Output: /app
166179
```
167180

168181
**Migration guide:**
169-
170182
- Remove `sessionId` from all method calls - each sandbox maintains its own session
171183
- If you need isolated execution contexts within the same sandbox, use `sandbox.createSession()`:
172184
```javascript
173185
// Create independent sessions with different environments
174186
const buildSession = await sandbox.createSession({
175-
name: "build",
176-
env: { NODE_ENV: "production" },
177-
cwd: "/build",
187+
name: 'build',
188+
env: { NODE_ENV: 'production' },
189+
cwd: '/build'
178190
});
179191
const testSession = await sandbox.createSession({
180-
name: "test",
181-
env: { NODE_ENV: "test" },
182-
cwd: "/test",
192+
name: 'test',
193+
env: { NODE_ENV: 'test' },
194+
cwd: '/test'
183195
});
184196
```
185197
- 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"

0 commit comments

Comments
 (0)