Files
Dani 2799202579 feat: Add Cloudflare Workers sandbox with AI code generation
Implemented complete Cloudflare sandbox integration for executing Claude Code with automatic file downloads.

Features:
- AI-powered code generation using Claude Sonnet 4.5
- Automatic extraction and download of HTML/CSS/JS files
- TypeScript launcher and monitoring tools
- Support for web development requests with file detection
- Integration with CLI (--sandbox cloudflare)
- Global edge deployment capability
- Comprehensive documentation and debugging guides

Files Added:
- Worker source (src/index.ts) with Claude AI integration
- TypeScript launcher with file extraction
- Real-time monitoring tool
- Complete documentation suite (4 MD files)
- Configuration files (wrangler.toml, package.json, tsconfig.json)

Integration:
- Modified src/index.js to support cloudflare sandbox provider
- Split E2B and Cloudflare logic into separate functions
- Added file download functionality similar to E2B

Tested:
- Successfully generates and downloads HTML/CSS/JS files
- Works with agents (e.g., frontend-developer)
- Proper error handling and user feedback

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 19:37:05 -04:00

51 lines
1.2 KiB
TOML

#:schema node_modules/wrangler/config-schema.json
name = "cloudflare-claude-sandbox"
main = "src/index.ts"
compatibility_date = "2024-01-01"
compatibility_flags = ["nodejs_compat"]
# Durable Objects configuration for sandbox persistence
[[durable_objects.bindings]]
name = "Sandbox"
class_name = "Sandbox"
# Durable Object migration (required for first deployment)
[[migrations]]
tag = "v1"
new_classes = ["Sandbox"]
# Environment variables (non-secret)
[vars]
ENVIRONMENT = "production"
# Development environment configuration
[env.development]
vars = { ENVIRONMENT = "development" }
# Staging environment configuration
[env.staging]
vars = { ENVIRONMENT = "staging" }
# Resource limits
[limits]
# CPU time limit per request (milliseconds)
cpu_ms = 50
# Build configuration
[build]
command = ""
# Observability
[observability]
enabled = true
# Usage model - required for Durable Objects
[usage_model]
# Use 'bundled' for Workers Paid plan ($5/month)
# Includes 10M requests/month and unlimited Durable Objects
# For free tier, comment this out (limited functionality)
# usage_model = "bundled"
# Note: Uncomment the line above after setting up Workers Paid plan
# Or remove this section entirely for the free tier (sandbox will be limited)