hts-ai commited on
Commit
e86dd8e
·
verified ·
1 Parent(s): e707361

🐳 13/02 - 18:01 - bonjour je suis architecte de l'ia   ameliore le systeme

Browse files
Files changed (4) hide show
  1. components/ops-sidebar.js +4 -0
  2. index.html +98 -1
  3. script.js +113 -1
  4. style.css +54 -0
components/ops-sidebar.js CHANGED
@@ -91,6 +91,10 @@ class OpsSidebar extends HTMLElement {
91
  <i data-feather="database"></i>
92
  <span>Secure Memory</span>
93
  </a>
 
 
 
 
94
  <a href="#config" class="nav-item" data-page="config">
95
  <i data-feather="settings"></i>
96
  <span>System Config</span>
 
91
  <i data-feather="database"></i>
92
  <span>Secure Memory</span>
93
  </a>
94
+ <a href="#cognitive" class="nav-item" data-page="cognitive">
95
+ <i data-feather="aperture"></i>
96
+ <span>Cognitive Core</span>
97
+ </a>
98
  <a href="#config" class="nav-item" data-page="config">
99
  <i data-feather="settings"></i>
100
  <span>System Config</span>
index.html CHANGED
@@ -413,10 +413,106 @@
413
  </div>
414
  </div>
415
  </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  <!-- System Config View -->
417
  <section id="view-config" class="hidden space-y-6 fade-in">
418
  <header class="mb-6">
419
- <h1 class="text-3xl font-bold text-white tracking-wide uppercase flex items-center gap-2">
420
  <i data-feather="settings" class="text-military-500"></i>
421
  System Configuration
422
  </h1>
@@ -768,6 +864,7 @@
768
  <script src="components/ops-status-card.js"></script>
769
  <script src="components/tactical-algorithm.js"></script>
770
  <script src="components/anti-exposure-core.js"></script>
 
771
  <!-- Main Logic -->
772
  <script src="script.js"></script>
773
  <script>feather.replace();</script>
 
413
  </div>
414
  </div>
415
  </section>
416
+ <!-- Cognitive Core View -->
417
+ <section id="view-cognitive" class="hidden space-y-6 fade-in">
418
+ <header class="mb-6 flex justify-between items-center">
419
+ <div>
420
+ <h1 class="text-3xl font-bold text-white tracking-wide uppercase flex items-center gap-2">
421
+ <i data-feather="aperture" class="text-blue-500"></i>
422
+ Cognitive Core
423
+ </h1>
424
+ <p class="text-slate-400 mt-2 font-mono text-sm">DEEPSEEK R1 T2 // MEMORY REASONING // CHAIN-OF-THOUGHT</p>
425
+ </div>
426
+ <div class="flex items-center gap-3">
427
+ <span class="px-3 py-1 bg-blue-900/30 border border-blue-700 text-blue-400 rounded-full text-sm font-medium flex items-center gap-2">
428
+ <div class="w-2 h-2 rounded-full bg-blue-500 animate-pulse"></div>
429
+ NEURAL ACTIVE
430
+ </span>
431
+ </div>
432
+ </header>
433
+
434
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 h-[calc(100vh-200px)]">
435
+ <!-- Main Cognitive Interface -->
436
+ <div class="lg:col-span-2 h-full">
437
+ <cognitive-core id="main-cognitive-core" class="h-full block"></cognitive-core>
438
+ </div>
439
+
440
+ <!-- AI Orchestration Panel -->
441
+ <div class="space-y-6">
442
+ <!-- Model Status -->
443
+ <div class="bg-slate-900/50 border border-slate-800 rounded-lg p-4">
444
+ <h3 class="text-sm font-semibold text-white mb-4 flex items-center gap-2">
445
+ <i data-feather="cpu" class="text-blue-500"></i>
446
+ Model Federation Status
447
+ </h3>
448
+ <div class="space-y-3">
449
+ <div class="flex items-center justify-between p-2 bg-slate-950 rounded border border-slate-800">
450
+ <div class="flex items-center gap-2">
451
+ <div class="w-2 h-2 rounded-full bg-blue-500"></div>
452
+ <span class="text-sm text-slate-300">DeepSeek R1 T2</span>
453
+ </div>
454
+ <span class="text-xs text-green-400 font-mono">ONLINE</span>
455
+ </div>
456
+ <div class="flex items-center justify-between p-2 bg-slate-950 rounded border border-slate-800">
457
+ <div class="flex items-center gap-2">
458
+ <div class="w-2 h-2 rounded-full bg-purple-500"></div>
459
+ <span class="text-sm text-slate-300">Mistral Small 24B</span>
460
+ </div>
461
+ <span class="text-xs text-green-400 font-mono">ONLINE</span>
462
+ </div>
463
+ <div class="flex items-center justify-between p-2 bg-slate-950 rounded border border-slate-800">
464
+ <div class="flex items-center gap-2">
465
+ <div class="w-2 h-2 rounded-full text-military-500 bg-military-500"></div>
466
+ <span class="text-sm text-slate-300">Gemma 3B</span>
467
+ </div>
468
+ <span class="text-xs text-green-400 font-mono">ONLINE</span>
469
+ </div>
470
+ </div>
471
+ </div>
472
+
473
+ <!-- Reasoning Trace -->
474
+ <div class="bg-slate-900/50 border border-slate-800 rounded-lg p-4 flex-1">
475
+ <h3 class="text-sm font-semibold text-white mb-4 flex items-center gap-2">
476
+ <i data-feather="activity" class="text-military-500"></i>
477
+ Reasoning Trace
478
+ </h3>
479
+ <div id="reasoning-trace" class="space-y-2 font-mono text-xs">
480
+ <div class="text-slate-500 italic">Awaiting cognitive query...</div>
481
+ </div>
482
+ </div>
483
+
484
+ <!-- Performance Metrics -->
485
+ <div class="bg-slate-900/50 border border-slate-800 rounded-lg p-4">
486
+ <h3 class="text-sm font-semibold text-white mb-3">Latency Metrics</h3>
487
+ <div class="space-y-2">
488
+ <div>
489
+ <div class="flex justify-between text-xs mb-1">
490
+ <span class="text-slate-400">Token Generation</span>
491
+ <span class="text-blue-400 font-mono" id="token-latency">24ms</span>
492
+ </div>
493
+ <div class="w-full bg-slate-800 rounded-full h-1">
494
+ <div class="bg-blue-500 h-1 rounded-full transition-all" style="width: 45%" id="token-bar"></div>
495
+ </div>
496
+ </div>
497
+ <div>
498
+ <div class="flex justify-between text-xs mb-1">
499
+ <span class="text-slate-400">Reasoning Steps</span>
500
+ <span class="text-military-500 font-mono" id="reasoning-steps">3/5</span>
501
+ </div>
502
+ <div class="w-full bg-slate-800 rounded-full h-1">
503
+ <div class="bg-military-500 h-1 rounded-full transition-all" style="width: 60%" id="reasoning-bar"></div>
504
+ </div>
505
+ </div>
506
+ </div>
507
+ </div>
508
+ </div>
509
+ </div>
510
+ </section>
511
+
512
  <!-- System Config View -->
513
  <section id="view-config" class="hidden space-y-6 fade-in">
514
  <header class="mb-6">
515
+ <h1 class="text-3xl font-bold text-white tracking-wide uppercase flex items-center gap-2">
516
  <i data-feather="settings" class="text-military-500"></i>
517
  System Configuration
518
  </h1>
 
864
  <script src="components/ops-status-card.js"></script>
865
  <script src="components/tactical-algorithm.js"></script>
866
  <script src="components/anti-exposure-core.js"></script>
867
+ <script src="components/cognitive-core.js"></script>
868
  <!-- Main Logic -->
869
  <script src="script.js"></script>
870
  <script>feather.replace();</script>
script.js CHANGED
@@ -627,9 +627,87 @@ class CRMManager {
627
  }
628
  }
629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  // --- Initialize Systems ---
631
  document.addEventListener('DOMContentLoaded', () => {
632
- // Initialize security
 
 
 
633
  const securityManager = new SecurityManager();
634
  const guardrails = new LLMGuardrails();
635
  const auditLogger = new AuditLogger('audit-log-container');
@@ -661,6 +739,7 @@ document.addEventListener('DOMContentLoaded', () => {
661
  'generator': document.getElementById('view-generator'),
662
  'memory': document.getElementById('view-memory'),
663
  'anti-exposure': document.getElementById('view-anti-exposure'),
 
664
  'config': document.getElementById('view-config'),
665
  'settings': document.getElementById('view-config')
666
  };
@@ -705,6 +784,39 @@ document.addEventListener('DOMContentLoaded', () => {
705
  }, 5000);
706
  }
707
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  }, 300);
709
  // Log navigation
710
  auditLogger.addLog({
 
627
  }
628
  }
629
 
630
+ // --- AI Orchestration System ---
631
+ class AIOrchestrator {
632
+ constructor() {
633
+ this.models = {
634
+ deepseek: { name: 'DeepSeek R1 T2', status: 'online', latency: 24 },
635
+ mistral: { name: 'Mistral Small 24B', status: 'online', latency: 45 },
636
+ llama: { name: 'Llama 3.2 3B', status: 'online', latency: 18 },
637
+ gemma: { name: 'Gemma 3B', status: 'online', latency: 12 }
638
+ };
639
+ this.reasoningTrace = [];
640
+ this.activeModel = 'deepseek';
641
+ }
642
+
643
+ async orchestrateQuery(query, context = {}) {
644
+ const trace = [];
645
+ const startTime = performance.now();
646
+
647
+ // Step 1: Initial Analysis
648
+ trace.push({ step: 1, model: 'deepseek', action: 'Query Analysis', status: 'processing' });
649
+ await this.simulateLatency(this.models.deepseek.latency);
650
+ trace[0].status = 'complete';
651
+ trace[0].detail = `Analyzing: "${query.substring(0, 50)}..."`;
652
+
653
+ // Step 2: Context Retrieval
654
+ trace.push({ step: 2, model: 'mistral', action: 'Memory Retrieval', status: 'processing' });
655
+ await this.simulateLatency(this.models.mistral.latency);
656
+ trace[1].status = 'complete';
657
+ trace[1].detail = `Retrieved ${Math.floor(Math.random() * 5) + 1} relevant context items`;
658
+
659
+ // Step 3: Reasoning Chain
660
+ trace.push({ step: 3, model: 'deepseek', action: 'Chain-of-Thought', status: 'processing' });
661
+ await this.simulateLatency(this.models.deepseek.latency * 2);
662
+ trace[2].status = 'complete';
663
+ trace[2].detail = 'Generated reasoning steps: 5';
664
+
665
+ // Step 4: Synthesis
666
+ trace.push({ step: 4, model: 'gemma', action: 'Response Synthesis', status: 'processing' });
667
+ await this.simulateLatency(this.models.gemma.latency);
668
+ trace[3].status = 'complete';
669
+ trace[3].detail = 'Output formatted and validated';
670
+
671
+ const endTime = performance.now();
672
+ return {
673
+ trace,
674
+ totalLatency: Math.floor(endTime - startTime),
675
+ modelConsensus: 0.94,
676
+ guardrailScore: 0.99
677
+ };
678
+ }
679
+
680
+ simulateLatency(ms) {
681
+ return new Promise(resolve => setTimeout(resolve, ms));
682
+ }
683
+
684
+ updateReasoningTraceUI(trace) {
685
+ const container = document.getElementById('reasoning-trace');
686
+ if (!container) return;
687
+
688
+ container.innerHTML = trace.map((step, idx) => `
689
+ <div class="flex items-start gap-2 p-2 rounded ${step.status === 'complete' ? 'bg-slate-800/50' : 'bg-blue-900/20'} animate-fade-in" style="animation-delay: ${idx * 0.1}s">
690
+ <div class="w-5 h-5 rounded-full ${step.status === 'complete' ? 'bg-green-500/20 text-green-400' : 'bg-blue-500/20 text-blue-400 animate-pulse'} flex items-center justify-center text-xs font-bold border ${step.status === 'complete' ? 'border-green-500/50' : 'border-blue-500/50'}">
691
+ ${step.step}
692
+ </div>
693
+ <div class="flex-1">
694
+ <div class="flex justify-between items-center">
695
+ <span class="text-xs font-semibold ${step.status === 'complete' ? 'text-slate-300' : 'text-blue-400'}">${step.action}</span>
696
+ <span class="text-xs text-slate-500 font-mono">${step.model}</span>
697
+ </div>
698
+ ${step.detail ? `<div class="text-xs text-slate-500 mt-1">${step.detail}</div>` : ''}
699
+ </div>
700
+ </div>
701
+ `).join('');
702
+ }
703
+ }
704
+
705
  // --- Initialize Systems ---
706
  document.addEventListener('DOMContentLoaded', () => {
707
+ // Initialize AI Orchestrator
708
+ const aiOrchestrator = new AIOrchestrator();
709
+
710
+ // Initialize security
711
  const securityManager = new SecurityManager();
712
  const guardrails = new LLMGuardrails();
713
  const auditLogger = new AuditLogger('audit-log-container');
 
739
  'generator': document.getElementById('view-generator'),
740
  'memory': document.getElementById('view-memory'),
741
  'anti-exposure': document.getElementById('view-anti-exposure'),
742
+ 'cognitive': document.getElementById('view-cognitive'),
743
  'config': document.getElementById('view-config'),
744
  'settings': document.getElementById('view-config')
745
  };
 
784
  }, 5000);
785
  }
786
  }
787
+
788
+ // Initialize Cognitive Core if needed
789
+ if (target === 'cognitive') {
790
+ const cognitiveCore = document.getElementById('main-cognitive-core');
791
+ if (cognitiveCore) {
792
+ // Listen for cognitive events
793
+ cognitiveCore.addEventListener('message-sent', async (e) => {
794
+ const query = e.detail.message;
795
+
796
+ // Update reasoning trace
797
+ const traceContainer = document.getElementById('reasoning-trace');
798
+ traceContainer.innerHTML = '<div class="text-blue-400 animate-pulse">Processing query through federation...</div>';
799
+
800
+ // Run orchestration
801
+ const result = await aiOrchestrator.orchestrateQuery(query);
802
+ aiOrchestrator.updateReasoningTraceUI(result.trace);
803
+
804
+ // Update metrics
805
+ document.getElementById('token-latency').textContent = result.totalLatency + 'ms';
806
+ document.getElementById('token-bar').style.width = Math.min((result.totalLatency / 200) * 100, 100) + '%';
807
+ document.getElementById('reasoning-steps').textContent = '5/5';
808
+ document.getElementById('reasoning-bar').style.width = '100%';
809
+
810
+ // Log to audit
811
+ auditLogger.addLog({
812
+ event: 'COGNITIVE_QUERY',
813
+ user: 'CurrentUser',
814
+ status: 'PROCESSED',
815
+ details: `Latency: ${result.totalLatency}ms, Consensus: ${result.modelConsensus}`
816
+ });
817
+ });
818
+ }
819
+ }
820
  }, 300);
821
  // Log navigation
822
  auditLogger.addLog({
style.css CHANGED
@@ -435,3 +435,57 @@ body {
435
  animation: alertPulse 1s infinite;
436
  }
437
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  animation: alertPulse 1s infinite;
436
  }
437
 
438
+ /* Cognitive Core Animations */
439
+ @keyframes neuralPulse {
440
+ 0%, 100% {
441
+ box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
442
+ border-color: rgba(59, 130, 246, 0.3);
443
+ }
444
+ 50% {
445
+ box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
446
+ border-color: rgba(59, 130, 246, 0.5);
447
+ }
448
+ }
449
+
450
+ .cognitive-active {
451
+ animation: neuralPulse 3s infinite;
452
+ }
453
+
454
+ /* Reasoning Trace Animations */
455
+ .reasoning-step {
456
+ transition: all 0.3s ease;
457
+ border-left: 2px solid transparent;
458
+ }
459
+
460
+ .reasoning-step.processing {
461
+ border-left-color: #3b82f6;
462
+ background: rgba(59, 130, 246, 0.05);
463
+ }
464
+
465
+ .reasoning-step.complete {
466
+ border-left-color: #22c55e;
467
+ background: rgba(34, 197, 94, 0.05);
468
+ }
469
+
470
+ /* AI Orchestration Visualizer */
471
+ .orchestration-node {
472
+ position: relative;
473
+ transition: all 0.3s ease;
474
+ }
475
+
476
+ .orchestration-node.active::after {
477
+ content: '';
478
+ position: absolute;
479
+ inset: -2px;
480
+ border-radius: inherit;
481
+ background: linear-gradient(45deg, #3b82f6, #8b5cf6, #22c55e);
482
+ opacity: 0.5;
483
+ z-index: -1;
484
+ animation: rotate 3s linear infinite;
485
+ }
486
+
487
+ @keyframes rotate {
488
+ from { transform: rotate(0deg); }
489
+ to { transform: rotate(360deg); }
490
+ }
491
+