Spaces:
Running
Running
Services
Business logic layer with pure functions and singleton services
Purpose
- Encapsulate complex business logic
- Provide clean APIs for operations
- Keep components simple and declarative
Layout
services/
βββ context.md # This file
βββ auth.ts # Hugging Face OAuth authentication
βββ game-engine.ts # Game lifecycle management
βββ console-capture.ts # Console interception
βββ html-parser.ts # Game HTML parsing
Scope
- In-scope: Business logic, side effects, API calls, authentication
- Out-of-scope: UI rendering, state storage
Entrypoints
authStore.login()- Start OAuth flowauthStore.logout()- Clear authenticationauthStore.getToken()- Get current tokenauthStore.isTokenValid()- Check token validitygameEngine.start()- Start game with world contentgameEngine.stop()- Clean up game instanceconsoleCapture.setup()- Begin console interceptionHTMLParser.extractGameContent()- Parse world from HTML
Dependencies
- @huggingface/hub for OAuth
- VibeGame for game engine
- Stores for state updates
- No UI dependencies