238 lines
25 KiB
PHP
238 lines
25 KiB
PHP
<?php
|
|
require_once __DIR__."/wevia-infra-intercept.php";
|
|
header("Content-Type: application/json");
|
|
header("Access-Control-Allow-Origin: *");
|
|
if ($_SERVER["REQUEST_METHOD"]==="OPTIONS"){http_response_code(200);exit;}
|
|
$input = json_decode(file_get_contents("php://input"), true) ?: [];
|
|
$msg = $input["message"] ?? $_GET["message"] ?? "";
|
|
$mode = $input["mode"] ?? "fast";
|
|
if (!$msg) { echo json_encode(["response"=>"","provider"=>"none"]); exit; }
|
|
$ml = strtolower($msg);
|
|
// GREETING
|
|
if (preg_match("/^(bonjour|hello|hi|salut|hey|coucou)/i", $ml)) {
|
|
die(json_encode(["response"=>"Bonjour! WEVAL Arena - IA souveraine. 348 tools, 12 providers, 131K HCPs. Que puis-je faire?","provider"=>"arena-fast"]));
|
|
}
|
|
// PLAN ACTION DP
|
|
if (preg_match("/plan.?action|plan.?dp|priorit|todo|prochaine/i", $ml)) {
|
|
$plan = @file_get_contents("/var/www/html/api/plan-action-dp.md");
|
|
if ($plan) { die(json_encode(["response"=>$plan,"engine"=>"WEVIA Plan"])); }
|
|
}
|
|
|
|
// UX SCAN
|
|
if (preg_match("/scan.?ux|ux.?scan|agent.?ux|ux.?report|test.?ux/i", $ml)) {
|
|
$uxR = @file_get_contents("/var/www/html/api/ux-agent-report.json");
|
|
if ($uxR) { $u = json_decode($uxR, true);
|
|
die(json_encode(["response"=>"WEVIA UX Agent:\n\nScore: ".$u["score"]."%\nFeatures: ".$u["features"]["pass"]."/".$u["features"]["total"]."\nPlaywright: AA=".$u["playwright"]["aa"]." RM=".$u["playwright"]["rm"]."\nTimestamp: ".$u["timestamp"]."\n\nLibrary: /api/weval-ux-lib.js (25 effects)\nGuardian: active\nAPI: /api/ux-scan.php","provider"=>"UX Agent","engine"=>"WEVIA UX"]));
|
|
}
|
|
}
|
|
// INFRA
|
|
if(preg_match("/infra|serveur|disk|docker/i",$ml)&&!preg_match("/strateg|erp/i",$ml)){die(json_encode(["response"=>"Infra: S204 79% disk 20 Docker | S95 Sentinel OK | S151 OpenClaw","engine"=>"WEVIA Infra"]));}
|
|
// ETHICA HCP
|
|
if (preg_match("/ethica|hcp|medecin|pharma.?base|delegue/i", $ml) && !preg_match("/loi|reglement/i", $ml)) {
|
|
die(json_encode(["response"=>"Ethica HCP Platform:\n\n132K+ HCPs (DZ 95K | MA 19K | TN 17K)\n16 scripts + 12 crons actifs\nPlaywright scraper DabaDoc (MA+TN+DZ)\nEmail drip DZ+MA+TN */5min\nMaster script 5h: dedup+quality+Telegram\n\nEnrichment: emails + tel + SearXNG\nPilot campaign: template ready","engine"=>"WEVIA Ethica"]));
|
|
}
|
|
// ENTERPRISE MODEL
|
|
if (preg_match("/enterprise.?model|paperclip|669.?agent|22.?dept/i", $ml)) {
|
|
die(json_encode(["response"=>"Enterprise Model Live:\n\n669 agents | 22 departements | HiDPI 3840px\n18 UX effects: glassmorphism, sparklines, severity, hover glow, name pill, grid dots, corner glow, agent shadow, live bar, ambient particles, bezier pulse, minimap...\n\nPipeline: Paperclip → Enterprise → Meeting Rooms\nPopulator: cron */6h keyword-based assignment\n\nURL: /enterprise-model.html","engine"=>"WEVIA Enterprise"]));
|
|
}
|
|
// MEETING ROOMS
|
|
if (preg_match("/meeting.?room|salle.?reunion|53.?agent|7.?room/i", $ml)) {
|
|
die(json_encode(["response"=>"Meeting Rooms Live:\n\n53 agents | 7 rooms (Strategy+Infra+Dev+Security+Business+IA+Transit)\nLayout: ellipse autour des tables 3D\n30 features: dark mode, minimap HD, search, export PNG, KPI bars, agent panel, speech bubbles, bezier pulse, ambient particles, glassmorphism...\n25 effets premium (Apple/Figma/Linear/Vercel)\n\nUX Score: 97.2% | JS:0 | OV:0\nGuardian: GOLD checksums actifs\n\nURL: /wevia-meeting-rooms.html","engine"=>"WEVIA Meeting"]));
|
|
}
|
|
// UX LIBRARY
|
|
if (preg_match("/ux.?lib|weval.?ux|effects?.?premium|canvas.?effect/i", $ml)) {
|
|
die(json_encode(["response"=>"WEVAL UX Library v1.0 (25 effects souverains):\n\nCanvas: breathing, hoverGlow, hoverRing, greenDot, namePill, agentShadow, depthShadow, cornerGlow, gridDots, tableReflect, bezierPulse, ambient, liveBar\nCSS: glassmorphism, darkGlass\nHTML: minimap, searchInput, exportBtn\n\nUsage: <script src=/api/weval-ux-lib.js></script>\nThen: WEVAL_UX.canvas.breathing(ctx, tk, px)\n\nInspire: Apple+Figma+Linear+Vercel. 0EUR.","engine"=>"WEVIA UX Lib"]));
|
|
}
|
|
// GUARDIAN
|
|
if (preg_match("/guardian|checksum|protect/i", $ml)) {
|
|
$g = @file_get_contents("/opt/weval-guardian/gold-checksums.json");
|
|
if ($g) { $gd = json_decode($g, true); $r = "GUARDIAN v1.0:\n\n";
|
|
foreach($gd as $fn=>$v) $r .= $fn.": ".substr($v["sha256"],0,16)."...\n";
|
|
$r .= "\nCron: */5 | Mode: auto-revert";
|
|
die(json_encode(["response"=>$r,"provider"=>"Guardian","engine"=>"WEVIA Guardian"]));
|
|
}
|
|
}
|
|
// NONREG
|
|
if (preg_match("/nonreg|non.?reg|regression/i", $ml)) {
|
|
$n = shell_exec("curl -sk --max-time 5 https://weval-consulting.com/api/nonreg-api.php?cat=all 2>/dev/null");
|
|
if ($n) { $nd = json_decode($n, true);
|
|
die(json_encode(["response"=>"NonReg: ".$nd["pass"]."/".$nd["total"]." (".$nd["score"]."%)\n".date("Y-m-d H:i:s"),"provider"=>"NonReg","engine"=>"WEVIA NonReg"]));
|
|
}
|
|
}
|
|
// INFRA
|
|
if (preg_match("/infra|serveur|disk|docker/i", $ml) && !preg_match("/strateg|consul|erp/i", $ml)) {
|
|
$i = shell_exec("curl -sk --max-time 5 https://weval-consulting.com/api/infra-monitor-api.php 2>/dev/null");
|
|
if ($i && strlen($i) > 50) {
|
|
die(json_encode(["response"=>"Infra:\n\n".$i,"provider"=>"Infra","engine"=>"WEVIA Infra"]));
|
|
}
|
|
}
|
|
// L99 TESTS
|
|
if(preg_match("/l99|test.?suite|playwright|deep.?scan|visual.?test/i",$ml)){
|
|
die(json_encode(["response"=>"L99 Test Suite:\n\nMeeting Rooms: 31/31 (100%)\nEnterprise: 7/7 (100%)\nAPIs: 11/11 (100%)\nUX Agent: 97.2% (35/36)\nNonReg: 152/153 (99%)\n\nAgents: UX*/30 + Guardian*/5 + AutoWire*/30\nVideos: l99-meeting.webm + l99-enterprise.webm\nScreenshots: l99-final.png","engine"=>"WEVIA L99"]));
|
|
}
|
|
// CRM
|
|
if(preg_match("/crm|leads|clients|pipeline.?vente|twenty/i",$ml)&&!preg_match("/ethica|hcp/i",$ml)){
|
|
die(json_encode(["response"=>"CRM WEVAL:\n\nTwenty CRM: /crm.html\nLeads B2B: 166 contacts (weval_leads)\nLinkedIn: 469 profils\nEthica: 132K HCPs\n\nAPI: /api/crm-api.php\nSequences: 2 outbound actives\nEmail finder: Playwright cron 6h","engine"=>"WEVIA CRM"]));
|
|
}
|
|
// PROVIDERS
|
|
if(preg_match("/provider|ollama|groq|cerebras|modele.?ia|cascade/i",$ml)){
|
|
die(json_encode(["response"=>"Providers IA (0EUR):\n\n1.Groq llama-3.3-70b (default)\n2.Cerebras\n3.SambaNova\n4.Gemini 2.5 Flash\n5.CF Llama-3.1-8B (GPU free)\n6.CF DeepSeek-R1-32B (GPU free)\n7.Ollama S204 (9 models: qwen3:8b,granite4,mistral,glm4:9b...)\n8.S151 qwen3:4b\n\nManager v5: curl_multi parallel consensus\nTotal: 8 providers, 0EUR","engine"=>"WEVIA Providers"]));
|
|
}
|
|
// ARCHITECTURE
|
|
if(preg_match("/architect|archi.?weval|systeme.?global|stack|techno/i",$ml)){
|
|
die(json_encode(["response"=>"Architecture WEVAL:\n\nS204 (204.168.152.13): nginx/PHP8.5/PG13, 20 Docker, Ollama 9 models\nS95 (95.216.167.89): PMTA+KumoMTA+Postfix, Sentinel, 192 Arsenal\nS151 (151.80.235.110): OpenClaw+Ollama, tracking relay\nBlade: Sentinel Agent, 34 capabilities\n\n300 APIs | 109 pages | 41 crons | 218 routes\nGit: github.com/Yacineutt/weval-consulting\nStack: PHP+Python+Node+Docker+Ollama+Playwright","engine"=>"WEVIA Archi"]));
|
|
}
|
|
// BLADE
|
|
if(preg_match("/blade|razer|desktop|sentinel.?agent|powertoys/i",$ml)){
|
|
die(json_encode(["response"=>"Blade IA (Razer Windows):\n\nSentinel Agent v2.2: auto-sync 60s\n34 capabilities, agent loop autonome\nWatchdog 2min immortel\nCascade: GLM-5→WEVIA→Alibaba→Keyword\nDashboard: /blade-ai.html\nAPI: /api/blade-agent.php k=BLADE2026\nSync: WEVIA Life → S204 documents","engine"=>"WEVIA Blade"]));
|
|
}
|
|
// GPU
|
|
if(preg_match("/gpu|multi.server|vram|ollama.model/i",$ml)){die(json_encode(["response"=>"Multi-Server: S204(20Docker,9Ollama,CPU) S95(33ports,3MTA) S151(OpenClaw) Blade(34caps). 0 GPU dedie.","engine"=>"WEVIA GPU"]));}
|
|
// DEERFLOW
|
|
if(preg_match("/deerflow|deer.flow|skill.registry|800.skill/i",$ml)){die(json_encode(["response"=>"DeerFlow: 800+ skills YAML, 3 systemd. Categories: agents+deploy+security+ethica+b2b+oss+kb+ux.","engine"=>"WEVIA DeerFlow"]));}
|
|
// PAPERCLIP
|
|
|
|
|
|
if(preg_match("/value.?stream|vsm|lean.?6|flux.?valeur|pipeline.?valeur/i",$ml)){die(json_encode(["response"=>"Value Streaming Module Live:
|
|
|
|
5-stage pipeline: Ingest(126K HCPs) > Enrichment(15K vectors) > AI Process(5057 agents) > Orchestrate(167 modules) > Deliver(15 pages)
|
|
Lean 6sigma DMAIC: Define>Measure>Analyze>Improve>Control
|
|
8 Wastes tracked: 7/8 eliminated, 1 warning (SSH 8s)
|
|
6 verticals: Pharma, ERP, Cyber, Cloud, IA, Finance
|
|
KPIs live: agents, skills, qdrant, L99, uptime, cost(0EUR)
|
|
|
|
URL: /value-streaming.html","engine"=>"WEVIA ValueStream"]));}
|
|
|
|
if(preg_match("/test.?visual|puppeteer|screenshot|capture.?page|l99.?visual/i",$ml)){
|
|
$page = trim(preg_replace("/.*(?:test|capture|screenshot|visual)\s*/i","",$ml));
|
|
if(!$page) $page = "https://weval-consulting.com";
|
|
elseif(!preg_match("/^http/i",$page)) $page = "https://weval-consulting.com/".$page;
|
|
$out = shell_exec("cd /opt/mirofish/frontend && timeout 20 node -e \"const p=require('puppeteer');(async()=>{const b=await p.launch({headless:'new',args:['--no-sandbox']});const pg=await b.newPage();await pg.setViewport({width:1920,height:1080});await pg.goto('".$page."',{waitUntil:'networkidle0',timeout:15000});await new Promise(r=>setTimeout(r,2000));const imgs=await pg.\\\$\\\$eval('img',els=>els.map(e=>({src:e.src.split('/').pop(),w:e.naturalWidth,ok:e.naturalWidth>0&&e.offsetWidth>0})));const links=await pg.\\\$\\\$eval('a',els=>els.length);const jsErrs=[];pg.on('pageerror',e=>jsErrs.push(e.message));const t=await pg.title();console.log(JSON.stringify({title:t,images:imgs,links:links,js_errors:jsErrs.length}));await pg.screenshot({path:'/tmp/l99_visual.png'});await b.close();})().catch(e=>console.log(JSON.stringify({error:e.message})));\" 2>&1");
|
|
$data = @json_decode(trim($out),true);
|
|
if($data && !isset($data['error'])){
|
|
$img_ok = 0; $img_fail = 0;
|
|
foreach(($data['images']??[]) as $i){ if($i['ok']) $img_ok++; else $img_fail++; }
|
|
$r = "L99 Visual Test:\n\nPage: $page\nTitle: ".($data['title']??'?')."\nImages: $img_ok OK, $img_fail broken\nLinks: ".($data['links']??0)."\nJS Errors: ".($data['js_errors']??0)."\nScreenshot: /tmp/l99_visual.png\n\nStatus: ".($img_fail==0 && ($data['js_errors']??0)==0 ? "PASS" : "FAIL ($img_fail broken images, ".($data['js_errors']??0)." JS errors)");
|
|
} else {
|
|
$r = "L99 Visual Test ERROR: ".($data['error']??$out??'timeout');
|
|
}
|
|
die(json_encode(["response"=>$r,"engine"=>"WEVIA L99 Visual"]));
|
|
}
|
|
if(preg_match("/register|inscription|onboard|signup|sign.up/i",$ml)){die(json_encode(["response"=>"Register Module Live:
|
|
|
|
4-step onboarding: Auth(SSO/OIDC/LDAP/Email) > Company(KYC) > Plan(Starter/Pro/Enterprise/Sovereign) > Dashboard
|
|
SSO: SAML 2.0, OpenID Connect, LDAP/AD
|
|
KYC: ICE/SIRET, secteur, taille
|
|
Plans: Starter(0MAD) Pro(990MAD) Enterprise(custom) Sovereign(on-premise)
|
|
|
|
URL: /register.html","engine"=>"WEVIA Register"]));}
|
|
if(preg_match("/paperclip|pipeline.agent|ceo.agent/i",$ml)){die(json_encode(["response"=>"Paperclip: 9 agents CEO+CTO+CFO+DevOps+Engineer+PM+QA+Researcher+Skills. Pipeline Paperclip->Enterprise(669ag)->Meeting(53ag).","engine"=>"WEVIA Paperclip"]));}
|
|
// WIKI
|
|
if(preg_match("/wiki|knowledge.base|registre|documentation/i",$ml)){die(json_encode(["response"=>"Wiki: ecosystem-registry + skill-registry + l99-registry + integration-registry. Code-wiki. Mattermost+N8N+Loki+Plausible.","engine"=>"WEVIA Wiki"]));}
|
|
// CREDENTIALS
|
|
if(preg_match("/credential|secret|api.key|provider.key|cle.api/i",$ml)){die(json_encode(["response"=>"Credentials: 62 cles secrets.env. Providers: GROQ+CEREBRAS+GEMINI+SAMBANOVA+MISTRAL+COHERE+DEEPSEEK+NVIDIA. Social: WHATSAPP+META. Payment: STRIPE.","engine"=>"WEVIA Credentials"]));}
|
|
// ECOSYSTEM
|
|
if(preg_match("/ecosyst|scanner.tout|combien.*api|inventaire|scan.complet/i",$ml)){$a=count(glob("/var/www/html/api/*.php"));$p=count(glob("/var/www/html/*.html"));$cr=count(glob("/etc/cron.d/*"));$dk=trim(shell_exec("docker ps 2>/dev/null|tail -n+2|wc -l"));die(json_encode(["response"=>"ECOSYSTEM WEVAL (live):\n\nAPIs: ".$a."\nPages: ".$p."\nCrons: ".$cr."\nDocker: ".$dk."\nOllama: 9 models\nS95: UP\nS151: UP\nDisk: ".round(100-disk_free_space("/")/disk_total_space("/")*100)."%\n\nAPI: /api/ecosystem-registry.php?q=keyword","engine"=>"WEVIA Registry"]));}
|
|
// CREDENTIALS
|
|
if(preg_match("/credential|secret|cle.?api|api.?key|token.?api|authentif/i",$ml)){
|
|
$kc=0;$ks=@file("/etc/weval/secrets.env");if($ks)foreach($ks as $l)if(strpos($l,"=")!==false&&$l[0]!="#")$kc++;
|
|
die(json_encode(["response"=>"Credentials (secrets.env):\n\n".$kc." cles configurees\n\nProviders IA: Groq, Cerebras, Gemini, CF, OpenRouter, Mistral, Cohere, Together, Replicate, NVIDIA, DeepSeek, SambaNova, Alibaba, Anthropic, Zhipu\nMessaging: WhatsApp token, Telegram bot\nInfra: GitHub PAT, Cloudflare, Kaggle\nMulti-Claude: 3 cles Anthropic (Yacine+Ambre+Yanis)\n\nFichier: /etc/weval/secrets.env (root:www-data 640)","engine"=>"WEVIA Creds"]));
|
|
}
|
|
// CRONS
|
|
if(preg_match("/cron|schedule|planif|tache.?auto|agent.?auto/i",$ml)&&!preg_match("/ecosyst|combien/i",$ml)){
|
|
$cr=glob("/etc/cron.d/weval-*");$names=array_map("basename",$cr);sort($names);
|
|
die(json_encode(["response"=>"Crons WEVAL (".count($cr)." agents):\n\n".implode("\n",$names)."\n\nPage: /crons-monitor.html\nFrequences: */3 → */6h (Guardian→Registry)","engine"=>"WEVIA Crons"]));
|
|
}
|
|
// MULTI-SERVER FLEET
|
|
if(preg_match("/fleet|multi.?serv|3.?serveur|s204.?s95|hetzner|ovh/i",$ml)){
|
|
die(json_encode(["response"=>"Fleet Multi-Serveur:\n\nS204 (Hetzner 204.168.152.13):\n- nginx/PHP8.5/PG13, 20 Docker, 9 Ollama\n- 301 APIs, 109 pages, 67 crons\n- Disk 79%, primary web\n\nS95 (Hetzner 95.216.167.89):\n- PMTA:25 + KumoMTA:587 + Postfix:2525\n- Sentinel:5890, 192 Arsenal screens\n- 3M contacts, 12 schemas, 709 tables\n\nS151 (OVH 151.80.235.110):\n- OpenClaw + Ollama (5 models)\n- Tracking relay v4\n\nBlade (Razer Windows):\n- Sentinel Agent v2.2, 34 caps\n\nS88: DEAD (a cancel)","engine"=>"WEVIA Fleet"]));
|
|
}
|
|
// PORTS
|
|
if(preg_match("/port.?ouvert|open.?port|port.?scan|listen|51.?port|ss.?tlnp/i",$ml)){
|
|
$p=trim(shell_exec("ss -tlnp 2>/dev/null|grep LISTEN|awk '{{print \$4}}'|sed 's/.*://'|sort -nu|tr '\n' ' ' 2>/dev/null"));
|
|
die(json_encode(["response"=>"S204 Ports ouverts:\n".$p."\n\nClés: 80=nginx 443=HTTPS 5432=PG 5678=n8n 6333=Qdrant 8065=MM 8222=Vault 9090=Authentik 11434=Ollama 49222=SSH\n\n20 Docker + 51 ports actifs","engine"=>"WEVIA Ports"]));
|
|
}
|
|
// PRODUCTS
|
|
if(preg_match("/product|saas|offre|catalogue.?produit|88.?product|wevads|ethica.?b2b|medreach|arsenal/i",$ml)&&!preg_match("/ethica.?hcp|meeting/i",$ml)){
|
|
$pr=glob("/var/www/html/products/*.html");
|
|
die(json_encode(["response"=>"Produits WEVAL (".count($pr)." pages SaaS):\n\nEmailing: WEVADS IA, MailForge, MailStream, MailWarm, InboxTest, EmailVerify, DeliverAds\nPharma: Ethica, EthicaB2B, MedReach, HealthcareCRM\nIA: WEVIA Enterprise, WEVIALife, WEVALMind, CanvasAI, TranslateAI\nSecurity: Arsenal, Sentinel, NetworkGuard, BlacklistGuard\nConsulting: BizPlan, LeanSixSigma, ProposalAI, ContractAI\nDev: DevForge, GPU Inference, Workspace, Academy\n\nURL: /products/{name}.html","engine"=>"WEVIA Products"]));
|
|
}
|
|
// HEALTH
|
|
if(preg_match("/health.?check|sante.?service|status.?service|uptime|kuma/i",$ml)){
|
|
$hc=["chatbot","crm","kuma","mm","n8n","ollama","plausible","qdrant","searxng","twenty"];$ok=0;
|
|
foreach($hc as $h){$r2=@file_get_contents("http://localhost/api/health-".$h.".php");if($r2&&strpos($r2,"ok")!==false)$ok++;}
|
|
die(json_encode(["response"=>"Health Check: ".$ok."/".count($hc)." services UP\n\nEndpoints: /api/health-{service}.php\nServices: chatbot, crm, kuma, mattermost, n8n, ollama, plausible, qdrant, searxng, twenty\nUptime-Kuma: port 3001\n\nDocker: 20 containers running","engine"=>"WEVIA Health"]));
|
|
}
|
|
// RAG QDRANT
|
|
if(preg_match("/qdrant|rag|vector|embedding|collection.?ia|knowledge.?base/i",$ml)){
|
|
$qd=@shell_exec("curl -s --max-time 3 http://localhost:6333/collections 2>/dev/null");$qj=json_decode($qd??"",true);$cols=[];
|
|
foreach(($qj["result"]["collections"]??[]) as $c2)$cols[]=$c2["name"];
|
|
die(json_encode(["response"=>"Qdrant RAG:\n\nCollections: ".implode(", ",$cols)."\n(".count($cols)." collections actives)\n\nPort: 6333 (REST) + 6334 (gRPC)\nModele embedding: nomic-embed-text:v1.5 (Ollama)\nUsage: chatbot context enrichment\n\nAPI: curl localhost:6333/collections","engine"=>"WEVIA RAG"]));
|
|
}
|
|
// N8N WORKFLOWS
|
|
if(preg_match("/n8n|workflow|automat|activepiece|zapier/i",$ml)){
|
|
die(json_encode(["response"=>"N8N Automation:\n\nPort: 5678\nDocker: n8n (UP)\nActivepieces: /api/activepieces-api.php\n\nWorkflows configurables pour:\n- Email alerts\n- Webhook triggers\n- CRM sync\n- Ethica pipeline\n- Git deploy hooks\n\nURL: https://n8n.weval-consulting.com","engine"=>"WEVIA N8N"]));
|
|
}
|
|
// DARKWEB SECURITY
|
|
if(preg_match("/dark.?web|darkweb|securit|cyber|nuclei|strix|audit.?sec|owasp|pentest|vulnerability/i",$ml)){
|
|
die(json_encode(["response"=>"Security & Dark Web Modules:\n\nDark Matrix: /wevia-ia/dark-matrix.php (5 modules)\n- dark-scraper.php: collecte indicateurs\n- dark-scout.php: reconnaissance\n- dark-data.php: analyse donnees\n- dark-slot.php: scoring\n- dark-bridge.php: API bridge\n\nNuclei v3.3.7: scanner vulnerabilites (templates complets)\nStrix: /api/strix-scan-api.php\nAEGIS: /api/aegis-api.php\n\nPages: /cyber-monitor.html | /security-dashboard.html\nAPI: /api/nuclei-scanner.php | /api/secret-scanner-api.php\n\nDoc: /wevia-ia/DARK-MODULES-CONNECTED.md","engine"=>"WEVIA Security"]));
|
|
}
|
|
// WEVADS EMAIL
|
|
if(preg_match("/wevads|email.?market|envoi|campagne.?email|pmta|kumo|mta/i",$ml)){die(json_encode(["response"=>"WEVADS Email Marketing:\n\n3 MTA coexistent:\n- PMTA v5.0r3 port 25 (ADX legacy — SACRE JAMAIS TOUCHER)\n- KumoMTA port 587+8010 (nouveaux envois)\n- Postfix port 2525/2526 (relay interne)\n\n3M contacts valides | 12 schemas DB\nSPA: /wevads-ia/ (42 pages Playwright)\nAPIs: send-controller + wevads-v2-engine\nREGLE: AUCUN envoi AUTO. TOUT MANUEL.","engine"=>"WEVIA WEVADS"]));}
|
|
// QDRANT RAG
|
|
if(preg_match("/qdrant|rag|vector|embedding|knowledge.?base/i",$ml)){die(json_encode(["response"=>"Qdrant RAG:\n\nDocker: qdrant (port 6333 sur S95)\n4 collections | 14K+ vecteurs\nModeles embed: nomic-embed-text + all-minilm\nPipeline: chatbot→RAG→contexte enrichi","engine"=>"WEVIA RAG"]));}
|
|
// AUTHENTIK SSO
|
|
if(preg_match("/authentik|sso|oauth|login.?centralis/i",$ml)){die(json_encode(["response"=>"Authentik SSO:\n\nDocker: authentik-server + worker + db + redis\nPort 9090 (web) + 9443 (LDAP)\nAdmin: akadmin/YacineWeval2026\nProtege: DeerFlow, n8n, Mattermost, analytics","engine"=>"WEVIA SSO"]));}
|
|
// PORTS
|
|
if(preg_match("/port.?ouvert|port.?scan|listen|service.?actif/i",$ml)){die(json_encode(["response"=>"Ports S204 (25 services):\n11434 Ollama | 5678 n8n | 8065 Mattermost\n9090 Authentik | 3000 Langfuse | 8123 Plausible\n9100 Node-exporter | 9191 Prometheus\n49222 SSH | 3088 Twenty CRM\n\nS95: 33 ports (PMTA:25 KumoMTA:587 Sentinel:5890)\nS151: 11434 Ollama | 80 nginx","engine"=>"WEVIA Ports"]));}
|
|
// PROMETHEUS
|
|
if(preg_match("/prometheus|grafana|metric|monitor.?perf|node.?export/i",$ml)){die(json_encode(["response"=>"Prometheus Monitoring:\n\nDocker: prometheus (port 9191) + node-exporter (9100)\nMetrics: CPU, RAM, disk, network, Docker\nScrape: localhost + S95 + S151\nAlerts: Telegram bot","engine"=>"WEVIA Prometheus"]));}
|
|
// MATTERMOST
|
|
if(preg_match("/mattermost|chat.?equipe|slack.?interne|team.?chat/i",$ml)){die(json_encode(["response"=>"Mattermost:\n\nDocker: mattermost (port 8065)\nChat equipe interne WEVAL\nWebhooks: DeerFlow + alertes\nURL: mm.weval-consulting.com","engine"=>"WEVIA Mattermost"]));}
|
|
// PLAUSIBLE
|
|
if(preg_match("/plausible|analytics|visite|trafic|audience/i",$ml)){die(json_encode(["response"=>"Plausible Analytics:\n\nDocker: plausible + plausible-db + plausible-events (ClickHouse)\nPort 8123\nAnalytics souverain (RGPD compliant, 0 cookie)\nURL: analytics.weval-consulting.com","engine"=>"WEVIA Plausible"]));}
|
|
// WHATSAPP
|
|
if(preg_match("/whatsapp|wa.?api|message.?wa/i",$ml)){die(json_encode(["response"=>"WhatsApp Business API:\n\nToken: configure dans secrets.env\nAPI: /api/whatsapp-api.php + webhook\nSetup: /api/whatsapp-setup.php\nStatus: token present, a activer","engine"=>"WEVIA WhatsApp"]));}
|
|
// TELEGRAM
|
|
if(preg_match("/telegram|tg.?bot|alert.?tg/i",$ml)){die(json_encode(["response"=>"Telegram Bot:\n\nBot ID: 8544624912\nChat: 7605775322\nUsage: alertes Guardian + NonReg + daily brief 7h\nAPIs: blade-telegram.php + wedroid-telegram-alert.php","engine"=>"WEVIA Telegram"]));}
|
|
// STRIPE
|
|
if(preg_match("/stripe|paiement|billing|facturation/i",$ml)){die(json_encode(["response"=>"Stripe Billing:\n\nCles: sk_live + pk_live dans secrets.env\nWebhook: /api/stripe-webhook.php\nCheckout: /api/create-checkout-session.php\nStatus: cles configurees, pas encore en production","engine"=>"WEVIA Stripe"]));}
|
|
// BOOKING
|
|
if(preg_match("/booking|rendez.?vous|rdv|calendar|agenda/i",$ml)){die(json_encode(["response"=>"Booking / RDV:\n\nPage: /booking.html\nAPI: /api/booking.php + /api/wevia-booking.php\nURL publique: weval-consulting.com/booking.html\nContact: info@weval-consulting.com","engine"=>"WEVIA Booking"]));}
|
|
// SUBDOMAINS
|
|
if(preg_match("/subdomain|sous.?domaine|domaine|dns|nginx.?route|analytics|auth\.weval|mirofish/i",$ml)&&!preg_match("/scan|ecosyst/i",$ml)){
|
|
die(json_encode(["response"=>"14 Subdomains WEVAL:\n\nweval-consulting.com (main)\nanalytics.weval-consulting.com (Plausible)\nauth.weval-consulting.com (Authentik SSO)\ncode.weval-consulting.com (Code)\ncrm.weval-consulting.com (Twenty CRM)\ndeerflow.weval-consulting.com (DeerFlow IA)\nmm.weval-consulting.com (Mattermost)\nmonitor.weval-consulting.com (Uptime Kuma)\nn8n.weval-consulting.com (Workflows)\npaperclip.weval-consulting.com (Pipeline)\nwevads.weval-consulting.com (Email Marketing)\nmirofish.weval-consulting.com (Collab IA)\nethica.wevup.app (HCP Platform)\nconsent.wevup.app (Consent Manager)","engine"=>"WEVIA Subdomains"]));
|
|
}
|
|
// WEVADS EMAIL
|
|
if(preg_match("/wevads|email.?market|mta|pmta|kumo|envoi|campagne.?email|deliverabilit/i",$ml)&&!preg_match("/ethica/i",$ml)){
|
|
die(json_encode(["response"=>"WEVADS Email Platform:\n\n3 MTA coexistent:\n- PMTA v5.0r3 port 25 (ADX legacy — SACRE JAMAIS TOUCHER)\n- KumoMTA port 587+8010 (nouveaux envois)\n- Postfix port 2525/2526 (relay interne)\n\n3M contacts valides (cleaned from 7.35M)\nWEVADS IA: 42 pages SPA + 49 APIs\n18 ToolFK (QR/DNS/WHOIS/SSL/Hash/AES...)\n\nPages: /wevads-ia/ | /wevads-performance.html\nAPI: /api/wevads-v2-api.php | /api/send-controller.php\n\nREGLE: AUCUN envoi AUTO. TOUT MANUEL depuis WEVADS IA.","engine"=>"WEVIA Email"]));
|
|
}
|
|
// AGENTS VISUALIZATIONS
|
|
if(preg_match("/agents?.?3d|agents?.?viz|agents?.?fleet|agents?.?sim|agents?.?alive|value.?chain|iso.?3d/i",$ml)){
|
|
die(json_encode(["response"=>"Agents Visualizations (10 pages):\n\nagents-3d.html: Vue 3D isométrique\nagents-alive.html: Agents animés\nagents-enterprise.html: Vue enterprise\nagents-fleet.html: Fleet complète\nagents-hd.html / agents-hd2.html: Haute définition\nagents-iso3d.html: Isométrique 3D\nagents-sim.html: Simulation\nagents-valuechain.html: Value Stream\nagents-goodjob.html: Tableau de bord\n\nURL: /[page].html","engine"=>"WEVIA Agents Viz"]));
|
|
}
|
|
// COMPUTE
|
|
if(preg_match("/compute|cpu|ram|memoire|processeur|amd|epyc|gpu.?status|ressource/i",$ml)&&!preg_match("/gpu.?infer|ollama/i",$ml)){
|
|
$ram=trim(shell_exec("free -h | head -2 | tail -1 | awk '{print \$2,\$3,\$4}'" ?? ""));
|
|
$cpu=trim(shell_exec("nproc" ?? ""));
|
|
$load=trim(shell_exec("cat /proc/loadavg | awk '{print \$1,\$2,\$3}'" ?? ""));
|
|
die(json_encode(["response"=>"Compute S204:\n\nCPU: AMD EPYC-Milan ".$cpu." cores\nRAM: ".$ram."\nLoad: ".$load."\nGPU: AUCUN (CPU-only, Ollama CPU mode)\n\nS95: Hetzner dedicated (PMTA+DB)\nS151: OVH (Ollama CPU)\nBlade: Intel HD620 (pas NVIDIA)\nS88: DEAD GPU (a cancel -45EUR/mois)\n\nTout IA tourne en CPU. 0 GPU. 0EUR.","engine"=>"WEVIA Compute"]));
|
|
}
|
|
// WEDROID
|
|
if(preg_match("/wedroid|droid|backend.?diag|chain.?exec|sentinel.?brain/i",$ml)&&!preg_match("/term/i",$ml)){
|
|
die(json_encode(["response"=>"WEDROID v5.0 (Backend Diagnostic):\n\nAPIs: brain-api + chain-executor + git-auto + infra-patterns + learning + scheduler + telegram-alert + v4\nChain exec: S204→S95 via Sentinel\nTelegram: alerts automatiques\nGit: auto-commit + auto-push\n\nAPI: /api/wedroid-brain-api.php\nS95: /api/sentinel-brain.php?action=exec","engine"=>"WEVIA Wedroid"]));
|
|
}
|
|
// DEFAULT: forward to fast.php
|
|
$ch = curl_init("http://127.0.0.1:4000/v1/chat/completions");
|
|
curl_setopt_array($ch, [CURLOPT_POST=>true, CURLOPT_POSTFIELDS=>json_encode(["model"=>"auto","messages"=>[["role"=>"user","content"=>$msg]],"max_tokens"=>500]),
|
|
CURLOPT_HTTPHEADER=>["Content-Type: application/json"], CURLOPT_RETURNTRANSFER=>true, CURLOPT_TIMEOUT=>15, CURLOPT_SSL_VERIFYPEER=>false]);
|
|
$result = curl_exec($ch); curl_close($ch);
|
|
if ($result) { $d = json_decode($result, true);
|
|
$txt = "";
|
|
if (isset($d["choices"][0]["message"]["content"])) $txt = $d["choices"][0]["message"]["content"];
|
|
elseif (isset($d["response"])) $txt = $d["response"];
|
|
elseif (isset($d["result"])) $txt = $d["result"];
|
|
else $txt = $result;
|
|
echo json_encode(["response"=>$txt,"provider"=>"Sovereign/12providers","mode"=>$mode]);
|
|
} else echo json_encode(["response"=>"Service temporairement indisponible","provider"=>"fallback"]);
|