Commit Graph

10 Commits

Author SHA1 Message Date
Dani 43c9d86a85 refactor(cloudflare): Clean up unnecessary logs and code output
- Removed full code output from console (code is saved to files anyway)
- Simplified file download logs to show only filenames
- Removed redundant separators and verbose output
- Keep only essential progress indicators:
  - Agent installation
  - Code generation progress
  - File extraction and save location

Users now see only the essential progress without code dumps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 19:46:26 -04:00
Dani 0d73e0b498 feat(cloudflare): Upgrade to claude-agent-sdk v0.1.23 with settingSources support
- Updated @anthropic-ai/claude-agent-sdk from ^0.1.0 to ^0.1.23
- Replaced manual agent loading with automatic settingSources: ['project']
- Removed temporary workaround for agent loading (SDK now properly supports it)
- Added gitignore entries for local test directories
- Verified settingSources functionality works with SDK v0.1.23

The latest SDK version properly supports automatic agent loading from .claude/ directory,
eliminating the need for manual file reading and systemPrompt manipulation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 19:44:32 -04:00
Dani dbdea302a5 fix(cloudflare): Listen for 'result' type messages from Agent SDK
The Agent SDK returns the final response in a message with type='result'
and the content in message.result, not in type='text' messages.

This was discovered through direct testing of the SDK.
2025-10-20 19:36:24 -04:00
Dani 95779b9f24 docs(cloudflare): Add comments explaining temporary agent loading solution
- Current SDK version (^0.1.0) does not properly support settingSources
- Manually loading agent content as workaround
- TODO: Revisit when SDK properly supports automatic agent loading
2025-10-20 19:28:57 -04:00
Dani ffd866a6cf fix(cloudflare): Load agent manually instead of using settingSources 2025-10-20 19:26:13 -04:00
Dani 4c0056f0e8 debug: Add CWD logging to troubleshoot Agent SDK 2025-10-20 19:23:24 -04:00
Dani 228f7b2b7a feat(cloudflare): Add better error handling for Agent SDK query 2025-10-20 18:31:07 -04:00
Dani 28d6229802 docs(cloudflare): Update IMPLEMENTATION_SUMMARY with file download structure details
Added comprehensive documentation about file download structure
matching E2B pattern (cloudflare-{timestamp}/).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 17:40:14 -04:00
Dani 40e5f66f85 fix(cloudflare): Align file download directory structure with E2B pattern
Fixed Cloudflare sandbox to save generated files in project root using
timestamp-based directories, matching E2B's sandbox-{id} pattern.

**Changes**:
- Modified launcher.ts to accept targetDir parameter (5th argument)
- Updated LauncherConfig interface with optional targetDir field
- Modified displayResults() to use targetDir instead of process.cwd()
- Fixed TypeScript errors (workerUrl undefined, unused language variable)
- Updated src/index.js to pass targetDir to launcher
- Added cloudflare-*/ and sandbox-*/ to .gitignore
- Updated IMPLEMENTATION_SUMMARY.md with file structure details

**Directory Structure**:
- Before: `.claude/sandbox/cloudflare/cloudflare-output/`
- After: `your-project/cloudflare-{timestamp}/`

**Pattern Comparison**:
- E2B: `your-project/sandbox-{id}/`
- Cloudflare: `your-project/cloudflare-{timestamp}/`

Files now download to clean, timestamped directories in the project root,
improving organization and matching user expectations from E2B behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-20 09:44:05 -04:00
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