f4c-realtime-core v0.1.0
subsystem
capsule://quake0day/[email protected]
Provides core real-time communication logic and generic UI components for audio/video calls and participant management using Cloudflare RealtimeKit. It encapsulates the integration with the RealtimeKit SDK and offers hooks and types for building real-time features.
Owns
- RealtimeKit SDK integration and state management
- Generic participant audio/video UI components (e.g., AudioVisualizer, UserCard)
- Common types and utilities for real-time interactions
Does not own
- Specific chat UI components (e.g., TextChatCard)
- Bot integration logic
- Room creation and authentication APIs
- Application-level branding or page layouts
AI orientation
This capsule handles all RealtimeKit client-side interactions. Agents should focus on enhancing real-time features, improving audio/video quality, or extending participant UI. Ensure adherence to RealtimeKit API changes and maintain generic component design.
Avoid
- Adding project-specific branding or hardcoded strings.
- Introducing direct dependencies on other application-specific frontend capsules.
Provides
library:useChatRoom— React hook for managing real-time chat room state and interactions.library:UserInfo— TypeScript interface for participant information.library:Message— TypeScript interface for chat messages.
Requires
http_api:/api/tokenfromf4c-room-api— Requires an authentication token from the room API to join a meeting.env:NEXT_PUBLIC_WORKER_URL— URL for the Cloudflare Worker, used by GET_WORKER_URL utility.
Dependencies
Capsules
f4c-room-api>=0.1.0
Invariants (must always hold)
- The `useChatRoom` hook must correctly manage RealtimeKit meeting state.
- UserCard and AudioVisualizer components must remain generic and only depend on `UserInfo` and `MediaStream` types.
Source files (6)
Click any file to view its content; the path on the right shows where the file lands when this capsule is installed.
src/app/src/common/consts.tsx→common/consts.tsxsrc/app/src/common/types.tsx→common/types.tsxsrc/app/src/common/utils.tsx→common/utils.tsxsrc/app/src/components/AudioVisualizer.tsx→components/AudioVisualizer.tsxsrc/app/src/components/UserCard.tsx→components/UserCard.tsxsrc/app/src/hooks/useChatRoom.ts→hooks/useChatRoom.ts
Plus capsule.yaml and
install.json.