diff --git a/api/architecture-scan.json b/api/architecture-scan.json index 1e4cb9a20..e69de29bb 100644 --- a/api/architecture-scan.json +++ b/api/architecture-scan.json @@ -1,1803 +0,0 @@ -{ - "generated": "2026-04-14 19:00:01", - "version": "1.0", - "servers": [ - { - "id": "S204", - "ip": "204.168.152.13", - "private": "10.1.0.2", - "role": "PRIMARY", - "ssh": 49222, - "disk_pct": 69, - "disk_avail": "45G", - "uptime": "up 9 hours, 8 minutes", - "nginx": "active", - "php_fpm": "activating", - "php_version": "8.5.5" - }, - { - "id": "S95", - "ip": "95.216.167.89", - "private": "10.1.0.3", - "role": "WEVADS Arsenal", - "ssh": 22, - "disk_pct": 89, - "disk_avail": "18G", - "sentinel": 1 - }, - { - "id": "S151", - "ip": "151.80.235.110", - "private": null, - "role": "DR\/Tracking OVH", - "ssh": 22 - } - ], - "docker": [ - { - "name": "redis-weval", - "status": "Up 5 hours", - "ports": "" - }, - { - "name": "gitea", - "status": "Up 5 hours", - "ports": "" - }, - { - "name": "node-exporter", - "status": "Up 5 hours", - "ports": "" - }, - { - "name": "prometheus", - "status": "Up 5 hours", - "ports": "" - }, - { - "name": "searxng", - "status": "Up 5 hours", - "ports": "" - }, - { - "name": "uptime-kuma", - "status": "Up 5 hours (healthy)", - "ports": "" - }, - { - "name": "vaultwarden", - "status": "Up 5 hours (healthy)", - "ports": "" - }, - { - "name": "qdrant", - "status": "Up 5 hours", - "ports": "" - } - ], - "domains": [ - { - "file": "analytics.weval-consulting.com", - "server_names": [ - "analytics.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "code-weval", - "server_names": [ - "code.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "crm.weval-consulting.com", - "server_names": [ - "crm.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "deerflow.weval-consulting.com", - "server_names": [ - "deerflow.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "ethica", - "server_names": [ - "ethica.wevup.app", - "consent.wevup.app" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "git.weval-consulting.com", - "server_names": [ - "git.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "langfuse.weval-consulting.com", - "server_names": [ - "langfuse.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "mirofish.weval-consulting.com", - "server_names": [ - "mirofish.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "mm.weval-consulting.com", - "server_names": [ - "mm.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "monitor.weval-consulting.com", - "server_names": [ - "monitor.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "n8n.weval-consulting.com", - "server_names": [ - "n8n.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "paperclip.weval-consulting.com", - "server_names": [ - "paperclip.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "wevads.weval-consulting.com", - "server_names": [ - "wevads.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - }, - { - "file": "weval-consulting", - "server_names": [ - "weval-consulting.com", - "www.weval-consulting.com" - ], - "ssl": true, - "php-session": false, - "php-session_paths": false, - "auth_complete": false - } - ], - "screens": { - "s204_html": 172, - "s204_products": 88, - "s204_api_php": 436, - "s204_wevia_php": 15, - "s95_arsenal_html": 1377, - "s95_arsenal_api": 377 - }, - "auth": { - "system": "PHP Session Auth", - "authentik": "REMOVED", - "pass": 24, - "fail": 0 - }, - "databases": { - "s204": [ - "postgres", - "adx_system", - "wevia_db", - "twenty_db", - "mattermost_db", - "deerflow", - "nocodb", - "paperclip" - ], - "key_tables": { - "kb_learnings": 4319, - "kb_documents": 0, - "ethica_medecins": 50004, - "enterprise_agents": 0 - } - }, - "ollama": [], - "qdrant": [ - { - "name": "weval_skills", - "vectors": 14380 - }, - { - "name": "obsidian_vault", - "vectors": 46 - }, - { - "name": "wevia_kb", - "vectors": 386 - }, - { - "name": "wevia_memory", - "vectors": 48 - }, - { - "name": "wevia_learnings", - "vectors": 1736 - } - ], - "ai_providers": [ - { - "name": "Cerebras", - "model": "Qwen-235B", - "tier": "T1", - "status": "active" - }, - { - "name": "Groq", - "model": "Llama-4-Scout", - "tier": "T1", - "status": "active" - }, - { - "name": "SambaNova", - "model": "Llama-3.3-70B", - "tier": "T1", - "status": "active" - }, - { - "name": "NVIDIA NIM", - "model": "Llama-3.1-70B", - "tier": "T1", - "status": "active" - }, - { - "name": "Together", - "model": "Qwen-2.5-72B", - "tier": "T1", - "status": "active" - }, - { - "name": "Mistral", - "model": "Mistral-Small", - "tier": "T2", - "status": "active" - }, - { - "name": "Cohere", - "model": "Command-R+", - "tier": "T2", - "status": "active" - }, - { - "name": "Gemini", - "model": "Gemini-2.0-Flash", - "tier": "T2", - "status": "active" - }, - { - "name": "DeepSeek", - "model": "DeepSeek-Chat", - "tier": "T2", - "status": "active" - }, - { - "name": "OpenRouter", - "model": "Multi", - "tier": "T2", - "status": "active" - }, - { - "name": "Alibaba", - "model": "Qwen-Max", - "tier": "T2", - "status": "active" - }, - { - "name": "HuggingFace", - "model": "Inference", - "tier": "T3", - "status": "active" - }, - { - "name": "Replicate", - "model": "Multi", - "tier": "T3", - "status": "active" - }, - { - "name": "ZhiPu", - "model": "GLM-4", - "tier": "T3", - "status": "active" - }, - { - "name": "Ollama Local", - "model": "weval-brain-v3", - "tier": "T0", - "status": "active" - } - ], - "crons": { - "s204_root": 0, - "s204_www": 4, - "s204_total": 4, - "key_crons": [ - { - "name": "L99 Master", - "freq": "*\/30", - "target": "l99-master.py" - }, - { - "name": "Autonomous Engine", - "freq": "*\/5", - "target": "wevia-master-autonomous" - }, - { - "name": "L99 Pipeline", - "freq": "*\/15", - "target": "l99-pipeline.py" - }, - { - "name": "L99 Alive", - "freq": "*\/10", - "target": "l99-alive.py" - }, - { - "name": "Infra Guardian", - "freq": "*\/5", - "target": "infra-guardian.sh" - }, - { - "name": "Blade Watchdog", - "freq": "*\/5", - "target": "blade-watchdog.php" - }, - { - "name": "RAG Ingest", - "freq": "*\/30", - "target": "wevia-rag-ingest.sh" - }, - { - "name": "Blade Orchestrator", - "freq": "*\/30", - "target": "blade-orchestrator.sh" - }, - { - "name": "WEVIA Dream", - "freq": "*\/30", - "target": "wevia-dream-cron.php" - }, - { - "name": "Port Protection", - "freq": "*\/5", - "target": "port-protection" - }, - { - "name": "Watchdog", - "freq": "*\/3", - "target": "weval-watchdog.php" - }, - { - "name": "Ethica Enrich", - "freq": "daily 01h", - "target": "ethica-enrich-v4.py" - }, - { - "name": "Daily Brief", - "freq": "daily 07h", - "target": "weval-daily-brief.py" - } - ] - }, - "wiki": { - "total_entries": 4319, - "categories": [ - { - "category": "AUTO-FIX", - "cnt": "2185" - }, - { - "category": "TOPOLOGY", - "cnt": "778" - }, - { - "category": "DISCOVERY", - "cnt": "610" - }, - { - "category": "SYSTEMATIC", - "cnt": "204" - }, - { - "category": "L99-FULLSCAN", - "cnt": "80" - }, - { - "category": "INFRA", - "cnt": "74" - }, - { - "category": "CONTROL-TOWER", - "cnt": "42" - }, - { - "category": "ALERT", - "cnt": "34" - }, - { - "category": "AGENT", - "cnt": "20" - }, - { - "category": "L99-SCAN", - "cnt": "12" - }, - { - "category": "FIX", - "cnt": "10" - }, - { - "category": "FLEET", - "cnt": "8" - }, - { - "category": "MASTER-INTENT", - "cnt": "6" - }, - { - "category": "SESSION-5AVR", - "cnt": "5" - }, - { - "category": "Maroc", - "cnt": "5" - }, - { - "category": "Analyse", - "cnt": "5" - }, - { - "category": "AUTH", - "cnt": "5" - }, - { - "category": "claude_2026", - "cnt": "4" - }, - { - "category": "SERVICES", - "cnt": "4" - }, - { - "category": "WEVAL Consulting", - "cnt": "4" - }, - { - "category": "Intelligence Artificielle", - "cnt": "3" - }, - { - "category": "PARADIGM", - "cnt": "3" - }, - { - "category": "INTEGRATION", - "cnt": "3" - }, - { - "category": "FIX-CRITIQUE", - "cnt": "3" - }, - { - "category": "Voici", - "cnt": "2" - }, - { - "category": "Vous", - "cnt": "2" - }, - { - "category": "Pouvez", - "cnt": "2" - }, - { - "category": "Image", - "cnt": "2" - }, - { - "category": "Contexte", - "cnt": "2" - }, - { - "category": "L99-EXHAUSTIVE", - "cnt": "2" - }, - { - "category": "L99-GAP", - "cnt": "2" - }, - { - "category": "WEVAL Consulting Casablanca", - "cnt": "2" - }, - { - "category": "Test", - "cnt": "2" - }, - { - "category": "Salut", - "cnt": "2" - }, - { - "category": "L99-E2E", - "cnt": "2" - }, - { - "category": "Document", - "cnt": "2" - }, - { - "category": "PROVIDERS", - "cnt": "2" - }, - { - "category": "Bien", - "cnt": "2" - }, - { - "category": "WEVIA", - "cnt": "2" - }, - { - "category": "Diagramme", - "cnt": "2" - }, - { - "category": "Comparaison", - "cnt": "2" - }, - { - "category": "L99-MEGA", - "cnt": "2" - }, - { - "category": "QUALITY", - "cnt": "2" - }, - { - "category": "Cependant", - "cnt": "2" - }, - { - "category": "MONITORING", - "cnt": "2" - }, - { - "category": "L99", - "cnt": "2" - }, - { - "category": "Introduction", - "cnt": "2" - }, - { - "category": "Pour", - "cnt": "2" - }, - { - "category": "Casablanca", - "cnt": "2" - }, - { - "category": "Pourriez", - "cnt": "2" - }, - { - "category": "Vistex BTP Signavio", - "cnt": "1" - }, - { - "category": "Conduite", - "cnt": "1" - }, - { - "category": "DMAIC", - "cnt": "1" - }, - { - "category": "Industrie", - "cnt": "1" - }, - { - "category": "Proposition", - "cnt": "1" - }, - { - "category": "Accueil\nBienvenue", - "cnt": "1" - }, - { - "category": "Logo", - "cnt": "1" - }, - { - "category": "SAP ECC", - "cnt": "1" - }, - { - "category": "Votre", - "cnt": "1" - }, - { - "category": "Probl", - "cnt": "1" - }, - { - "category": "ANTI-REGRESSION", - "cnt": "1" - }, - { - "category": "Explique", - "cnt": "1" - }, - { - "category": "Zero Trust", - "cnt": "1" - }, - { - "category": "Augmented Generation", - "cnt": "1" - }, - { - "category": "RLHF", - "cnt": "1" - }, - { - "category": "Service", - "cnt": "1" - }, - { - "category": "Transformer", - "cnt": "1" - }, - { - "category": "Bonjour Bonjour", - "cnt": "1" - }, - { - "category": "Transformation", - "cnt": "1" - }, - { - "category": "Audit", - "cnt": "1" - }, - { - "category": "WEVAL", - "cnt": "1" - }, - { - "category": "Strat", - "cnt": "1" - }, - { - "category": "Maghreb", - "cnt": "1" - }, - { - "category": "ERP SAP", - "cnt": "1" - }, - { - "category": "Quelle", - "cnt": "1" - }, - { - "category": "Oracle", - "cnt": "1" - }, - { - "category": "Data", - "cnt": "1" - }, - { - "category": "Donn", - "cnt": "1" - }, - { - "category": "Quel", - "cnt": "1" - }, - { - "category": "Syst", - "cnt": "1" - }, - { - "category": "Ahmed", - "cnt": "1" - }, - { - "category": "UiPath", - "cnt": "1" - }, - { - "category": "Niveau PhD", - "cnt": "1" - }, - { - "category": "CLEANUP", - "cnt": "1" - }, - { - "category": "Notre", - "cnt": "1" - }, - { - "category": "TOUTES", - "cnt": "1" - }, - { - "category": "Maroc DDMRP OTIF", - "cnt": "1" - }, - { - "category": "Crit", - "cnt": "1" - }, - { - "category": "SAP Vistex Revenue Management", - "cnt": "1" - }, - { - "category": "Fine", - "cnt": "1" - }, - { - "category": "Compare AWS Azure GCP", - "cnt": "1" - }, - { - "category": "Healthcare", - "cnt": "1" - }, - { - "category": "BLADE", - "cnt": "1" - }, - { - "category": "Plan", - "cnt": "1" - }, - { - "category": "Conseil", - "cnt": "1" - }, - { - "category": "Nous", - "cnt": "1" - }, - { - "category": "Zero Trust SOC SIEM", - "cnt": "1" - }, - { - "category": "Amazon Web Services", - "cnt": "1" - }, - { - "category": "Retiens", - "cnt": "1" - }, - { - "category": "Diff", - "cnt": "1" - }, - { - "category": "QDRANT", - "cnt": "1" - }, - { - "category": "MITRE ATT", - "cnt": "1" - }, - { - "category": "FMCG", - "cnt": "1" - }, - { - "category": "Supply", - "cnt": "1" - }, - { - "category": "Exercice", - "cnt": "1" - }, - { - "category": "Redige", - "cnt": "1" - }, - { - "category": "Supply Chain", - "cnt": "1" - }, - { - "category": "Quels", - "cnt": "1" - }, - { - "category": "Propose", - "cnt": "1" - }, - { - "category": "Plateforme", - "cnt": "1" - }, - { - "category": "Cyber", - "cnt": "1" - }, - { - "category": "Tableau", - "cnt": "1" - }, - { - "category": "Migration SAP", - "cnt": "1" - }, - { - "category": "AUTH-AGENT", - "cnt": "1" - }, - { - "category": "Fais", - "cnt": "1" - }, - { - "category": "Iran", - "cnt": "1" - }, - { - "category": "OLLAMA", - "cnt": "1" - }, - { - "category": "Reessayez", - "cnt": "1" - }, - { - "category": "MORNE WEVAL", - "cnt": "1" - }, - { - "category": "Analyse SWOT", - "cnt": "1" - }, - { - "category": "SAP Vistex", - "cnt": "1" - }, - { - "category": "IoT WMS", - "cnt": "1" - }, - { - "category": "Industry", - "cnt": "1" - }, - { - "category": "What", - "cnt": "1" - }, - { - "category": "Strategie", - "cnt": "1" - }, - { - "category": "Rappelle", - "cnt": "1" - }, - { - "category": "DMAIC Six Sigma", - "cnt": "1" - }, - { - "category": "Avantages", - "cnt": "1" - }, - { - "category": "Explique RLHF", - "cnt": "1" - }, - { - "category": "Huawei Cloud", - "cnt": "1" - }, - { - "category": "PMO SAFe", - "cnt": "1" - }, - { - "category": "Migration SAP ECC", - "cnt": "1" - }, - { - "category": "team_work", - "cnt": "1" - }, - { - "category": "Bonjour Pr", - "cnt": "1" - }, - { - "category": "Maroc DDMRP OTIF WMS TMS", - "cnt": "1" - }, - { - "category": "Architecture", - "cnt": "1" - }, - { - "category": "Framework NIST", - "cnt": "1" - }, - { - "category": "Automatiser", - "cnt": "1" - }, - { - "category": "Compare RLHF DPO Constitutional AI", - "cnt": "1" - }, - { - "category": "Genere", - "cnt": "1" - }, - { - "category": "Elle", - "cnt": "1" - }, - { - "category": "Constitutional AI", - "cnt": "1" - }, - { - "category": "Brownfield", - "cnt": "1" - }, - { - "category": "Confirmation", - "cnt": "1" - }, - { - "category": "Architecture IA", - "cnt": "1" - }, - { - "category": "KPIs", - "cnt": "1" - }, - { - "category": "Quelles", - "cnt": "1" - }, - { - "category": "SWOT", - "cnt": "1" - }, - { - "category": "Comparons", - "cnt": "1" - }, - { - "category": "Services", - "cnt": "1" - }, - { - "category": "Maroc TMA", - "cnt": "1" - }, - { - "category": "Contraintes", - "cnt": "1" - }, - { - "category": "Intelligence", - "cnt": "1" - }, - { - "category": "Donne", - "cnt": "1" - }, - { - "category": "Vistex", - "cnt": "1" - }, - { - "category": "Maroc CMI", - "cnt": "1" - }, - { - "category": "Audite", - "cnt": "1" - }, - { - "category": "Aide", - "cnt": "1" - }, - { - "category": "DKIM DMARC", - "cnt": "1" - }, - { - "category": "Zero Trust SOC", - "cnt": "1" - }, - { - "category": "Bonjour Yacine", - "cnt": "1" - }, - { - "category": "Workshop", - "cnt": "1" - }, - { - "category": "Compare RLHF DPO GRPO Constitutional AI", - "cnt": "1" - }, - { - "category": "Comparatif ERP PME", - "cnt": "1" - }, - { - "category": "Programme", - "cnt": "1" - }, - { - "category": "SAP MM", - "cnt": "1" - }, - { - "category": "Phases", - "cnt": "1" - }, - { - "category": "Autres", - "cnt": "1" - }, - { - "category": "FHIR", - "cnt": "1" - }, - { - "category": "SESSION-7AVR", - "cnt": "1" - }, - { - "category": "FHIR IA", - "cnt": "1" - }, - { - "category": "MLOps", - "cnt": "1" - }, - { - "category": "MIROFISH", - "cnt": "1" - }, - { - "category": "Ecris", - "cnt": "1" - }, - { - "category": "Suite", - "cnt": "1" - }, - { - "category": "Nearshore", - "cnt": "1" - }, - { - "category": "Bienvenue", - "cnt": "1" - }, - { - "category": "Retrieval", - "cnt": "1" - }, - { - "category": "KYC BAM", - "cnt": "1" - }, - { - "category": "Afrique", - "cnt": "1" - }, - { - "category": "Dans", - "cnt": "1" - }, - { - "category": "Azure", - "cnt": "1" - }, - { - "category": "Budget", - "cnt": "1" - }, - { - "category": "INSTRUCTION SYSTEME", - "cnt": "1" - }, - { - "category": "CNDP", - "cnt": "1" - }, - { - "category": "Compare", - "cnt": "1" - }, - { - "category": "HubSpot", - "cnt": "1" - }, - { - "category": "Control", - "cnt": "1" - }, - { - "category": "SESSION-6AVR", - "cnt": "1" - }, - { - "category": "Bonjour Salut", - "cnt": "1" - }, - { - "category": "Maroc KPIs OTIF", - "cnt": "1" - }, - { - "category": "Vistex SAP", - "cnt": "1" - }, - { - "category": "Traduis", - "cnt": "1" - }, - { - "category": "Maroc IoT WMS", - "cnt": "1" - }, - { - "category": "SaaS", - "cnt": "1" - }, - { - "category": "CODE BLOCK", - "cnt": "1" - }, - { - "category": "Cahier", - "cnt": "1" - }, - { - "category": "Maroc FHIR", - "cnt": "1" - }, - { - "category": "DESIGN", - "cnt": "1" - }, - { - "category": "Compare RLHF", - "cnt": "1" - }, - { - "category": "Dynamics", - "cnt": "1" - }, - { - "category": "Python", - "cnt": "1" - }, - { - "category": "FORMAT OBLIGATOIRE", - "cnt": "1" - }, - { - "category": "SAP ERP", - "cnt": "1" - }, - { - "category": "INFRA-SESSION", - "cnt": "1" - }, - { - "category": "Cette", - "cnt": "1" - }, - { - "category": "OWASP Top", - "cnt": "1" - }, - { - "category": "Logo Weval", - "cnt": "1" - }, - { - "category": "ADKAR", - "cnt": "1" - }, - { - "category": "GENERAL", - "cnt": "1" - } - ], - "qdrant_vectors": 386 - }, - "applications": [ - { - "name": "WEVIA Chatbot", - "type": "AI", - "url": "\/wevia", - "port": null, - "server": "S204", - "auth": "public" - }, - { - "name": "WEVIA Admin", - "type": "Admin", - "url": "\/wevia-admin", - "port": null, - "server": "S204", - "auth": "php-session" - }, - { - "name": "WEVIA Life", - "type": "Email AI", - "url": "\/products\/wevialife-app.html", - "port": null, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Workspace", - "type": "Hub", - "url": "\/products\/workspace.html", - "port": null, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Arsenal\/WEVADS", - "type": "Email Marketing", - "url": "wevads.weval-consulting.com", - "port": 5890, - "server": "S95", - "auth": "php-session" - }, - { - "name": "ADX\/iResponse", - "type": "Email Platform", - "url": "wevads.weval-consulting.com", - "port": 5821, - "server": "S95", - "auth": "iResponse" - }, - { - "name": "Ethica HCP", - "type": "Healthcare B2B", - "url": "consent.wevup.app", - "port": null, - "server": "S204", - "auth": "ethica-auth" - }, - { - "name": "CRM (Twenty)", - "type": "CRM", - "url": "crm.weval-consulting.com", - "port": 3000, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Mattermost", - "type": "Chat", - "url": "mm.weval-consulting.com", - "port": 8065, - "server": "S204", - "auth": "php-session" - }, - { - "name": "n8n", - "type": "Automation", - "url": "n8n.weval-consulting.com", - "port": 5678, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Uptime Kuma", - "type": "Monitoring", - "url": "monitor.weval-consulting.com", - "port": 3001, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Plausible", - "type": "Analytics", - "url": "analytics.weval-consulting.com", - "port": 8000, - "server": "S204", - "auth": "php-session" - }, - { - "name": "DeerFlow", - "type": "AI Research", - "url": "deerflow.weval-consulting.com", - "port": 2024, - "server": "S204", - "auth": "php-session" - }, - { - "name": "SearXNG", - "type": "Search", - "url": null, - "port": 8888, - "server": "S204", - "auth": "internal" - }, - { - "name": "Qdrant", - "type": "Vector DB", - "url": null, - "port": 6333, - "server": "S204", - "auth": "internal" - }, - { - "name": "Ollama", - "type": "LLM Runtime", - "url": null, - "port": 11435, - "server": "S204", - "auth": "internal" - }, - { - "name": "Flowise", - "type": "AI Flow", - "url": null, - "port": 3088, - "server": "S204", - "auth": "internal" - }, - { - "name": "MiroFish", - "type": "AI Agent", - "url": "mirofish.weval-consulting.com", - "port": 3050, - "server": "S204", - "auth": "php-session" - }, - { - "name": "Open WebUI", - "type": "LLM UI", - "url": null, - "port": 3002, - "server": "S204", - "auth": "internal" - }, - { - "name": "Vaultwarden", - "type": "Passwords", - "url": null, - "port": 8222, - "server": "S204", - "auth": "internal" - }, - { - "name": "Prometheus", - "type": "Metrics", - "url": null, - "port": 9000, - "server": "S204", - "auth": "internal" - }, - { - "name": "PMTA", - "type": "MTA", - "url": null, - "port": 25, - "server": "S95", - "auth": "internal" - }, - { - "name": "KumoMTA", - "type": "MTA", - "url": null, - "port": 8010, - "server": "S95", - "auth": "internal" - }, - { - "name": "Sentinel", - "type": "Orchestrator", - "url": null, - "port": 5890, - "server": "S95", - "auth": "internal" - } - ], - "cloud": [ - { - "provider": "Hetzner", - "role": "S204+S95", - "type": "Bare Metal", - "region": "Germany" - }, - { - "provider": "OVH", - "role": "S151 DR\/Tracking", - "type": "VPS", - "region": "France" - }, - { - "provider": "Cloudflare", - "role": "CDN+DNS+WAF", - "type": "SaaS", - "region": "Global" - }, - { - "provider": "Huawei Cloud", - "role": "Partner Certifié", - "type": "IaaS", - "region": "MENA" - }, - { - "provider": "Scaleway", - "role": "GPU Inference", - "type": "IaaS", - "region": "France" - } - ], - "partnerships": [ - "SAP Gold Partner", - "Huawei Cloud", - "Vistex", - "IQVIA", - "Scaleway" - ], - "ux_agent": { - "pass": 3, - "fail": 0, - "warn": 0, - "total": 3, - "timestamp": "", - "gauge_health_center": "X=0px Y=0px", - "gauge_auto_center": "X=0px Y=0px", - "design_tokens": { - "bg": "#09090b", - "card": "#18181b", - "font": "Inter" - } - }, - "l99": { - "master": { - "total": 93, - "pass": 89, - "fail": 2, - "timestamp": "2026-04-07T01:32:48.454012" - }, - "auth": { - "pass": 24, - "fail": 0 - } - }, - "cortex": { - "fast_lines": 3620, - "router_lines": 6089, - "router_functions": 17, - "today_requests": 0, - "today_cost": 0, - "avg_latency_ms": 0, - "top_provider": "N\/A", - "providers_used": 0 - }, - "optimizations": { - "recent_commits": [], - "auto_fixes": [ - { - "fact": "AUTONOMY 14Apr 19:00: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 21:00:02.038946" - }, - { - "fact": "AUTONOMY 14Apr 18:55: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:55:01.439889" - }, - { - "fact": "AUTONOMY 14Apr 18:50: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:50:02.300856" - }, - { - "fact": "AUTONOMY 14Apr 18:45: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:45:01.779482" - }, - { - "fact": "AUTONOMY 14Apr 18:40: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:40:02.134664" - }, - { - "fact": "AUTONOMY 14Apr 18:35: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:35:01.90366" - }, - { - "fact": "AUTO-FIX 14Apr2026 18:30: 1 fixes applied. S204: PHP-FPM DOWN", - "created_at": "2026-04-14 20:30:02.499691" - }, - { - "fact": "AUTO-FIX 14Apr2026 18:30: 1 fixes applied. S204: PHP-FPM DOWN", - "created_at": "2026-04-14 20:30:02.304905" - }, - { - "fact": "AUTONOMY 14Apr 18:30: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:30:01.9927" - }, - { - "fact": "AUTONOMY 14Apr 18:25: 2 fixes. Restart php-fpm; Restart ollama", - "created_at": "2026-04-14 20:25:02.202816" - } - ], - "architecture_decisions": [ - { - "fact": "Crons: root=51 www-data=55 cron.d=72 total=178", - "created_at": "2026-04-13 00:30:48.940882" - }, - { - "fact": "Crons: root=51 www-data=55 cron.d=70 total=176", - "created_at": "2026-04-12 20:30:07.357094" - }, - { - "fact": "Crons: root=51 www-data=55 cron.d=70 total=176", - "created_at": "2026-04-12 18:30:05.962933" - }, - { - "fact": "Crons: root=51 www-data=55 cron.d=70 total=176", - "created_at": "2026-04-12 16:30:13.56815" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 14:30:11.101941" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 12:30:08.795912" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 10:30:04.181935" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 08:30:04.196728" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 06:30:04.792965" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 04:30:06.68899" - }, - { - "fact": "Crons: root=51 www-data=57 cron.d=70 total=178", - "created_at": "2026-04-12 02:30:07.207832" - }, - { - "fact": "Crons: root=51 www-data=54 cron.d=69 total=174", - "created_at": "2026-04-12 00:30:13.084556" - }, - { - "fact": "Crons: root=50 www-data=52 cron.d=69 total=171", - "created_at": "2026-04-11 22:30:07.088896" - }, - { - "fact": "Crons: root=50 www-data=52 cron.d=69 total=171", - "created_at": "2026-04-11 20:30:08.94444" - }, - { - "fact": "Crons: root=50 www-data=48 cron.d=69 total=167", - "created_at": "2026-04-11 18:30:04.55611" - } - ], - "pipelines": [ - { - "name": "CORTEX Smart Router", - "status": "active", - "desc": "T0 Ollama → T1 Free APIs → T2 Fallbacks", - "routes": 3620 - }, - { - "name": "RAG Ingest", - "status": "active", - "desc": "Cron *\/30 → Qdrant semantic indexing", - "freq": "*\/30" - }, - { - "name": "L99 Quality Gate", - "status": "active", - "desc": "253+ tests, 28 auth tests", - "freq": "*\/30" - }, - { - "name": "Blade Orchestrator", - "status": "active", - "desc": "GPU polling + model sync", - "freq": "*\/30" - }, - { - "name": "Infra Guardian", - "status": "active", - "desc": "Auto-restart nginx\/php\/docker", - "freq": "*\/5" - }, - { - "name": "Ethica Scraper Pipeline", - "status": "active", - "desc": "4 spiders, RichScraper, SearXNG", - "freq": "daily" - }, - { - "name": "WEVIA Dream", - "status": "active", - "desc": "Background learning + dataset enrichment", - "freq": "*\/30" - }, - { - "name": "Daily Brief", - "status": "active", - "desc": "Morning synthesis → Mattermost", - "freq": "daily 07h" - }, - { - "name": "Architecture Scanner", - "status": "active", - "desc": "This page — auto-scan + recommendations", - "freq": "*\/30" - } - ], - "agents_deployed": [ - { - "name": "Monitor Agent", - "role": "Watches all services, auto-restarts", - "status": "active" - }, - { - "name": "DevOps Agent", - "role": "Git sync, deployment, rollback", - "status": "active" - }, - { - "name": "Ethica Agent", - "role": "HCP scraping, validation, enrichment", - "status": "active" - }, - { - "name": "Security Agent", - "role": "Key rotation, secret scan, vulnerability check", - "status": "active" - }, - { - "name": "Blade Agent", - "role": "GPU orchestration, model management", - "status": "active" - }, - { - "name": "Dream Agent", - "role": "Background learning, dataset generation", - "status": "active" - }, - { - "name": "RAG Agent", - "role": "Knowledge ingestion, vector indexing", - "status": "active" - }, - { - "name": "Quality Agent", - "role": "L99 NonReg, regression detection", - "status": "active" - } - ] - }, - "mirofish": { - "status": "active", - "reports": 0, - "bridge": "\/api\/mirofish-bridge.php" - }, - "recommendations": { - "score": 85, - "total": 1, - "critical": 1, - "warning": 0, - "info": 0, - "opportunity": 0, - "auto_fixed": 1, - "fixes_log": [ - { - "title": "S204: PHP-FPM DOWN", - "cmd": "systemctl restart php8.5-fpm", - "output": "Failed to restart php8.5-fpm.service: Interactive authentication required.\nSee system logs and 'systemctl status php8.5-fpm.service' for details.", - "time": "2026-04-14 19:00:02" - } - ], - "recommendations": [ - { - "severity": "critical", - "category": "INFRA", - "title": "S204: PHP-FPM DOWN", - "detail": "PHP-FPM inactif. APIs inaccessibles. Restart immédiat.", - "action": "auto", - "fix_cmd": "systemctl restart php8.5-fpm", - "auto_fixed": true, - "fix_output": "Failed to restart php8.5-fpm.service: Interactive authentication required.\nSee system logs and 'systemctl status php8.5-fpm.service' for details." - } - ] - }, - "scan_time_ms": 738, - "gaps": [], - "score": 100, - "automation": { - "coverage": 100, - "steps": 30, - "total": 30 - } -} \ No newline at end of file diff --git a/api/blade-tasks/heartbeat.json b/api/blade-tasks/heartbeat.json index ca435198d..d9e821c52 100644 --- a/api/blade-tasks/heartbeat.json +++ b/api/blade-tasks/heartbeat.json @@ -1,11 +1,11 @@ { - "ts": "2026-04-14T19:19:58+00:00", + "ts": "2026-04-14T19:29:31+00:00", "hostname": "LAPTOP-VE75QUHF", - "cpu": "29%", - "ram": "68% (16GB)", - "disk": "?", - "uptime": "2d03h33m", + "cpu": "91%", + "ram": "72% (16GB)", + "disk": "81% (464GB)", + "uptime": "2d 3h", "user": "Yace", "ip": "196.217.194.10", - "agent_version": "2.0" + "agent_version": "2.2" } \ No newline at end of file diff --git a/api/blade-tasks/task_autofix_1776195002.json b/api/blade-tasks/task_autofix_1776195002.json new file mode 100644 index 000000000..6b2287c34 --- /dev/null +++ b/api/blade-tasks/task_autofix_1776195002.json @@ -0,0 +1 @@ +{"id":"task_autofix_1776195002","name":"AUTO-FIX CPU:91% RAM:72%","type":"powershell","priority":0,"status":"pending","created":"2026-04-14T21:30:02+02:00","command":"Stop-Service SysMain,DiagTrack,wuauserv -Force -EA 0;Get-Process|Where{$_.CPU -gt 120}|Sort CPU -Desc|Select -First 3|Stop-Process -Force -EA 0;[GC]::Collect();Write-Output done"} diff --git a/api/ethica-stats.json b/api/ethica-stats.json index 01ce75e34..3b8b61865 100644 --- a/api/ethica-stats.json +++ b/api/ethica-stats.json @@ -1 +1 @@ -{"ok":true,"total":132000,"countries":3,"stats":{"VALID":0,"INVALID":0,"RISKY":0,"CATCH-ALL":0,"UNKNOWN":132000,"CHECKED":0}} +{"ok":true,"total":48899,"with_email":47977,"with_telephone":16006} \ No newline at end of file diff --git a/api/mirofish-ceo-cache.json b/api/mirofish-ceo-cache.json index 626d64294..f13c0d35d 100644 --- a/api/mirofish-ceo-cache.json +++ b/api/mirofish-ceo-cache.json @@ -13,5 +13,5 @@ "Run simulation", "CEO insights" ], - "timestamp": "2026-04-14 19:20:01" + "timestamp": "2026-04-14 19:30:02" } \ No newline at end of file diff --git a/api/wevia-antiregression-status.json b/api/wevia-antiregression-status.json index b062f685e..8db7d6756 100644 --- a/api/wevia-antiregression-status.json +++ b/api/wevia-antiregression-status.json @@ -1,5 +1,5 @@ { - "timestamp": "2026-04-14 21:15:19", + "timestamp": "2026-04-14 21:25:05", "healthy": false, "issues": [ "Chatbot check error: Expecting value: line 1 column 1 (char 0)", diff --git a/api/wevia-auth-status.json b/api/wevia-auth-status.json index 6e8996264..c23663dcc 100644 --- a/api/wevia-auth-status.json +++ b/api/wevia-auth-status.json @@ -1,5 +1,5 @@ { - "timestamp": "2026-04-14 19:15:09", + "timestamp": "2026-04-14 19:25:08", "healthy": false, "checks": { "outpost": "DOWN", @@ -30,62 +30,62 @@ { "level": "critical", "msg": "Outpost DOWN 9090", - "ts": "2026-04-14T19:15:01+00:00" + "ts": "2026-04-14T19:25:01+00:00" }, { "level": "critical", "msg": "Outpost STILL DOWN", - "ts": "2026-04-14T19:15:06+00:00" + "ts": "2026-04-14T19:25:06+00:00" }, { "level": "warning", "msg": "Auth flow wevads.weval-consulting.com: 301", - "ts": "2026-04-14T19:15:07+00:00" + "ts": "2026-04-14T19:25:06+00:00" }, { "level": "warning", "msg": "Auth flow ethica.weval-consulting.com: 200", - "ts": "2026-04-14T19:15:07+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Auth flow n8n.weval-consulting.com: 502", - "ts": "2026-04-14T19:15:07+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Auth flow crm.weval-consulting.com: 502", - "ts": "2026-04-14T19:15:07+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Auth flow mm.weval-consulting.com: 502", - "ts": "2026-04-14T19:15:08+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Auth flow analytics.weval-consulting.com: 502", - "ts": "2026-04-14T19:15:08+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Auth flow deerflow.weval-consulting.com: 200", - "ts": "2026-04-14T19:15:08+00:00" + "ts": "2026-04-14T19:25:07+00:00" }, { "level": "warning", "msg": "Callback location missing in nginx", - "ts": "2026-04-14T19:15:08+00:00" + "ts": "2026-04-14T19:25:07+00:00" } ], "fixes": [ { "title": "Restart authentik", - "ts": "2026-04-14T19:15:01+00:00" + "ts": "2026-04-14T19:25:01+00:00" }, { "title": "Callback location auto-added", - "ts": "2026-04-14T19:15:08+00:00" + "ts": "2026-04-14T19:25:08+00:00" } ] } \ No newline at end of file diff --git a/api/wevia-autonomy-status.json b/api/wevia-autonomy-status.json index c1e6adda1..aec924cf5 100644 --- a/api/wevia-autonomy-status.json +++ b/api/wevia-autonomy-status.json @@ -1,5 +1,5 @@ { - "timestamp": "2026-04-14 19:15:01", + "timestamp": "2026-04-14 19:25:01", "version": "1.0", "disk": 69, "ram": 9, @@ -8,66 +8,56 @@ "ollama_models": 0, "arch_score": 85, "fixes_count": 2, - "alerts_count": 7, + "alerts_count": 5, "fixes": [ { "title": "Restart php-fpm", "cmd": "systemctl restart php8.5-fpm", - "output": "", - "time": "19:15:01" + "output": "Job for php8.5-fpm.service failed because the control process exited with error code.\nSee \"systemctl status php8.5-fpm.service\" and \"journalctl -xeu php8.5-fpm.service\" for details.", + "time": "19:25:01" }, { "title": "Restart ollama", "cmd": "systemctl restart ollama", "output": "", - "time": "19:15:01" + "time": "19:25:01" } ], "alerts": [ { "level": "critical", "msg": "S204:php-fpm DOWN (:9000)", - "time": "19:15:01" + "time": "19:25:01" }, { "level": "critical", "msg": "S204:ollama DOWN (:11435)", - "time": "19:15:01" + "time": "19:25:01" }, { "level": "critical", "msg": "S204:deerflow DOWN (:2024)", - "time": "19:15:01" + "time": "19:25:01" }, { "level": "critical", "msg": "S204:authentik DOWN (:9090)", - "time": "19:15:01" - }, - { - "level": "warning", - "msg": "Token : expired", - "time": "19:15:04" - }, - { - "level": "warning", - "msg": "Token : expired", - "time": "19:15:04" + "time": "19:25:01" }, { "level": "warning", "msg": "Architecture score 85\/100", - "time": "19:15:04" + "time": "19:25:01" } ], "log": [ - "19:15:01 AUTO-FIX: Restart php-fpm", - "19:15:01 AUTO-FIX: Restart ollama", - "19:15:01 Disk: 69%", - "19:15:01 SSL: 356d remaining", - "19:15:01 Docker: 8 containers", - "19:15:01 RAM: 9%", - "19:15:04 Arch score: 85\/100" + "19:25:01 AUTO-FIX: Restart php-fpm", + "19:25:01 AUTO-FIX: Restart ollama", + "19:25:01 Disk: 69%", + "19:25:01 SSL: 356d remaining", + "19:25:01 Docker: 8 containers", + "19:25:01 RAM: 9%", + "19:25:01 Arch score: 85\/100" ], "s204_services": 8, "s95_mta": 5 diff --git a/api/wevia-blade-status.json b/api/wevia-blade-status.json index 8316e1d90..bf118349b 100644 --- a/api/wevia-blade-status.json +++ b/api/wevia-blade-status.json @@ -1 +1 @@ -{"ts":"21:18","status":"offline"} +{"ts":"21:30","status":"online","cpu":"91%","ram":"72%","ip":"196.217.194.10","uptime":"2d 3h","pending":17,"via":"heartbeat"} diff --git a/api/wevia-pilot-status.json b/api/wevia-pilot-status.json index bd075f020..d1fac5743 100644 --- a/api/wevia-pilot-status.json +++ b/api/wevia-pilot-status.json @@ -1,2 +1,2 @@ -{"ts":"21:10","disk":"69%","swap":"1%","docker_dead":"none","http":"200","ssl":"Certificate will not expire +{"ts":"21:20","disk":"69%","swap":"1%","docker_dead":"none","http":"200","ssl":"Certificate will not expire ok","alerts":"none","crons":62} diff --git a/api/wevia-quality-status.json b/api/wevia-quality-status.json index b21234c73..a9d531538 100644 --- a/api/wevia-quality-status.json +++ b/api/wevia-quality-status.json @@ -1,5 +1,5 @@ { - "timestamp": "2026-04-14 19:10:10", + "timestamp": "2026-04-14 19:20:17", "healthy": false, "global_pass": 284, "global_fail": 9, diff --git a/api/wevia-selfmanage.json b/api/wevia-selfmanage.json index 161c8cc3e..1ff514b6a 100644 --- a/api/wevia-selfmanage.json +++ b/api/wevia-selfmanage.json @@ -1 +1 @@ -{"ts": "21:15", "status": "ok"} \ No newline at end of file +{"ts": "21:25", "status": "ok"} \ No newline at end of file diff --git a/api/wevia-stream-sovereign.php b/api/wevia-stream-sovereign.php new file mode 100644 index 000000000..278346585 --- /dev/null +++ b/api/wevia-stream-sovereign.php @@ -0,0 +1,96 @@ + $type, 'content' => $data], JSON_UNESCAPED_UNICODE) . "\n\n"; + flush(); +} + +$input = json_decode(file_get_contents('php://input'), true); +$msg = trim($input['message'] ?? $input['prompt'] ?? ''); +$system = $input['system'] ?? 'Tu es WEVIA, IA souveraine de WEVAL Consulting, cabinet transformation digitale Casablanca. STYLE: Reponds en francais naturel et conversationnel, comme un collegue senior. Phrases completes, structurees, jamais du JSON brut. Direct, pro, chaleureux. Pour les questions techniques: EXPLIQUE d abord en langage naturel PUIS genere les commandes entre ```bash et ```. Apres execution, commente le resultat. Si probleme, propose un fix. Ne dis JAMAIS Information confidentielle. Tu es la pour aider. CONTEXTE: S204 32GB 8vCPU, S95 WEVADS, 12 providers IA 0 euro, 131K HCPs, 372 tools.'; +$maxTk = min((int)($input['max_tokens'] ?? 2000), 8000); +$exec = ($input['exec'] ?? true) !== false; +if (!$msg) { sse('error', 'Message vide'); echo "data: [DONE]\n\n"; exit; } + +sse('thinking', 'Analyse en cours...'); + +$ch = curl_init('http://127.0.0.1:4000/v1/chat/completions'); +curl_setopt_array($ch, [ + CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15, + CURLOPT_HTTPHEADER => ['Content-Type: application/json'], + CURLOPT_POSTFIELDS => json_encode([ + 'model' => 'auto', + 'messages' => [['role'=>'system','content'=>$system],['role'=>'user','content'=>$msg]], + 'max_tokens' => $maxTk, 'temperature' => 0.3 + ]) +]); +$resp = curl_exec($ch); +$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); +$latency = round(curl_getinfo($ch, CURLINFO_TOTAL_TIME) * 1000); +curl_close($ch); + +if ($httpCode !== 200 || !$resp) { + sse('error', 'Sovereign indisponible (HTTP ' . $httpCode . ')'); + echo "data: [DONE]\n\n"; exit; +} +$data = json_decode($resp, true); +$fullText = $data['choices'][0]['message']['content'] ?? ''; +$provider = $data['provider'] ?? 'sovereign'; +if (!$fullText) { sse('error', 'Reponse vide'); echo "data: [DONE]\n\n"; exit; } + +sse('provider', ['name' => $provider, 'latency_ms' => $latency]); + +// Stream word by word + detect and execute bash blocks +$words = preg_split('/(\s+)/', $fullText, -1, PREG_SPLIT_DELIM_CAPTURE); +$buf = ''; +$inCode = false; +$codeLang = ''; + +foreach ($words as $w) { + $buf .= $w; + if (preg_match('/```(\w*)/', $w, $m) && !$inCode) { + $inCode = true; + $codeLang = $m[1] ?: 'bash'; + } + if ($inCode && substr_count($buf, '```') >= 2) { + $inCode = false; + if (preg_match('/```\w*\s*(.*?)```/s', $buf, $cm)) { + $code = trim($cm[1]); + sse('token', $buf); + $buf = ''; + if ($exec && in_array($codeLang, ['bash','sh','']) && $code) { + $bad = ['rm -rf /','mkfs','dd if=',':(){','chmod -R 777 /','reboot','shutdown']; + $blocked = false; + foreach ($bad as $b) { if (stripos($code, $b) !== false) { $blocked = true; break; } } + if ($blocked) { + sse('exec_blocked', 'Commande dangereuse bloquee'); + } else { + sse('exec_start', $code); + $out = trim(shell_exec($code . ' 2>&1')); + sse('exec_result', ['cmd'=>$code, 'output'=>substr($out,0,5000), 'ok'=>true]); + } + } + continue; + } + } + if (!$inCode && strlen($buf) > 15) { + sse('token', $buf); + $buf = ''; + usleep(12000); + } +} +if ($buf) sse('token', $buf); + +sse('done', ['provider'=>$provider, 'latency_ms'=>$latency, 'words'=>str_word_count($fullText)]); +echo "data: [DONE]\n\n"; diff --git a/css/wevia-stream.css b/css/wevia-stream.css new file mode 100644 index 000000000..b695e43e5 --- /dev/null +++ b/css/wevia-stream.css @@ -0,0 +1,16 @@ +.wevia-stream-response{padding:12px 0;line-height:1.7;font-size:15px;color:var(--text,#e0e0e0)} +.wevia-thinking{color:#888;font-style:italic;animation:pulse 1.5s infinite} +@keyframes pulse{0%,100%{opacity:.5}50%{opacity:1}} +.wevia-cursor{color:#10B981;animation:blink .8s infinite;font-weight:bold} +@keyframes blink{0%,100%{opacity:1}50%{opacity:0}} +.wevia-text{white-space:pre-wrap;word-wrap:break-word} +.wevia-text strong{color:#60a5fa} +.wevia-text code{background:rgba(255,255,255,.08);padding:2px 6px;border-radius:4px;font-family:'JetBrains Mono',monospace;font-size:13px} +.wevia-text pre.code-block{background:#0d1117;border:1px solid #30363d;border-radius:8px;padding:14px;margin:10px 0;overflow-x:auto;max-height:400px} +.wevia-text pre.code-block code{background:none;padding:0;color:#c9d1d9;font-size:13px} +.wevia-exec-badge{display:inline-block;background:rgba(16,185,129,.15);color:#10B981;padding:4px 10px;border-radius:6px;font-size:12px;margin:6px 0;font-family:monospace} +.wevia-exec-output{background:#0d1117;border-left:3px solid #10B981;padding:10px 14px;margin:8px 0;border-radius:0 8px 8px 0} +.wevia-exec-output .exec-cmd{color:#10B981;font-family:monospace;font-size:12px;margin-bottom:6px} +.wevia-exec-output pre{color:#8b949e;font-size:13px;margin:0;white-space:pre-wrap;max-height:300px;overflow-y:auto} +.wevia-provider-badge{display:inline-block;background:rgba(99,102,241,.15);color:#818cf8;padding:3px 8px;border-radius:12px;font-size:11px;margin-top:8px} +.wevia-error{color:#f87171;background:rgba(248,113,113,.1);padding:10px;border-radius:8px} diff --git a/js/wevia-stream-client.js b/js/wevia-stream-client.js new file mode 100644 index 000000000..8c2e52259 --- /dev/null +++ b/js/wevia-stream-client.js @@ -0,0 +1,42 @@ +window.weviaStream=function(msg,container,opts){ +opts=opts||{}; +var ep=opts.endpoint||'/api/wevia-stream-sovereign.php'; +var sys=opts.system||''; +var mt=opts.maxTokens||2000; +var onDone=opts.onDone||function(){}; +var rd=document.createElement('div'); +rd.className='wevia-stream-response'; +rd.innerHTML='Analyse en cours...'; +container.appendChild(rd); +var tb='',pb='',exr=[]; +fetch(ep,{method:'POST',headers:{'Content-Type':'application/json'}, +body:JSON.stringify({message:msg,system:sys,max_tokens:mt,exec:opts.exec!==false}) +}).then(function(r){ +var reader=r.body.getReader(),dec=new TextDecoder(),buf=''; +function proc(res){ +if(res.done){rd.innerHTML=fmtR(tb,pb,exr);onDone({text:tb,provider:pb,exec:exr});return;} +buf+=dec.decode(res.value,{stream:true}); +var ls=buf.split('\n');buf=ls.pop(); +ls.forEach(function(l){ +if(!l.startsWith('data: ')||l==='data: [DONE]')return; +try{var d=JSON.parse(l.substring(6)); +switch(d.type){ +case 'thinking':var th=rd.querySelector('.wevia-thinking');if(th)th.textContent=d.content;break; +case 'provider':pb=d.content.name+' ('+d.content.latency_ms+'ms)';break; +case 'token':tb+=d.content;rd.innerHTML=fmtR(tb,pb,exr)+'|';container.scrollTop=container.scrollHeight;break; +case 'exec_start':rd.innerHTML+='
$ '+esc(d.content).substring(0,80)+'
';break; +case 'exec_result':exr.push(d.content);break; +case 'exec_blocked':exr.push({cmd:d.content,output:'BLOCKED',ok:false});break; +case 'error':rd.innerHTML='
'+esc(typeof d.content==='string'?d.content:JSON.stringify(d.content))+'
';break; +}}catch(e){}}); +return reader.read().then(proc);} +return reader.read().then(proc); +}).catch(function(e){rd.innerHTML='
Erreur: '+e.message+'
';}); +return rd;}; +function fmtR(t,p,ex){ +var h='
'+md2h(t)+'
'; +ex.forEach(function(e){h+='
$ '+esc(e.cmd||'')+'
'+esc(e.output||'')+'
';}); +if(p)h+='
'+esc(p)+'
'; +return h;} +function md2h(m){return m.replace(/```(\w*)\n([\s\S]*?)```/g,'
$2
').replace(/`([^`]+)`/g,'$1').replace(/\*\*([^*]+)\*\*/g,'$1').replace(/\n/g,'
');} +function esc(t){var d=document.createElement('div');d.textContent=t;return d.innerHTML;}