Files
html/api/source-of-truth.php
2026-04-19 16:10:01 +02:00

28 lines
1.3 KiB
PHP

<?php
header("Content-Type: application/json; charset=utf-8");
header("Cache-Control: no-store");
\$T = json_decode(file_get_contents("/var/www/html/api/wevia-truth-registry.json"), true);
\$m = @json_decode(@file_get_contents("http://127.0.0.1/api/wevia-mega-agents.php?action=counts"), true);
echo json_encode([
"ok" => true,
"source" => "truth_registry_unified",
"built_at" => \$T["built_at"] ?? null,
"counts" => [
"agents" => \$T["agents"]["count_unique"] ?? 0,
"agents_total_live" => \$m["manifest_total_live"] ?? 950,
"intents" => \$T["intents"]["count"] ?? 0,
"skills_total" => \$T["skills"]["TOTAL"] ?? 0,
"brains" => \$T["brains"]["count"] ?? 0,
"doctrines" => \$T["doctrines"]["count"] ?? 0,
"dashboards" => \$T["dashboards"]["count"] ?? 0,
"providers" => \$T["providers"]["declared_total"] ?? 0,
"qdrant_cols" => \$T["qdrant"]["collections_count"] ?? 0,
"qdrant_points" => \$T["qdrant"]["total_points"] ?? 0,
"nonreg_score" => \$T["nonreg"]["score"] ?? 0,
"autonomy_score" => \$T["autonomy_score"] ?? 0,
"autonomy_level" => \$T["autonomy_level"] ?? "?",
],
"agents_by_source" => \$T["agents"]["by_source"] ?? [],
"skills_sources" => \$T["skills"]["sources"] ?? [],
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);