auto-sync-2250

This commit is contained in:
opus
2026-04-16 22:50:01 +02:00
parent 7fcefa1ec4
commit 18eff17656
39 changed files with 108 additions and 105 deletions

View File

@@ -301,7 +301,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -296,7 +296,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -225,7 +225,7 @@ let activeFilter = 'all';
async function load() {
try {
const r = await fetch('/api/agents-status.php');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
allAgents = d.agents || [];
document.getElementById('s-total').textContent = d.total;
document.getElementById('s-active').textContent = d.active;

View File

@@ -1,5 +1,5 @@
{
"ts": "2026-04-16T20:44:58+00:00",
"ts": "2026-04-16T20:49:54+00:00",
"hostname": "blade",
"cpu": "?",
"ram": "?",

View File

@@ -1,11 +1,11 @@
{
"ts": "2026-04-16T20:14:09+00:00",
"ts": "2026-04-16T20:49:47+00:00",
"results": {
"GITHUB_TOKEN": 401,
"GROQ_KEY": 200,
"CEREBRAS_API_KEY": 200,
"GEMINI_KEY": 200,
"SAMBANOVA_KEY": 402,
"SAMBANOVA_KEY": 0,
"MISTRAL_KEY": 200
},
"expired": [
@@ -16,8 +16,8 @@
},
{
"name": "SAMBANOVA_KEY",
"code": 402,
"reason": "NO_BALANCE"
"code": 0,
"reason": "FAIL"
}
],
"renewed": [],

View File

@@ -1,5 +1,5 @@
{
"timestamp": "2026-04-16T22:30:18.920638",
"timestamp": "2026-04-16T22:45:18.495567",
"layers": {
"DOCKER": {
"n": "DOCKER",

View File

@@ -13,5 +13,5 @@
"Run simulation",
"CEO insights"
],
"timestamp": "2026-04-16 20:40:01"
"timestamp": "2026-04-16 20:45:01"
}

View File

@@ -430,6 +430,7 @@ function detect_complexity($msg) {
// PROVIDER SELECTION
// =================================================================
function select_provider($intent, $complexity) {
global $secrets;
$alibaba = ["name"=>"Alibaba/Qwen","type"=>"cloud",
"url"=>"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions",
"key"=>"sk-34db1ad3152443cd86563d1bfc576c30","model"=>"qwen-plus"];
@@ -445,9 +446,9 @@ function select_provider($intent, $complexity) {
$meditron = ["name"=>"Ollama/Meditron","type"=>"local","model"=>"meditron:7b"];
if ($intent === "medical") return $meditron;
if ($complexity === "high") return $cerebras; // 235B for complex
if (in_array($intent, ["code","debug","security","tech","execute"])) return $cerebras;
return $cerebras; // was alibaba
if ($complexity === "high") return $groq;
if (in_array($intent, ["code","debug","security","tech","execute"])) return $groq;
return $groq;
}
// =================================================================
@@ -620,6 +621,7 @@ function ollama_call($model, $system, $msg) {
}
function cloud_call_chain($system, $msg) {
global $secrets;
// Fallback chain: Groq 8s -> Cerebras 6s -> SambaNova 6s -> Alibaba 10s
$providers = [
["https://api.groq.com/openai/v1/chat/completions", ($secrets["GROQ_KEY"]??""), "llama-3.3-70b-versatile", 8],
@@ -652,6 +654,7 @@ function cloud_call($url, $key, $model, $system, $msg, $timeout=12) {
// CONSENSUS (curl_multi parallel: Alibaba + Cerebras + Groq)
// =================================================================
function consensus_ask($msg, $system) {
global $secrets;
$providers = [
["n"=>"alibaba","u"=>"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions","k"=>"sk-34db1ad3152443cd86563d1bfc576c30","m"=>"qwen-plus"],
["n"=>"cerebras","u"=>"https://api.cerebras.ai/v1/chat/completions","k"=>"csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh","m"=>"qwen-3-235b-a22b-instruct-2507"],

View File

@@ -1,5 +1,5 @@
{
"timestamp": "2026-04-16 22:40:05",
"timestamp": "2026-04-16 22:45:05",
"healthy": true,
"issues": [],
"fixes": [],

View File

@@ -1,5 +1,5 @@
{
"timestamp": "2026-04-16 20:40:08",
"timestamp": "2026-04-16 20:45:08",
"healthy": false,
"checks": {
"outpost": "DOWN",
@@ -19,7 +19,7 @@
"docker:authentik-worker": "NOT_FOUND",
"docker:authentik-db": "NOT_FOUND",
"docker:authentik-redis": "NOT_FOUND",
"open_ports": 65,
"open_ports": 66,
"nginx": "OK"
},
"flow_ok": 2,
@@ -30,62 +30,62 @@
{
"level": "critical",
"msg": "Outpost DOWN 9090",
"ts": "2026-04-16T20:40:01+00:00"
"ts": "2026-04-16T20:45:01+00:00"
},
{
"level": "critical",
"msg": "Outpost STILL DOWN",
"ts": "2026-04-16T20:40:06+00:00"
"ts": "2026-04-16T20:45:06+00:00"
},
{
"level": "warning",
"msg": "Auth flow wevads.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:07+00:00"
"ts": "2026-04-16T20:45:06+00:00"
},
{
"level": "warning",
"msg": "Auth flow ethica.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:07+00:00"
"ts": "2026-04-16T20:45:07+00:00"
},
{
"level": "warning",
"msg": "Auth flow n8n.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:07+00:00"
"ts": "2026-04-16T20:45:07+00:00"
},
{
"level": "warning",
"msg": "Auth flow crm.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:07+00:00"
"ts": "2026-04-16T20:45:07+00:00"
},
{
"level": "warning",
"msg": "Auth flow mm.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:07+00:00"
"ts": "2026-04-16T20:45:07+00:00"
},
{
"level": "warning",
"msg": "Auth flow analytics.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:08+00:00"
"ts": "2026-04-16T20:45:07+00:00"
},
{
"level": "warning",
"msg": "Auth flow deerflow.weval-consulting.com: 200",
"ts": "2026-04-16T20:40:08+00:00"
"ts": "2026-04-16T20:45:08+00:00"
},
{
"level": "warning",
"msg": "Callback location missing in nginx",
"ts": "2026-04-16T20:40:08+00:00"
"ts": "2026-04-16T20:45:08+00:00"
}
],
"fixes": [
{
"title": "Restart authentik",
"ts": "2026-04-16T20:40:01+00:00"
"ts": "2026-04-16T20:45:01+00:00"
},
{
"title": "Callback location auto-added",
"ts": "2026-04-16T20:40:08+00:00"
"ts": "2026-04-16T20:45:08+00:00"
}
]
}

View File

@@ -1,8 +1,8 @@
{
"timestamp": "2026-04-16 20:40:01",
"timestamp": "2026-04-16 20:45:01",
"version": "1.0",
"disk": 84,
"ram": 16,
"ram": 27,
"docker": 19,
"ssl_days": 353,
"ollama_models": 5,
@@ -14,26 +14,26 @@
{
"level": "critical",
"msg": "S204:authentik DOWN (:9090)",
"time": "20:40:01"
"time": "20:45:01"
},
{
"level": "warning",
"msg": "Token : expired",
"time": "20:40:03"
"time": "20:45:02"
},
{
"level": "warning",
"msg": "Token : expired",
"time": "20:40:03"
"time": "20:45:02"
}
],
"log": [
"20:40:01 Disk: 84%",
"20:40:01 SSL: 353d remaining",
"20:40:02 Docker: 19 containers",
"20:40:02 Ollama: 5 models, 5.2GB",
"20:40:02 RAM: 16%",
"20:40:03 Arch score: 100\/100"
"20:45:01 Disk: 84%",
"20:45:01 SSL: 353d remaining",
"20:45:01 Docker: 19 containers",
"20:45:01 Ollama: 5 models, 5.2GB",
"20:45:01 RAM: 27%",
"20:45:02 Arch score: 100\/100"
],
"s204_services": 8,
"s95_mta": 5

View File

@@ -1 +1 @@
{"ts":"22:44","status":"offline"}
{"ts":"22:48","status":"offline"}

View File

@@ -1,8 +1,8 @@
{
"date": "2026-04-16 20:30:01",
"score": "7\/13 (53.8%)",
"passed": 7,
"failed": 6,
"date": "2026-04-16 20:45:01",
"score": "8\/13 (61.5%)",
"passed": 8,
"failed": 5,
"total": 13,
"regressions": [],
"auto_fixes": [],
@@ -30,12 +30,12 @@
{
"name": "eng:SSL",
"ok": true,
"detail": "21t 0a"
"detail": "24t 0a"
},
{
"name": "eng:Compare",
"ok": false,
"detail": "0t 0a"
"ok": true,
"detail": "165t 3a"
},
{
"name": "api:Dream",

View File

@@ -1 +1 @@
{"ts": "22:40", "status": "ok"}
{"ts": "22:45", "status": "ok"}

View File

@@ -243,7 +243,7 @@ async function checkStatus() {
const c = new AbortController();
setTimeout(() => c.abort(), 8000);
const r = await fetch('/api/blade-poll.php?k=BLADE2026&action=status', { signal: c.signal });
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const on = d.heartbeat && d.heartbeat.ts;
_fails = 0;
@@ -344,7 +344,7 @@ async function sendChat() {
addChat('user', esc(msg));
// Try AI brain first
let parsed = null;
try { const r = await fetch('/api/blade-brain.php?msg=' + encodeURIComponent(msg)); /* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}} if (d.ok && d.tasks?.length) parsed = d.tasks; } catch(e) {}
try { const r = await fetch('/api/blade-brain.php?msg=' + encodeURIComponent(msg)); /* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}} if (d.ok && d.tasks?.length) parsed = d.tasks; } catch(e) {}
// Fallback to keyword
if (!parsed) { const kp = parseIntent(msg); if (kp) parsed = [kp]; }
if (parsed && parsed.length) {
@@ -408,7 +408,7 @@ async function pollAndExecute() {
if (document.hidden) return;
try {
const r = await fetch('/api/blade-poll.php?k=BLADE2026&action=poll');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if (d.task && d.task.command) {
await fetch('/api/blade-poll.php?k=BLADE2026&action=done&file=' + encodeURIComponent(d.task._file) + '&result=browser_dispatched');
if (d.task.name && d.task.name.includes('RELOAD')) location.reload();

View File

@@ -116,7 +116,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -925,7 +925,7 @@ async function checkArenaHealth() {
const ctrl = new AbortController();
setTimeout(() => ctrl.abort(), 90000);
const r = await fetch("/api/wevia-arena-health.php", {signal: ctrl.signal});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const sel = document.getElementById("modelSelect");
if (!sel || !d.models) return;

View File

@@ -433,7 +433,7 @@ setInterval(loadData,30000);
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -37,7 +37,7 @@ async function testHealth(){
out.textContent='Fetching health...\n';
try{
const r=await fetch(API+'?health',{credentials:'include'});
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); const j=null; {var _q=(_t_j||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){j={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); let j=null; {var _q=(_t_j||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){j={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:"[JSON] "+e.message}}}}
out.textContent+=`Health: ${JSON.stringify(j)}\n`;
}catch(e){
out.textContent+=`ERROR: ${e.message}\n`;

View File

@@ -235,7 +235,7 @@ async function loadAll() {
async function loadFiability() {
try {
const r = await fetch('/api/wevia-fiability.php?report');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if (d.status === 'no_report') {
document.getElementById('fiaScore').textContent = '—';
document.getElementById('fiaDetail').textContent = 'Aucun scan';
@@ -260,7 +260,7 @@ async function loadFiability() {
async function loadStatus() {
try {
const r = await fetch(API + '?status');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if (d.status === 'never_run') {
document.getElementById('liveStatus').textContent = '● NEVER RUN';
@@ -346,7 +346,7 @@ async function loadHistory() {
async function loadHealth() {
try {
const r = await fetch(API + '?health');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('stUptime').textContent = d.uptime || '?';
} catch(e) {}
@@ -404,7 +404,7 @@ async function triggerCycle(force = false) {
try {
const url = force ? API + '?run&force=1' : API + '?run';
const r = await fetch(url);
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
btn.textContent = d.skipped ? '⏭ Skipped' : '✅ Done';
await loadAll();
} catch(e) {

View File

@@ -107,7 +107,7 @@ async function send(){
const typing=document.createElement('div');typing.className='typing';typing.textContent='Ethica AI réfléchit...';chat.appendChild(typing);chat.scrollTop=chat.scrollHeight;
try{
const r=await fetch(API,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({message:ETHICA_PREFIX+q})});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
typing.remove();
addMsg(d.response||d.content||d.error||'Erreur','bot');
}catch(e){typing.remove();addMsg('Erreur de connexion','bot')}

View File

@@ -28,7 +28,7 @@ th{background:#0f172a;font-weight:600}
async function loadStats() {
try {
const r = await fetch('/api/ethica-stats.php');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('subtitle').textContent =
`contacts: ${d.total||0}${d.countries||3} pays`;
document.getElementById('stats').innerHTML =
@@ -64,13 +64,13 @@ async function sendWA(){
const to=document.getElementById('wa-to').value;
const msg=document.getElementById('wa-msg').value;
const r=await fetch('/api/whatsapp-api.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'action=send&to='+encodeURIComponent(to)+'&message='+encodeURIComponent(msg)});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('wa-result').innerHTML=d.ok?'<span style="color:#25D366">✅ Envoyé!</span>':'<span style="color:#ff4444">❌ '+JSON.stringify(d.response?.error?.message||d.error)+'</span>';
}
async function sendWATemplate(){
const to=document.getElementById('wa-to').value;
const r=await fetch('/api/whatsapp-api.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'action=send&to='+encodeURIComponent(to)+'&template=hello_world&lang=en_US'});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('wa-result').innerHTML=d.ok?'<span style="color:#25D366">✅ Template envoyé!</span>':'<span style="color:#ff4444">❌ '+JSON.stringify(d.response?.error?.message||d.error)+'</span>';
}
</script>

View File

@@ -94,7 +94,7 @@ h2{padding:12px 40px 0;font-size:15px;color:#7c3aed;text-transform:uppercase;let
(async function(){
try{
const r=await fetch('/api/wevia-action-engine.php',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'action=ethica_stats'});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if(d.ok){
const el=document.getElementById('hcp-count');
if(el && d.total) el.textContent=Math.round(d.total/1000)+'K';

View File

@@ -193,7 +193,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -278,7 +278,7 @@ let lastFeedTs='';
async function loadFeed(){
try{
const r=await fetch('/api/ethica-feed-api.php');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if(!d.feed||!d.feed.length)return;
const newTs=d.feed[0].ts;
if(newTs===lastFeedTs)return;
@@ -299,7 +299,7 @@ setInterval(loadFeed,30000);
async function loadData(){
try{
const r=await fetch('/api/ethica-api.php?action=stats&token=ETHICA_API_2026_SECURE');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if(d.total){
document.getElementById('kpi-total').textContent=d.total.toLocaleString();
document.getElementById('p-collecte').textContent=d.total.toLocaleString();

View File

@@ -190,7 +190,7 @@ async function send(){
try{
const r=await fetch('/api/wevia-master-api.php',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({message:q,history:c.msgs.slice(-6)})});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
let reply=d.content||d.response||d.text||'';
let prov=d.provider||d.model||'unknown';
document.getElementById('ld').classList.remove('on');

View File

@@ -112,7 +112,7 @@ setInterval(()=>{document.getElementById('clock').textContent=new Date().toLocal
async function fetchLive(){
try{
const r=await fetch('/api/l99-api.php?action=results');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if(d.tests){
DATA.tests=d.tests.length;
DATA.pass=d.tests.filter(t=>t.status==='P').length;

View File

@@ -213,7 +213,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -112,7 +112,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -114,7 +114,7 @@ async function load() {
method: 'POST', headers: {'Content-Type':'application/json'},
body: JSON.stringify({message:'verifyfp'})
});
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); const j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); let j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
if (j.engine === 'NL-Priority' || j.tool === 'fast-path') {
document.getElementById('awBadge').textContent = 'OPERATIONAL';
document.getElementById('awDetail').textContent = 'pipeline v6 priority JSON live';
@@ -127,7 +127,7 @@ async function load() {
// Sovereign cascade
try {
const r = await fetch('/api/sovereign/v1/models');
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); const j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); let j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
const n = (j.data || []).length;
document.getElementById('sovBadge').textContent = n + ' providers';
document.getElementById('sovDetail').textContent = 'cascade :4000/v1 OK';
@@ -140,7 +140,7 @@ async function load() {
// NonReg
try {
const r = await fetch('/api/nonreg-latest.json');
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); const j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_j=await r.text(); let j=null; {var _q=(_t_j||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){j={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{j=JSON.parse(_q)}catch(e){j={error:'[JSON] '+e.message}}}}
document.getElementById('nrBadge').textContent = j.score + '%';
document.getElementById('nrBadge').className = 'badge ' + (j.fail === 0 ? 'ok' : 'warn');
document.getElementById('nrDetail').textContent = j.pass + '/' + j.total + ' &mdash; ts ' + j.ts;

View File

@@ -79,7 +79,7 @@ let allAccts=[];
async function load(){
try{
const r=await fetch(API+'?action=status');/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const r=await fetch(API+'?action=status');/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const warming=d.warming_count||d.accounts_warming||911;
const pending=d.pending_count||871;
const active=d.active_count||1;

View File

@@ -82,7 +82,7 @@ async function load(){
try{
const r=await fetch(CACHE+'?t='+Date.now());
if(!r.ok)throw new Error('cache '+r.status);
/* HTML_GUARD_V2_BATCH */ const _t_c=await r.text(); const c=null; {var _q=(_t_c||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){c={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{c=JSON.parse(_q)}catch(e){c={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_c=await r.text(); let c=null; {var _q=(_t_c||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){c={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{c=JSON.parse(_q)}catch(e){c={error:"[JSON] "+e.message}}}}
render(c.report,c.tools||{});
}catch(e){
_lastScan=d.scan_time||d.last_scan||'';
@@ -180,7 +180,7 @@ async function runScan(){
b.textContent='⏳ Scanning...';b.disabled=true;
try{
const r=await fetch(API+'&action=auto_run').catch(()=>fetch('/api/oss-cache.json'));
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
b.textContent=`✅ +${d.new_tools} tools`;
setTimeout(()=>{b.textContent='⚡ Scan Now';b.disabled=false;load()},3000);
}catch(e){b.textContent='❌ Error';setTimeout(()=>{b.textContent='⚡ Scan Now';b.disabled=false},2000)}
@@ -192,7 +192,7 @@ async function loadTrending(){
box.innerHTML='<div class="card"><div class="card-b" style="text-align:center;padding:30px;color:var(--mu)">Loading trending...</div></div>';
try{
const r=await fetch('/api/oss-trending.json?t='+Date.now());
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
box.innerHTML=`<div class="card"><div class="card-h"><div class="card-t">📈 GitHub Trending</div><span class="badge b-ac">${(d.trending||[]).length}</span></div>
<div class="card-b" style="padding:0;max-height:400px;overflow-y:auto"><table class="tbl"><tr><th>Score</th><th>★</th><th>Repo</th><th>Lang</th><th>Needs</th></tr>
${(d.trending||[]).map(t=>`<tr><td class="score" style="color:${t.score>=30?'var(--ac)':t.score>=15?'var(--gn)':'var(--mu2)'}">${t.score}</td><td class="stars">${fmt(t.stars)}</td><td><a href="${t.url}" target="_blank">${t.name.split('/').pop()}</a><br><span style="font-size:9px;color:var(--mu)">${(t.description||'').slice(0,70)}</span></td><td style="font-family:var(--mono);font-size:10px">${t.language||'?'}</td><td>${(t.needs||[]).slice(0,3).map(n=>tag(n)).join('')}</td></tr>`).join('')}

View File

@@ -50,7 +50,7 @@ const API='/api/secret-scanner-api.php';
async function load(){
try{
const r=await fetch(API+'?action=results');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if(d.error){document.getElementById('history').textContent='No scan yet. Click Scan Now.';return}
// KPIs
const s=d.summary||{};
@@ -118,7 +118,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -419,7 +419,7 @@ async function init() {
async function loadStats() {
try {
const r = await fetch(API_VAULT + '?action=stats');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
document.getElementById('sNotes').textContent = d.files || d.notes || 0;
document.getElementById('hFiles').textContent = d.files || 0;
document.getElementById('sDirs').textContent = (d.dirs||[]).length;
@@ -440,7 +440,7 @@ async function loadStats() {
async function loadDirs() {
try {
const r = await fetch(API_VAULT + '?action=list');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const sb = document.getElementById('dirList');
const icons = {doctrines:'📜',tools:'🔧',sessions:'📅',decisions:'⚖️',ethica:'💊',infra:'🖥️',kb:'📚',arena:'⚡',daily:'📊'};
sb.innerHTML = `<div class="dir-item ${!currentDir?'active':''}" onclick="loadDir('')"><span class="icon">🏠</span> All<span class="count">${d.count}</span></div>`;
@@ -459,7 +459,7 @@ async function loadDir(dir) {
currentDir = dir;
loadDirs();
const r = await fetch(API_VAULT + '?action=list&dir=' + dir);
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const res = document.getElementById('results');
document.getElementById('noteView').style.display = 'none';
res.innerHTML = '';
@@ -486,7 +486,7 @@ async function doSearch() {
? API_SEMANTIC + '?q=' + encodeURIComponent(q)
: API_VAULT + '?action=search&q=' + encodeURIComponent(q);
const r = await fetch(url);
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
if (!d.results || d.results.length === 0) {
res.innerHTML = '<div style="text-align:center;color:var(--fg3);padding:20px">No results</div>';
return;
@@ -510,7 +510,7 @@ async function doSearch() {
async function loadNote(file) {
try {
const r = await fetch(API_VAULT + '?action=read&file=' + encodeURIComponent(file));
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
if (d.error) { alert(d.error); return; }
currentFile = file;
document.getElementById('results').innerHTML = '';
@@ -552,7 +552,7 @@ async function saveNote() {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: `action=write&file=${encodeURIComponent(currentFile)}&content=${encodeURIComponent(content)}`
});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
if (d.ok) {
document.getElementById('noteContent').textContent = content;
document.getElementById('noteContent').style.display = 'block';
@@ -584,7 +584,7 @@ async function createNote() {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: `action=write&file=${encodeURIComponent(dir+'/'+name+'.md')}&content=${encodeURIComponent(content)}`
});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
if (d.ok) {
document.getElementById('modalBg').classList.remove('show');
document.getElementById('newFilename').value = '';
@@ -607,7 +607,7 @@ async function reEmbed() {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'action=exec_s204&cmd=timeout+30+python3+/opt/weval-l99/tools/vault-embed.py+2>&1'
});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
btn.textContent = '🧠 Re-Embed ✅';
setTimeout(()=>{ btn.textContent='🧠 Re-Embed'; btn.disabled=false; }, 3000);
} catch(e) { btn.textContent = '🧠 Error'; btn.disabled = false; }
@@ -624,7 +624,7 @@ async function masterCmd(msg) {
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({message: msg})
});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
res.innerHTML = `<div class="result-item"><div class="file">Master Response (${d.source||'?'})</div><pre class="snippet" style="white-space:pre-wrap;max-height:400px;overflow:auto">${typeof d.content==='string'?d.content:JSON.stringify(d.content,null,2)}</pre></div>`;
} catch(e) {
res.innerHTML = `<div style="color:var(--red);padding:20px">Master timeout</div>`;
@@ -695,7 +695,7 @@ async function buildHomepage() {
try {
const r = await fetch(API_VAULT + '?action=list');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const dirs = (d.files||[]).filter(f=>f.type==='dir');
for (const dir of dirs) {
@@ -762,7 +762,7 @@ async function syncPromptToMaster() {
try {
// Read the current system prompt
const r = await fetch(API_VAULT + '?action=read&file=doctrines/000-system-prompt.md');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const content = d.content || '';
const tokens = Math.ceil(content.length / 4);
@@ -794,7 +794,7 @@ function viewDigest() {
async function loadPromptPreviewEnhanced() {
try {
const r = await fetch(API_VAULT + '?action=read&file=doctrines/000-system-prompt.md');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const content = d.content || '';
const tokens = Math.ceil(content.length / 4);
const el = document.getElementById('promptPreview');
@@ -826,7 +826,7 @@ saveNote = async function() {
async function loadPromptPreview() {
try {
const r = await fetch('/api/wevia-prompt.php?format=json');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const el = document.getElementById('promptPreview');
if (el) {
const lines = d.prompt.split('\n').filter(l=>l.trim()).slice(0,5);
@@ -907,7 +907,7 @@ async function moveNote() {
// Read content, write to new path, delete old
try {
const r = await fetch(API_VAULT + '?action=read&file=' + encodeURIComponent(currentFile));
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
const content = d.content;
const newPath = newDir + '/' + name;
@@ -944,7 +944,7 @@ async function renameNote() {
try {
const r = await fetch(API_VAULT + '?action=read&file=' + encodeURIComponent(currentFile));
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
await fetch(API_VAULT, {
method: 'POST',
@@ -1019,7 +1019,7 @@ async function duplicateNote() {
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'action=write&file=' + encodeURIComponent(newName) + '&content=' + encodeURIComponent(content)
});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||'').trim();if(_q.startsWith('<!DOCTYPE')||_q.startsWith('<html')){d={error:'[HTTP '+(r.status||'?')+'] Backend indisponible',isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:'[JSON] '+e.message}}}}
if (d.ok) { toast('Duplique: ' + newName, 'ok'); loadStats(); loadDir(currentDir||''); }
} catch(e) { toast(e.message, 'err'); }
}

View File

@@ -938,7 +938,7 @@ async function checkArenaHealth() {
const ctrl = new AbortController();
setTimeout(() => ctrl.abort(), 90000);
const r = await fetch("/api/wevia-arena-health.php", {signal: ctrl.signal});
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const sel = document.getElementById("modelSelect");
if (!sel || !d.models) return;

View File

@@ -336,7 +336,7 @@ async function send() {
async function loadStats() {
try {
const r = await fetch('/api/source-of-truth.json?t=' + Date.now());
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('prov-count').textContent = Object.keys(d.providers || {}).length;
document.getElementById('footer-stats').textContent = Object.keys(d.agents || {}).length + ' agents | Sovereign';
} catch(e) {}

View File

@@ -235,7 +235,7 @@ async function loadAll() {
async function loadFiability() {
try {
const r = await fetch('/api/wevia-fiability.php?report');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if (d.status === 'no_report') {
document.getElementById('fiaScore').textContent = '—';
document.getElementById('fiaDetail').textContent = 'Aucun scan';
@@ -260,7 +260,7 @@ async function loadFiability() {
async function loadStatus() {
try {
const r = await fetch(API + '?status');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
if (d.status === 'never_run') {
document.getElementById('liveStatus').textContent = '● NEVER RUN';
@@ -346,7 +346,7 @@ async function loadHistory() {
async function loadHealth() {
try {
const r = await fetch(API + '?health');
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('stUptime').textContent = d.uptime || '?';
} catch(e) {}
@@ -404,7 +404,7 @@ async function triggerCycle(force = false) {
try {
const url = force ? API + '?run&force=1' : API + '?run';
const r = await fetch(url);
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
btn.textContent = d.skipped ? '⏭ Skipped' : '✅ Done';
await loadAll();
} catch(e) {
@@ -433,7 +433,7 @@ async function tick(){
try{
const r=await fetch(U,{cache:'no-cache'});
if(!r.ok) return;
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const body=document.getElementById('ulo-body');
const ts=document.getElementById('ulo-ts');
if(!body) return;

View File

@@ -209,7 +209,7 @@ async function apiCall(action, params = '') {
document.getElementById('loading').classList.add('show');
try {
const r = await fetch(`${API}?action=${action}${params}`);
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
document.getElementById('loading').classList.remove('show');
return d;
} catch (e) {

View File

@@ -423,7 +423,7 @@ async function runTask(preset){
(async function loadAgentFleet() {
try {
const r = await fetch("/api/agents-catalog-api.php");
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); const d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
/* HTML_GUARD_V2_BATCH */ const _t_d=await r.text(); let d=null; {var _q=(_t_d||"").trim();if(_q.startsWith("<!DOCTYPE")||_q.startsWith("<html")){d={error:"[HTTP "+(r.status||"?")+"] Backend indisponible",isHtmlError:true};}else{try{d=JSON.parse(_q)}catch(e){d={error:"[JSON] "+e.message}}}}
const fleet = document.querySelector(".fleet");
if (!fleet || !d.agents) return;