Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

README.md

61 lines2.6 KB

TanStack AI

@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's RunController to the DO run log yourself with runLogStore and runLogStream from ./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's sleepAfter idle timeout fires — see Durable runs at the edge.
  • Entry points: . for the provider, ./agent for the coordinator, ./runner for the container runtime.

Documentation

License

MIT