VibeGame / src /lib /services /context.md
dylanebert
improved prompting/UX
db9635c
# Services
Core business logic with centralized content management for JSFiddle-style game development.
## Purpose
Single source of truth content management, game lifecycle, and virtual file operations
## Layout
```
services/
β”œβ”€β”€ context.md # This file
β”œβ”€β”€ content-manager.ts # Editor content with conflict detection
β”œβ”€β”€ auth.ts # Hugging Face OAuth
β”œβ”€β”€ websocket.ts # WebSocket connection
β”œβ”€β”€ message-handler.ts # Message routing with segment processing
β”œβ”€β”€ game-engine.ts # VibeGame lifecycle with reload events
β”œβ”€β”€ html-document-parser.ts # HTML parsing using DOMParser
β”œβ”€β”€ virtual-fs.ts # Virtual file system with version tracking
└── console-sync.ts # Console interception
```
## Scope
- In-scope: Content synchronization, game lifecycle, HTML parsing, virtual file operations
- Out-of-scope: UI rendering, component state
## Entrypoints
- `contentManager` - Single reactive store for all editor content with bidirectional sync
- `gameEngine` - JSFiddle-style game lifecycle management
- `virtualFileSystem` - Virtual file operations for editor content
- `HTMLDocumentParser` - HTML parsing
- `messageHandler` - Message routing and segment processing
## Dependencies
- Svelte stores for reactive content management
- VibeGame for game engine
- DOMParser for HTML parsing
- @huggingface/hub for OAuth