Repository navigation
feat: expose sandbox preview in the Python and Node SDKs - #797
Merged
alongubkin merged 3 commits intoSep 30, 2026
Merged
alongubkin merged 3 commits into
alongubkin merged 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Member
Author
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
alongubkin
deleted the
alon/alien-1117-python-and-node-sdks-dont-expose-sandboxpreview
branch
September 30, 2026 15:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes ALIEN-1117.
Problem
The Rust sandbox binding has
preview(sandbox_id, port): it mints an authenticated, port-scoped capability to reach a service inside a sandbox (endpoint, headers, allowed ports, expiry). The Python and Node SDKs didn't expose it. Node'scapabilities()even hidpreviewon purpose, because there was no method to call. An application that talks to a server inside its sandbox had no supported way to do it from Python or TypeScript.Change
alienplatform):Sandbox.preview(sandbox_id, port) -> SandboxPreview(endpoint,headers,allowed_ports,expires_in_seconds), exported from the package, andpreviewincapabilities().SandboxHandle.preview(sandboxId, port)returningSandboxPreviewJs; a port outsideu16is rejected withInvalidArg.previewis now advertised incapabilities().@alienplatform/bindings):SandboxPreviewtype,Sandbox.preview, and the raw handle type. The remote-deployment sandbox gets it too, since it shares the wrapper.Tests
Both SDKs are tested through the real native module against a loopback server that stands in for the local sandbox route:
packages/bindings/tests/sandbox.test.ts:capabilities()includespreview;preview("s1", 8080)returns the route's endpoint and ports; the request carries the route token and the port; port 70000 is refused.crates/alien-bindings-python/tests/test_bindings.py: the same, returning aSandboxPreview.tests/remote.test.ts(addon members check) now expectspreviewon the nativeSandboxHandle.Local runs: Node bindings suites (81 tests) against a locally built addon,
tsc, biome; Python tests (11) against a locally built wheel, ruff, mypy.🤖 Generated with Claude Code