Download docs/js/agentos-live.js from Snapkitty/agentos: direct link, hf CLI and curl.
- Browser
- Download file 4.32 kB
-
https://huggingface.co/Snapkitty/agentos/resolve/main/docs/js/agentos-live.js
- Command line
-
hf download hf://Snapkitty/agentos/docs/js/agentos-live.js
-
curl -L -o agentos-live.js https://huggingface.co/Snapkitty/agentos/resolve/main/docs/js/agentos-live.js
4.32 kB
| // 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); | |
| })(); | |