Skip to content

ADR 0003 No Native Deps

Vitor edited this page Dec 3, 2026 · 1 revision

0003. No native dependencies

Status: accepted (2026-12-02)

Context

botticelli runs through npx inside agent harnesses on macOS, Linux and Windows. Native modules (sharp, canvas) break on Node upgrades and missing toolchains. Image work here is small: 236–736px thumbnails, dHash, k-means over a few thousand pixels, and a grid composite.

Decision

Decode and encode images in pure JS (jpeg-js, pngjs). The browser automation for the hunter (playwright-core) is an optional dependency that is loaded lazily and uses an installed Chrome or the Playwright cache. It never downloads browsers on install.

Consequences

  • Pure JS is slower than sharp. That's fine at thumbnail sizes, so the pipeline always works on thumbnails, never on originals.
  • WebP and GIF thumbnails are requested as JPEG renditions from the CDN instead of being decoded locally.

Clone this wiki locally