23 lines
1.3 KiB
PHP
23 lines
1.3 KiB
PHP
<?php
|
|
// V4: Save php://input to global for both intercept and chatbot
|
|
$GLOBALS['_wevia_raw_input'] = file_get_contents('php://input');
|
|
$_wq_json = @json_decode($GLOBALS['_wevia_raw_input'], true);
|
|
$_wq = mb_strtolower(trim($_wq_json['message'] ?? ''));
|
|
if($_wq) {
|
|
$actions = ['consolide','lance ','monte','corrige','nettoie','optimise','supprime','redemarr','restart','autofix','auto-fix','repare','git push','vacuum','cleanup','clean','augmente','securise','test fonctionnel','cartograph','defect','sante ecran','screens health','combien.*ecran','sync tout','sync all','reconcilie','etat l99','met a jour l99','wiki update','vault status','gitea','paperclip','ethica','providers','playwright','self heal','doctrine'];
|
|
$_isAct = false;
|
|
foreach($actions as $_a) if(strpos($_wq,$_a)!==false) $_isAct=true;
|
|
if($_isAct) {
|
|
$_POST['message'] = $_wq;
|
|
ob_start();
|
|
@include '/var/www/html/api/wevia-exec.php';
|
|
$_out = ob_get_clean();
|
|
$_d = @json_decode($_out, true);
|
|
if($_d && !empty($_d['response'])) {
|
|
header('Content-Type: application/json');
|
|
die(json_encode(['response'=>'[EXEC] '.$_d['response'],'engine'=>'WEVIA-Exec','executed'=>true]));
|
|
}
|
|
}
|
|
}
|
|
function wevia_check_intercept($q){ return null; }
|