cyb/landing/cyb.js

/* cyb.ai — the robot · the deck. seven chapters: robot · own · worlds · anatomy · wire · numbers · get it
   marks: ● measured · ○ target · ◌ mock. every number carries one. */
(() => {
const $ = (s, r = document) => r.querySelector(s);
const el = (h) => { const t = document.createElement('template'); t.innerHTML = h.trim(); return t.content.firstChild; };
const fmt = (n) => n.toLocaleString('en-US');
const esc = (t) => String(t).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
const M = (k) => `<i class="mk ${k}"></i>`;
const MONO = 'JetBrains Mono,Menlo,monospace';
const COLS = ['#ff1a00', '#ff7a00', '#ffc400', '#00ff41', '#00b8ff', '#1e00ff', '#7a00ff'];
const REL = 'https://github.com/cyberia-to/cyb/releases/download/v0.16.0/';

/* ------------------------------------------------------------------ sound · synthesized, no files */
const sfx = (() => {
  let ac = null, master = null, on = localStorage.getItem('cyber.sound') !== 'off', amb = null;
  const ensure = () => { if (ac) return true; try { ac = new (window.AudioContext || window.webkitAudioContext)(); master = ac.createGain(); master.gain.value = .22; master.connect(ac.destination); } catch { return false; } return true; };
  const resume = () => { if (ac && ac.state === 'suspended') ac.resume(); };
  const tone = (f0, f1, dur, type = 'sine', g = .5, at = 0) => { if (!on || !ensure()) return; resume(); const t = ac.currentTime + at; const o = ac.createOscillator(), v = ac.createGain(); o.type = type; o.frequency.setValueAtTime(f0, t); if (f1) o.frequency.exponentialRampToValueAtTime(f1, t + dur); v.gain.setValueAtTime(0, t); v.gain.linearRampToValueAtTime(g, t + .006); v.gain.exponentialRampToValueAtTime(.0005, t + dur); o.connect(v); v.connect(master); o.start(t); o.stop(t + dur + .02); };
  const noise = (dur, g = .3, hp = 2000) => { if (!on || !ensure()) return; resume(); const t = ac.currentTime; const n = ac.sampleRate * dur | 0, b = ac.createBuffer(1, n, ac.sampleRate), d = b.getChannelData(0); for (let i = 0; i < n; i++) d[i] = (Math.random() * 2 - 1) * (1 - i / n); const src = ac.createBufferSource(); src.buffer = b; const f = ac.createBiquadFilter(); f.type = 'highpass'; f.frequency.value = hp; const v = ac.createGain(); v.gain.value = g; src.connect(f); f.connect(v); v.connect(master); src.start(t); };
  const ambient = (start) => { if (!ensure()) return; if (start && !amb && on) { const v = ac.createGain(); v.gain.value = 0; v.connect(master); const f = ac.createBiquadFilter(); f.type = 'lowpass'; f.frequency.value = 220; f.connect(v); const os = [55, 55.4, 82.5].map((fr) => { const o = ac.createOscillator(); o.type = 'triangle'; o.frequency.value = fr; o.connect(f); o.start(); return o; }); v.gain.linearRampToValueAtTime(.06, ac.currentTime + 4); amb = { v, os }; } if (!start && amb) { amb.v.gain.linearRampToValueAtTime(0, ac.currentTime + 1); const a = amb; amb = null; setTimeout(() => a.os.forEach((o) => o.stop()), 1200); } };
  const NOTES = [220, 246.9, 277.2, 329.6, 370, 440, 493.9];
  return {
    get on() { return on; },
    toggle() { on = !on; localStorage.setItem('cyber.sound', on ? 'on' : 'off'); if (on) { ensure(); resume(); ambient(true); tone(660, 990, .12, 'sine', .4); } else ambient(false); return on; },
    wake() { if (on && ensure()) { resume(); ambient(true); } },
    tick() { noise(.02, .25, 3000); tone(1800, 1200, .03, 'square', .08); },
    move(dir, ch) { noise(.03, .2, 1500); tone(dir > 0 ? 440 : 520, dir > 0 ? 560 : 400, .08, 'sine', .25); if (ch != null) { const r = NOTES[ch]; tone(r, null, .5, 'sine', .18, .04); tone(r * 1.5, null, .45, 'sine', .1, .08); } },
    link() { tone(880, 1320, .16, 'sine', .35); tone(1320, 1760, .22, 'triangle', .18, .1); },
    hash() { noise(.012, .12, 4000); },
    ticket() { tone(1760, 1750, .35, 'sine', .3); tone(2640, 2630, .25, 'sine', .12, .02); },
    converge(d) { const f = 220 + 1200 * Math.min(1, Math.max(0, (-Math.log10(Math.max(d, 1e-9)) - 1) / 7)); tone(f, f * 1.02, .07, 'triangle', .22); },
    stake(v) { tone(v ? 160 : 110, 60, .25, 'sine', .45); noise(.05, .15, 800); },
    mentor() { [0, 2, 4, 6].forEach((k, i) => tone(NOTES[k] * 2, null, .3, 'sine', .22, i * .09)); },
    chord(ch) { const r = NOTES[ch]; [1, 1.25, 1.5, 2].forEach((m, i) => tone(r * m, null, .9, 'sine', .14, i * .05)); },
  };
})();


const CH = [
  { id: 'robot', name: 'the robot', c: 'var(--c1)' }, { id: 'own', name: 'own', c: 'var(--c2)' }, { id: 'worlds', name: 'worlds', c: 'var(--c3)' }, { id: 'anatomy', name: 'anatomy', c: 'var(--c4)' },
  { id: 'wire', name: 'the wire', c: 'var(--c5)' }, { id: 'numbers', name: 'numbers', c: 'var(--c6)' }, { id: 'get', name: 'get it', c: 'var(--c7)' },
];
const chIdx = (id) => CH.findIndex((c) => c.id === id);
const S = []; const push = (ch, html, cls = '', extra = {}) => S.push({ ch: chIdx(ch), cls, html, ...extra });
const shot = (file, cls, cap) => `<figure class="shot ${cls}">${cap ? `<figcaption>${esc(cap)}</figcaption>` : ''}</figure>`;

/* the twenty-one parts: name · layer · line · today (anatomy.md / cy/specs/anatomy.md) */
const PARTS = [
  ['name', 'identity', 'a unique identity nobody can take — a name that resolves to your robot on a network that cannot be turned off', 'ports with the soft3 genesis'],
  ['avatar', 'identity', 'the robot\'s model — the rendered being others see and recognize', 'to grow'],
  ['soul', 'identity', 'one file that defines how your robot thinks when asked — which model, which manners, what it may do unasked', 'to define'],
  ['ward', 'identity', 'the enforcer: every act any code wants passes its gate — allowed, refused, or asked of you', 'live · effect router'],
  ['soma', 'mind', 'mind and model: local inference on your own silicon. nobody reads your questions', 'live'],
  ['brain', 'mind', 'the knowledge graph, rendered live — everything it knows, as a world you fly through', 'live · 37 fps on pixel, 60 Hz on mac'],
  ['memory', 'mind', 'every particle as a file — the same brain ranked by focus, viewed as your library', 'live'],
  ['com', 'senses', 'the commander: one line where you type — the robot\'s mouth, always present', 'live'],
  ['sense', 'senses', 'the messenger: how it talks to other neurons, particles and robots', 'seed'],
  ['voice', 'senses', 'it hears and speaks', 'to grow'],
  ['vision', 'senses', 'it sees — camera, screen, world', 'to grow'],
  ['state', 'senses', 'reads other networks and proves what it reads; every answer wears a tier — verified, anchored, or unproven', 'doctrine'],
  ['sigma', 'value', 'not a wallet: the sum of everything it owns, and the neurons it commands', 'live · last-known balance'],
  ['vault', 'value', 'secrets under seal — keys, mnemonics, sleeping identities. sigma spends; vault signs', 'live · XChaCha20 under mnemonic + TOTP'],
  ['log', 'time', 'everything that ever happened, on a durable tape — the robot forgets nothing', 'live · 43,613 signals on a phone'],
  ['now', 'time', 'the context: the particle it stands on — what commands act on, what the model sees. attention is a position', 'partial'],
  ['plan', 'time', 'standing orders and schedules — it acts at 3am so you don\'t have to', 'seed'],
  ['time', 'time', 'one screen: the past flowing into now flowing into the plan. your life, one axis', 'to build · the flagship view'],
  ['body', 'flesh', 'the physical body: silicon, sensors, energy, mining — telemetry of the machine it lives on', 'live · the default world'],
  ['cell', 'flesh', 'organs it can grow: live-loaded programs that add abilities while it runs', 'folded into neuron'],
  ['radio', 'flesh', 'the physical layer: sovereign transport to other networks — the wire obeys the graph', 'live as cy wire · shell wiring not started'],
];
const partsFig = (layer) => `<div class="parts">${PARTS.filter((p) => !layer || p[1] === layer).map(([n, l, d, t]) => `
${n}<i>${l}${esc(d)}</span><span class="st">${esc(t)}</span></div>`).join('')}</div>`; /* 1 · the robot */ push('robot', `<div><p class="kick">cyb · the robot · v0.16.0</p><p class="hero-word">cyb</p> <h2>intelligence <em>you own.</em></h2> <p class="lead">the immortal robot — your personal interface to superintelligence. a digital being that works for you: thinks while you think, earns while you sleep, remembers what you forget. yours forever.</p> <div class="tiles"><div class="tile"><b>not rented</b>not a subscription, not an account that gets banned</div><div class="tile"><b>one binary</b>macOS · android · linux — the same robot, the same worlds</div><div class="tile"><b>local mind</b>inference on your own silicon; nobody reads your questions</div><div class="tile"><b>mines and pays</b>from your pocket, on real chains</div></div> <p class="kbd">→ or space to move · <span id="nslides"></span> slides</p></div>`, 'one'); push('robot', `<div><p class="kick">01 · the robot · the body</p><h2>the robot is cy<br><em>with a body.</em></h2><p class="lead">cy is the agent — the mind over the book, headless anywhere. cyb gives it eyes, ears, pictures and a pocket. every cyb is born unique and grows with its owner: it learns from every cyberlink you create, remembers everything you ever linked, and reasons over a living cybergraph no corporation can erase.</p><p class="mute">the robot belongs to its owner, runs on any surface, and answers to no one else.</p></div>${shot('mac.png', 'mac', 'the brain world on macOS · v0.16.0 · 1,437 particles · 5,603 axons')}`, '', { bridge: 'why own a mind at all? because every other one is rented.' }); /* 2 · own */ push('own', `<div><p class="kick">02 · own · the thesis</p><h2>all intelligence sold today<br><em>is rented.</em></h2><p class="lead">the provider owns it, it dies with the account, it cannot be transferred. cyb is a robot you own outright: it earns, acts, remembers, has standing, and does not die. a capital asset that compounds.</p><p class="mute">the wedge: own, don't rent. ownership is the founding principle — no keys, no robot.</p></div> <div class="steps"><div class="step"><b>it earns</b><span>mines settlement tickets and proof-of-work on your machine; sigma holds what it owns</span></div><div class="step"><b>it acts</b><span>every act passes ward's gate — allowed, refused, or asked of you; nothing acts on its own</span></div><div class="step"><b>it remembers</b><span>a durable log and a ranked memory; the robot forgets nothing</span></div><div class="step"><b>it does not die</b><span>name + soul + vault seed + log — carry those four to any machine and the robot resurrects</span></div></div>`, 'ink'); push('own', `<div><p class="kick">02 · own · immortality</p><h2>carry four things<br><em>and it resurrects.</em></h2><p class="lead">the robot's immortality needs no extra organ. it is the backup: name, soul, vault seed, log. move them to any machine and the same robot wakes up with the same memory, the same keys, the same standing.</p></div> <div class="nums"><div class="n"><big>name</big><small>the identity that resolves through the graph · ports with the soft3 genesis</small></div><div class="n"><big>soul</big><small>one file: which model, which manners, what it may do unasked</small></div><div class="n"><big>seed</big><small>the vault: keys and mnemonics under seal</small></div><div class="n"><big>log</big><small>everything that ever happened, on a durable tape</small></div></div>`, '', { bridge: 'what it looks like, today, on real devices.' }); /* 3 · worlds */ push('worlds', `<div class="full"><p class="kick">03 · worlds · the same robot on a phone</p><h2>ten worlds. <em>one binary.</em></h2><div class="shots">${shot('android.png', 'phone', 'body · telemetry, miners, networks')}${shot('android-brain.png', 'phone', 'brain · the graph you fly through')}${shot('android-log.png', 'phone', 'log · 43,613 signals')}${shot('android-sigma.png', 'phone', 'sigma · what it owns')}</div><p class="fine">pixel 10 · v0.16.0 · all shots are the shipped build ${M('m')}</p></div>`, 'one'); push('worlds', `<div><p class="kick">03 · worlds · the body</p><h2>the default world<br><em>is the body.</em></h2><p class="lead">cpu, memory, network, energy — and the miners: zheng settlement tickets and the seer, with the day's yield. the robot opens on what it already knows and never says "loading": never wait on the network to paint.</p><p class="mute">worlds in the shipped build: body · brain · log · chat · robot · sigma · models · vault · memory · oracle ${M('m')}

${shot('android.png', 'phone', 'body world · pixel 10')}`
)
; push('worlds', `<div><p class="kick">03 · worlds · the brain</p><h2>everything it knows,<br><em>as a world you fly through.</em></h2><p class="lead">the knowledge graph rendered live as topology — particles sized by focus, axons as light. one compute kernel per frame; on the phone it paints over Vulkan with zero-copy memory. tap a particle to read it.</p><p class="mute">measured: 37 fps on pixel 10 ${M('m')}, 60 Hz pinned on mac ${M('m')}; the 100+ fps on the old page is a target ${M('t')}

${shot('android-brain.png', 'phone', 'brain · pixel 10')}`, '', { bridge: 'under the worlds, twenty-one parts in six layers.' }); /* 4 · anatomy */ push('anatomy', `<div class="full"><p class="kick">04 · anatomy · twenty-one parts, six layers</p><h2>a robot is not an account.<br><em>it is an organism.</em></h2>${partsFig()}

identity · mind · senses · value · time · flesh — each part a power that is only yours. status words are from the anatomy page: live, seed, to grow, to build ${M('m')}</p></div>`, 'one ink'); push('anatomy', `<div><p class="kick">04 · anatomy · what is live today</p><h2>soma, brain, memory,<br><em>com, sigma, vault, log, body.</em></h2><p class="lead">eight organs carry real traffic in v0.16.0: the local model streams tokens, the brain paints the graph, memory ranks it by focus, com is the mouth, sigma holds the balance, vault signs under seal, the log keeps every signal, the body reports the machine.</p><p class="mute">to grow: avatar, voice, vision, plan, sense. to build: time, the flagship view — log ← now → plan, your life on one axis. radio is live as cy wire; wiring it into the shell is the named next milestone.</p></div> <div class="nums"><div class="n"><big>8</big><small>organs live in v0.16.0 ${M('m')}