Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
1234567891011121314151617181920212223242526// Demo page logic for the live-binding cycle proof. Same host shape as esm.js;// only the seeded guest graph differs.import { boot } from "@nibling/kernel";
const out = document.getElementById("out");const errEl = document.getElementById("err");const exitEl = document.getElementById("exit");const dec = new TextDecoder();
try { const runtime = await boot(); const read = async (p) => await (await fetch(p)).text(); runtime.writeTree({ "/app/main.mjs": await read("/demo/app/cycle-main.mjs"), "/app/cycle-a.mjs": await read("/demo/app/cycle-a.mjs"), "/app/cycle-b.mjs": await read("/demo/app/cycle-b.mjs"), }); const proc = runtime.exec("/app/main.mjs"); proc.stdout.pipeTo(new WritableStream({ write: (c) => { out.textContent += dec.decode(c); } })); proc.stderr.pipeTo(new WritableStream({ write: (c) => { errEl.textContent += dec.decode(c); } })); exitEl.textContent = String(await proc.exited);} catch (e) { errEl.textContent = "BOOT FAILED: " + (e?.message ?? String(e)); exitEl.textContent = "?";}