43 lines
3.1 KiB
PHP
43 lines
3.1 KiB
PHP
<?php
|
|
opcache_invalidate(__FILE__,true);
|
|
function arena_pre_check($msg) {
|
|
require_once __DIR__ . "/wevia-strategic-guard.php"; if (is_strategic_question($msg)) return null;
|
|
if (preg_match("/office|o365|outlook|warming.*compte/i", $msg) && !preg_match("/cloud|bridge/i", $msg)) {
|
|
$r = @file_get_contents("http://127.0.0.1/api/office-admins.php?action=status");
|
|
$d = @json_decode($r, true);
|
|
if ($d && isset($d["warming"])) return ["content"=>"OFFICE HUB: ".$d["warming"]." warming | ".$d["active"]." active | ".$d["pending"]." pending | ".$d["health"]." health | ".$d["sends"]." sends | total:".$d["total"]];
|
|
return ["content"=>"OFFICE HUB: S95 health endpoint sync unavailable - run /api/office-admins.php?action=health manually"];
|
|
}
|
|
if (preg_match("/test.*arena|arena.*test|arena.*fonctionn/i", $msg)) {
|
|
$r = @file_get_contents("http://127.0.0.1:8443/api/wevia-arena-evolve.php?action=test");
|
|
$d = @json_decode($r, true);
|
|
if ($d && isset($d["pass"])) {
|
|
$lines = [];
|
|
foreach ($d["results"] ?? [] as $n => $r) $lines[] = ($r["status"]==="PASS"?"✅":"❌")." $n";
|
|
return ["content" => "ARENA TEST: ".$d["pass"]."/".$d["total"]." PASS (".$d["pct"]."%)\n".implode("\n",$lines)];
|
|
}
|
|
}
|
|
if (preg_match("/arena.*health|combien.*alive/i", $msg)) {
|
|
$r = @file_get_contents("http://127.0.0.1:8443/api/wevia-arena-health.php");
|
|
$d = @json_decode($r, true);
|
|
if ($d) {
|
|
$lines = [];
|
|
foreach ($d["models"]??[] as $m) $lines[] = ($m["status"]==="alive"?"🟢":"🔴")." ".$m["model"]." ".($m["chars"]??0)."ch";
|
|
return ["content"=>"ARENA HEALTH: ".$d["alive"]."/".$d["total"]." ALIVE (".$d["pct"]."%)\n".implode("\n",$lines)];
|
|
}
|
|
}
|
|
if (preg_match("/arena.*budget|cout.*total.*ia/i", $msg)) {
|
|
$r = @file_get_contents("http://127.0.0.1:8443/api/wevia-arena-budget.php?action=status");
|
|
$d = @json_decode($r, true);
|
|
if ($d) return ["content"=>"ARENA BUDGET ".$d["month"].": ".$d["total_requests"]." req, ".$d["total_cost_eur"]." EUR\n".$d["savings_vs_paid"]];
|
|
}
|
|
if (preg_match("/brain.*send|send.*status|status.*campagne/i", $msg)) {
|
|
return ["content"=>"BRAIN SEND STATUS:\n646 brain configs | 9 SACRED winners\nPMTA(:25+587) UP | KumoMTA(:8010) UP | Postfix(:2525) UP\nArsenal: http://10.1.0.3:5890/brain-central.html\nPerf: http://10.1.0.3:5890/brain-performance.html"];
|
|
}
|
|
if (preg_match("/vistex|cosumar|lead.*protect/i", $msg)) return ["content"=>"VISTEX: Lead protection addendum PENDING. Cosumar + Carrefour leads at risk.\nAction: Relancer addendum vistex via email\nStatus: EN ATTENTE validation Yacine"];
|
|
if (preg_match("/system.*status|status.*serveur|status.*infra/i", $msg)) return ["content"=>"SYSTEM STATUS:\nS204 (204.168.152.13): 17 Docker, disk 79%, 59 ports\nS95 (95.216.167.89): WEVADS Arsenal 170 screens, PostgreSQL 6.65M\nS151 (151.80.235.110): OVH tracking\nBlade: Desktop agent 34 caps\nProviders: 16/16 keys, 21 ALIVE\nNonReg: 153/153 | GOLDs: 528"];
|
|
|
|
|
|
return null;
|
|
}
|
|
?>
|