feat: split ai-chat and codemode into separate packages#756
feat: split ai-chat and codemode into separate packages#756threepointone merged 3 commits intomainfrom
Conversation
Extract @cloudflare/ai-chat and @cloudflare/codemode into their own packages with comprehensive READMEs. Update agents README to remove chat-specific content and point to new packages. Fix documentation imports to reflect new package structure. Maintains backward compatibility, no breaking changes.
🦋 Changeset detectedLatest commit: f0db0c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Claude Code ReviewIssues Found1. Runtime console.log side effects in production code The re-export files have deprecation warnings via console.log that execute on import:
Problem: These console.log statements run every time the module is imported, even in production. This adds unnecessary overhead and pollutes logs. Recommendation: Use build-time deprecation warnings instead:
Example: /**
* @deprecated Use @cloudflare/ai-chat instead. Will be removed in v1.0.0
*/
export * from "@cloudflare/ai-chat";2. Missing peerDependency metadata
"@cloudflare/ai-chat": "^0.0.1",
"@cloudflare/codemode": "^0.0.1",Problem: These should be in 3. Type-only export missing from ai-types.ts
export type { IncomingMessage, OutgoingMessage };
export const MessageType = { ...AiChatMessageType, ...AgentsMessageType };The MessageType merge combines enums from two sources. Verify this doesn't cause enum key collisions at runtime. SummaryGood refactoring overall - clean package separation and backward compatibility maintained. Address the console.log side effects and peer dependency metadata before merging. |
commit: |
Update documentation to reflect the package reorganization where AI chat functionality has been extracted into @cloudflare/ai-chat package: - Update import paths from agents/ai-chat-agent to @cloudflare/ai-chat - Update import paths from agents/ai-react to @cloudflare/ai-chat/react - Affects human-in-the-loop guide and agents API reference Related to cloudflare/agents#756 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… packages Sync documentation changes from cloudflare/agents PR #756: - Update import paths from agents/* to @cloudflare/ai-chat/* and @cloudflare/codemode/* - Add comprehensive documentation for @cloudflare/ai-chat package - Add comprehensive documentation for @cloudflare/codemode package - Update all code examples to reflect new package structure This reflects the splitting of ai-chat and codemode into separate packages while maintaining backward compatibility. Source PR: cloudflare/agents#756
Extract @cloudflare/ai-chat and @cloudflare/codemode into their own packages with comprehensive READMEs. Update agents README to remove chat-specific content and point to new packages. Fix documentation imports to reflect new package structure.
Maintains backward compatibility, no breaking changes.