Documentation
¶
Overview ¶
tbwasm is the browser entry for the tacklebox pure-Go core: the same packages purebuild proves natively (registry pull → overlay unpack → introspection → liveuser → EROFS → FAT ESP → ISO9660/El Torito), compiled to WASM and exposed as three JS calls:
tboxIntrospect(image, registry) → Promise<factsJSON> tboxBuildIso(opts, onChunk) → Promise<bytesWritten> tboxReset()
opts: { label, initrd: Uint8Array|null }. onChunk receives Uint8Array pieces of the ISO as they stream — the caller appends them to an OPFS file or a download stream. State (tree + blob store) lives between the two calls so the GUI can show facts before committing to a build.
Memory model: nothing the size of the image is held in linear memory. Layer bodies stream to an OPFS arena during unpack, post-unpack tree surgery (live overlay, liveuser, autologin) streams to a second arena, the authored EROFS streams to a third, and reads slice back out of OPFS 4 MiB at a time. The wasm heap holds the oci.Node tree, the EROFS inode table and chunk buffers only — metadata scale, not content scale. That distinction is load-bearing: wasm32 gives a single 32-bit linear memory, so ~4 GiB is a hard ceiling with no host tunable and no Memory64 escape (Go cannot target it) — tacklebox#156.