hts-ai commited on
Commit
a451779
·
verified ·
1 Parent(s): 66488ad

🐳 25/07 - 21:28 - Cerveau Holographique Fédéré. corrige donne lui accé partout et memoire  et mem0

Browse files
Files changed (2) hide show
  1. agent.html +9 -0
  2. cerveau-hologramme.html +168 -4
agent.html CHANGED
@@ -132,6 +132,15 @@
132
  <a href="cognitive-hive.html" class="flex items-center gap-2 text-dark-400 hover:text-white transition" title="Cognitive Hive">
133
  <i data-lucide="hexagon" class="w-4 h-4"></i>
134
  </a>
 
 
 
 
 
 
 
 
 
135
  <div class="w-9 h-9 rounded-xl bg-gradient-to-br from-neon-amber to-neon-orange flex items-center justify-center shadow-lg shadow-neon-amber/20 pulse-glow">
136
  <i data-lucide="brain" class="w-5 h-5 text-dark-950"></i>
137
  </div>
 
132
  <a href="cognitive-hive.html" class="flex items-center gap-2 text-dark-400 hover:text-white transition" title="Cognitive Hive">
133
  <i data-lucide="hexagon" class="w-4 h-4"></i>
134
  </a>
135
+ <a href="content-scan.html" class="text-dark-400 hover:text-white transition" title="Content Scan"><i data-lucide="scan-search" class="w-4 h-4"></i></a>
136
+ <a href="anti-parasite.html" class="text-dark-400 hover:text-white transition" title="Anti-Parasite"><i data-lucide="bug-off" class="w-4 h-4"></i></a>
137
+ <a href="stop-net.html" class="text-dark-400 hover:text-white transition" title="Stop Net"><i data-lucide="shield-off" class="w-4 h-4"></i></a>
138
+ <a href="web-cleaner.html" class="text-dark-400 hover:text-white transition" title="WEB CLEANER"><i data-lucide="scan-eye" class="w-4 h-4"></i></a>
139
+ <a href="mailing-seo-geo.html" class="text-dark-400 hover:text-white transition" title="SEO GEO"><i data-lucide="map-pinned" class="w-4 h-4"></i></a>
140
+ <a href="cerveau-hologramme.html" class="text-dark-400 hover:text-white transition" title="Hologramme"><i data-lucide="radio" class="w-4 h-4"></i></a>
141
+ <a href="soe.html" class="text-dark-400 hover:text-white transition" title="SOE"><i data-lucide="search" class="w-4 h-4"></i></a>
142
+ <a href="tracker.html" class="text-dark-400 hover:text-white transition" title="IP Tracker"><i data-lucide="map-pin" class="w-4 h-4"></i></a>
143
+ <a href="navigateur.html" class="text-dark-400 hover:text-white transition" title="Navigateur Virtuel"><i data-lucide="globe" class="w-4 h-4"></i></a>
144
  <div class="w-9 h-9 rounded-xl bg-gradient-to-br from-neon-amber to-neon-orange flex items-center justify-center shadow-lg shadow-neon-amber/20 pulse-glow">
145
  <i data-lucide="brain" class="w-5 h-5 text-dark-950"></i>
146
  </div>
cerveau-hologramme.html CHANGED
@@ -77,10 +77,19 @@
77
 
78
  <!-- TOP BAR -->
79
  <div class="flex items-center justify-between py-4 border-b border-glass-border anim-up">
80
- <div class="flex items-center gap-3">
81
- <a href="dashboard.html" class="text-dark-400 hover:text-white transition" title="Dashboard"><i data-lucide="layout-dashboard" class="w-5 h-5"></i></a>
82
- <a href="index.html" class="text-dark-400 hover:text-white transition" title="Fast Takedown"><i data-lucide="shield-alert" class="w-5 h-5"></i></a>
83
- <a href="agent.html" class="text-dark-400 hover:text-white transition" title="Agent Hybride"><i data-lucide="brain" class="w-5 h-5"></i></a>
 
 
 
 
 
 
 
 
 
84
  <div class="w-9 h-9 rounded-xl bg-gradient-to-br from-neon-purple to-neon-cyan flex items-center justify-center shadow-lg shadow-neon-purple/20">
85
  <i data-lucide="radio" class="w-5 h-5 text-white"></i>
86
  </div>
@@ -177,6 +186,42 @@
177
  </div>
178
  </div>
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  </div>
181
 
182
  <!-- TOAST -->
@@ -407,6 +452,122 @@ function enableSpeakButton(text) {
407
  document.getElementById('speakBtn').classList.remove('cursor-not-allowed', 'opacity-40');
408
  }
409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  // ═══ OPENROUTER CHAT ══════════════════════════════════════════
411
  async function openRouterChat(messages, { model = "x-ai/grok-4-1-fast", temperature = 0.4, max_tokens = 2048 }) {
412
  const cfg = window.SENTINEL_CONFIG?.openRouter;
@@ -453,6 +614,7 @@ async function sendMessage(auto = false) {
453
  const reply = await openRouterChat(messages, {});
454
  addChatBubble(reply, "ai");
455
  enableSpeakButton(reply);
 
456
  } catch (e) {
457
  addChatBubble("❌ Erreur : " + e.message, "ai");
458
  }
@@ -519,6 +681,8 @@ function showToast(msg) {
519
 
520
  // ═══ INIT ═════════════════════════════════════════════════════════
521
  lucide.createIcons();
 
 
522
  </script>
523
  </body>
524
  </html>
 
77
 
78
  <!-- TOP BAR -->
79
  <div class="flex items-center justify-between py-4 border-b border-glass-border anim-up">
80
+ <div class="flex items-center gap-3 flex-wrap">
81
+ <a href="dashboard.html" class="text-dark-400 hover:text-white transition" title="Dashboard"><i data-lucide="layout-dashboard" class="w-4 h-4"></i></a>
82
+ <a href="index.html" class="text-dark-400 hover:text-white transition" title="Fast Takedown"><i data-lucide="shield-alert" class="w-4 h-4"></i></a>
83
+ <a href="soe.html" class="text-dark-400 hover:text-white transition" title="SOE Inverse"><i data-lucide="search" class="w-4 h-4"></i></a>
84
+ <a href="tracker.html" class="text-dark-400 hover:text-white transition" title="IP Tracker"><i data-lucide="map-pin" class="w-4 h-4"></i></a>
85
+ <a href="agent.html" class="text-dark-400 hover:text-white transition" title="Agent Hybride"><i data-lucide="brain" class="w-4 h-4"></i></a>
86
+ <a href="content-scan.html" class="text-dark-400 hover:text-white transition" title="Content Scan"><i data-lucide="scan-search" class="w-4 h-4"></i></a>
87
+ <a href="anti-parasite.html" class="text-dark-400 hover:text-white transition" title="Anti-Parasite"><i data-lucide="bug-off" class="w-4 h-4"></i></a>
88
+ <a href="stop-net.html" class="text-dark-400 hover:text-white transition" title="Stop Net"><i data-lucide="shield-off" class="w-4 h-4"></i></a>
89
+ <a href="web-cleaner.html" class="text-dark-400 hover:text-white transition" title="WEB CLEANER"><i data-lucide="scan-eye" class="w-4 h-4"></i></a>
90
+ <a href="mailing-seo-geo.html" class="text-dark-400 hover:text-white transition" title="SEO GEO"><i data-lucide="map-pinned" class="w-4 h-4"></i></a>
91
+ <a href="cognitive-hive.html" class="text-dark-400 hover:text-white transition" title="Cognitive Hive"><i data-lucide="hexagon" class="w-4 h-4"></i></a>
92
+ <a href="cognitive-os.html" class="text-dark-400 hover:text-white transition" title="Cognitive OS"><i data-lucide="cpu" class="w-4 h-4"></i></a>
93
  <div class="w-9 h-9 rounded-xl bg-gradient-to-br from-neon-purple to-neon-cyan flex items-center justify-center shadow-lg shadow-neon-purple/20">
94
  <i data-lucide="radio" class="w-5 h-5 text-white"></i>
95
  </div>
 
186
  </div>
187
  </div>
188
 
189
+ <!-- ═══ MEMORY & MEM0 PANELS ═══ -->
190
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-4 mt-6 anim-up anim-up-3">
191
+
192
+ <!-- 8 Memory Systems -->
193
+ <div class="glow-card rounded-xl p-4">
194
+ <div class="flex items-center justify-between mb-3">
195
+ <div class="flex items-center gap-2">
196
+ <i data-lucide="database" class="w-4 h-4 text-neon-purple"></i>
197
+ <span class="text-xs font-semibold text-white uppercase tracking-wider">8 Mémoires</span>
198
+ </div>
199
+ <button onclick="resetMemories()" class="text-[10px] text-dark-500 hover:text-white transition">Reset</button>
200
+ </div>
201
+ <div class="space-y-1.5" id="memoryGrid"></div>
202
+ </div>
203
+
204
+ <!-- 2 Mem0 Instances -->
205
+ <div class="glow-card rounded-xl p-4">
206
+ <div class="flex items-center gap-2 mb-3">
207
+ <i data-lucide="hard-drive" class="w-4 h-4 text-neon-cyan"></i>
208
+ <span class="text-xs font-semibold text-white uppercase tracking-wider">2× Mem0</span>
209
+ </div>
210
+ <div class="space-y-2.5" id="mem0Grid"></div>
211
+ </div>
212
+ </div>
213
+
214
+ <!-- Active Context -->
215
+ <div class="glow-card rounded-xl p-4 mt-4 anim-up anim-up-4">
216
+ <div class="flex items-center gap-2 mb-3">
217
+ <i data-lucide="eye" class="w-4 h-4 text-neon-green"></i>
218
+ <span class="text-xs font-semibold text-white uppercase tracking-wider">Contexte actif</span>
219
+ </div>
220
+ <div id="activeContext" class="text-[11px] text-dark-400 space-y-1">
221
+ <div class="flex items-center gap-2"><span class="w-1.5 h-1.5 rounded-full bg-dark-500"></span>Aucun contexte chargé</div>
222
+ </div>
223
+ </div>
224
+
225
  </div>
226
 
227
  <!-- TOAST -->
 
452
  document.getElementById('speakBtn').classList.remove('cursor-not-allowed', 'opacity-40');
453
  }
454
 
455
+ // ═══ MEMORY & MEM0 STATE ══════════════════════════════════════════
456
+ const MEMORY_SYSTEMS = [
457
+ { id: "working", name: "Mémoire de travail", icon: "cpu", color: "#fbbf24", desc: "Contexte immédiat de la conversation" },
458
+ { id: "episodic", name: "Mémoire épisodique", icon: "calendar", color: "#a78bfa", desc: "Événements et interactions passées" },
459
+ { id: "semantic", name: "Mémoire sémantique", icon: "book-open", color: "#60a5fa", desc: "Connaissances et faits structurés" },
460
+ { id: "procedural", name: "Mémoire procédurale", icon: "settings", color: "#34d399", desc: "Procédures et workflows appris" },
461
+ { id: "longterm", name: "Mémoire long terme", icon: "archive", color: "#f472b6", desc: "Persistance cross-sessions" },
462
+ { id: "sensory", name: "Mémoire sensorielle", icon: "eye", color: "#fb923c", desc: "Patterns visuels et IOCs" },
463
+ { id: "metacognitive", name: "Métacognition", icon: "brain", color: "#22d3ee", desc: "Auto-évaluation et stratégies" },
464
+ { id: "social", name: "Mémoire sociale", icon: "users", color: "#f87171", desc: "Profils d'acteurs et relations" },
465
+ ];
466
+
467
+ const MEM0_INSTANCES = [
468
+ { id: "mem0-personal", name: "Mem0 Personnel", icon: "user", color: "#fbbf24", desc: "Préférences opérateur, historique", entries: 0 },
469
+ { id: "mem0-organizational", name: "Mem0 Organisation", icon: "building", color: "#22d3ee", desc: "Base de connaissances SentinelAI", entries: 0 },
470
+ ];
471
+
472
+ let hologramMemories = {};
473
+ MEMORY_SYSTEMS.forEach(m => { hologramMemories[m.id] = []; });
474
+ let hologramMem0 = { personal: [], organizational: [] };
475
+
476
+ function renderMemoryGrid() {
477
+ const el = document.getElementById("memoryGrid");
478
+ if (!el) return;
479
+ el.innerHTML = MEMORY_SYSTEMS.map(m => {
480
+ const count = hologramMemories[m.id]?.length || 0;
481
+ const hasData = count > 0;
482
+ return `<div class="flex items-center gap-2 py-1.5 px-2 rounded-md ${hasData ? 'bg-white/[0.03]' : ''} transition">
483
+ <i data-lucide="${m.icon}" class="w-3.5 h-3.5 shrink-0" style="color:${m.color}"></i>
484
+ <div class="flex-1 min-w-0">
485
+ <div class="text-[11px] text-dark-200 truncate">${m.name}</div>
486
+ <div class="text-[9px] text-dark-500">${m.desc}</div>
487
+ </div>
488
+ <div class="flex items-center gap-1">
489
+ ${hasData ? `<span class="text-[10px] font-mono" style="color:${m.color}">${count}</span>` : '<span class="text-[10px] text-dark-600">∅</span>'}
490
+ <span class="w-1.5 h-1.5 rounded-full ${hasData ? 'animate-pulse' : ''}" style="background:${hasData ? m.color : '#3a3e52'}"></span>
491
+ </div>
492
+ </div>`;
493
+ }).join("");
494
+ lucide.createIcons();
495
+ }
496
+
497
+ function renderMem0Grid() {
498
+ const el = document.getElementById("mem0Grid");
499
+ if (!el) return;
500
+ el.innerHTML = MEM0_INSTANCES.map(m => {
501
+ const data = m.id === "mem0-personal" ? hologramMem0.personal : hologramMem0.organizational;
502
+ const count = data?.length || 0;
503
+ return `<div class="p-3 rounded-lg border border-glass-border bg-white/[0.02]">
504
+ <div class="flex items-center gap-2 mb-1.5">
505
+ <i data-lucide="${m.icon}" class="w-4 h-4" style="color:${m.color}"></i>
506
+ <span class="text-[11px] font-semibold text-white">${m.name}</span>
507
+ <span class="text-[10px] font-mono px-1.5 py-0.5 rounded" style="background:${m.color}15;color:${m.color}">${count} entrées</span>
508
+ </div>
509
+ <div class="text-[10px] text-dark-500">${m.desc}</div>
510
+ <div class="mt-1.5 h-1 rounded-full bg-dark-700 overflow-hidden">
511
+ <div class="h-full rounded-full transition-all duration-500" style="width:${Math.min(count * 5, 100)}%;background:${m.color}"></div>
512
+ </div>
513
+ </div>`;
514
+ }).join("");
515
+ lucide.createIcons();
516
+ }
517
+
518
+ function storeInMemories(query, response, modelUsed) {
519
+ const safeModel = modelUsed || 'Holographe IA';
520
+ const safeQuery = query || '';
521
+ const safeResponse = response || '';
522
+
523
+ // Working memory
524
+ hologramMemories.working.push({ type: "ai_response", model: safeModel, ts: Date.now() });
525
+ // Episodic
526
+ hologramMemories.episodic.push({ event: "voice_query", query: safeQuery, ts: Date.now() });
527
+ // Long-term
528
+ hologramMemories.longterm.push({ query: safeQuery, response: safeResponse.substring(0, 500), model: safeModel, ts: Date.now() });
529
+ // Semantic
530
+ hologramMemories.semantic.push({ topic: safeQuery, fact: safeResponse.substring(0, 200), ts: Date.now() });
531
+ // Procedural
532
+ hologramMemories.procedural.push({ mode: "voice", model: safeModel, success: true, ts: Date.now() });
533
+ // Metacognitive
534
+ hologramMemories.metacognitive.push({ self_eval: "response_generated", ts: Date.now() });
535
+ // Sensory
536
+ hologramMemories.sensory.push({ input_type: "voice", content: safeQuery.substring(0, 100), ts: Date.now() });
537
+ // Social
538
+ hologramMemories.social.push({ actor: "user", action: "query", ts: Date.now() });
539
+
540
+ // Mem0 Personal
541
+ hologramMem0.personal.push({ query: safeQuery, model: safeModel, ts: Date.now() });
542
+ // Mem0 Organizational
543
+ hologramMem0.organizational.push({ category: "hologram_interaction", model: safeModel, ts: Date.now() });
544
+
545
+ renderMemoryGrid();
546
+ renderMem0Grid();
547
+ updateActiveContext(safeQuery);
548
+ }
549
+
550
+ function updateActiveContext(msg) {
551
+ const el = document.getElementById("activeContext");
552
+ if (!el) return;
553
+ const words = (msg || '').split(/\s+/).slice(0, 8).join(" ");
554
+ el.innerHTML = `
555
+ <div class="flex items-center gap-2 py-0.5"><span class="w-1.5 h-1.5 rounded-full bg-neon-green"></span><span class="truncate">Contexte: ${words || 'Aucun'}…</span></div>
556
+ <div class="flex items-center gap-2 py-0.5"><span class="w-1.5 h-1.5 rounded-full bg-neon-purple"></span>Mode: Voice + Chat</div>
557
+ <div class="flex items-center gap-2 py-0.5"><span class="w-1.5 h-1.5 rounded-full bg-neon-cyan"></span>Mémoires: ${Object.values(hologramMemories).reduce((a,b) => a + b.length, 0)} entrées</div>
558
+ <div class="flex items-center gap-2 py-0.5"><span class="w-1.5 h-1.5 rounded-full bg-neon-amber"></span>Mem0: ${hologramMem0.personal.length + hologramMem0.organizational.length} entrées</div>
559
+ `;
560
+ }
561
+
562
+ function resetMemories() {
563
+ MEMORY_SYSTEMS.forEach(m => { hologramMemories[m.id] = []; });
564
+ hologramMem0 = { personal: [], organizational: [] };
565
+ renderMemoryGrid();
566
+ renderMem0Grid();
567
+ updateActiveContext('');
568
+ showToast("Mémoires réinitialisées");
569
+ }
570
+
571
  // ═══ OPENROUTER CHAT ══════════════════════════════════════════
572
  async function openRouterChat(messages, { model = "x-ai/grok-4-1-fast", temperature = 0.4, max_tokens = 2048 }) {
573
  const cfg = window.SENTINEL_CONFIG?.openRouter;
 
614
  const reply = await openRouterChat(messages, {});
615
  addChatBubble(reply, "ai");
616
  enableSpeakButton(reply);
617
+ storeInMemories(msg, reply, "Holographe IA");
618
  } catch (e) {
619
  addChatBubble("❌ Erreur : " + e.message, "ai");
620
  }
 
681
 
682
  // ═══ INIT ═════════════════════════════════════════════════════════
683
  lucide.createIcons();
684
+ renderMemoryGrid();
685
+ renderMem0Grid();
686
  </script>
687
  </body>
688
  </html>