Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
12345678910111213141516import { getKernel } from "@nibling/kernel";import type { Connect } from "./protocol.ts";import { serve } from "./serve.ts";
// Booting starts before the handshake, so the two overlap. A failure reaches the coordinator as bootFailed.const kernel = getKernel();kernel.catch(() => {});
addEventListener("message", function accept(event: MessageEvent<Connect | null>) { const port = event.ports[0]; if (event.source !== parent || parent === self || !__APP_ORIGINS__.includes(event.origin)) return; if (event.data?.t !== "connect" || !port) return; removeEventListener("message", accept); serve(kernel, port);});