Commit eeeba98
Complete Cloudflare Agents integration with AG-UI events
Adds full AG-UI integration for Cloudflare Agents with both client and server support:
## Client-Side (CloudflareAgentsClient)
- Extends AbstractAgent for full AG-UI compatibility
- Connects to deployed Cloudflare Agents via WebSocket
- Emits all AG-UI lifecycle events (thinking, message, done, error)
- Supports middleware, subscribers, and state management
- Handles server-sent events (SSE) and NDJSON responses
## Server-Side (AIChatAgentAGUI)
- Extends AIChatAgent from @cloudflare/ai-agent
- Runs on Cloudflare Workers with Durable Objects
- Emits AG-UI events via AgentsToAGUIAdapter
- Users override generateResponse() for custom logic
- Returns SSE/NDJSON responses compatible with client
## Shared Components
- AgentsToAGUIAdapter: Converts Vercel AI SDK streams to AG-UI events
- helpers.ts: SSE and NDJSON response formatting utilities
- Clean exports in index.ts for easy integration
## Quality
- Build passes ✅
- Typecheck passes ✅
- Follows AG-UI TypeScript SDK patterns
- Updated README with comprehensive examples
- Added .gitignore and .npmignore for clean package
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent eaab3b5 commit eeeba98
File tree
11 files changed
+1037
-203
lines changed- integrations/community/cloudflare-agents/typescript
- src
11 files changed
+1037
-203
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments