20aed903ba
- Voice pipeline: ESP32 WebSocket client → voice bridge → LLM → Piper TTS (Tower :8001) - Hints engine: 3 puzzles (LA_440, LEFOU_PIANO, QR_FINALE), anti-cheat, 3 hint levels - MCP hardware server: 6 tools (puzzle, audio, LED, camera, scenario, status), stdio transport - Analytics: ESP32 module + 6 web endpoints + Dashboard UI with chat interface - Security: auth middleware (Bearer NVS), rate limiting, input validation on 30 endpoints - Frontend: code-split (1.1MB → 210KB initial), ErrorBoundary, API timeout, WS reconnect - Tests: 24 Python + 38 TypeScript + 18 MCP = 80 project tests (+ 19 mascarade) - Specs: AI_INTEGRATION_SPEC, MCP_HARDWARE_SERVER_SPEC, QA_TEST_MATRIX_SPEC - Docs: SECURITY, DEPLOYMENT_RUNBOOK, voice pipeline guide, AI architecture map - 6 AI agent definitions (.github/agents/ai_*.md) - TUI orchestration script (tools/dev/zacus_tui.py) - Docker compose TTS for Tower + KXKM-AI - CHANGELOG, README, mkdocs.yml updated - Cycle detection (DFS) in runtime3 validator - Sprint plan: plans/SPRINT_AI_INTEGRATION.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
77 lines
2.1 KiB
Markdown
77 lines
2.1 KiB
Markdown
# Zacus Story Designer — React 19 + Blockly
|
|
|
|
Studio auteur visuel pour concevoir des scenarios Zacus avec des blocs type Scratch.
|
|
Genere du YAML canonique et communique avec le firmware ESP32 via l'API Story V2.
|
|
|
|
## Setup
|
|
|
|
```bash
|
|
cd frontend-scratch-v2
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Connexion API (optionnel) :
|
|
|
|
```bash
|
|
VITE_STORY_API_BASE=http://<esp_ip>:8080 npm run dev
|
|
```
|
|
|
|
## Scripts disponibles
|
|
|
|
| Commande | Description |
|
|
| --- | --- |
|
|
| `npm run dev` | Serveur de dev Vite (HMR) |
|
|
| `npm run build` | Build production (`dist/`) |
|
|
| `npm test` | Tests Vitest (18 tests) |
|
|
| `npm run lint` | ESLint |
|
|
|
|
## Architecture
|
|
|
|
L'interface s'organise en 4 onglets :
|
|
|
|
| Onglet | Composant | Role |
|
|
| --- | --- | --- |
|
|
| Designer | `BlocklyDesigner.tsx` | Editeur blocs + generation YAML live |
|
|
| Dashboard | `Dashboard.tsx` | Vue d'ensemble scenario |
|
|
| Media | `MediaManager.tsx` | Gestion assets audio/image |
|
|
| Network | `NetworkPanel.tsx` | Monitoring devices terrain |
|
|
|
|
Autres fichiers cles :
|
|
- `src/components/RuntimeControls.tsx` — actions HTTP Story V2 (list, status, validate, deploy)
|
|
- `src/lib/scenario.ts` — mapping blocs → document scenario → YAML
|
|
- `src/types.ts` — types TypeScript du document scenario
|
|
|
|
## Stack OSS
|
|
|
|
| Brique | Version | Licence | Role |
|
|
| --- | --- | --- | --- |
|
|
| blockly | 12.4.1 | Apache-2.0 | editeur blocs |
|
|
| yaml | 2.8.2 | ISC | serialisation YAML |
|
|
| zod | 4.3.6 | MIT | validation locale |
|
|
| ajv | 8.18.0 | MIT | JSON schema |
|
|
| @monaco-editor/react | 4.7.0 | MIT | vue YAML |
|
|
|
|
Note : `scratch-gui` / `scratch-vm` sont AGPL-3.0, non retenus pour garder un front permissif.
|
|
|
|
## API Story V2
|
|
|
|
| Methode | Endpoint | Description |
|
|
| --- | --- | --- |
|
|
| GET | `/api/story/list` | Liste des scenarios |
|
|
| GET | `/api/story/status` | Statut runtime |
|
|
| POST | `/api/story/validate` | Validation YAML |
|
|
| POST | `/api/story/deploy` | Deploiement sur device |
|
|
|
|
Variable d'environnement : `VITE_STORY_API_BASE` (defaut : pas de proxy).
|
|
|
|
## Tests
|
|
|
|
18 tests passing (Vitest). Lancer avec `npm test`.
|
|
|
|
## Prochaines etapes
|
|
|
|
1. Mapping complet steps + transitions (FSM) avec validation croisee
|
|
2. Import/export Blockly JSON
|
|
3. Tests E2E avec API mock
|