@tanstack/ai-sandbox-cloudflare 0.4.6 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/package.json +8 -7
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source
|
|
4
|
+
media="(prefers-color-scheme: dark)"
|
|
5
|
+
srcset="https://tanstack.com/api/readme/ai.png?theme=dark"
|
|
6
|
+
/>
|
|
7
|
+
<source
|
|
8
|
+
media="(prefers-color-scheme: light)"
|
|
9
|
+
srcset="https://tanstack.com/api/readme/ai.png"
|
|
10
|
+
/>
|
|
11
|
+
<img
|
|
12
|
+
src="https://tanstack.com/api/readme/ai.png"
|
|
13
|
+
alt="TanStack AI"
|
|
14
|
+
width="900"
|
|
15
|
+
/>
|
|
16
|
+
</picture>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
# @tanstack/ai-sandbox-cloudflare
|
|
22
|
+
|
|
23
|
+
Cloudflare sandbox provider for TanStack AI
|
|
24
|
+
|
|
25
|
+
Runs harness adapters inside [Cloudflare Containers](https://developers.cloudflare.com/containers/) through the uniform `SandboxHandle`, so the agent and a live preview URL of what it builds run at the edge in one deploy.
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @tanstack/ai-sandbox-cloudflare
|
|
33
|
+
# or
|
|
34
|
+
pnpm add @tanstack/ai-sandbox-cloudflare
|
|
35
|
+
# or
|
|
36
|
+
yarn add @tanstack/ai-sandbox-cloudflare
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
import { cloudflareSandbox } from '@tanstack/ai-sandbox-cloudflare'
|
|
43
|
+
|
|
44
|
+
const sandbox = cloudflareSandbox({ binding: env.Sandbox })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Hand the provider to a sandboxed run the same way as any other; see the [sandbox docs](https://tanstack.com/ai/latest/docs/sandbox/overview) for the surrounding wiring.
|
|
48
|
+
|
|
49
|
+
- **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](https://tanstack.com/ai/latest/docs/sandbox/cloudflare#durable-runs-at-the-edge).
|
|
50
|
+
- **Entry points:** `.` for the provider, `./agent` for the coordinator, `./runner` for the container runtime.
|
|
51
|
+
|
|
52
|
+
## Documentation
|
|
53
|
+
|
|
54
|
+
- [Sandbox overview](https://tanstack.com/ai/latest/docs/sandbox/overview): what a sandbox run is and how the pieces fit
|
|
55
|
+
- [Providers](https://tanstack.com/ai/latest/docs/sandbox/providers): every provider side by side, with the capability matrix
|
|
56
|
+
- [Cloudflare guide](https://tanstack.com/ai/latest/docs/sandbox/cloudflare): the coordinator, durable runs at the edge, and callback hosts
|
|
57
|
+
- [Harnesses](https://tanstack.com/ai/latest/docs/sandbox/harnesses) and [Harness auth](https://tanstack.com/ai/latest/docs/sandbox/auth): what runs inside, and how it signs in
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-sandbox-cloudflare",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"description": "Cloudflare sandbox provider for TanStack AI — run harness adapters inside Cloudflare Containers (edge) through the uniform SandboxHandle.",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"zod": "^4.0.0",
|
|
48
|
-
"@tanstack/ai": "^0.
|
|
49
|
-
"@tanstack/ai-sandbox": "^0.5.
|
|
50
|
-
"@tanstack/ai-sandbox-local-process": "^0.2.
|
|
48
|
+
"@tanstack/ai": "^0.63.0",
|
|
49
|
+
"@tanstack/ai-sandbox": "^0.5.17",
|
|
50
|
+
"@tanstack/ai-sandbox-local-process": "^0.2.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@cloudflare/workers-types": "^4.20260317.1",
|
|
54
54
|
"@types/node": "^24.10.1",
|
|
55
55
|
"@vitest/coverage-v8": "4.1.10",
|
|
56
56
|
"zod": "^4.2.0",
|
|
57
|
-
"@tanstack/ai": "0.
|
|
58
|
-
"@tanstack/ai-sandbox
|
|
59
|
-
"@tanstack/ai-sandbox": "0.
|
|
57
|
+
"@tanstack/ai": "0.63.0",
|
|
58
|
+
"@tanstack/ai-sandbox": "0.5.17",
|
|
59
|
+
"@tanstack/ai-sandbox-local-process": "0.2.6"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "vite build",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"lint:fix": "oxlint src --type-aware --fix",
|
|
65
65
|
"test:build": "publint --strict",
|
|
66
66
|
"test:oxlint": "oxlint src --type-aware",
|
|
67
|
+
"test:coverage": "vitest run --coverage --coverage.include='src/**' --coverage.reporter=text-summary --coverage.reporter=json-summary",
|
|
67
68
|
"test:lib": "vitest",
|
|
68
69
|
"test:lib:dev": "pnpm test:lib --watch",
|
|
69
70
|
"test:types": "tsc"
|