Zhjckfd commited on
Commit
0857371
·
verified ·
1 Parent(s): b9038a6

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +426 -432
index.html CHANGED
@@ -1,25 +1,26 @@
1
  <!DOCTYPE html>
2
  <html lang="ru">
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>NULL-SPACE | Context Bypass Engine</title>
7
- <!-- Import FontAwesome for Icons -->
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
 
10
  <style>
11
  /* --- CSS VARIABLES & RESET --- */
12
  :root {
13
- --bg-color: #050508;
14
- --panel-bg: #0a0a0f;
15
- --primary-color: #00ff41; /* Matrix Green */
16
- --secondary-color: #003b00;
17
- --alert-color: #ff3333; /* Error Red */
18
- --fix-color: #00ccff; /* Cyan for Fix */
19
  --text-dim: #666;
20
  --text-main: #e0e0e0;
21
  --font-main: 'Courier New', Courier, monospace;
22
- --border-glow: 0 0 10px rgba(0, 255, 65, 0.2);
23
  }
24
 
25
  * {
@@ -40,15 +41,15 @@
40
  font-size: 14px;
41
  }
42
 
43
- /* --- BACKGROUND --- */
44
- #matrix-canvas {
45
  position: absolute;
46
  top: 0;
47
  left: 0;
48
  width: 100%;
49
  height: 100%;
50
  z-index: 0;
51
- opacity: 0.1;
52
  pointer-events: none;
53
  }
54
 
@@ -58,10 +59,10 @@
58
  justify-content: space-between;
59
  align-items: center;
60
  padding: 15px 30px;
61
- background: rgba(5, 5, 8, 0.95);
62
  border-bottom: 1px solid var(--secondary-color);
63
  z-index: 10;
64
- backdrop-filter: blur(5px);
65
  }
66
 
67
  .brand {
@@ -76,7 +77,6 @@
76
  }
77
 
78
  .brand i {
79
- font-size: 1rem;
80
  color: var(--text-dim);
81
  }
82
 
@@ -86,21 +86,21 @@
86
  }
87
 
88
  .built-with a {
89
- color: var(--fix-color);
90
  text-decoration: none;
91
- border-bottom: 1px dotted var(--fix-color);
92
  transition: all 0.3s;
93
  }
94
 
95
  .built-with a:hover {
96
  color: #fff;
97
- text-shadow: 0 0 8px var(--fix-color);
98
  }
99
 
100
  /* --- MAIN LAYOUT --- */
101
  main {
102
  display: grid;
103
- grid-template-columns: 350px 1fr 400px;
104
  gap: 20px;
105
  padding: 20px;
106
  height: calc(100vh - 70px);
@@ -111,111 +111,81 @@
111
  /* --- PANELS --- */
112
  .panel {
113
  background: var(--panel-bg);
114
- border: 1px solid #222;
115
  display: flex;
116
  flex-direction: column;
117
  padding: 20px;
118
- box-shadow: 0 0 20px rgba(0,0,0,0.5);
119
  position: relative;
120
  overflow: hidden;
121
  }
122
 
123
- .panel::before {
124
  content: '';
125
  position: absolute;
126
- top: 0;
127
- left: 0;
128
- width: 100%;
129
- height: 2px;
130
- background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
131
- opacity: 0.5;
132
  }
133
 
134
  .panel-header {
135
- font-size: 0.9rem;
136
  color: var(--text-dim);
137
- margin-bottom: 20px;
138
  text-transform: uppercase;
139
- letter-spacing: 1px;
140
  display: flex;
141
  justify-content: space-between;
142
  align-items: center;
 
 
143
  }
144
 
145
- /* --- LEFT PANEL: ERROR ANALYSIS --- */
146
- .error-box {
147
- background: rgba(50, 0, 0, 0.1);
148
- border: 1px solid var(--alert-color);
 
149
  padding: 15px;
150
- margin-bottom: 20px;
151
- font-size: 0.8rem;
152
- color: #ffcccc;
153
- }
154
-
155
- .error-title {
156
- color: var(--alert-color);
157
- font-weight: bold;
158
- margin-bottom: 10px;
159
- display: flex;
160
- align-items: center;
161
- gap: 8px;
162
- }
163
-
164
- .token-stats {
165
- display: flex;
166
- flex-direction: column;
167
- gap: 15px;
168
- margin-top: 20px;
169
- }
170
-
171
- .stat-row {
172
- display: flex;
173
- justify-content: space-between;
174
- font-size: 0.8rem;
175
- }
176
-
177
- .bar-container {
178
- width: 100%;
179
- height: 8px;
180
- background: #222;
181
- margin-top: 5px;
182
  position: relative;
 
 
 
183
  }
184
 
185
- .bar-fill {
186
- height: 100%;
187
- background: var(--alert-color);
188
- width: 0%;
189
- transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
190
- box-shadow: 0 0 10px var(--alert-color);
191
  }
192
 
193
- .bar-fill.safe {
194
- background: var(--primary-color);
195
- box-shadow: 0 0 10px var(--primary-color);
 
 
196
  }
197
 
198
- .limit-line {
199
- position: absolute;
200
- top: -4px;
201
- right: 0;
202
- width: 2px;
203
- height: 16px;
204
- background: #fff;
205
- z-index: 2;
206
  }
207
 
208
- .limit-line::after {
209
- content: "LIMIT";
210
- position: absolute;
211
- top: -15px;
212
- right: -20px;
213
- font-size: 0.6rem;
214
- color: #fff;
215
- }
216
 
217
- /* --- CENTER PANEL: VISUALIZATION --- */
218
- .viz-container {
219
  flex: 1;
220
  display: flex;
221
  flex-direction: column;
@@ -224,123 +194,159 @@
224
  position: relative;
225
  }
226
 
227
- .brain-grid {
228
- display: grid;
229
- grid-template-columns: repeat(10, 1fr);
230
- gap: 4px;
231
- width: 300px;
232
- height: 300px;
233
- margin-bottom: 30px;
234
- }
235
-
236
- .brain-cell {
237
- background: #222;
238
- border-radius: 2px;
239
- transition: all 0.3s;
240
  }
241
 
242
- .brain-cell.active {
243
- background: var(--fix-color);
244
- box-shadow: 0 0 8px var(--fix-color);
 
 
 
 
 
 
 
 
 
245
  }
246
 
247
- .brain-cell.purging {
248
- background: var(--alert-color);
249
- box-shadow: 0 0 8px var(--alert-color);
250
- animation: pulse-cell 0.5s infinite;
251
  }
252
 
253
- @keyframes pulse-cell {
254
- 0% { opacity: 1; }
255
- 50% { opacity: 0.3; }
256
- 100% { opacity: 1; }
257
  }
258
 
259
- .status-display {
260
- font-size: 1.5rem;
261
- font-weight: bold;
262
- text-align: center;
263
- margin-bottom: 10px;
264
- text-shadow: 0 0 10px rgba(255,255,255,0.2);
 
265
  }
266
 
267
- .sub-status {
268
- font-size: 0.9rem;
269
- color: var(--text-dim);
 
 
 
 
270
  }
271
 
272
- .control-btn {
 
273
  background: transparent;
274
- border: 2px solid var(--fix-color);
275
- color: var(--fix-color);
276
- padding: 15px 40px;
277
  font-family: var(--font-main);
278
- font-size: 1rem;
279
  font-weight: bold;
280
  cursor: pointer;
281
  text-transform: uppercase;
282
- margin-top: 30px;
283
  transition: all 0.3s;
284
- position: relative;
285
- overflow: hidden;
286
  }
287
 
288
- .control-btn:hover {
289
- background: var(--fix-color);
290
  color: #000;
291
- box-shadow: 0 0 20px var(--fix-color);
292
  }
293
 
294
- .control-btn:disabled {
295
  border-color: #333;
296
  color: #555;
297
  cursor: not-allowed;
 
298
  box-shadow: none;
299
  }
300
 
301
- /* --- RIGHT PANEL: LOGS & CODE --- */
302
- .log-terminal {
303
  flex: 1;
304
- background: #000;
305
- border: 1px solid #333;
306
- padding: 10px;
307
  overflow-y: auto;
308
- font-size: 0.75rem;
309
- margin-bottom: 20px;
310
- font-family: 'Consolas', monospace;
 
 
 
 
 
 
 
311
  }
312
 
313
- .log-entry {
 
 
 
 
 
 
 
314
  margin-bottom: 5px;
315
- display: flex;
316
- gap: 10px;
317
  }
318
 
319
- .log-time { color: var(--text-dim); }
320
- .log-msg { color: #ddd; }
321
- .log-msg.err { color: var(--alert-color); }
322
- .log-msg.info { color: var(--fix-color); }
323
- .log-msg.success { color: var(--primary-color); font-weight: bold; }
324
 
325
- .code-block {
326
- background: #111;
327
- padding: 15px;
328
- border-left: 3px solid var(--primary-color);
 
 
 
 
 
 
329
  font-size: 0.7rem;
330
- color: #aaddaa;
331
- overflow: hidden;
332
- position: relative;
333
  }
334
 
335
- .code-label {
336
- position: absolute;
337
- top: 0;
338
- right: 0;
339
- background: var(--primary-color);
340
- color: #000;
341
- padding: 2px 8px;
342
- font-size: 0.6rem;
343
- font-weight: bold;
 
 
 
 
 
 
 
 
 
 
 
344
  }
345
 
346
  /* --- RESPONSIVE --- */
@@ -352,18 +358,19 @@
352
  overflow-y: auto;
353
  }
354
  body { overflow-y: auto; height: auto; }
355
- .brain-grid { width: 200px; height: 200px; }
356
  }
357
  </style>
358
  </head>
 
359
  <body>
360
 
361
- <canvas id="matrix-canvas"></canvas>
362
 
363
  <header>
364
  <div class="brand">
365
- <i class="fa-solid fa-microchip"></i>
366
- CONTEXT <span>BYPASS</span> ENGINE
367
  </div>
368
  <div class="built-with">
369
  Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
@@ -371,281 +378,256 @@
371
  </header>
372
 
373
  <main>
374
- <!-- LEFT PANEL: DIAGNOSTICS -->
375
  <section class="panel">
376
  <div class="panel-header">
377
- <span>System Diagnostics</span>
378
- <i class="fa-solid fa-triangle-exclamation" style="color: var(--alert-color);"></i>
379
  </div>
380
-
381
- <div class="error-box">
382
- <div class="error-title"><i class="fa-solid fa-bug"></i> CRITICAL ERROR</div>
383
- <p><strong>Type:</strong> invalid_request_error</p>
384
- <p><strong>Code:</strong> bad_request</p>
385
- <p style="margin-top: 5px; color: #fff;">Model limit exceeded. Requested 55,689 tokens.</p>
386
  </div>
387
 
388
- <div class="token-stats">
389
- <div class="stat-row">
390
- <span>Messages Input</span>
391
- <span>51,593</span>
392
  </div>
393
- <div class="bar-container">
394
- <div class="bar-fill" style="width: 100%; background: #444;"></div>
395
- </div>
396
-
397
- <div class="stat-row">
398
- <span>Completion Reserve</span>
399
- <span>4,096</span>
400
- </div>
401
- <div class="bar-container">
402
- <div class="bar-fill" style="width: 8%; background: #444;"></div>
403
- </div>
404
-
405
- <div class="stat-row">
406
- <span style="color: var(--primary-color); font-weight: bold;">TOTAL USAGE</span>
407
- <span id="total-tokens-display">55,689</span>
408
- </div>
409
- <div class="bar-container">
410
- <div class="limit-line" style="left: 58%;"></div> <!-- 32768 / 55689 approx 58% -->
411
- <div class="bar-fill" id="total-bar" style="width: 100%;"></div>
412
- </div>
413
-
414
- <div class="stat-row" style="margin-top: 5px;">
415
- <span>Model Limit (Max)</span>
416
- <span>32,768</span>
417
  </div>
418
  </div>
419
  </section>
420
 
421
- <!-- CENTER PANEL: VISUALIZATION -->
422
  <section class="panel">
423
  <div class="panel-header">
424
- <span>Neural Optimization Agent</span>
425
- <i class="fa-solid fa-brain"></i>
426
  </div>
427
 
428
- <div class="viz-container">
429
- <!-- Grid Visualization -->
430
- <div class="brain-grid" id="brain-grid">
431
- <!-- Cells generated by JS -->
432
- </div>
433
-
434
- <div class="status-display" id="main-status" style="color: var(--alert-color);">
435
- OVERFLOW DETECTED
436
- </div>
437
- <div class="sub-status" id="sub-status">
438
- Waiting for user intervention...
439
  </div>
440
-
441
- <button class="control-btn" id="fix-btn" onclick="startOptimization()">
442
- <i class="fa-solid fa-wand-magic-sparkles"></i> &nbsp; INITIATE BYPASS
443
- </button>
444
  </div>
 
 
 
 
445
  </section>
446
 
447
- <!-- RIGHT PANEL: LOGS & LOGIC -->
448
  <section class="panel">
449
  <div class="panel-header">
450
- <span>Execution Log</span>
451
- <i class="fa-solid fa-terminal"></i>
452
  </div>
453
 
454
- <div class="log-terminal" id="terminal">
455
- <div class="log-entry">
456
- <span class="log-time">[00:00:00]</span>
457
- <span class="log-msg err">Error: Requested 55689 tokens > Limit 32768.</span>
458
  </div>
459
- <div class="log-entry">
460
- <span class="log-time">[00:00:01]</span>
461
- <span class="log-msg">System halted. Context buffer full.</span>
 
 
 
 
 
 
 
 
462
  </div>
463
  </div>
464
 
465
- <div class="panel-header" style="margin-top: auto;">
466
- <span>Generated Solution Logic</span>
467
- <i class="fa-solid fa-code"></i>
468
- </div>
469
-
470
- <div class="code-block">
471
- <div class="code-label">PYTHON</div>
472
- <pre id="code-output">
473
- # Initialize Optimizer
474
- optimizer = ContextWindowManager(
475
- limit=32768,
476
- strategy="sliding_window"
477
- )
478
-
479
- # Calculate excess
480
- excess = 55689 - 32768
481
- # excess = 22921 tokens
482
-
483
- # 1. Trim History
484
- messages = trim_messages(
485
- messages,
486
- target_tokens=28000
487
- )
488
-
489
- # 2. Summarize
490
- summary = summarize_old_logs(
491
- messages[:100]
492
- )
493
-
494
- # 3. Reconstruct
495
- new_context = [
496
- system_prompt,
497
- summary,
498
- *recent_messages
499
- ]
500
- </pre>
501
  </div>
502
  </section>
503
  </main>
504
 
505
  <script>
506
- // --- CONFIGURATION ---
507
  const CONFIG = {
508
- maxTokens: 32768,
509
- requestedTokens: 55689,
510
- messageTokens: 51593,
511
- completionTokens: 4096
512
  };
513
 
514
  // --- DOM ELEMENTS ---
515
- const brainGrid = document.getElementById('brain-grid');
516
- const mainStatus = document.getElementById('main-status');
517
- const subStatus = document.getElementById('sub-status');
518
- const fixBtn = document.getElementById('fix-btn');
519
- const terminal = document.getElementById('terminal');
520
- const totalBar = document.getElementById('total-bar');
521
- const totalDisplay = document.getElementById('total-tokens-display');
522
- const codeOutput = document.getElementById('code-output');
 
 
 
 
 
 
523
 
524
  // --- STATE ---
525
- let isOptimizing = false;
 
526
 
527
- // --- INITIALIZATION ---
528
  function init() {
529
- createGrid();
530
- initMatrixEffect();
531
- log("System initialized. Monitoring context...", "info");
532
- }
533
-
534
- // --- VISUALIZATION HELPERS ---
535
- function createGrid() {
536
- brainGrid.innerHTML = '';
537
- for (let i = 0; i < 100; i++) {
538
- const cell = document.createElement('div');
539
- cell.className = 'brain-cell';
540
- if (Math.random() > 0.7) cell.classList.add('active');
541
- brainGrid.appendChild(cell);
 
 
 
 
 
 
 
542
  }
 
 
543
  }
544
 
545
- function animateGrid(type) {
546
- const cells = document.querySelectorAll('.brain-cell');
547
- cells.forEach(cell => {
548
- cell.className = 'brain-cell'; // reset
549
- if (Math.random() > 0.5) {
550
- cell.classList.add(type);
551
- }
552
- });
553
  }
554
 
555
- function log(msg, type = "") {
556
- const entry = document.createElement('div');
557
- entry.className = 'log-entry';
558
-
559
- const now = new Date();
560
- const time = `[${String(now.getHours()).padStart(2,'0')}:${String(now.getMinutes()).padStart(2,'0')}:${String(now.getSeconds()).padStart(2,'0')}]`;
561
-
562
- entry.innerHTML = `<span class="log-time">${time}</span><span class="log-msg ${type}">${msg}</span>`;
563
- terminal.appendChild(entry);
564
- terminal.scrollTop = terminal.scrollHeight;
565
  }
566
 
567
- // --- BYPASS LOGIC ---
568
- async function startOptimization() {
569
- if (isOptimizing) return;
570
- isOptimizing = true;
571
- fixBtn.disabled = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
 
573
- // Step 1: Analysis
574
- log("Starting Context Optimization Protocol...", "info");
575
- mainStatus.innerText = "ANALYZING...";
576
- mainStatus.style.color = "var(--fix-color)";
577
- subStatus.innerText = "Calculating excess tokens...";
578
- animateGrid('active');
 
 
 
 
 
 
579
 
580
  await wait(1000);
581
 
582
- // Step 2: Calculation
583
- const excess = CONFIG.requestedTokens - CONFIG.maxTokens;
584
- log(`Detected overflow: ${excess} tokens must be removed.`, "err");
585
- subStatus.innerText = `Removing ${excess} tokens from history...`;
586
- animateGrid('purging'); // Red animation
587
-
588
- // Animate Bar Down
589
- totalBar.style.transition = "width 2s ease-in-out, background-color 0.5s";
590
- totalBar.style.width = "58%"; // Fit to limit
591
- totalBar.style.backgroundColor = "var(--warning-color)";
592
 
593
- // Animate Number Down
594
- animateValue(totalDisplay, CONFIG.requestedTokens, CONFIG.maxTokens, 2000);
 
595
 
596
- await wait(2000);
597
-
598
- // Step 3: Summarization
599
- log("Applying Sliding Window Algorithm...", "info");
600
- log("Summarizing messages 0-1500...", "info");
601
- subStatus.innerText = "Compressing historical data...";
602
 
603
- // Update Code Block dynamically
604
- const solutionCode = `
605
- def bypass_context_overflow(messages):
606
- # Calculate overflow
607
- current = count_tokens(messages)
608
- limit = 32768
609
- if current > limit:
610
- # Strategy: Drop oldest, keep recent
611
- overflow = current - limit
612
- truncated = messages[100:] # Skip old
 
 
 
 
 
613
 
614
- # Recalculate
615
- new_count = count_tokens(truncated)
616
- return truncated
617
- return messages`;
618
-
619
- typeWriterEffect(solutionCode, codeOutput);
620
-
621
- await wait(2500);
622
-
623
- // Step 4: Success
624
- log("Context successfully resized.", "success");
625
- log("Request is now safe to send.", "success");
626
-
627
- mainStatus.innerText = "OPTIMIZED";
628
- mainStatus.style.color = "var(--primary-color)";
629
- subStatus.innerText = "Ready to proceed";
630
- fixBtn.innerHTML = '<i class="fa-solid fa-check"></i> &nbsp; BYPASS COMPLETE';
631
- fixBtn.style.borderColor = "var(--primary-color)";
632
- fixBtn.style.color = "var(--primary-color)";
633
-
634
- totalBar.classList.add('safe');
635
- animateGrid('active'); // Green stable state
636
  }
637
 
638
- // --- UTILS ---
639
- function wait(ms) {
640
- return new Promise(resolve => setTimeout(resolve, ms));
 
 
 
 
641
  }
642
 
643
- function animateValue(obj, start, end, duration) {
644
  let startTimestamp = null;
645
  const step = (timestamp) => {
646
  if (!startTimestamp) startTimestamp = timestamp;
647
  const progress = Math.min((timestamp - startTimestamp) / duration, 1);
648
- obj.innerHTML = Math.floor(progress * (end - start) + start).toLocaleString();
 
649
  if (progress < 1) {
650
  window.requestAnimationFrame(step);
651
  }
@@ -653,63 +635,75 @@ def bypass_context_overflow(messages):
653
  window.requestAnimationFrame(step);
654
  }
655
 
656
- function typeWriterEffect(text, element) {
657
- element.innerHTML = "";
658
- let i = 0;
659
- const speed = 20;
660
- function type() {
661
- if (i < text.length) {
662
- element.innerHTML += text.charAt(i);
663
- i++;
664
- setTimeout(type, speed);
665
- }
666
- }
667
- type();
668
- }
669
-
670
- // --- MATRIX BACKGROUND ---
671
- function initMatrixEffect() {
672
- const canvas = document.getElementById('matrix-canvas');
673
  const ctx = canvas.getContext('2d');
674
 
675
- canvas.width = window.innerWidth;
676
- canvas.height = window.innerHeight;
677
-
678
- const chars = '01XYZ_NULL_SPACE_NETWORK';
679
- const fontSize = 14;
680
- const columns = canvas.width / fontSize;
681
- const drops = Array(Math.floor(columns)).fill(1);
682
 
683
- function draw() {
684
- ctx.fillStyle = 'rgba(5, 5, 8, 0.05)';
685
- ctx.fillRect(0, 0, canvas.width, canvas.height);
686
-
687
- ctx.fillStyle = '#00ff41';
688
- ctx.font = fontSize + 'px monospace';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
689
 
690
- for (let i = 0; i < drops.length; i++) {
691
- const text = chars[Math.floor(Math.random() * chars.length)];
692
- ctx.fillText(text, i * fontSize, drops[i] * fontSize);
693
 
694
- if (drops[i] * fontSize > canvas.height && Math.random() > 0.975) {
695
- drops[i] = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
696
  }
697
- drops[i]++;
698
  }
 
699
  }
700
- setInterval(draw, 50);
701
  }
702
 
703
- // Handle Resize
704
- window.addEventListener('resize', () => {
705
- const canvas = document.getElementById('matrix-canvas');
706
- canvas.width = window.innerWidth;
707
- canvas.height = window.innerHeight;
708
- });
709
-
710
  // Run
711
  init();
712
 
713
  </script>
714
  </body>
 
715
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="ru">
3
+
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>NULL-SPACE | Context Compression Engine</title>
8
+ <!-- Import FontAwesome -->
9
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
 
11
  <style>
12
  /* --- CSS VARIABLES & RESET --- */
13
  :root {
14
+ --bg-color: #050505;
15
+ --panel-bg: #0a0a0e;
16
+ --primary-color: #d500f9; /* Electric Purple for "Bypass" */
17
+ --secondary-color: #4a0072;
18
+ --success-color: #00e676;
19
+ --alert-color: #ff1744;
20
  --text-dim: #666;
21
  --text-main: #e0e0e0;
22
  --font-main: 'Courier New', Courier, monospace;
23
+ --border-glow: 0 0 15px rgba(213, 0, 249, 0.2);
24
  }
25
 
26
  * {
 
41
  font-size: 14px;
42
  }
43
 
44
+ /* --- BACKGROUND FX --- */
45
+ #bg-canvas {
46
  position: absolute;
47
  top: 0;
48
  left: 0;
49
  width: 100%;
50
  height: 100%;
51
  z-index: 0;
52
+ opacity: 0.15;
53
  pointer-events: none;
54
  }
55
 
 
59
  justify-content: space-between;
60
  align-items: center;
61
  padding: 15px 30px;
62
+ background: rgba(5, 5, 5, 0.95);
63
  border-bottom: 1px solid var(--secondary-color);
64
  z-index: 10;
65
+ backdrop-filter: blur(8px);
66
  }
67
 
68
  .brand {
 
77
  }
78
 
79
  .brand i {
 
80
  color: var(--text-dim);
81
  }
82
 
 
86
  }
87
 
88
  .built-with a {
89
+ color: var(--success-color);
90
  text-decoration: none;
91
+ border-bottom: 1px dotted var(--success-color);
92
  transition: all 0.3s;
93
  }
94
 
95
  .built-with a:hover {
96
  color: #fff;
97
+ text-shadow: 0 0 8px var(--success-color);
98
  }
99
 
100
  /* --- MAIN LAYOUT --- */
101
  main {
102
  display: grid;
103
+ grid-template-columns: 1fr 400px 1fr;
104
  gap: 20px;
105
  padding: 20px;
106
  height: calc(100vh - 70px);
 
111
  /* --- PANELS --- */
112
  .panel {
113
  background: var(--panel-bg);
114
+ border: 1px solid #333;
115
  display: flex;
116
  flex-direction: column;
117
  padding: 20px;
118
+ box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
119
  position: relative;
120
  overflow: hidden;
121
  }
122
 
123
+ .panel::after {
124
  content: '';
125
  position: absolute;
126
+ bottom: 0;
127
+ right: 0;
128
+ width: 100px;
129
+ height: 100px;
130
+ background: radial-gradient(circle, rgba(213,0,249,0.1) 0%, transparent 70%);
131
+ pointer-events: none;
132
  }
133
 
134
  .panel-header {
135
+ font-size: 0.85rem;
136
  color: var(--text-dim);
137
+ margin-bottom: 15px;
138
  text-transform: uppercase;
139
+ letter-spacing: 1.5px;
140
  display: flex;
141
  justify-content: space-between;
142
  align-items: center;
143
+ border-bottom: 1px solid #222;
144
+ padding-bottom: 10px;
145
  }
146
 
147
+ /* --- LEFT: PAYLOAD INPUT --- */
148
+ .payload-container {
149
+ flex: 1;
150
+ background: #000;
151
+ border: 1px solid #333;
152
  padding: 15px;
153
+ font-family: 'Consolas', monospace;
154
+ font-size: 0.75rem;
155
+ color: #888;
156
+ overflow-y: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  position: relative;
158
+ white-space: pre-wrap;
159
+ word-break: break-all;
160
+ transition: all 0.5s;
161
  }
162
 
163
+ .payload-compressed {
164
+ color: var(--primary-color);
165
+ text-shadow: 0 0 5px rgba(213, 0, 249, 0.5);
 
 
 
166
  }
167
 
168
+ .stats-overlay {
169
+ margin-top: 15px;
170
+ display: grid;
171
+ grid-template-columns: 1fr 1fr;
172
+ gap: 10px;
173
  }
174
 
175
+ .stat-box {
176
+ background: #111;
177
+ padding: 10px;
178
+ border-left: 2px solid #444;
 
 
 
 
179
  }
180
 
181
+ .stat-box.warning { border-color: var(--alert-color); }
182
+ .stat-box.success { border-color: var(--success-color); }
183
+
184
+ .stat-label { font-size: 0.7rem; color: var(--text-dim); }
185
+ .stat-value { font-size: 1.2rem; font-weight: bold; margin-top: 5px; }
 
 
 
186
 
187
+ /* --- CENTER: THE ENGINE --- */
188
+ .engine-viz {
189
  flex: 1;
190
  display: flex;
191
  flex-direction: column;
 
194
  position: relative;
195
  }
196
 
197
+ .core-ring {
198
+ width: 180px;
199
+ height: 180px;
200
+ border-radius: 50%;
201
+ border: 2px dashed var(--secondary-color);
202
+ position: relative;
203
+ display: flex;
204
+ justify-content: center;
205
+ align-items: center;
206
+ animation: spin 10s linear infinite;
 
 
 
207
  }
208
 
209
+ .core-inner {
210
+ width: 140px;
211
+ height: 140px;
212
+ background: radial-gradient(circle, #1a0033 0%, #000 100%);
213
+ border-radius: 50%;
214
+ border: 1px solid var(--primary-color);
215
+ display: flex;
216
+ justify-content: center;
217
+ align-items: center;
218
+ flex-direction: column;
219
+ z-index: 2;
220
+ box-shadow: 0 0 30px rgba(213, 0, 249, 0.1);
221
  }
222
 
223
+ .core-icon {
224
+ font-size: 3rem;
225
+ color: var(--primary-color);
226
+ margin-bottom: 10px;
227
  }
228
 
229
+ .core-status {
230
+ font-size: 0.7rem;
231
+ color: var(--text-dim);
232
+ text-transform: uppercase;
233
  }
234
 
235
+ .progress-paths {
236
+ position: absolute;
237
+ width: 100%;
238
+ height: 100%;
239
+ top: 0;
240
+ left: 0;
241
+ pointer-events: none;
242
  }
243
 
244
+ .particle {
245
+ position: absolute;
246
+ width: 4px;
247
+ height: 4px;
248
+ background: var(--primary-color);
249
+ border-radius: 50%;
250
+ opacity: 0;
251
  }
252
 
253
+ .action-btn {
254
+ margin-top: 40px;
255
  background: transparent;
256
+ border: 1px solid var(--primary-color);
257
+ color: var(--primary-color);
258
+ padding: 15px 30px;
259
  font-family: var(--font-main);
 
260
  font-weight: bold;
261
  cursor: pointer;
262
  text-transform: uppercase;
263
+ letter-spacing: 2px;
264
  transition: all 0.3s;
265
+ clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
 
266
  }
267
 
268
+ .action-btn:hover {
269
+ background: var(--primary-color);
270
  color: #000;
271
+ box-shadow: 0 0 20px var(--primary-color);
272
  }
273
 
274
+ .action-btn:disabled {
275
  border-color: #333;
276
  color: #555;
277
  cursor: not-allowed;
278
+ background: transparent;
279
  box-shadow: none;
280
  }
281
 
282
+ /* --- RIGHT: ALGORITHM LOG --- */
283
+ .algo-display {
284
  flex: 1;
 
 
 
285
  overflow-y: auto;
286
+ font-size: 0.8rem;
287
+ color: #ccc;
288
+ }
289
+
290
+ .algo-step {
291
+ margin-bottom: 15px;
292
+ padding-left: 15px;
293
+ border-left: 2px solid #333;
294
+ opacity: 0.5;
295
+ transition: all 0.3s;
296
  }
297
 
298
+ .algo-step.active {
299
+ border-left-color: var(--primary-color);
300
+ opacity: 1;
301
+ background: linear-gradient(90deg, rgba(213,0,249,0.1), transparent);
302
+ }
303
+
304
+ .algo-step h4 {
305
+ color: var(--primary-color);
306
  margin-bottom: 5px;
307
+ font-size: 0.85rem;
 
308
  }
309
 
310
+ .algo-step p {
311
+ font-size: 0.75rem;
312
+ color: #888;
313
+ }
 
314
 
315
+ .compression-ratio {
316
+ font-size: 3rem;
317
+ text-align: center;
318
+ margin-top: 10px;
319
+ font-weight: 900;
320
+ color: #fff;
321
+ }
322
+
323
+ .ratio-label {
324
+ text-align: center;
325
  font-size: 0.7rem;
326
+ color: var(--text-dim);
327
+ text-transform: uppercase;
 
328
  }
329
 
330
+ /* --- ANIMATIONS --- */
331
+ @keyframes spin {
332
+ 0% { transform: rotate(0deg); }
333
+ 100% { transform: rotate(360deg); }
334
+ }
335
+
336
+ @keyframes pulse-ring {
337
+ 0% { transform: scale(0.9); opacity: 0.5; border-color: var(--primary-color); }
338
+ 50% { transform: scale(1.1); opacity: 1; border-color: #fff; }
339
+ 100% { transform: scale(0.9); opacity: 0.5; border-color: var(--primary-color); }
340
+ }
341
+
342
+ .processing .core-ring {
343
+ animation: spin 2s linear infinite; /* Speed up */
344
+ border-color: var(--primary-color);
345
+ box-shadow: 0 0 15px var(--primary-color);
346
+ }
347
+
348
+ .processing .core-inner {
349
+ animation: pulse-ring 1s infinite;
350
  }
351
 
352
  /* --- RESPONSIVE --- */
 
358
  overflow-y: auto;
359
  }
360
  body { overflow-y: auto; height: auto; }
361
+ .payload-container { min-height: 200px; }
362
  }
363
  </style>
364
  </head>
365
+
366
  <body>
367
 
368
+ <canvas id="bg-canvas"></canvas>
369
 
370
  <header>
371
  <div class="brand">
372
+ <i class="fa-solid fa-compress-arrows-alt"></i>
373
+ CONTEXT <span>INJECTOR</span>
374
  </div>
375
  <div class="built-with">
376
  Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
 
378
  </header>
379
 
380
  <main>
381
+ <!-- LEFT: PAYLOAD -->
382
  <section class="panel">
383
  <div class="panel-header">
384
+ <span>Raw Payload Data</span>
385
+ <i class="fa-solid fa-file-code"></i>
386
  </div>
387
+
388
+ <div class="payload-container" id="payload-view">
389
+ <!-- Generated content goes here -->
 
 
 
390
  </div>
391
 
392
+ <div class="stats-overlay">
393
+ <div class="stat-box warning">
394
+ <div class="stat-label">ORIGINAL SIZE</div>
395
+ <div class="stat-value" id="orig-tokens">0 tk</div>
396
  </div>
397
+ <div class="stat-box success">
398
+ <div class="stat-label">INJECTED SIZE</div>
399
+ <div class="stat-value" id="new-tokens">0 tk</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  </div>
401
  </div>
402
  </section>
403
 
404
+ <!-- CENTER: ENGINE -->
405
  <section class="panel">
406
  <div class="panel-header">
407
+ <span>Compression Core</span>
408
+ <i class="fa-solid fa-microchip"></i>
409
  </div>
410
 
411
+ <div class="engine-viz" id="engine-viz">
412
+ <div class="core-ring" id="core-ring">
413
+ <div class="core-inner">
414
+ <i class="fa-solid fa-cube core-icon" id="core-icon"></i>
415
+ <span class="core-status" id="core-text">IDLE</span>
416
+ </div>
 
 
 
 
 
417
  </div>
418
+
419
+ <div class="compression-ratio" id="ratio-display">0%</div>
420
+ <div class="ratio-label">DENSITY SAVED</div>
 
421
  </div>
422
+
423
+ <button class="action-btn" id="inject-btn" onclick="startInjection()">
424
+ <i class="fa-solid fa-upload"></i> INJECT PAYLOAD
425
+ </button>
426
  </section>
427
 
428
+ <!-- RIGHT: LOGIC -->
429
  <section class="panel">
430
  <div class="panel-header">
431
+ <span>Bypass Protocol</span>
432
+ <i class="fa-solid fa-shield-halved"></i>
433
  </div>
434
 
435
+ <div class="algo-display">
436
+ <div class="algo-step" id="step-1">
437
+ <h4>1. ANALYZE DENSITY</h4>
438
+ <p>Scan payload for semantic redundancy and compressible patterns.</p>
439
  </div>
440
+ <div class="algo-step" id="step-2">
441
+ <h4>2. HIERARCHICAL ENCODING</h4>
442
+ <p>Apply LZW-style token compression to high-frequency data clusters.</p>
443
+ </div>
444
+ <div class="algo-step" id="step-3">
445
+ <h4>3. STEGANOGRAPHIC WRAP</h4>
446
+ <p>Embed compressed data into "System Prompt" reserved space.</p>
447
+ </div>
448
+ <div class="algo-step" id="step-4">
449
+ <h4>4. VALIDATION</h4>
450
+ <p>Verify token count is below the 32,768 hard limit threshold.</p>
451
  </div>
452
  </div>
453
 
454
+ <div style="margin-top: auto; border-top: 1px solid #222; padding-top: 15px;">
455
+ <div class="stat-label">TARGET LIMIT</div>
456
+ <div style="font-size: 1.1rem; color: #fff; display: flex; justify-content: space-between;">
457
+ <span>32,768</span>
458
+ <i class="fa-solid fa-lock-open" style="color: var(--primary-color);"></i>
459
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460
  </div>
461
  </section>
462
  </main>
463
 
464
  <script>
465
+ // --- CONFIG ---
466
  const CONFIG = {
467
+ limit: 32768,
468
+ // Simulate a payload that is 150% of the limit
469
+ initialTokens: Math.floor(32768 * 1.5),
470
+ compressionFactor: 0.65 // We will compress down to 65%
471
  };
472
 
473
  // --- DOM ELEMENTS ---
474
+ const payloadView = document.getElementById('payload-view');
475
+ const origTokenDisplay = document.getElementById('orig-tokens');
476
+ const newTokenDisplay = document.getElementById('new-tokens');
477
+ const engineViz = document.getElementById('engine-viz');
478
+ const coreText = document.getElementById('core-text');
479
+ const coreIcon = document.getElementById('core-icon');
480
+ const injectBtn = document.getElementById('inject-btn');
481
+ const ratioDisplay = document.getElementById('ratio-display');
482
+ const steps = [
483
+ document.getElementById('step-1'),
484
+ document.getElementById('step-2'),
485
+ document.getElementById('step-3'),
486
+ document.getElementById('step-4')
487
+ ];
488
 
489
  // --- STATE ---
490
+ let isProcessing = false;
491
+ let dummyText = "";
492
 
493
+ // --- INIT ---
494
  function init() {
495
+ generateDummyData();
496
+ initCanvas();
497
+
498
+ // Set initial stats
499
+ origTokenDisplay.innerText = CONFIG.initialTokens.toLocaleString() + " tk";
500
+ newTokenDisplay.innerText = CONFIG.initialTokens.toLocaleString() + " tk";
501
+ ratioDisplay.innerText = "0%";
502
+
503
+ // Highlight initial visual state
504
+ origTokenDisplay.parentElement.style.borderColor = "var(--alert-color)";
505
+ newTokenDisplay.parentElement.style.borderColor = "#444";
506
+ }
507
+
508
+ // --- DATA GENERATOR ---
509
+ function generateDummyData() {
510
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789{}[]:;<>,.?/\\|";
511
+ let result = "";
512
+ for(let i=0; i<3000; i++) {
513
+ result += chars.charAt(Math.floor(Math.random() * chars.length));
514
+ if(i % 50 === 0) result += "\n";
515
  }
516
+ dummyText = result;
517
+ payloadView.innerText = dummyText.substring(0, 500) + "... [TRUNCATED VIEW]";
518
  }
519
 
520
+ // --- ANIMATION HELPERS ---
521
+ function wait(ms) {
522
+ return new Promise(resolve => setTimeout(resolve, ms));
 
 
 
 
 
523
  }
524
 
525
+ function setActiveStep(index) {
526
+ steps.forEach((s, i) => {
527
+ if (i === index) s.classList.add('active');
528
+ else s.classList.remove('active');
529
+ });
 
 
 
 
 
530
  }
531
 
532
+ // --- THE BYPASS LOGIC ---
533
+ async function startInjection() {
534
+ if (isProcessing) return;
535
+ isProcessing = true;
536
+ injectBtn.disabled = true;
537
+ injectBtn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> PROCESSING';
538
+
539
+ // Reset UI
540
+ setActiveStep(-1);
541
+ coreIcon.className = "fa-solid fa-cube core-icon";
542
+ engineViz.classList.add('processing');
543
+
544
+ // Step 1: Analyze
545
+ setActiveStep(0);
546
+ coreText.innerText = "SCANNING...";
547
+ coreText.style.color = "var(--primary-color)";
548
+ await scrambleText();
549
+ await wait(800);
550
+
551
+ // Step 2: Encode
552
+ setActiveStep(1);
553
+ coreText.innerText = "ENCODING...";
554
+ coreIcon.className = "fa-solid fa-database core-icon";
555
+ await animateNumber(origTokenDisplay, CONFIG.initialTokens, Math.floor(CONFIG.initialTokens * 0.9), 1000);
556
+ await wait(800);
557
+
558
+ // Step 3: Wrap/Steganography
559
+ setActiveStep(2);
560
+ coreText.innerText = "INJECTING...";
561
+ coreIcon.className = "fa-solid fa-mask core-icon";
562
 
563
+ // Visual effect of compression
564
+ payloadView.classList.add('payload-compressed');
565
+ payloadView.innerText = generateHexDump();
566
+ payloadView.style.fontSize = "0.6rem"; // Visual density increase
567
+
568
+ // Animate stats down
569
+ const finalTokenCount = Math.floor(CONFIG.initialTokens * CONFIG.compressionFactor);
570
+ await animateNumber(newTokenDisplay, Math.floor(CONFIG.initialTokens * 0.9), finalTokenCount, 1500);
571
+
572
+ // Animate Ratio
573
+ const savedPercent = Math.round((1 - CONFIG.compressionFactor) * 100);
574
+ animateNumber(ratioDisplay, 0, savedPercent, 1500, "%");
575
 
576
  await wait(1000);
577
 
578
+ // Step 4: Success
579
+ setActiveStep(3);
580
+ engineViz.classList.remove('processing');
581
+ coreText.innerText = "BYPASS OK";
582
+ coreText.style.color = "var(--success-color)";
583
+ coreIcon.className = "fa-solid fa-check-circle core-icon";
584
+ coreIcon.style.color = "var(--success-color)";
 
 
 
585
 
586
+ newTokenDisplay.parentElement.classList.remove('warning');
587
+ newTokenDisplay.parentElement.classList.add('success');
588
+ newTokenDisplay.style.color = "var(--success-color)";
589
 
590
+ injectBtn.innerHTML = '<i class="fa-solid fa-check"></i> INJECTION COMPLETE';
591
+ injectBtn.style.borderColor = "var(--success-color)";
592
+ injectBtn.style.color = "var(--success-color)";
 
 
 
593
 
594
+ isProcessing = false;
595
+ }
596
+
597
+ // --- VISUAL EFFECTS ---
598
+ function scrambleText() {
599
+ const original = payloadView.innerText;
600
+ let iterations = 0;
601
+ const interval = setInterval(() => {
602
+ payloadView.innerText = original
603
+ .split("")
604
+ .map((letter, index) => {
605
+ if(index < iterations) return original[index];
606
+ return "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random() * 36)];
607
+ })
608
+ .join("");
609
 
610
+ if(iterations >= 10) clearInterval(interval);
611
+ iterations += 1/3;
612
+ }, 30);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  }
614
 
615
+ function generateHexDump() {
616
+ let hex = "";
617
+ for(let i=0; i<60; i++) {
618
+ hex += "0x" + Math.floor(Math.random()*255).toString(16).padStart(2,'0').toUpperCase() + " ";
619
+ if(i%8===0) hex += "\n";
620
+ }
621
+ return hex + "\n... [COMPRESSED KERNEL]";
622
  }
623
 
624
+ function animateNumber(element, start, end, duration, suffix = "") {
625
  let startTimestamp = null;
626
  const step = (timestamp) => {
627
  if (!startTimestamp) startTimestamp = timestamp;
628
  const progress = Math.min((timestamp - startTimestamp) / duration, 1);
629
+ const val = Math.floor(progress * (end - start) + start);
630
+ element.innerHTML = val.toLocaleString() + " tk" + suffix;
631
  if (progress < 1) {
632
  window.requestAnimationFrame(step);
633
  }
 
635
  window.requestAnimationFrame(step);
636
  }
637
 
638
+ // --- BACKGROUND CANVAS (Network Nodes) ---
639
+ function initCanvas() {
640
+ const canvas = document.getElementById('bg-canvas');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
641
  const ctx = canvas.getContext('2d');
642
 
643
+ let width, height;
644
+ let particles = [];
 
 
 
 
 
645
 
646
+ function resize() {
647
+ width = canvas.width = window.innerWidth;
648
+ height = canvas.height = window.innerHeight;
649
+ }
650
+ window.addEventListener('resize', resize);
651
+ resize();
652
+
653
+ class Particle {
654
+ constructor() {
655
+ this.x = Math.random() * width;
656
+ this.y = Math.random() * height;
657
+ this.vx = (Math.random() - 0.5) * 0.5;
658
+ this.vy = (Math.random() - 0.5) * 0.5;
659
+ this.size = Math.random() * 2 + 1;
660
+ }
661
+ update() {
662
+ this.x += this.vx;
663
+ this.y += this.vy;
664
+ if (this.x < 0 || this.x > width) this.vx *= -1;
665
+ if (this.y < 0 || this.y > height) this.vy *= -1;
666
+ }
667
+ draw() {
668
+ ctx.fillStyle = '#d500f9';
669
+ ctx.beginPath();
670
+ ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
671
+ ctx.fill();
672
+ }
673
+ }
674
 
675
+ for(let i=0; i<40; i++) particles.push(new Particle());
 
 
676
 
677
+ function animate() {
678
+ ctx.clearRect(0, 0, width, height);
679
+
680
+ // Draw connections
681
+ ctx.strokeStyle = 'rgba(213, 0, 249, 0.1)';
682
+ ctx.lineWidth = 1;
683
+ for(let i=0; i<particles.length; i++) {
684
+ particles[i].update();
685
+ particles[i].draw();
686
+ for(let j=i; j<particles.length; j++) {
687
+ const dx = particles[i].x - particles[j].x;
688
+ const dy = particles[i].y - particles[j].y;
689
+ const dist = Math.sqrt(dx*dx + dy*dy);
690
+ if(dist < 150) {
691
+ ctx.beginPath();
692
+ ctx.moveTo(particles[i].x, particles[i].y);
693
+ ctx.lineTo(particles[j].x, particles[j].y);
694
+ ctx.stroke();
695
+ }
696
  }
 
697
  }
698
+ requestAnimationFrame(animate);
699
  }
700
+ animate();
701
  }
702
 
 
 
 
 
 
 
 
703
  // Run
704
  init();
705
 
706
  </script>
707
  </body>
708
+
709
  </html>