Skip to content

Start remote container bridges with sensible defaults - #85

Merged
davideast merged 1 commit into
mainfrom
apple-container-provider
Jul 8, 2026
Merged

Start remote container bridges with sensible defaults#85
davideast merged 1 commit into
mainfrom
apple-container-provider

Conversation

@davideast

Copy link
Copy Markdown
Owner

Start a real container bridge with one call

This introduces a host-side remote container bridge API with sensible defaults:

import { startRemoteContainerBridge } from '@inbrowser/sandbox/remote/host';

const bridge = await startRemoteContainerBridge({
  image: 'ubuntu:latest',
});

const sandbox = await createRemoteSandbox({
  id: 'local-container-session',
  transport: bridge.createWebSocketProvider(),
});

The default path selects a local host adapter, generates a bridge token, validates local origins, exposes browser-ready WebSocket configuration, and resolves Apple container when the CLI is available.

Developers can still choose every layer

The sandbox package now exposes explicit host-only subpaths for manual composition:

  • @inbrowser/sandbox/remote/host owns startRemoteContainerBridge, provider/host contracts, shared host behavior, and resolver types.
  • @inbrowser/sandbox/remote/node adds a Node HTTP/WebSocket host and Node command runner.
  • @inbrowser/sandbox/remote/bun keeps Bun host support and adds a Bun command runner.
  • @inbrowser/sandbox/remote/apple-container promotes the Apple container provider into the package.

The Apple provider is no longer Bun-bound. It uses an injectable HostCommandRunner, with a Node default and a Bun runner available for Bun-hosted flows.

The demo now runs through the public bridge API

The remote container demo now calls startRemoteContainerBridge directly while preserving the fake provider for automated UI and protocol tests. The real Apple container integration test also exercises the high-level bridge path, so the demo validates the same API users will copy.

The bridge behavior is covered across host runtimes

Coverage now includes Bun and Node host parity for authentication, streaming run.output events, authenticated port proxy URLs, session cleanup, provider auto-resolution, resolver diagnostics, command-runner injection, Apple stale cleanup, and the one-call createWebSocketProvider() path.

Verified locally:

bun install
bun run build
bun run typecheck
bun run test
bun run check
bun run --cwd examples/remote-container-bridge build
INBROWSER_TEST_APPLE_CONTAINER=1 REMOTE_CONTAINER_IMAGE=ubuntu:latest bun run --cwd examples/remote-container-bridge test

@davideast
davideast merged commit 3092d35 into main Jul 8, 2026
1 check passed
@davideast
davideast deleted the apple-container-provider branch July 8, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant