How teglonlabs/vibespace works
Main Components
• Models: These include the data schemas for Vibe, World, and WorldMoment (with sensor data as a bonus) found in the models directory. They form the backbone that defines the properties of both vibes and worlds.
• Repository: An in-memory, thread-safe storage system that enables CRUD operations for both vibes and worlds. This is crucial for persisting the entities and providing rapid access in a real-time scenario.
• Server: This is the core MCP protocol implementation using JSON-RPC. It exposes resources using custom URI schemes (like “vibe://” and “world://”) and contains endpoints for combined interactions (e.g., “world://{id}/vibe”).
• Streaming: A dedicated component implementing NATS integration for real-time streaming of “world moments.” It facilitates multi-tenant stream ID namespacing and efficient, real-time updates.
• RPC Tools: The rpcmethods package and associated utilities that format and provide JSON-RPC requests, standardize method names, and improve error handling. This package is central to securely connecting vibes and worlds in the application’s logic.
Highlighting the Combination of Vibes and Worlds
• JSON-RPC API layer as a central hub where requests are received. Clearly show that calls with URIs such as “vibe://{id}” and “world://{id}” are parsed then processed to modify or bind related data.
• A component representing “RPC Method Discovery and Tools” (from the rpcmethods package) next to the Server, emphasizing that these are used to ensure proper resource access and to combine operations across vibes and worlds.
Architectural Patterns and Relationships
• Graph components representing “Vibes” and “Worlds” so that they converge when specific operations are performed (e.g., when a world is created, followed by setting its current vibe, the “world” component is linked to the “vibe” component). This convergence is a key area to highlight as it shows how the two are combinable.