Decode a .bgcode v1 buffer to plain G-code. Walks every block, verifies per-block CRC32 (when the
file declares it), decompresses + decodes the GCode blocks, and concatenates them in file order.
Non-GCode blocks are walked past (their metadata/thumbnails are surfaced in phase 4). Every failure
is a structured, bounded ContainerError (from @chestnutlabs/gcode-containers) — never a crash or
an unbounded read/allocation.
@chestnutlabs/gcode-bgcode — Binary G-code (
.bgcode) decode adapter (DD-011, epic #188).A license-clean, in-memory decoder for Prusa's binary G-code container.
.bgcodeis a container of ordinary G-code, so decoding it (block walk → CRC verify → decompress → decode → concatenate) yields plain G-code the existing parser/dialect/IR/renderer stack consumes unchanged. Decode-only.Clean-room from the published spec (RR-003) — no AGPL
libbgcode/MeatPack code. Depends only on@chestnutlabs/toolpath-coreand@chestnutlabs/gcode-containers(forcrc32/ContainerError); nothree, framework, filesystem, or network.All spec codecs are decoded (None/DEFLATE/heatshrink × None/MeatPack), validated against real Prusa files (golden-equivalence). Phase 4c registers a container adapter so
.bgcodeflows through the parser pipeline viacontainers: 'auto', surfacing machine geometry + settings + thumbnails.