File size: 4,316 Bytes
c5f93fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// AgentOS Live Data Fetcher
// Fetches real-time status from .agentos runtime via GitHub raw content

(async function() {
    const API_BASE = 'https://raw.githubusercontent.com/SNAPKITTYWEST/snapkitty-agentos/main/.agentos';
    
    // Fetch git bucket count from manifest
    async function fetchBucketCount() {
        try {
            const response = await fetch(`${API_BASE}/gitbucket/index/manifest.json`);
            if (!response.ok) return 'β€”';
            const data = await response.json();
            return data.buckets ? data.buckets.length : 0;
        } catch (e) {
            return 'β€”';
        }
    }
    
    // Fetch problem registry count
    async function fetchProblemCount() {
        try {
            const response = await fetch(`${API_BASE}/pnp/problem_registry.json`);
            if (!response.ok) return 'β€”';
            const data = await response.json();
            return data.problems ? data.problems.length : 0;
        } catch (e) {
            return 'β€”';
        }
    }
    
    // Fetch skills count
    async function fetchSkillCount() {
        try {
            const response = await fetch(`${API_BASE}/skills/registry.json`);
            if (!response.ok) return 'β€”';
            const data = await response.json();
            return data.skills ? data.skills.length : 0;
        } catch (e) {
            return 'β€”';
        }
    }
    
    // Update UI with live data
    const bucketCount = await fetchBucketCount();
    const problemCount = await fetchProblemCount();
    const skillCount = await fetchSkillCount();
    
    document.getElementById('bucket-count').textContent = bucketCount;
    document.getElementById('solution-count').textContent = problemCount;
    document.getElementById('agent-count').textContent = skillCount;
    
    // Animate terminal with realistic output
    const terminalLines = [
        '$ npm run verify:all',
        'β–Ά Plasma Gate verification...',
        'βœ“ Ed25519 public key present',
        'β–Ά P/NP problem verification...',
        'βœ“ 3 problems registered (all open)',
        'β–Ά Skill verification...',
        'βœ“ ledger_validation_v3 verified',
        'βœ“ borrow_chain_scheduler_v1 verified',
        'β–Ά APL Fortran package verification...',
        'βœ“ 10 files, 6 symbols verified',
        '',
        '$ npm run swarm',
        'β–Ά Loading problems from registry...',
        'βœ“ 3 problems loaded',
        'β–Ά Distributing to git buckets...',
        'βœ“ Sealed 3 problems β†’ bucket_np_registry',
        'βœ“ Sealed 1 problem β†’ bucket_np_1',
        'βœ“ Sealed 1 problem β†’ bucket_np_2',
        'βœ“ Sealed 1 problem β†’ bucket_p_3',
        'β–Ά Verification: 6/6 passed',
        'βœ“ Swarm orchestration complete',
        '',
        '$ git push origin main',
        'βœ“ Deployed to GitHub Pages',
        'β–ˆ'
    ];
    
    const terminal = document.getElementById('terminal-output');
    let lineIndex = 0;
    
    function addTerminalLine() {
        if (lineIndex < terminalLines.length) {
            const line = document.createElement('div');
            const isLast = lineIndex === terminalLines.length - 1;
            line.className = isLast ? 'terminal-line cursor' : 'terminal-line';
            line.textContent = terminalLines[lineIndex];
            
            // Color coding
            if (terminalLines[lineIndex].startsWith('βœ“')) {
                line.style.color = '#27c93f';
            } else if (terminalLines[lineIndex].startsWith('β–Ά')) {
                line.style.color = '#00d4cc';
            } else if (terminalLines[lineIndex].startsWith('$')) {
                line.style.color = '#ffbd2e';
            }
            
            terminal.appendChild(line);
            terminal.scrollTop = terminal.scrollHeight;
            lineIndex++;
            
            // Faster animation for empty lines
            const delay = terminalLines[lineIndex - 1] === '' ? 200 : 400;
            setTimeout(addTerminalLine, delay);
        }
    }
    
    // Start terminal animation after 2 seconds
    setTimeout(() => {
        terminal.innerHTML = '';
        addTerminalLine();
    }, 2000);
})();