secutorpro's picture
🐳 22/07 - 10:56 - Tu es un expert SEO impitoyable spécialisé en nettoyage massif et Geo Maillage Inverse.**Mode : Stop Net Ultra-Agressif activé**Entrée : [INSÉRER URL OU MOT-CLÉ + LOCALISATION]**Mis
84f4898 verified
Raw
History Blame Contribute Delete
11.8 kB
// =====================================================
// SentinelAI Stop Net Ultra-Agressif Engine
// =====================================================
const state = {
startTime: Date.now(),
domain: '',
location: '',
keywords: '',
parasites: [],
meshNodes: [],
meshLinks: [],
logs: [],
packets: [],
canvasAnimId: null,
hoveredNode: null,
analyzing: false,
analysisData: null,
stopNetScore: 0,
cleaningUrgency: 0,
geoScore: 0,
trafficPotential: 0,
relevance: 0,
};
const CognitiveAI = {
neural: { layers: [4, 8, 8, 6, 3], activations: [], weights: [], biases: [], pulses: [] }, active: false, automation: false, iterations: 0, decisions: [], patterns: [], predictions: [], autoActions: 0, confidence: 0, learningRate: 0.01, automationInterval: null, neuralAnimId: null,
initNeural() { this.neural.weights = []; this.neural.biases = []; for (let i = 0; i < this.neural.layers.length - 1; i++) { const lw = [], lb = []; for (let j = 0; j < this.neural.layers[i + 1]; j++) { const nw = []; for (let k = 0; k < this.neural.layers[i]; k++) nw.push(Math.random() * 2 - 1); lw.push(nw); lb.push(Math.random() * 0.5 - 0.25); } this.neural.weights.push(lw); this.neural.biases.push(lb); } this.neural.activations = this.neural.layers.map(n => new Array(n).fill(0)); this.neural.pulses = []; },
sigmoid(x) { return 1 / (1 + Math.exp(-x)); },
forwardPass(inputs) { this.neural.activations[0] = inputs.slice(); for (let i = 0; i < this.neural.weights.length; i++) { const next = []; for (let j = 0; j < this.neural.weights[i].length; j++) { let sum = this.neural.biases[i][j]; for (let k = 0; k < this.neural.weights[i][j].length; k++) sum += this.neural.activations[i][k] * this.neural.weights[i][j][k]; next.push(this.sigmoid(sum)); } this.neural.activations[i + 1] = next; for (let j = 0; j < next.length; j++) { if (Math.random() < 0.3) this.neural.pulses.push({ layer: i, fromNeuron: Math.floor(Math.random() * this.neural.layers[i]), toNeuron: j, progress: 0, speed: 0.03 + Math.random() * 0.02, intensity: next[j] }); } } return this.neural.activations[this.neural.activations.length - 1]; },
recognizePatterns() { const patterns = []; if (state.parasites.filter(p => p.type === 'old-thin' || p.type === 'orphan').length > 3) patterns.push({ type: 'Massive Nettoyage Requis', description: 'Plus de 3 parasites majeurs détectés — nettoyage en masse recommandé', confidence: 0.92, severity: 'critical' }); if (state.parasites.filter(p => p.type === 'declining').length > 2) patterns.push({ type: 'Chute Libre Détectée', description: 'Pages en chute de trafic — neutralisation prioritaire', confidence: 0.85, severity: 'high' }); if (state.stopNetScore < 40) patterns.push({ type: 'Score Critique', description: `Score ${state.stopNetScore}/100 — intervention urgente requise`, confidence: 0.90, severity: 'critical' }); if (state.parasites.filter(p => p.action === 'redirect-301').length > 5) patterns.push({ type: 'Redirection Massive', description: 'Plus de 5 redirections 301 nécessaires — structurer en silos', confidence: 0.80, severity: 'high' }); this.patterns = patterns; return patterns; },
predictWeaknesses() { const predictions = []; if (state.stopNetScore < 30) predictions.push({ prediction: 'Score < 30 — risque de pénalité Google dans 30 jours', probability: 0.85, timeframe: '30 jours', action: 'Nettoyage immédiat + redirect 301' }); if (state.cleaningUrgency > 70) predictions.push({ prediction: 'Urgence nettoyage > 70 — perte de positions SERP en cours', probability: 0.88, timeframe: 'En cours', action: 'Stop Net agressif immédiat' }); if (state.geoScore < 40) predictions.push({ prediction: `Score géo ${state.geoScore}% — maillage insuffisant pour maintenir positions`, probability: 0.75, timeframe: '60 jours', action: 'Créer cocons sémantiques géo' }); this.predictions = predictions; return predictions; },
makeDecisions() { const decisions = []; if (this.patterns.some(p => p.type === 'Massive Nettoyage Requis')) decisions.push({ decision: 'Lancer Stop Net agressif sur tous les parasites >7 ans', action: 'stop-net-massif', priority: 'CRITIQUE', impact: '+25-35 points score', confidence: 0.92 }); if (this.patterns.some(p => p.type === 'Chute Libre Détectée')) decisions.push({ decision: 'Noindex + canonical vers page pilier pour pages en chute', action: 'noindex-canonical', priority: 'HAUTE', impact: '+15-20 points autorité', confidence: 0.85 }); if (this.patterns.some(p => p.type === 'Redirection Massive')) decisions.push({ decision: 'Structurer les redirections 301 en silos géographiques', action: 'silos-redirect', priority: 'MOYENNE', impact: '+10-15 points jus de lien', confidence: 0.78 }); if (state.geoScore < 40) decisions.push({ decision: 'Déployer maillage inversé géo sur pages restantes à fort potentiel', action: 'geo-mesh-inverse', priority: 'HAUTE', impact: '+20-30 points couverture géo', confidence: 0.88 }); this.decisions = decisions; return decisions; },
autoRemediate() { if (!state.analysisData) { showToast('Lancez d\'abord l\'analyse Stop Net', true); return; } addLog('Stop Net IA: Auto-remédiation des parasitesprioritaires...', 'system'); let actionsTaken = 0; const critical = state.parasites.filter(p => p.severity === 'critical'); critical.forEach((p, i) => { setTimeout(() => { p.status = 'neutralized'; actionsTaken++; this.autoActions++; this.updateAutoCount(); addLog(`Stop Net: ${p.url} neutralisé (${p.action})`, 'success'); }, i * 300); }); setTimeout(() => { state.stopNetScore = Math.min(100, state.stopNetScore + actionsTaken * 5); updateStats(); addLog(`Stop Net IA: Score mis à jour — ${state.stopNetScore}/100`, 'success'); showToast(`Auto-remédiation: ${actionsTaken} parasites neutralisés !`); }, critical.length * 300 + 500); },
deepLearn() { if (!state.analysisData) { showToast('Lancez d\'abord l\'analyse', true); return; } addLog('Stop Net IA: Démarrage apprentissage profond...', 'system'); if (!this.active) this.initNeural(); for (let epoch = 0; epoch < 5; epoch++) { setTimeout(() => { for (let i = 0; i < this.neural.weights.length; i++) for (let j = 0; j < this.neural.weights[i].length; j++) for (let k = 0; k < this.neural.weights[i][j].length; k++) this.neural.weights[i][j][k] += (Math.random() - 0.5) * this.learningRate; const inputs = [state.relevance / 100, state.geoScore / 100, state.cleaningUrgency / 100, state.trafficPotential / 100]; const outputs = this.forwardPass(inputs); this.confidence = Math.min(0.99, this.confidence + 0.05); this.iterations++; this.renderStatus(); addLog(`Stop Net IA: Epoch ${epoch + 1}/5 — Convergence: ${(outputs.reduce((a, b) => a + b, 0) / outputs.length * 100).toFixed(1)}%`, 'info'); if (epoch === 4) { addLog(`Stop Net IA: Apprentissage terminé — Confiance: ${(this.confidence * 100).toFixed(0)}%`, 'success'); showToast(`Deep Learning terminé ! Confiance: ${(this.confidence * 100).toFixed(0)}%`); } }, epoch * 800); } },
runCycle() { if (!state.analysisData) { showToast('Lancez d\'abord l\'analyse', true); return; } addLog('Stop Net IA: Cycle cognitif complet...', 'system'); if (!this.active) this.initNeural(); const inputs = [state.relevance / 100, state.geoScore / 100, state.cleaningUrgency / 100, state.trafficPotential / 100]; this.forwardPass(inputs); this.recognizePatterns(); this.predictWeaknesses(); this.makeDecisions(); this.iterations++; this.confidence = Math.min(0.95, 0.6 + this.iterations * 0.02); this.renderStatus(); this.renderDecisions(); this.renderMetrics(); addLog(`Stop Net IA: Cycle #${this.iterations}${this.patterns.length} patterns, ${this.predictions.length} prédictions`, 'success'); showToast(`Cycle cognitif #${this.iterations} terminé !`); },
activate() { if (this.active) { this.deactivate(); return; } if (!state.analysisData) { showToast('Lancez d\'abord l\'analyse Stop Net', true); return; } this.active = true; this.initNeural(); this.renderStatus(); this.startNeuralAnimation(); this.runCycle(); const label = document.getElementById('aiActivateLabel'); if (label) label.textContent = 'Désactiver'; addLog('Stop Net IA: Moteur cognitif activé', 'system'); showToast('Moteur Stop Net activé ! 🔥'); },
deactivate() { this.active = false; this.automation = false; this.stopAutomation(); this.stopNeuralAnimation(); const toggle = document.getElementById('aiAutomationToggle'); if (toggle) toggle.checked = false; this.renderStatus(); this.renderToggle(); const label = document.getElementById('aiActivateLabel'); if (label) label.textContent = 'Activer l\'IA'; addLog('Stop Net IA: Moteur cognitif désactivé', 'system'); showToast('Moteur Stop Net désactivé'); },
toggleAutomation() { const toggle = document.getElementById('aiAutomationToggle'); const isChecked = toggle ? toggle.checked : false; if (!this.active) { if (toggle) toggle.checked = false; this.renderToggle(); showToast('Activez d\'abord l\'IA', true); return; } this.automation = isChecked; if (this.automation) { this.startAutomation(); addLog('Stop Net IA: Automatisation activée', 'system'); showToast('Automatisation activée ! ⚙️'); } else { this.stopAutomation(); addLog('Stop Net IA: Automatisation désactivée', 'system'); showToast('Automatisation désactivée'); } this.renderToggle(); },
startAutomation() { this.automationInterval = setInterval(() => { if (this.active && this.automation) { this.runCycle(); if (this.patterns.some(p => p.severity === 'critical') && Math.random() > 0.5) { addLog('Stop Net IA: Parasite critique — auto-remédiation', 'warning'); this.autoRemediate(); } } }, 5000); },
stopAutomation() { if (this.automationInterval) { clearInterval(this.automationInterval); this.automationInterval = null; } },
startNeuralAnimation() { const canvas = document.getElementById('neuralCanvas'); if (!canvas) return; function resize() { const rect = canvas.parentElement.getBoundingClientRect(); canvas.width = rect.width - 8; canvas.height = 220; } resize(); window.addEventListener('resize', resize); const animate = () => { if (!this.active) { this.neuralAnimId = null; return; } const ctx = canvas.getContext('2d'); const w = canvas.width, h = canvas.height; ctx.clearRect(0, 0, w, h); const lc = this.neural.layers.length, ls = w / (lc + 1); const np = this.neural.layers.map((count, li) => { const pos = [], ns = h / (count + 1); for (let i = 0; i < count; i++) pos.push({ x: ls * (li + 1), y: ns * (i + 1) }); return pos; }); for (let i = 0; i < this.neural.weights.length; i++) for (let j = 0; j < this.neural.weights[i].length; j++) for (let k = 0; k < this.neural.weights[i][j].length; k++) { const from = np[i][k], to = np[i + 1][j], weight = this.neural.weights[i][j][k]; ctx.beginPath(); ctx.moveTo(from.x, from.y); ctx.lineTo(to.x, to.y); ctx.strokeStyle = weight > 0 ? `rgba(239, 68, 68, ${Math.abs(weight) * 0.15})` : `rgba(220, 38, 38, ${Math.abs(weight) * 0.15})`; ctx.lineWidth = Math.abs(weight) * 1.5; ctx.stroke(); } this.neural.pulses = this.neural.pulses.filter(p => { p.progress += p.speed; if (p.progress >= 1) return false; const from = np[p.layer][p.fromNeuron], to = np[p.layer + 1][p.toNeuron]; const px = from.x + (to.x - from.x) * p.progress, py = from.y + (to.y - from.y) * p.progress; ctx.beginPath(); ctx.arc(px, py, 4, 0, Math.PI * 2); ctx.fillStyle = `rgba(239, 68, 68, ${p.intensity * 0.4})`; ctx.fill(); ctx.beginPath(); ctx.arc(px, py, 2, 0, Math.PI * 2); ctx.fillStyle = '#f87171'; ctx.fill(); return true; }); for (let i = 0; i < np.length; i++) for (let j = 0; j < np[i].length; j++) { const pos = np[i][j], activation = this.neural.activations[i][j] || 0, radius = i === 0 || i === np.length - 1 ? 7 : 6; const grad = ctx.createRadialGradient(pos.x, pos.y, 0, pos.x,