54 lines
2.1 KiB
PHP
54 lines
2.1 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
|
|
chdir("/var/www/html");
|
|
$out["recent_commits_60m"] = array_filter(array_map("trim", explode("\n", @shell_exec("git log --since='60 minutes ago' --oneline 2>&1 | head -15"))));
|
|
$out["recent_tags"] = array_filter(array_map("trim", explode("\n", @shell_exec("git tag -l 'wave-*' --sort=-creatordate 2>&1 | head -10"))));
|
|
|
|
// Scan wevia.html for V10 state + pdf i18n confirmed
|
|
$w = @file_get_contents("/var/www/html/wevia.html");
|
|
$out["wevia"] = [
|
|
"size" => strlen($w),
|
|
"v10_mermaid" => strpos($w, "AMBRE-V10-MERMAID") !== false,
|
|
"v10_sanitize_accents" => strpos($w, "replace(/[éèêë]/g") !== false,
|
|
"mermaid_render_api" => strpos($w, "window.mermaid.render(") !== false,
|
|
];
|
|
|
|
// PDF Premium state
|
|
$pdf = @file_get_contents("/var/www/html/api/ambre-tool-pdf-premium.php");
|
|
$out["pdf_premium"] = [
|
|
"size" => strlen($pdf),
|
|
"i18n_fr" => strpos($pdf, '"fr" =>') !== false,
|
|
"i18n_en" => strpos($pdf, '"en" =>') !== false,
|
|
"i18n_ar" => strpos($pdf, '"ar" =>') !== false,
|
|
];
|
|
|
|
// Ethica state
|
|
$out["ethica"] = [
|
|
"ecm_py" => file_exists("/opt/weval-l99/ecm.py") ? filesize("/opt/weval-l99/ecm.py") : "missing",
|
|
"consent_live" => trim(@shell_exec("curl -sI --max-time 3 https://consent.wevup.app/ 2>&1 | head -1")),
|
|
];
|
|
|
|
// Registry 643 + wave-229 tools confirmed
|
|
$reg = @json_decode(@file_get_contents("/var/www/html/api/wevia-tool-registry.json"), true);
|
|
if ($reg) {
|
|
$w229 = array_filter($reg["tools"] ?? [], function($t){return ($t["wave"] ?? 0) == 229;});
|
|
$out["registry"] = [
|
|
"total" => count($reg["tools"] ?? []),
|
|
"wave_229_count" => count($w229),
|
|
];
|
|
}
|
|
|
|
// Monitoring status
|
|
$out["monitoring"] = [
|
|
"load" => trim(@shell_exec("uptime")),
|
|
"cascade_up" => @file_get_contents("http://127.0.0.1:4000/health", false, stream_context_create(["http"=>["timeout"=>3]])) ? "UP" : "DOWN",
|
|
];
|
|
|
|
// Mermaid KB
|
|
$mkb = @json_decode(@file_get_contents("/var/www/html/generated/mermaid-learn-kb.json"), true);
|
|
$out["mermaid_kb_total"] = is_array($mkb) ? count($mkb) : 0;
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|