packages/ai-sandbox-cloudflare
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
@tanstack/ai-sandbox-cloudflare#
Cloudflare sandbox provider for TanStack AI
Runs harness adapters inside Cloudflare Containers through the uniform SandboxHandle, so the agent and a live preview URL of what it builds run at the edge in one deploy.
Besides the provider, the package ships a ready-made agent coordinator: @tanstack/ai-sandbox-cloudflare/agent for apps composing directly, and @tanstack/ai-sandbox-cloudflare/runner for the container side.
Installation#
npm install @tanstack/ai-sandbox-cloudflare
# or
pnpm add @tanstack/ai-sandbox-cloudflare
# or
yarn add @tanstack/ai-sandbox-cloudflare
Usage#
import { cloudflareSandbox } from '@tanstack/ai-sandbox-cloudflare'
const sandbox = cloudflareSandbox({ binding: env.Sandbox })
Hand the provider to a sandboxed run the same way as any other; see the sandbox docs for the surrounding wiring.
- Durable runs: the coordinator Durable Object is what outlives the request — not the provider on its own. Use the ready-made
createCloudflareSandboxAgent, or bind core'sRunControllerto the DO run log yourself withrunLogStoreandrunLogStreamfrom./agent; then a dropped connection only detaches the tail while the DO keeps driving. A detached run that goes quiet can still stop when the container'ssleepAfteridle timeout fires — see Durable runs at the edge. - Entry points:
.for the provider,./agentfor the coordinator,./runnerfor the container runtime.
Documentation#
- Sandbox overview: what a sandbox run is and how the pieces fit
- Providers: every provider side by side, with the capability matrix
- Cloudflare guide: the coordinator, durable runs at the edge, and callback hosts
- Harnesses and Harness auth: what runs inside, and how it signs in
License#
MIT