$type,"engine"=>$engine,"text"=>$text,"intent"=>"godmode"], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) . "\n\n"; @ob_flush(); @flush(); } $AGENTS = [ "deliverability" => function(){ $p = @shell_exec("systemctl is-active pmta postfix 2>&1 | tr \"\n\" \",\""); $q = @shell_exec("pmta show queues 2>&1 | head -3 || echo no_pmta_cli"); return "MTA status: ".trim($p ?: "unknown")." | Queue: ".trim($q ?: "n/a"); }, "office_tenants" => function(){ $n = @shell_exec("PGPASSWORD=admin123 psql -h 10.1.0.3 -U admin -d adx_system -t -c \"SELECT COUNT(*) FROM graph_accounts WHERE status=\\x27active\\x27\" 2>/dev/null | tr -d \" \n\""); return "Azure AD active graph accounts: " . ($n ?: "db_unreachable"); }, "tokens_health" => function(){ $s = @file_get_contents("/etc/weval/secrets.env"); if (!$s) return "secrets.env not readable"; preg_match_all("/^([A-Z_]+)=/m", $s, $m); return "secrets.env: " . count($m[1]) . " keys · " . substr(implode(",", array_slice($m[1],0,8)), 0, 120); }, "qdrant_vault" => function(){ $r = @file_get_contents("http://127.0.0.1:6333/collections"); if(!$r) return "qdrant unreachable"; $d = @json_decode($r, true); $cols = $d["result"]["collections"] ?? []; return "Qdrant: " . count($cols) . " collections · " . implode(",", array_map(function($c){return $c["name"];}, $cols)); }, "blade_status" => function(){ $r = @file_get_contents("http://10.1.0.3:5890/?ping", false, stream_context_create(["http"=>["timeout"=>3]])); $sentinel = $r ? "UP" : "DOWN"; $blade_tasks = @glob("/var/www/html/api/blade-tasks/*.json"); return "Sentinel-lite: $sentinel · Blade tasks queued: " . count($blade_tasks ?: []); }, "paperclip_agents" => function(){ $n = @shell_exec("PGPASSWORD=admin123 psql -h 127.0.0.1 -U admin -d paperclip -t -c \"SELECT COUNT(*) FROM agents\" 2>/dev/null | tr -d \" \n\""); return "Paperclip agents: " . ($n ?: "db_unreachable"); }, "superclaude_skills" => function(){ $n = @shell_exec("find /opt/SuperClaude_Framework -name \"*.md\" 2>/dev/null | wc -l"); return "SuperClaude skills: " . trim($n ?: "0"); }, "creative_engine" => function(){ $f = "/var/www/html/api/wevia-creative-engine.php"; if (!file_exists($f)) return "creative engine: not found"; $c = @file_get_contents($f); preg_match_all("/preg_match\\(/", $c, $m); return "creative engine: " . strlen($c) . "B · " . count($m[0]) . " intent patterns"; }, "dataset_pairs" => function(){ $f = "/opt/weval-l99/dataset-ft.jsonl"; if (!file_exists($f)) return "dataset: missing"; $n = @shell_exec("wc -l < $f 2>/dev/null | tr -d \" \n\""); return "FT dataset pairs: " . ($n ?: "unknown"); }, "doctrine_count" => function(){ $a = @shell_exec("ls /opt/wevads/vault/doctrines/*.md 2>/dev/null | wc -l | tr -d \" \n\""); $b = @shell_exec("ls /var/www/html/wiki/doctrine*.md 2>/dev/null | wc -l | tr -d \" \n\""); $h = @shell_exec("ls /var/www/html/wiki/doctrine*.html 2>/dev/null | wc -l | tr -d \" \n\""); return "doctrines: vault_md=$a wiki_md=$b wiki_html=$h"; }, ]; emit("answer", "Orchestrator/plan", "### godmode plan\n10 new agents parallel: " . implode(", ", array_keys($AGENTS))); foreach ($AGENTS as $name => $fn) { try { $t0 = microtime(true); $r = $fn(); $ms = intval((microtime(true) - $t0) * 1000); emit("answer", "Orchestrator/$name", "### $name [{$ms}ms]\n$r"); } catch (Throwable $e) { emit("answer", "Orchestrator/$name", "### $name\nERR: " . $e->getMessage()); } } emit("done", "Orchestrator/summary", "godmode 10/10 agents executed"); echo "data: [DONE]\n\n"; flush();