392 lines
15 KiB
PHP
392 lines
15 KiB
PHP
<?php
|
|
/**
|
|
* WEVIA CAPABILITY REGISTRY v1.0
|
|
* Maps ALL available tools/capabilities for Master AI orchestration
|
|
* Each capability has: name, description, endpoint, method, params
|
|
*/
|
|
|
|
define('WEVIA_CAPS', [
|
|
// === BLADE IA ===
|
|
'blade_brain' => [
|
|
'name' => 'Blade IA Brain',
|
|
'desc' => 'Cerveau IA principal — planning, exécution, chain of thought, multi-file',
|
|
'endpoint' => '/api/blade-brain.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['blade', 'brain', 'planifier', 'exécuter', 'plan d\'action'],
|
|
],
|
|
'blade_agent' => [
|
|
'name' => 'Blade Agent Loop',
|
|
'desc' => 'Boucle agent autonome — Plan→Execute→Observe→Loop (max 15 steps)',
|
|
'endpoint' => '/api/blade-agent.php?k=BLADE2026&goal=',
|
|
'method' => 'GET',
|
|
'trigger' => ['agent blade', 'exécute automatiquement', 'lance blade'],
|
|
],
|
|
'blade_ops' => [
|
|
'name' => 'Blade Ops',
|
|
'desc' => 'Opérations infra: SSH, monitoring, déploiement, rollback',
|
|
'endpoint' => '/api/blade-ops-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['ops', 'déployer', 'rollback', 'infra ops'],
|
|
],
|
|
'blade_power' => [
|
|
'name' => 'Blade Power Pack',
|
|
'desc' => '8 endpoints: health, disk, docker, crons, git, benchmark, providers',
|
|
'endpoint' => '/api/blade-power.php',
|
|
'method' => 'GET',
|
|
'trigger' => ['power pack', 'health check', 'statut serveur'],
|
|
],
|
|
|
|
// === WEDROID ===
|
|
'wedroid' => [
|
|
'name' => 'WeDroid Brain',
|
|
'desc' => 'Orchestrateur droid (35KB) — commandes SSH, gestion multi-serveur',
|
|
'endpoint' => '/api/wedroid-brain-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['droid', 'wedroid', 'commande serveur', 'ssh'],
|
|
],
|
|
|
|
// === MANAGER CONSENSUS ===
|
|
'manager' => [
|
|
'name' => 'WEVAL Manager Consensus',
|
|
'desc' => 'Gestionnaire consensus multi-agent (35KB) — décisions, validation, pipeline',
|
|
'endpoint' => '/api/weval-manager.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['manager', 'consensus', 'décision', 'validation'],
|
|
],
|
|
|
|
// === SOVEREIGN CLAUDE ===
|
|
'sovereign_fast' => [
|
|
'name' => 'WEVAL IA Fast',
|
|
'desc' => 'Router IA rapide (26KB) — 33 routes, intent detection, multi-provider',
|
|
'endpoint' => '/api/weval-ia-fast.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['ia fast', 'question rapide'],
|
|
],
|
|
'chat_proxy' => [
|
|
'name' => 'Chat Proxy',
|
|
'desc' => 'Proxy chatbot (13KB) — bridge vers tous les providers',
|
|
'endpoint' => '/api/chat-proxy.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['chat proxy'],
|
|
],
|
|
|
|
// === ETHICA ===
|
|
'ethica' => [
|
|
'name' => 'Ethica API',
|
|
'desc' => 'API HCP pharma (11KB) — CRUD médecins, scraping, enrichissement',
|
|
'endpoint' => '/api/ethica-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['ethica', 'hcp', 'médecin', 'pharma', 'scraping hcp'],
|
|
],
|
|
|
|
// === CRM ===
|
|
'crm' => [
|
|
'name' => 'CRM API',
|
|
'desc' => 'Gestion contacts et pipeline (14KB) — Twenty CRM bridge',
|
|
'endpoint' => '/api/crm-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['crm', 'contact', 'pipeline', 'lead'],
|
|
],
|
|
|
|
// === SECURITY ===
|
|
'nuclei' => [
|
|
'name' => 'Nuclei Scanner',
|
|
'desc' => '2,617 templates de scan — vulnérabilités, misconfig, CVE',
|
|
'endpoint' => 'exec:nuclei',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['nuclei', 'scan sécurité', 'vulnérabilité', 'cve'],
|
|
],
|
|
|
|
// === L99/NONREG ===
|
|
'l99' => [
|
|
'name' => 'L99 Test Framework',
|
|
'desc' => '37 scripts Python — tests fonctionnels, visuels, sécurité, SSO, pipeline',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-master.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['l99', 'nonreg', 'test', 'regression'],
|
|
],
|
|
|
|
// === OSS DISCOVERY ===
|
|
'oss_discovery' => [
|
|
'name' => 'OSS Discovery',
|
|
'desc' => 'Découverte outils open-source (20KB) — trending, gap analysis, auto-install',
|
|
'endpoint' => '/api/oss-discovery.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['oss', 'open source', 'discover', 'trending'],
|
|
],
|
|
|
|
// === AI BENCHMARK ===
|
|
'benchmark' => [
|
|
'name' => 'AI Benchmark',
|
|
'desc' => 'Benchmark IA (11KB) — compare providers, latence, qualité',
|
|
'endpoint' => '/api/ai-benchmark.php',
|
|
'method' => 'GET',
|
|
'trigger' => ['benchmark', 'comparer modèles', 'performance ia'],
|
|
],
|
|
|
|
// === MCP ===
|
|
'mcp' => [
|
|
'name' => 'MCP Protocol',
|
|
'desc' => 'Model Context Protocol (15KB) — tools, resources, prompts',
|
|
'endpoint' => '/api/mcp.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['mcp', 'protocol', 'tools mcp'],
|
|
],
|
|
|
|
// === DEERFLOW ===
|
|
'deerflow' => [
|
|
'name' => 'DeerFlow',
|
|
'desc' => 'LangGraph agent framework — multi-step, stateful, Qdrant-connected',
|
|
'endpoint' => 'http://127.0.0.1:3002',
|
|
'method' => 'WEB',
|
|
'trigger' => ['deerflow', 'langgraph', 'agent flow'],
|
|
],
|
|
|
|
// === WHISPER ===
|
|
'whisper' => [
|
|
'name' => 'Whisper STT',
|
|
'desc' => 'Speech-to-text — whisper.cpp compilé + model base (148MB)',
|
|
'endpoint' => 'exec:whisper',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['whisper', 'transcription', 'audio', 'voice'],
|
|
],
|
|
|
|
// === SEARXNG ===
|
|
'search' => [
|
|
'name' => 'SearXNG',
|
|
'desc' => 'Moteur de recherche souverain — web, images, actualités',
|
|
'endpoint' => 'http://127.0.0.1:8888/search',
|
|
'method' => 'GET',
|
|
'trigger' => ['cherche', 'search', 'google', 'recherche web'],
|
|
],
|
|
|
|
// === WEVIA MASTER ===
|
|
'master_router' => [
|
|
'name' => 'WEVIA Master Router',
|
|
'desc' => '22 endpoints IA — scoring, RAG 14K, cascade, streaming',
|
|
'endpoint' => '/api/wevia-master-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['master', 'router', 'wevia ia'],
|
|
],
|
|
'master_agents' => [
|
|
'name' => 'WEVIA Agents',
|
|
'desc' => '4 agents autonomes — monitor, devops, ethica, security',
|
|
'endpoint' => '/api/wevia-agent-loop.php',
|
|
'method' => 'GET',
|
|
'trigger' => ['agent monitor', 'agent devops', 'agent ethica', 'agent security'],
|
|
],
|
|
|
|
// === ADX/WEVADS ===
|
|
'adx_bridge' => [
|
|
'name' => 'ADX Bridge',
|
|
'desc' => 'Bridge ADX système (26KB) — contacts, campaigns, tracking',
|
|
'endpoint' => '/api/adx-bridge.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['adx', 'wevads', 'campaign', 'contacts adx'],
|
|
],
|
|
'wevads_engine' => [
|
|
'name' => 'WEVADS v2 Engine',
|
|
'desc' => 'Moteur WEVADS v2 (33KB) — 79 modules, pipeline, automation',
|
|
'endpoint' => '/api/wevads-v2-engine.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['wevads engine', 'module wevads'],
|
|
],
|
|
// === QWEN IMAGE / VISION ===
|
|
'qwen_image' => [
|
|
'name' => 'Qwen Image / Vision',
|
|
'desc' => 'Analyse images via Groq Llama-4-Scout vision (FREE). Upload image ou URL.',
|
|
'endpoint' => '/api/wevia-vision-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['image', 'photo', 'vision', 'screenshot', 'analyse image', 'qwen image', 'décris image'],
|
|
],
|
|
|
|
'wevia_life' => [
|
|
'name' => 'WEVIA LIFE',
|
|
'desc' => 'Email intelligence: lire, analyser, classifier, ENVOYER emails. IMAP proxy, RAG chat, 2077 emails classifiés. PHPOffice+pdftotext+tesseract',
|
|
'endpoint' => '/products/wevialife-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['email', 'mail', 'wevia life', 'lire email', 'envoyer email', 'inbox', 'imap'],
|
|
],
|
|
|
|
// === SOVEREIGN CLAUDE (Main Chatbot 356KB) ===
|
|
'sovereign_claude' => [
|
|
'name' => 'Sovereign Claude (Claude B)',
|
|
'desc' => 'Chatbot principal WEVAL 356KB — fullscreen, multi-model, fichiers, vision, voix, RAG, CoT, self-correction',
|
|
'endpoint' => '/wevia-ia/weval-chatbot-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['claude', 'chatbot', 'wevia chatbot', 'sovereign claude', 'claude b'],
|
|
],
|
|
'sovereign_claude2' => [
|
|
'name' => 'Sovereign Claude V2',
|
|
'desc' => 'Claude V2 supervision autonome — délégation, pipeline, auto-analyse via L99',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/sovereign-claude2.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['claude v2', 'claude 2', 'sovereign v2', 'délégation claude'],
|
|
],
|
|
|
|
// === WEVCODE ===
|
|
'wevcode' => [
|
|
'name' => 'WevCode',
|
|
'desc' => 'IDE IA intégré — génération code, review, refactoring, SuperClaude framework',
|
|
'endpoint' => '/api/wevcode-superclaude.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['wevcode', 'code review', 'refactoring', 'ide', 'superclaude'],
|
|
],
|
|
'wevcode_ux' => [
|
|
'name' => 'WevCode UX',
|
|
'desc' => 'Interface WevCode visuelle — éditeur, preview, déploiement',
|
|
'endpoint' => '/wevcode.html',
|
|
'method' => 'WEB',
|
|
'trigger' => ['wevcode ux', 'éditeur code', 'code ui'],
|
|
],
|
|
|
|
// === L99 VISUAL/VIDEO/AUTOFIX ===
|
|
'l99_visual' => [
|
|
'name' => 'L99 Visual Test',
|
|
'desc' => 'Screenshots + comparaison visuelle Playwright/Chromium — détecte régressions UI',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-visual-test.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['screenshot', 'visual test', 'capture écran', 'régression visuelle'],
|
|
],
|
|
'l99_video' => [
|
|
'name' => 'L99 Video Test',
|
|
'desc' => 'Enregistrement vidéo des tests — preuve visuelle automatisée',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-videotest.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['video test', 'enregistrement', 'preuve vidéo'],
|
|
],
|
|
'l99_autofix' => [
|
|
'name' => 'L99 AutoFix',
|
|
'desc' => 'Auto-réparation: détecte problèmes + applique correctifs automatiquement',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-autofix-pipeline.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['autofix', 'auto-repair', 'réparer automatiquement', 'self-heal'],
|
|
],
|
|
'l99_security' => [
|
|
'name' => 'L99 Security Scan',
|
|
'desc' => 'Scan sécurité automatisé — vulnérabilités, ports, SSL, configs',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-security-scan.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['scan sécurité l99', 'security scan', 'audit sécurité'],
|
|
],
|
|
'l99_pipeline' => [
|
|
'name' => 'L99 Visual Pipeline',
|
|
'desc' => 'Pipeline complet: test → screenshot → compare → rapport → autofix',
|
|
'endpoint' => 'exec:python3 /opt/weval-l99/l99-visual-pipeline.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['pipeline visuel', 'test complet', 'pipeline l99'],
|
|
],
|
|
|
|
// === MIROFISH ===
|
|
'mirofish' => [
|
|
'name' => 'MiroFish',
|
|
'desc' => 'CEO layer predictions — Docker :3050 frontend, :5001 backend API',
|
|
'endpoint' => 'http://127.0.0.1:5001',
|
|
'method' => 'POST',
|
|
'trigger' => ['mirofish', 'prediction', 'ceo layer', 'forecast'],
|
|
],
|
|
|
|
// === CODERABBIT ===
|
|
'coderabbit' => [
|
|
'name' => 'CodeRabbit',
|
|
'desc' => 'Webhook code review automatique — analyse PR GitHub, feedback qualité',
|
|
'endpoint' => '/api/coderabbit-webhook.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['coderabbit', 'code review', 'pull request', 'pr review'],
|
|
],
|
|
|
|
// === AUTOLEARN ===
|
|
'autolearn' => [
|
|
'name' => 'WEVIA AutoLearn',
|
|
'desc' => 'Auto-apprentissage (11KB) — apprend des conversations, enrichit KB, cron */2h',
|
|
'endpoint' => 'exec:python3 /var/www/html/tests/wevia-autolearn.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['autolearn', 'auto-apprentissage', 'apprendre'],
|
|
],
|
|
|
|
// === ADS COMMANDER ===
|
|
'ads_commander' => [
|
|
'name' => 'Ads Commander',
|
|
'desc' => 'Gestion campagnes publicitaires — ROAS monitoring, creative performance',
|
|
'endpoint' => '/api/ads-commander-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['ads', 'publicité', 'campaign ads', 'roas', 'creative'],
|
|
],
|
|
|
|
// === AEGIS SECURITY ===
|
|
'aegis' => [
|
|
'name' => 'Aegis Security',
|
|
'desc' => 'Sécurité active — monitoring threats, alertes, blocage',
|
|
'endpoint' => '/api/aegis-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['aegis', 'threat', 'menace', 'blocage'],
|
|
],
|
|
|
|
// === AIOS ===
|
|
'aios' => [
|
|
'name' => 'AIOS',
|
|
'desc' => 'AI Operating System — runtime agents, terminal, orchestration',
|
|
'endpoint' => '/api/aios-api.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['aios', 'ai os', 'operating system'],
|
|
],
|
|
|
|
// === CLAUDE SYNC ===
|
|
'claude_sync' => [
|
|
'name' => 'Claude Sync',
|
|
'desc' => 'Synchronisation conversations Claude — backup, export, analyse',
|
|
'endpoint' => '/api/claude-sync.php',
|
|
'method' => 'POST',
|
|
'trigger' => ['claude sync', 'synchroniser', 'backup conversations'],
|
|
],
|
|
|
|
// === PLAYWRIGHT TESTS ===
|
|
'playwright' => [
|
|
'name' => 'Playwright Tests',
|
|
'desc' => 'Tests Playwright — fonctionnel, qualité, SSO, multi-navigateur',
|
|
'endpoint' => 'exec:python3 /opt/weval-nonreg/pw-functional-test.py',
|
|
'method' => 'EXEC',
|
|
'trigger' => ['playwright', 'test navigateur', 'test fonctionnel', 'test qualité'],
|
|
],
|
|
|
|
]);
|
|
|
|
/**
|
|
* Find matching capabilities for a user query
|
|
*/
|
|
function wevia_findCapabilities($message) {
|
|
$msg = mb_strtolower($message);
|
|
$matches = [];
|
|
foreach (WEVIA_CAPS as $id => $cap) {
|
|
$score = 0;
|
|
foreach ($cap['trigger'] as $trigger) {
|
|
if (mb_strpos($msg, $trigger) !== false) $score += 10;
|
|
}
|
|
$words = explode(' ', $msg);
|
|
foreach ($words as $word) {
|
|
if (mb_strlen($word) > 3 && mb_strpos($cap['desc'], $word) !== false) $score += 2;
|
|
}
|
|
if ($score > 0) $matches[$id] = array_merge($cap, ['score' => $score]);
|
|
}
|
|
arsort($matches);
|
|
return array_slice($matches, 0, 5, true);
|
|
}
|
|
|
|
function wevia_capabilityContext($message) {
|
|
$caps = wevia_findCapabilities($message);
|
|
if (empty($caps)) return '';
|
|
$ctx = "\n\n## CAPABILITIES WEVAL DISPONIBLES\n";
|
|
foreach ($caps as $id => $cap) {
|
|
$ctx .= "- **{$cap['name']}**: {$cap['desc']}\n";
|
|
}
|
|
return $ctx;
|
|
}
|
|
|
|
function wevia_listCapabilities() {
|
|
$list = [];
|
|
foreach (WEVIA_CAPS as $id => $cap) {
|
|
$list[$id] = ['name' => $cap['name'], 'desc' => $cap['desc'], 'endpoint' => $cap['endpoint']];
|
|
}
|
|
return $list;
|
|
}
|