feat: replay visuel VLM-first, worker séparé, package Léa, AZERTY, sécurité HTTPS

Pipeline replay visuel :
- VLM-first : l'agent appelle Ollama directement pour trouver les éléments
- Template matching en fallback (seuil strict 0.90)
- Stop immédiat si élément non trouvé (pas de clic blind)
- Replay depuis session brute (/replay-session) sans attendre le VLM
- Vérification post-action (screenshot hash avant/après)
- Gestion des popups (Enter/Escape/Tab+Enter)

Worker VLM séparé :
- run_worker.py : process distinct du serveur HTTP
- Communication par fichiers (_worker_queue.txt + _replay_active.lock)
- Le serveur HTTP ne fait plus jamais de VLM → toujours réactif
- Service systemd rpa-worker.service

Capture clavier :
- raw_keys (vk + press/release) pour replay exact indépendant du layout
- Fix AZERTY : ToUnicodeEx + AltGr detection
- Enter capturé comme \n, Tab comme \t
- Filtrage modificateurs seuls (Ctrl/Alt/Shift parasites)
- Fusion text_input consécutifs, dédup key_combo

Sécurité & Internet :
- HTTPS Let's Encrypt (lea.labs + vwb.labs.laurinebazin.design)
- Token API fixe dans .env.local
- HTTP Basic Auth sur VWB
- Security headers (HSTS, CSP, nosniff)
- CORS domaines publics, plus de wildcard

Infrastructure :
- DPI awareness (SetProcessDpiAwareness) Python + Rust
- Métadonnées système (dpi_scale, window_bounds, monitors, os_theme)
- Template matching multi-scale [0.5, 2.0]
- Résolution dynamique (plus de hardcode 1920x1080)
- VLM prefill fix (47x speedup, 3.5s au lieu de 180s)

Modules :
- core/auth/ : credential vault (Fernet AES), TOTP (RFC 6238), auth handler
- core/federation/ : LearningPack export/import anonymisé, FAISS global
- deploy/ : package Léa (config.txt, Lea.bat, install.bat, LISEZMOI.txt)

UX :
- Filtrage OS (VWB + Chat montrent que les workflows de l'OS courant)
- Bibliothèque persistante (cache local + SQLite)
- Clustering hybride (titre fenêtre + DBSCAN)
- EdgeConstraints + PostConditions peuplés
- GraphBuilder compound actions (toutes les frappes)

Agent Rust :
- Token Bearer auth (network.rs)
- sysinfo.rs (DPI, résolution, window bounds via Win32 API)
- config.txt lu automatiquement
- Support Chrome/Brave/Firefox (pas que Edge)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dom
2026-03-26 10:19:18 +01:00
parent fe5e0ba83d
commit d5deac3029
162 changed files with 25669 additions and 557 deletions

22
svc.sh
View File

@@ -54,6 +54,7 @@ declare -A PORTS=(
[monitoring]=5003
[agent-chat]=5004
[streaming]=5005
[worker]=5099
[vwb-frontend]=3002
)
@@ -63,14 +64,15 @@ declare -A SYSTEMD_UNITS=(
[vwb-backend]="rpa-vwb-backend.service"
[agent-chat]="rpa-agent-chat.service"
[streaming]="rpa-streaming.service"
[worker]="rpa-worker.service"
[vwb-frontend]="rpa-vwb-frontend.service"
)
# Services gérés par systemd (ceux qui ont un .service)
SYSTEMD_SERVICES="streaming agent-chat dashboard vwb-backend vwb-frontend"
SYSTEMD_SERVICES="streaming worker agent-chat dashboard vwb-backend vwb-frontend"
# Tous les services connus
ALL_SERVICES="api dashboard vwb-backend monitoring agent-chat streaming vwb-frontend"
ALL_SERVICES="api dashboard vwb-backend monitoring agent-chat streaming worker vwb-frontend"
declare -A COMMANDS=(
[api]="$VENV_DIR/bin/python3 server/api_upload.py"
@@ -79,6 +81,7 @@ declare -A COMMANDS=(
[monitoring]="$VENV_DIR/bin/python3 monitoring_server.py"
[agent-chat]="$VENV_DIR/bin/python3 -m agent_chat.app"
[streaming]="$VENV_DIR/bin/python3 -m agent_v0.server_v1.api_stream"
[worker]="$VENV_DIR/bin/python3 -m agent_v0.server_v1.run_worker"
[vwb-frontend]="cd $SCRIPT_DIR/visual_workflow_builder/frontend_v4 && npm run dev"
)
@@ -86,8 +89,8 @@ declare -A COMMANDS=(
declare -A SVC_GROUPS=(
[vwb]="vwb-backend vwb-frontend"
[all]="api dashboard vwb-backend vwb-frontend"
[full]="api dashboard vwb-backend vwb-frontend monitoring agent-chat streaming"
[boot]="streaming agent-chat dashboard vwb-backend vwb-frontend"
[full]="api dashboard vwb-backend vwb-frontend monitoring agent-chat streaming worker"
[boot]="streaming worker agent-chat dashboard vwb-backend vwb-frontend"
)
# =============================================================================
@@ -350,7 +353,7 @@ do_install() {
# Vérifier que les fichiers existent
local missing=false
for unit in rpa-streaming.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service rpa-vision.target; do
for unit in rpa-streaming.service rpa-worker.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service rpa-vision.target; do
if [ -f "$SYSTEMD_DIR/$unit" ]; then
echo -e " ${GREEN}OK${NC} $unit"
else
@@ -394,7 +397,7 @@ do_enable() {
echo -e "${CYAN}${BOLD}Activation du demarrage automatique au boot...${NC}"
systemctl --user daemon-reload
systemctl --user enable rpa-vision.target
for unit in rpa-streaming.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service; do
for unit in rpa-streaming.service rpa-worker.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service; do
systemctl --user enable "$unit" 2>/dev/null
echo -e " ${GREEN}OK${NC} $unit"
done
@@ -405,7 +408,7 @@ do_enable() {
do_disable() {
echo -e "${YELLOW}${BOLD}Desactivation du demarrage automatique...${NC}"
systemctl --user disable rpa-vision.target 2>/dev/null || true
for unit in rpa-streaming.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service; do
for unit in rpa-streaming.service rpa-worker.service rpa-agent-chat.service rpa-dashboard.service rpa-vwb-backend.service rpa-vwb-frontend.service; do
systemctl --user disable "$unit" 2>/dev/null || true
echo -e " ${GREEN}OK${NC} $unit"
done
@@ -429,7 +432,8 @@ show_help() {
echo " disable Desactiver le demarrage auto au boot"
echo ""
echo -e "${BOLD}Services:${NC}"
echo " streaming Streaming Server GPU (port 5005)"
echo " streaming Streaming Server HTTP (port 5005)"
echo " worker VLM Worker GPU (process séparé)"
echo " agent-chat Agent Chat (port 5004)"
echo " dashboard Web Dashboard (port 5001)"
echo " vwb-backend VWB Backend Flask (port 5002)"
@@ -438,7 +442,7 @@ show_help() {
echo " monitoring Monitoring (port 5003) [legacy uniquement]"
echo ""
echo -e "${BOLD}Groupes:${NC}"
echo " boot Services systemd (streaming, chat, dashboard, vwb)"
echo " boot Services systemd (streaming, worker, chat, dashboard, vwb)"
echo " vwb VWB backend + frontend"
echo " all Core (api, dashboard, vwb)"
echo " full Tous les services"