kirikir13 commited on
Commit
288a764
·
verified ·
1 Parent(s): f2c51e1

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +688 -539
index.html CHANGED
@@ -1,581 +1,730 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>DocuPacker Pro v4 — Ghost Protocol Prime</title>
7
- <style>
8
- :root {
9
- --bg-dark: #03040a;
10
- --bg-panel: #05060a;
11
- --neon-cyan: #00f6ff;
12
- --neon-magenta: #ff2bd6;
13
- --neon-green: #00ff41;
14
- --text-main: #b7f7ff;
15
- --text-dim: #6a7a9a;
16
- --border: 1px solid rgba(0, 246, 255, 0.2);
17
- }
18
-
19
- * { box-sizing: box-sizing; }
20
-
21
- body {
22
- background-color: var(--bg-dark);
23
- color: var(--text-main);
24
- font-family: 'Consolas', 'Monaco', monospace;
25
- margin: 0;
26
- padding: 0;
27
- height: 100vh;
28
- overflow: hidden;
29
- display: flex;
30
- flex-direction: column;
31
- }
32
-
33
- /* --- Header --- */
34
- header {
35
- background: linear-gradient(90deg, #000 0%, #0b1020 50%, #000 100%);
36
- border-bottom: 1px solid var(--neon-cyan);
37
- padding: 15px 20px;
38
- display: flex;
39
- justify-content: space-between;
40
- align-items: center;
41
- box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
42
- z-index: 10;
43
- }
44
-
45
- .brand {
46
- font-size: 24px;
47
- font-weight: 800;
48
- color: var(--neon-cyan);
49
- text-shadow: 0 0 5px var(--neon-cyan);
50
- letter-spacing: 2px;
51
- }
52
-
53
- .status-bar {
54
- font-size: 12px;
55
- color: var(--neon-green);
56
- }
57
-
58
- /* --- Main Layout --- */
59
- main {
60
- display: flex;
61
- flex: 1;
62
- padding: 20px;
63
- gap: 20px;
64
- overflow: hidden;
65
- }
66
-
67
- .panel {
68
- background: var(--bg-panel);
69
- border: var(--border);
70
- border-radius: 6px;
71
- padding: 15px;
72
- display: flex;
73
- flex-direction: column;
74
- box-shadow: 0 4px 15px rgba(0,0,0,0.5);
75
- position: relative;
76
- overflow: hidden;
77
- }
78
 
79
- .panel::before {
80
- content: '';
81
- position: absolute;
82
- top: 0; left: 0; right: 0; height: 1px;
83
- background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
84
- opacity: 0.5;
85
- }
86
-
87
- .panel-title {
88
- color: var(--neon-magenta);
89
- font-weight: bold;
90
- margin-bottom: 10px;
91
- text-transform: uppercase;
92
- font-size: 14px;
93
- border-bottom: 1px solid rgba(255, 27, 216, 0.3);
94
- padding-bottom: 5px;
95
- }
96
-
97
- /* Left Panel: Input */
98
- #input-panel { flex: 2; }
99
-
100
- .drop-zone {
101
- border: 2px dashed var(--text-dim);
102
- height: 150px;
103
- display: flex;
104
- align-items: center;
105
- justify-content: center;
106
- color: var(--text-dim);
107
- cursor: pointer;
108
- transition: 0.3s;
109
- margin-bottom: 10px;
110
- }
111
-
112
- .drop-zone:hover, .drop-zone.active {
113
- border-color: var(--neon-cyan);
114
- background: rgba(0, 246, 255, 0.05);
115
- color: var(--neon-cyan);
116
- }
117
-
118
- .file-list {
119
- flex: 1;
120
- overflow-y: auto;
121
- font-size: 12px;
122
- }
123
-
124
- .file-item {
125
- padding: 4px 8px;
126
- border-bottom: 1px solid rgba(255,255,255,0.05);
127
- display: flex;
128
- justify-content: space-between;
129
- }
130
- .file-item:hover { background: rgba(0, 246, 255, 0.1); }
131
-
132
- /* Center Panel: Console & Tree */
133
- #console-panel { flex: 4; }
134
-
135
- .log-container {
136
- flex: 1;
137
- background: #02030a;
138
- border: 1px solid #111;
139
- padding: 10px;
140
- overflow-y: auto;
141
- font-size: 12px;
142
- color: var(--text-dim);
143
- margin-bottom: 10px;
144
- }
145
-
146
- .log-entry { margin-bottom: 4px; }
147
- .log-entry.error { color: var(--neon-magenta); }
148
- .log-entry.success { color: var(--neon-green); }
149
- .log-entry.info { color: var(--neon-cyan); }
150
-
151
- .ascii-tree {
152
- background: #000;
153
- color: var(--neon-cyan);
154
- padding: 10px;
155
- border: 1px solid #333;
156
- height: 200px;
157
- overflow: auto;
158
- font-size: 11px;
159
- white-space: pre;
160
- }
161
-
162
- /* Right Panel: Metrics */
163
- #metrics-panel { flex: 2; }
164
-
165
- .metric-box {
166
- background: rgba(0, 246, 255, 0.05);
167
- border: 1px solid var(--neon-cyan);
168
- padding: 10px;
169
- margin-bottom: 10px;
170
- }
171
-
172
- .trinary-grid {
173
- display: grid;
174
- grid-template-columns: 1fr 1fr 1fr;
175
- gap: 5px;
176
- text-align: center;
177
- }
178
- .trinary-item { font-weight: bold; }
179
- .trinary-hot { color: #ff2b2b; }
180
- .trinary-idle { color: #ffd700; }
181
- .trinary-inhibited { color: #555; }
182
-
183
- /* Footer Actions */
184
- footer {
185
- padding: 15px;
186
- border-top: 1px solid #333;
187
- display: flex;
188
- gap: 10px;
189
- background: #0b1020;
190
- }
191
-
192
- button {
193
- background: transparent;
194
- border: 1px solid var(--neon-cyan);
195
- color: var(--neon-cyan);
196
- padding: 10px 20px;
197
- font-family: inherit;
198
- font-weight: bold;
199
- cursor: pointer;
200
- transition: 0.2s;
201
- text-transform: uppercase;
202
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
 
204
- button:hover {
205
- background: var(--neon-cyan);
206
- color: #000;
207
- box-shadow: 0 0 10px var(--neon-cyan);
208
- }
209
 
210
- button.danger {
211
- border-color: var(--neon-magenta);
212
- color: var(--neon-magenta);
213
- }
214
- button.danger:hover {
215
- background: var(--neon-magenta);
216
- color: #fff;
217
- box-shadow: 0 0 10px var(--neon-magenta);
218
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
- /* Progress Bar */
221
- .progress-container {
222
- height: 4px;
223
- background: #333;
224
- margin-top: 10px;
225
- position: relative;
226
- }
227
- .progress-bar {
228
- height: 100%;
229
- width: 0%;
230
- background: var(--neon-green);
231
- transition: width 0.2s;
232
- box-shadow: 0 0 5px var(--neon-green);
233
- }
234
 
235
- /* Modal */
236
- .modal {
237
- display: none;
238
- position: fixed;
239
- top: 0; left: 0; width: 100%; height: 100%;
240
- background: rgba(0,0,0,0.8);
241
- z-index: 100;
242
- justify-content: center;
243
- align-items: center;
244
- }
245
- .modal-content {
246
- background: var(--bg-panel);
247
- border: 1px solid var(--neon-cyan);
248
- padding: 20px;
249
- width: 600px;
250
- max-height: 80vh;
251
- overflow: auto;
252
- }
253
- .modal-header {
254
- color: var(--neon-cyan);
255
- font-size: 18px;
256
- margin-bottom: 15px;
257
- border-bottom: 1px solid #333;
258
- }
259
- pre { background: #000; padding: 10px; color: #fff; border: 1px solid #333; }
260
- </style>
261
- </head>
262
- <body>
263
 
264
- <header>
265
- <div class="brand">DOCUPACKER PRO v4 <span style="font-size:12px; color:var(--neon-magenta)">// GHOST PROTOCOL PRIME</span></div>
266
- <div class="status-bar">SYSTEM ONLINE // WAITING FOR INPUT</div>
267
- </header>
268
-
269
- <main>
270
- <!-- INPUT PANEL -->
271
- <div class="panel" id="input-panel">
272
- <div class="panel-title">INPUT / FILE TREE</div>
273
- <div class="drop-zone" id="drop-zone">
274
- <div>
275
- <strong>DROP FILES/FOLDER HERE</strong><br>
276
- <small>OR CLICK TO SELECT</small>
277
- </div>
278
- </div>
279
- <div class="file-list" id="file-list"></div>
280
  </div>
 
281
 
282
- <!-- CONSOLE PANEL -->
283
- <div class="panel" id="console-panel">
284
- <div class="panel-title">OPERATION CONSOLE</div>
285
- <div class="log-container" id="log-container"></div>
286
- <div class="panel-title">ASCII STRUCTURE</div>
287
- <div class="ascii-tree" id="ascii-tree"></div>
288
- <div class="progress-container">
289
- <div class="progress-bar" id="progress-bar"></div>
290
- </div>
291
  </div>
 
292
 
293
- <!-- METRICS PANEL -->
294
- <div class="panel" id="metrics-panel">
295
- <div class="panel-title">EVE INTELLIGENCE</div>
296
-
297
- <div class="metric-box">
298
- <div style="font-size:10px; color:var(--text-dim)">TRINARY STATE ANALYSIS</div>
299
- <div class="trinary-grid" style="margin-top:5px;">
300
- <div class="trinary-item trinary-hot">HOT<br><span id="count-hot">0</span></div>
301
- <div class="trinary-item trinary-idle">IDLE<br><span id="count-idle">0</span></div>
302
- <div class="trinary-item trinary-inhibited">INHIBITED<br><span id="count-inhibited">0</span></div>
303
- </div>
304
- </div>
305
-
306
- <div class="metric-box">
307
- <div style="font-size:10px; color:var(--text-dim)">CONCEPT MINING</div>
308
- <div id="concept-list" style="margin-top:5px; font-size:11px; color:var(--neon-cyan)">
309
- -- NO DATA --
310
- </div>
311
- </div>
312
-
313
- <div class="metric-box">
314
- <div style="font-size:10px; color:var(--text-dim)">STATS</div>
315
- <div style="font-size:11px; margin-top:5px;">
316
- Total Files: <span id="stat-total">0</span><br>
317
- Total Size: <span id="stat-size">0 KB</span>
318
- </div>
319
- </div>
320
- </div>
321
- </main>
322
-
323
- <footer>
324
- <button onclick="startProcessing()">ENGAGE PROCESSING</button>
325
- <button onclick="exportAll()">EXPORT PACKAGE</button>
326
- <button class="danger" onclick="bootstrapMode()">BOOTSTRAP V2</button>
327
- </footer>
328
-
329
- <!-- MODAL FOR OUTPUT -->
330
- <div class="modal" id="output-modal">
331
- <div class="modal-content">
332
- <div class="modal-header">GENERATED MANIFEST / EXPORT</div>
333
- <div id="modal-body"></div>
334
- <div style="margin-top:15px; text-align:right;">
335
- <button onclick="downloadFiles()">DOWNLOAD ALL</button>
336
- <button class="danger" onclick="closeModal()">CLOSE</button>
337
- </div>
338
  </div>
 
339
  </div>
340
-
341
- <script>
342
- // --- STATE ---
343
- let files = [];
344
- let processedData = null;
345
- let generatedManifest = null;
346
-
347
- // --- CONSTANTS ---
348
- const TEXT_EXT = ['.py', '.md', '.txt', '.json', '.sql', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.js', '.html', '.css'];
349
- const DB_EXT = ['.db', '.sqlite'];
350
-
351
- // --- LOGGING ---
352
- function log(msg, type='info') {
353
- const container = document.getElementById('log-container');
354
- const div = document.createElement('div');
355
- div.className = `log-entry ${type}`;
356
- div.textContent = `[${new Date().toLocaleTimeString()}] ${msg}`;
357
- container.appendChild(div);
358
- container.scrollTop = container.scrollHeight;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
359
  }
 
360
 
361
- // --- INPUT HANDLING ---
362
- const dropZone = document.getElementById('drop-zone');
363
- const fileListEl = document.getElementById('file-list');
364
-
365
- dropZone.addEventListener('click', () => {
366
- const input = document.createElement('input');
367
- input.type = 'file';
368
- input.multiple = true;
369
- input.onchange = handleFileSelect;
370
- input.click();
371
- });
372
 
373
- dropZone.addEventListener('dragover', (e) => {
374
- e.preventDefault();
375
- dropZone.classList.add('active');
376
- });
377
- dropZone.addEventListener('dragleave', () => dropZone.classList.remove('active'));
378
- dropZone.addEventListener('drop', (e) => {
379
- e.preventDefault();
380
- dropZone.classList.remove('active');
381
- handleFileSelect({ target: { files: e.dataTransfer.files } });
 
 
 
 
 
382
  });
 
 
383
 
384
- function handleFileSelect(event) {
385
- files = Array.from(event.target.files);
386
- fileListEl.innerHTML = '';
387
- files.forEach(f => {
388
- const row = document.createElement('div');
389
- row.className = 'file-item';
390
- row.innerHTML = `<span>${f.name}</span> <span style="color:var(--text-dim)">${(f.size/1024).toFixed(1)} KB</span>`;
391
- fileListEl.appendChild(row);
392
- });
393
- log(`Loaded ${files.length} files for analysis.`);
394
  }
395
 
396
- // --- CORE LOGIC ---
397
- async function startProcessing() {
398
- if (files.length === 0) {
399
- log("No files loaded. Please drag and drop files.", "error");
400
- return;
401
- }
402
 
403
- log("INITIALIZING EVE INTELLIGENCE ENGINE...", "info");
404
- const progressBar = document.getElementById('progress-bar');
405
- progressBar.style.width = '0%';
406
-
407
- let results = [];
408
- let concepts = {};
409
- let trinary = { hot: 0, idle: 0, inhibited: 0 };
410
- let totalSize = 0;
411
-
412
- // 1. Analyze Files
413
- for (let i = 0; i < files.length; i++) {
414
- const file = files[i];
415
- totalSize += file.size;
416
-
417
- // Trinary Logic (Age)
418
- // Simulating "Age" by assuming new files are HOT
419
- const now = Date.now();
420
- const age = now - file.lastModified;
421
- let state = "INHIBITED";
422
- if (age < 7 * 86400000) { state = "HOT"; trinary.hot++; }
423
- else if (age < 30 * 86400000) { state = "IDLE"; trinary.idle++; }
424
- else { trinary.inhibited++; }
425
-
426
- // Content Analysis
427
- let content = "";
428
- let isText = TEXT_EXT.some(ext => file.name.toLowerCase().endsWith(ext));
429
- let isDb = DB_EXT.some(ext => file.name.toLowerCase().endsWith(ext));
430
-
431
- if (isText) {
432
- try {
433
- content = await file.text();
434
- // Concept Mining
435
- const lower = content.toLowerCase();
436
- ['memory', 'agent', 'pipeline', 'schema', 'logic', 'eve'].forEach(k => {
437
- if (lower.includes(k)) concepts[k] = (concepts[k] || 0) + 1;
438
- });
439
- } catch(e) { log(`Error reading ${file.name}`, "error"); }
440
- }
441
-
442
- results.push({
443
- name: file.name,
444
- size: file.size,
445
- type: isDb ? 'db' : (isText ? 'text' : 'binary'),
446
- state: state,
447
- content: content,
448
- hash: await hashFile(file)
449
- });
450
-
451
- progressBar.style.width = `${((i+1)/files.length)*50}%`;
452
  }
453
 
454
- // 2. Generate ASCII Tree
455
- const tree = generateTree(files);
456
- document.getElementById('ascii-tree').textContent = tree;
 
 
 
 
 
457
 
458
- // 3. Update UI
459
- document.getElementById('count-hot').textContent = trinary.hot;
460
- document.getElementById('count-idle').textContent = trinary.idle;
461
- document.getElementById('count-inhibited').textContent = trinary.inhibited;
462
- document.getElementById('stat-total').textContent = files.length;
463
- document.getElementById('stat-size').textContent = (totalSize/1024).toFixed(1) + " KB";
464
 
465
- const conceptList = document.getElementById('concept-list');
466
- conceptList.innerHTML = Object.keys(concepts).map(k => `<span style="border:1px solid var(--neon-cyan); padding:2px; margin:2px;">${k}: ${concepts[k]}</span>`).join('');
 
467
 
468
- processedData = results;
469
- progressBar.style.width = '100%';
470
- log("PROCESSING COMPLETE. EVE READY.", "success");
471
- }
 
 
472
 
473
- function generateTree(files) {
474
- // Simplified tree generator
475
- let lines = ["PROJECT_ROOT/"];
476
- files.forEach(f => lines.push("├── " + f.name));
477
- return lines.join("\n");
478
  }
479
 
480
- async function hashFile(file) {
 
 
 
 
 
 
 
 
 
 
 
 
481
  const buffer = await file.arrayBuffer();
482
  const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
483
  const hashArray = Array.from(new Uint8Array(hashBuffer));
484
  return hashArray.map(b => b.toString(16).padStart(2, '0')).join("");
485
- }
486
-
487
- // --- EXPORT LOGIC ---
488
- function exportAll() {
489
- if (!processedData) {
490
- log("Process data first!", "error");
491
- return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  }
 
493
 
494
- // Build Manifest
495
- const manifest = {
496
- version: "2.0.0",
497
- project: "Ghost Protocol Export",
498
- generated: new Date().toISOString(),
499
- stats: { files: files.length, size: document.getElementById('stat-size').textContent },
500
- files: processedData
501
- };
502
-
503
- // Build Markdown
504
- let md = `# DOCUPACKER PRO EXPORT\n\n`;
505
- md += `## INDEX\n1. Overview\n2. Structure\n3. Contents\n\n`;
506
- md += `## STRUCTURE\n```text\n${generateTree(files)}\n```\n\n`;
507
- md += `## CONTENTS\n`;
508
-
509
- processedData.forEach(f => {
510
- md += `--- FILE: ${f.name} (${f.type}) ---\n`;
511
- md += `STATE: ${f.state}\n`;
512
- md += `HASH: ${f.hash}\n`;
513
- if (f.type === 'text') {
514
- md += `\n${f.content}\n`;
515
- } else if (f.type === 'db') {
516
- md += `\n[BINARY DB FILE]\n`;
517
- }
518
- });
519
-
520
- generatedManifest = manifest;
521
-
522
- // Show Modal
523
- const modal = document.getElementById('output-modal');
524
- const body = document.getElementById('modal-body');
525
- body.innerHTML = `<pre>${JSON.stringify(manifest, null, 2)}</pre>`;
526
- modal.style.display = 'flex';
527
-
528
- log("Manifest generated successfully.");
529
- }
530
-
531
- function downloadFiles() {
532
- if (!generatedManifest) return;
533
-
534
- // 1. Download JSON
535
- const jsonBlob = new Blob([JSON.stringify(generatedManifest, null, 2)], {type: "application/json"});
536
- const jsonUrl = URL.createObjectURL(jsonBlob);
537
- const a = document.createElement('a');
538
- a.href = jsonUrl;
539
- a.download = "manifest.json";
540
- a.click();
541
-
542
- // 2. Download MD (Simulated)
543
- // In a real app we'd construct the full MD blob here
544
- log("Downloading manifest.json...");
545
- }
546
 
547
- function closeModal() {
548
- document.getElementById('output-modal').style.display = 'none';
549
- }
550
 
551
- // --- BOOTSTRAP LOGIC ---
552
- function bootstrapMode() {
553
- if (!generatedManifest) {
554
- log("Bootstrap requires a generated manifest. Export first.", "error");
555
- return;
556
- }
557
-
558
- log("BOOTSTRAP MODE V2 INITIATED...", "info");
559
- log("Reading manifest structure...", "info");
560
- log("Rehydrating file tree...", "info");
561
-
562
- const modal = document.getElementById('output-modal');
563
- const body = document.getElementById('modal-body');
564
-
565
- let html = `<h3>BOOTSTRAP REBUILD REPORT</h3>`;
566
- html += `<p>Source: Manifest v2.0</p>`;
567
- html += `<p>Target: Local Workspace</p>`;
568
- html += `<ul>`;
569
- generatedManifest.files.forEach(f => {
570
- html += `<li>Restored: ${f.name} (${f.state})</li>`;
571
- });
572
- html += `</ul>`;
573
- html += `<p style="color:var(--neon-green)">SYSTEM REHYDRATION COMPLETE.</p>`;
574
-
575
- body.innerHTML = html;
576
- modal.style.display = 'flex';
577
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
 
579
- </script>
580
  </body>
 
581
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>DocuPacker Pro v4 Ghost Protocol Prime</title>
8
+ <style>
9
+ :root {
10
+ --bg-dark: #03040a;
11
+ --bg-panel: #05060a;
12
+ --neon-cyan: #00f6ff;
13
+ --neon-magenta: #ff2bd6;
14
+ --neon-green: #00ff41;
15
+ --text-main: #b7f7ff;
16
+ --text-dim: #6a7a9a;
17
+ --border: 1px solid rgba(0, 246, 255, 0.2);
18
+ --glass: rgba(5, 6, 10, 0.7);
19
+ }
20
+
21
+ * {
22
+ box-sizing: box-sizing;
23
+ scrollbar-width: thin;
24
+ scrollbar-color: var(--neon-cyan) var(--bg-dark);
25
+ }
26
+
27
+ body {
28
+ background-color: var(--bg-dark);
29
+ color: var(--text-main);
30
+ font-family: 'Courier New', 'Consolas', monospace; /* Monospace fits the theme better */
31
+ margin: 0;
32
+ padding: 0;
33
+ height: 100vh;
34
+ overflow: hidden;
35
+ display: flex;
36
+ flex-direction: column;
37
+ background-image:
38
+ linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
39
+ repeating-linear-gradient(rgba(0, 246, 255, 0.03) 1px, transparent 1px),
40
+ repeating-linear-gradient(90deg, rgba(0, 246, 255, 0.03) 1px, transparent 1px);
41
+ background-size: 100% 100%, 20px 20px, 20px 20px;
42
+ }
43
+
44
+ /* --- Header --- */
45
+ header {
46
+ background: linear-gradient(90deg, #000 0%, #0b1020 50%, #000 100%);
47
+ border-bottom: 1px solid var(--neon-cyan);
48
+ padding: 15px 20px;
49
+ display: flex;
50
+ justify-content: space-between;
51
+ align-items: center;
52
+ box-shadow: 0 0 15px rgba(0, 246, 255, 0.2);
53
+ z-index: 10;
54
+ }
55
+
56
+ .brand {
57
+ font-size: 24px;
58
+ font-weight: 800;
59
+ color: var(--neon-cyan);
60
+ text-shadow: 0 0 5px var(--neon-cyan);
61
+ letter-spacing: 2px;
62
+ display: flex;
63
+ align-items: center;
64
+ gap: 10px;
65
+ }
66
+
67
+ .status-bar {
68
+ font-size: 12px;
69
+ color: var(--neon-green);
70
+ text-transform: uppercase;
71
+ letter-spacing: 1px;
72
+ animation: pulse 2s infinite;
73
+ }
74
+
75
+ /* --- Main Layout --- */
76
+ main {
77
+ display: grid;
78
+ grid-template-columns: 1fr 2fr 1fr; /* Responsive Grid */
79
+ flex: 1;
80
+ padding: 20px;
81
+ gap: 20px;
82
+ overflow: hidden;
83
+ }
84
+
85
+ @media (max-width: 1000px) {
86
+ main {
87
+ grid-template-columns: 1fr;
88
+ overflow-y: auto;
89
+ }
90
+ }
91
+
92
+ .panel {
93
+ background: var(--bg-panel);
94
+ border: var(--border);
95
+ border-radius: 6px;
96
+ padding: 15px;
97
+ display: flex;
98
+ flex-direction: column;
99
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
100
+ position: relative;
101
+ overflow: hidden;
102
+ backdrop-filter: blur(5px);
103
+ }
104
+
105
+ .panel::before {
106
+ content: '';
107
+ position: absolute;
108
+ top: 0;
109
+ left: 0;
110
+ right: 0;
111
+ height: 1px;
112
+ background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
113
+ opacity: 0.5;
114
+ }
115
+
116
+ .panel-title {
117
+ color: var(--neon-magenta);
118
+ font-weight: bold;
119
+ margin-bottom: 10px;
120
+ text-transform: uppercase;
121
+ font-size: 14px;
122
+ border-bottom: 1px solid rgba(255, 27, 216, 0.3);
123
+ padding-bottom: 5px;
124
+ display: flex;
125
+ justify-content: space-between;
126
+ }
127
+
128
+ /* Left Panel: Input */
129
+ #input-panel {
130
+ min-width: 0; /* Flex fix */
131
+ }
132
+
133
+ .drop-zone {
134
+ border: 2px dashed var(--text-dim);
135
+ height: 150px;
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: center;
139
+ color: var(--text-dim);
140
+ cursor: pointer;
141
+ transition: 0.3s;
142
+ margin-bottom: 10px;
143
+ position: relative;
144
+ overflow: hidden;
145
+ }
146
+
147
+ .drop-zone:hover,
148
+ .drop-zone.active {
149
+ border-color: var(--neon-cyan);
150
+ background: rgba(0, 246, 255, 0.05);
151
+ color: var(--neon-cyan);
152
+ box-shadow: inset 0 0 20px rgba(0, 246, 255, 0.1);
153
+ }
154
+
155
+ .drop-zone::after {
156
+ content: 'SCAN AREA';
157
+ position: absolute;
158
+ bottom: 5px;
159
+ right: 5px;
160
+ font-size: 8px;
161
+ opacity: 0.5;
162
+ }
163
+
164
+ .file-list {
165
+ flex: 1;
166
+ overflow-y: auto;
167
+ font-size: 12px;
168
+ border-top: 1px solid rgba(255, 255, 255, 0.05);
169
+ }
170
+
171
+ .file-item {
172
+ padding: 8px;
173
+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);
174
+ display: flex;
175
+ justify-content: space-between;
176
+ align-items: center;
177
+ }
178
+
179
+ .file-item:hover {
180
+ background: rgba(0, 246, 255, 0.1);
181
+ color: var(--neon-cyan);
182
+ }
183
+
184
+ /* Center Panel: Console & Tree */
185
+ #console-panel {
186
+ min-width: 0;
187
+ }
188
+
189
+ .log-container {
190
+ flex: 1;
191
+ background: #02030a;
192
+ border: 1px solid #111;
193
+ padding: 10px;
194
+ overflow-y: auto;
195
+ font-size: 12px;
196
+ color: var(--text-dim);
197
+ margin-bottom: 10px;
198
+ font-family: monospace;
199
+ }
200
+
201
+ .log-entry {
202
+ margin-bottom: 4px;
203
+ border-left: 2px solid transparent;
204
+ padding-left: 5px;
205
+ }
206
+
207
+ .log-entry.error { color: var(--neon-magenta); border-left-color: var(--neon-magenta); }
208
+ .log-entry.success { color: var(--neon-green); border-left-color: var(--neon-green); }
209
+ .log-entry.info { color: var(--neon-cyan); border-left-color: var(--neon-cyan); }
210
+
211
+ .ascii-tree {
212
+ background: #000;
213
+ color: var(--neon-cyan);
214
+ padding: 10px;
215
+ border: 1px solid #333;
216
+ height: 200px;
217
+ overflow: auto;
218
+ font-size: 11px;
219
+ white-space: pre;
220
+ line-height: 1.4;
221
+ }
222
+
223
+ /* Right Panel: Metrics */
224
+ #metrics-panel {
225
+ min-width: 0;
226
+ }
227
+
228
+ .metric-box {
229
+ background: rgba(0, 246, 255, 0.05);
230
+ border: 1px solid var(--neon-cyan);
231
+ padding: 10px;
232
+ margin-bottom: 10px;
233
+ position: relative;
234
+ }
235
+
236
+ .metric-box::after {
237
+ content: '';
238
+ position: absolute;
239
+ top: -1px; left: -1px;
240
+ width: 5px; height: 5px;
241
+ background: var(--neon-cyan);
242
+ }
243
+
244
+ .trinary-grid {
245
+ display: grid;
246
+ grid-template-columns: 1fr 1fr 1fr;
247
+ gap: 5px;
248
+ text-align: center;
249
+ }
250
+
251
+ .trinary-item {
252
+ font-weight: bold;
253
+ font-size: 10px;
254
+ }
255
+
256
+ .trinary-hot { color: #ff2b2b; }
257
+ .trinary-idle { color: #ffd700; }
258
+ .trinary-inhibited { color: #555; }
259
+
260
+ /* Footer Actions */
261
+ footer {
262
+ padding: 15px;
263
+ border-top: 1px solid #333;
264
+ display: flex;
265
+ gap: 10px;
266
+ background: #0b1020;
267
+ justify-content: center;
268
+ }
269
+
270
+ button {
271
+ background: transparent;
272
+ border: 1px solid var(--neon-cyan);
273
+ color: var(--neon-cyan);
274
+ padding: 10px 20px;
275
+ font-family: inherit;
276
+ font-weight: bold;
277
+ cursor: pointer;
278
+ transition: 0.2s;
279
+ text-transform: uppercase;
280
+ font-size: 12px;
281
+ position: relative;
282
+ overflow: hidden;
283
+ }
284
+
285
+ button:hover {
286
+ background: var(--neon-cyan);
287
+ color: #000;
288
+ box-shadow: 0 0 10px var(--neon-cyan);
289
+ }
290
+
291
+ button.danger {
292
+ border-color: var(--neon-magenta);
293
+ color: var(--neon-magenta);
294
+ }
295
+
296
+ button.danger:hover {
297
+ background: var(--neon-magenta);
298
+ color: #fff;
299
+ box-shadow: 0 0 10px var(--neon-magenta);
300
+ }
301
+
302
+ /* Progress Bar */
303
+ .progress-container {
304
+ height: 4px;
305
+ background: #333;
306
+ margin-top: 10px;
307
+ position: relative;
308
+ overflow: hidden;
309
+ }
310
+
311
+ .progress-bar {
312
+ height: 100%;
313
+ width: 0%;
314
+ background: var(--neon-green);
315
+ transition: width 0.2s;
316
+ box-shadow: 0 0 5px var(--neon-green);
317
+ }
318
+
319
+ /* Modal */
320
+ .modal {
321
+ display: none;
322
+ position: fixed;
323
+ top: 0;
324
+ left: 0;
325
+ width: 100%;
326
+ height: 100%;
327
+ background: rgba(0, 0, 0, 0.9);
328
+ z-index: 100;
329
+ justify-content: center;
330
+ align-items: center;
331
+ }
332
+
333
+ .modal-content {
334
+ background: var(--bg-panel);
335
+ border: 1px solid var(--neon-cyan);
336
+ padding: 20px;
337
+ width: 600px;
338
+ max-height: 80vh;
339
+ overflow: auto;
340
+ box-shadow: 0 0 30px rgba(0, 246, 255, 0.2);
341
+ }
342
+
343
+ .modal-header {
344
+ color: var(--neon-cyan);
345
+ font-size: 18px;
346
+ margin-bottom: 15px;
347
+ border-bottom: 1px solid #333;
348
+ }
349
+
350
+ pre {
351
+ background: #000;
352
+ padding: 10px;
353
+ color: #fff;
354
+ border: 1px solid #333;
355
+ max-height: 400px;
356
+ overflow: auto;
357
+ }
358
+
359
+ @keyframes pulse {
360
+ 0% { opacity: 1; }
361
+ 50% { opacity: 0.5; }
362
+ 100% { opacity: 1; }
363
+ }
364
+
365
+ /* Scrollbar styling */
366
+ ::-webkit-scrollbar { width: 8px; }
367
+ ::-webkit-scrollbar-track { background: #000; }
368
+ ::-webkit-scrollbar-thumb { background: var(--neon-cyan); }
369
+ </style>
370
+ </head>
371
 
372
+ <body>
 
 
 
 
373
 
374
+ <header>
375
+ <div class="brand">
376
+ <span>DOCUPACKER PRO v4</span>
377
+ <span style="font-size:12px; color:var(--neon-magenta); font-weight:normal;">// GHOST PROTOCOL PRIME</span>
378
+ </div>
379
+ <div class="status-bar">SYSTEM ONLINE // WAITING FOR INPUT</div>
380
+ <!-- Required Link -->
381
+ <div style="font-size: 10px; opacity: 0.5;">
382
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" style="color: var(--text-dim); text-decoration: none;">Built with anycoder</a>
383
+ </div>
384
+ </header>
385
+
386
+ <main>
387
+ <!-- INPUT PANEL -->
388
+ <div class="panel" id="input-panel">
389
+ <div class="panel-title">INPUT / FILE TREE</div>
390
+
391
+ <!-- Fixed Drop Zone -->
392
+ <div class="drop-zone" id="drop-zone">
393
+ <div style="text-align: center;">
394
+ <strong style="font-size: 16px;">DROP FILES/FOLDER HERE</strong><br>
395
+ <small style="color: var(--neon-cyan)">OR CLICK TO SELECT</small>
396
+ </div>
397
+ <!-- Hidden Input for Click Trigger -->
398
+ <input type="file" id="file-input" multiple style="display: none;">
399
+ </div>
400
+
401
+ <div class="file-list" id="file-list">
402
+ <div style="padding:10px; text-align:center; color:#555;">-- NO FILES SELECTED --</div>
403
+ </div>
404
+ </div>
405
 
406
+ <!-- CONSOLE PANEL -->
407
+ <div class="panel" id="console-panel">
408
+ <div class="panel-title">OPERATION CONSOLE</div>
409
+ <div class="log-container" id="log-container"></div>
410
+ <div class="panel-title">ASCII STRUCTURE</div>
411
+ <div class="ascii-tree" id="ascii-tree"></div>
412
+ <div class="progress-container">
413
+ <div class="progress-bar" id="progress-bar"></div>
414
+ </div>
415
+ </div>
 
 
 
 
416
 
417
+ <!-- METRICS PANEL -->
418
+ <div class="panel" id="metrics-panel">
419
+ <div class="panel-title">EVE INTELLIGENCE</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
 
421
+ <div class="metric-box">
422
+ <div style="font-size:10px; color:var(--text-dim)">TRINARY STATE ANALYSIS</div>
423
+ <div class="trinary-grid" style="margin-top:5px;">
424
+ <div class="trinary-item trinary-hot">HOT<br><span id="count-hot">0</span></div>
425
+ <div class="trinary-item trinary-idle">IDLE<br><span id="count-idle">0</span></div>
426
+ <div class="trinary-item trinary-inhibited">INHIBITED<br><span id="count-inhibited">0</span></div>
 
 
 
 
 
 
 
 
 
 
427
  </div>
428
+ </div>
429
 
430
+ <div class="metric-box">
431
+ <div style="font-size:10px; color:var(--text-dim)">CONCEPT MINING</div>
432
+ <div id="concept-list" style="margin-top:5px; font-size:11px; color:var(--neon-cyan)">
433
+ -- NO DATA --
 
 
 
 
 
434
  </div>
435
+ </div>
436
 
437
+ <div class="metric-box">
438
+ <div style="font-size:10px; color:var(--text-dim)">STATS</div>
439
+ <div style="font-size:11px; margin-top:5px;">
440
+ Total Files: <span id="stat-total">0</span><br>
441
+ Total Size: <span id="stat-size">0 KB</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  </div>
443
+ </div>
444
  </div>
445
+ </main>
446
+
447
+ <footer>
448
+ <button onclick="startProcessing()">ENGAGE PROCESSING</button>
449
+ <button onclick="exportAll()">EXPORT PACKAGE</button>
450
+ <button class="danger" onclick="bootstrapMode()">BOOTSTRAP V2</button>
451
+ </footer>
452
+
453
+ <!-- MODAL FOR OUTPUT -->
454
+ <div class="modal" id="output-modal">
455
+ <div class="modal-content">
456
+ <div class="modal-header">GENERATED MANIFEST / EXPORT</div>
457
+ <div id="modal-body"></div>
458
+ <div style="margin-top:15px; text-align:right;">
459
+ <button onclick="downloadFiles()">DOWNLOAD ALL</button>
460
+ <button class="danger" onclick="closeModal()">CLOSE</button>
461
+ </div>
462
+ </div>
463
+ </div>
464
+
465
+ <script>
466
+ // --- STATE ---
467
+ let files = [];
468
+ let processedData = null;
469
+ let generatedManifest = null;
470
+
471
+ // --- CONSTANTS ---
472
+ const TEXT_EXT = ['.py', '.md', '.txt', '.json', '.sql', '.yaml', '.yml', '.toml', '.ini', '.cfg', '.js', '.html', '.css'];
473
+ const DB_EXT = ['.db', '.sqlite'];
474
+
475
+ // --- LOGGING ---
476
+ function log(msg, type='info') {
477
+ const container = document.getElementById('log-container');
478
+ const div = document.createElement('div');
479
+ div.className = `log-entry ${type}`;
480
+ div.textContent = `[SYS] ${msg}`;
481
+ container.appendChild(div);
482
+ container.scrollTop = container.scrollHeight;
483
+ }
484
+
485
+ // --- INPUT HANDLING ---
486
+ const dropZone = document.getElementById('drop-zone');
487
+ const fileListEl = document.getElementById('file-list');
488
+ const fileInput = document.getElementById('file-input');
489
+
490
+ // 1. Handle Click (Trigger Hidden Input)
491
+ dropZone.addEventListener('click', () => {
492
+ fileInput.click();
493
+ });
494
+
495
+ // 2. Handle Input Change (File Selection)
496
+ fileInput.addEventListener('change', (e) => {
497
+ handleFileSelect(e);
498
+ // Reset input value so same files can be selected again if needed
499
+ fileInput.value = '';
500
+ });
501
+
502
+ // 3. Handle Drag & Drop
503
+ dropZone.addEventListener('dragover', (e) => {
504
+ e.preventDefault(); // Essential to allow dropping
505
+ dropZone.classList.add('active');
506
+ });
507
+
508
+ dropZone.addEventListener('dragleave', (e) => {
509
+ // Only remove active class if we are leaving the dropZone itself
510
+ if (e.target === dropZone) {
511
+ dropZone.classList.remove('active');
512
  }
513
+ });
514
 
515
+ dropZone.addEventListener('drop', (e) => {
516
+ e.preventDefault();
517
+ dropZone.classList.remove('active');
518
+ // Access files directly from dataTransfer
519
+ handleFileSelect({ target: { files: e.dataTransfer.files } });
520
+ });
 
 
 
 
 
521
 
522
+ function handleFileSelect(event) {
523
+ files = Array.from(event.target.files);
524
+ fileListEl.innerHTML = '';
525
+
526
+ if(files.length === 0) return;
527
+
528
+ files.forEach(f => {
529
+ const row = document.createElement('div');
530
+ row.className = 'file-item';
531
+ row.innerHTML = `
532
+ <span style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;">${f.name}</span>
533
+ <span style="color:var(--text-dim)">${(f.size/1024).toFixed(1)} KB</span>
534
+ `;
535
+ fileListEl.appendChild(row);
536
  });
537
+ log(`Loaded ${files.length} files for analysis.`);
538
+ }
539
 
540
+ // --- CORE LOGIC ---
541
+ async function startProcessing() {
542
+ if (files.length === 0) {
543
+ log("No files loaded. Please drag and drop files.", "error");
544
+ return;
 
 
 
 
 
545
  }
546
 
547
+ log("INITIALIZING EVE INTELLIGENCE ENGINE...", "info");
548
+ const progressBar = document.getElementById('progress-bar');
549
+ progressBar.style.width = '0%';
 
 
 
550
 
551
+ let results = [];
552
+ let concepts = {};
553
+ let trinary = { hot: 0, idle: 0, inhibited: 0 };
554
+ let totalSize = 0;
555
+
556
+ // 1. Analyze Files
557
+ for (let i = 0; i < files.length; i++) {
558
+ const file = files[i];
559
+ totalSize += file.size;
560
+
561
+ // Trinary Logic (Age)
562
+ const now = Date.now();
563
+ const age = now - file.lastModified;
564
+ let state = "INHIBITED";
565
+ if (age < 7 * 86400000) { state = "HOT"; trinary.hot++; }
566
+ else if (age < 30 * 86400000) { state = "IDLE"; trinary.idle++; }
567
+ else { trinary.inhibited++; }
568
+
569
+ // Content Analysis
570
+ let content = "";
571
+ let isText = TEXT_EXT.some(ext => file.name.toLowerCase().endsWith(ext));
572
+ let isDb = DB_EXT.some(ext => file.name.toLowerCase().endsWith(ext));
573
+
574
+ if (isText) {
575
+ try {
576
+ content = await file.text();
577
+ // Concept Mining
578
+ const lower = content.toLowerCase();
579
+ ['memory', 'agent', 'pipeline', 'schema', 'logic', 'eve'].forEach(k => {
580
+ if (lower.includes(k)) concepts[k] = (concepts[k] || 0) + 1;
581
+ });
582
+ } catch(e) { log(`Error reading ${file.name}`, "error"); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  }
584
 
585
+ results.push({
586
+ name: file.name,
587
+ size: file.size,
588
+ type: isDb ? 'db' : (isText ? 'text' : 'binary'),
589
+ state: state,
590
+ content: content,
591
+ hash: await hashFile(file)
592
+ });
593
 
594
+ progressBar.style.width = `${((i+1)/files.length)*50}%`;
595
+ }
 
 
 
 
596
 
597
+ // 2. Generate ASCII Tree
598
+ const tree = generateTree(files);
599
+ document.getElementById('ascii-tree').textContent = tree;
600
 
601
+ // 3. Update UI
602
+ document.getElementById('count-hot').textContent = trinary.hot;
603
+ document.getElementById('count-idle').textContent = trinary.idle;
604
+ document.getElementById('count-inhibited').textContent = trinary.inhibited;
605
+ document.getElementById('stat-total').textContent = files.length;
606
+ document.getElementById('stat-size').textContent = (totalSize/1024).toFixed(1) + " KB";
607
 
608
+ const conceptList = document.getElementById('concept-list');
609
+ if(Object.keys(concepts).length > 0) {
610
+ conceptList.innerHTML = Object.keys(concepts).map(k => `<span style="border:1px solid var(--neon-cyan); padding:2px; margin:2px; display:inline-block;">${k}: ${concepts[k]}</span>`).join('');
611
+ } else {
612
+ conceptList.textContent = "-- NO CONCEPTS DETECTED --";
613
  }
614
 
615
+ processedData = results;
616
+ progressBar.style.width = '100%';
617
+ log("PROCESSING COMPLETE. EVE READY.", "success");
618
+ }
619
+
620
+ function generateTree(files) {
621
+ let lines = ["PROJECT_ROOT/"];
622
+ files.forEach(f => lines.push("├── " + f.name));
623
+ return lines.join("\n");
624
+ }
625
+
626
+ async function hashFile(file) {
627
+ try {
628
  const buffer = await file.arrayBuffer();
629
  const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
630
  const hashArray = Array.from(new Uint8Array(hashBuffer));
631
  return hashArray.map(b => b.toString(16).padStart(2, '0')).join("");
632
+ } catch(e) {
633
+ return "HASH_ERROR";
634
+ }
635
+ }
636
+
637
+ // --- EXPORT LOGIC ---
638
+ function exportAll() {
639
+ if (!processedData) {
640
+ log("Process data first!", "error");
641
+ return;
642
+ }
643
+
644
+ // Build Manifest
645
+ const manifest = {
646
+ version: "2.0.0",
647
+ project: "Ghost Protocol Export",
648
+ generated: new Date().toISOString(),
649
+ stats: { files: files.length, size: document.getElementById('stat-size').textContent },
650
+ files: processedData
651
+ };
652
+
653
+ // Build Markdown
654
+ let md = `# DOCUPACKER PRO EXPORT\n\n`;
655
+ md += `## INDEX\n1. Overview\n2. Structure\n3. Contents\n\n`;
656
+ md += `## STRUCTURE\n```text\n${generateTree(files)}\n```\n\n`;
657
+ md += `## CONTENTS\n`;
658
+
659
+ processedData.forEach(f => {
660
+ md += `--- FILE: ${f.name} (${f.type}) ---\n`;
661
+ md += `STATE: ${f.state}\n`;
662
+ md += `HASH: ${f.hash}\n`;
663
+ if (f.type === 'text') {
664
+ md += `\n${f.content}\n`;
665
+ } else if (f.type === 'db') {
666
+ md += `\n[BINARY DB FILE]\n`;
667
  }
668
+ });
669
 
670
+ generatedManifest = manifest;
671
+
672
+ // Show Modal
673
+ const modal = document.getElementById('output-modal');
674
+ const body = document.getElementById('modal-body');
675
+ body.innerHTML = `<pre>${JSON.stringify(manifest, null, 2)}</pre>`;
676
+ modal.style.display = 'flex';
677
+
678
+ log("Manifest generated successfully.");
679
+ }
680
+
681
+ function downloadFiles() {
682
+ if (!generatedManifest) return;
683
+
684
+ // 1. Download JSON
685
+ const jsonBlob = new Blob([JSON.stringify(generatedManifest, null, 2)], {type: "application/json"});
686
+ const jsonUrl = URL.createObjectURL(jsonBlob);
687
+ const a = document.createElement('a');
688
+ a.href = jsonUrl;
689
+ a.download = "manifest.json";
690
+ a.click();
691
+
692
+ log("Downloading manifest.json...");
693
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
694
 
695
+ function closeModal() {
696
+ document.getElementById('output-modal').style.display = 'none';
697
+ }
698
 
699
+ // --- BOOTSTRAP LOGIC ---
700
+ function bootstrapMode() {
701
+ if (!generatedManifest) {
702
+ log("Bootstrap requires a generated manifest. Export first.", "error");
703
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  }
705
+
706
+ log("BOOTSTRAP MODE V2 INITIATED...", "info");
707
+ log("Reading manifest structure...", "info");
708
+ log("Rehydrating file tree...", "info");
709
+
710
+ const modal = document.getElementById('output-modal');
711
+ const body = document.getElementById('modal-body');
712
+
713
+ let html = `<h3>BOOTSTRAP REBUILD REPORT</h3>`;
714
+ html += `<p>Source: Manifest v2.0</p>`;
715
+ html += `<p>Target: Local Workspace</p>`;
716
+ html += `<ul>`;
717
+ generatedManifest.files.forEach(f => {
718
+ html += `<li>Restored: ${f.name} (${f.state})</li>`;
719
+ });
720
+ html += `</ul>`;
721
+ html += `<p style="color:var(--neon-green)">SYSTEM REHYDRATION COMPLETE.</p>`;
722
+
723
+ body.innerHTML = html;
724
+ modal.style.display = 'flex';
725
+ }
726
 
727
+ </script>
728
  </body>
729
+
730
  </html>