# 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