File size: 1,447 Bytes
794cf6c
 
bc7e9cd
794cf6c
 
 
bc7e9cd
794cf6c
 
 
 
 
bc7e9cd
db9635c
bc7e9cd
 
 
db9635c
bc7e9cd
db9635c
bc7e9cd
794cf6c
 
 
 
bc7e9cd
 
794cf6c
 
 
bc7e9cd
 
 
 
 
794cf6c
 
 
bc7e9cd
794cf6c
bc7e9cd
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# 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