Open core. The language is yours.
m0saic is one idea — every layout is a string of rectangles — carried by a stack of small packages. Everything from the language up through the template libraries is open source or on its way there: 12 packages, four already on npm, the rest landing in the m0saic-project org. This page is the architecture in one read: what each layer does, what it depends on, and where to find it.
The m0 grammar: parser, validator and AST algebra. Frozen at 1.x — the one package the whole system agrees on.
depends on: —
Builders, transforms and queries that produce m0 strings — placeRect, golden, bentoGrid, weightedSplit, the QR generator. If it emits m0, it lives here.
depends on: dsl · dsl-file-formats
The on-disk transport: parse and serialize .m0, .m0c and .m0p — a bare layout, a layout with labels and overlays, a pack of them.
depends on: dsl
Canonical TypeScript types for documents, sources, templates, outputs and telemetry. The lowest-level public surface; nothing below it but the DSL.
depends on: dsl
Document loaders and validators, asset and secret resolvers, template-repo loading, the ffmpeg toolchain fetch, the share-link codec, and the telemetry client (local records, rollups, the sender). Public so the privacy story is checkable.
depends on: dsl · dsl-stdlib · types
Text → SVG glyph paths with a bundled deterministic font, so text in a layout is geometry too and renders identically on every machine.
depends on: —
The shape library: named layouts — the 33-tile M, the brand pattern, QR bodies, masks, generators — as .m0c entries any template or the editor can drop in.
depends on: dsl · dsl-file-formats · dsl-stdlib · types
The authoring runtime — defineMosaicTemplate, props schemas, seeded randomness, primitives, ffmpeg expression builders, the forensic namespace. Anything an author uses that isn't producing m0.
depends on: dsl · dsl-stdlib · platform · types
The built-in library that ships with the product: brand, hero, charts, alpine data-viz, media, social, agents, GitHub, forensic. One registry, every id frozen once shipped.
depends on: dictionary · dsl-stdlib · platform · template-utils · types
Community-contributed templates, one folder per publisher, ids @handle/pack/slug/vN. Signed releases; the same manifest shape as the official library.
depends on: dsl-stdlib · platform · template-utils · types
The Community M — the 33-tile brand M as .m0c/.m0p, one slot folder per contributor, the generated index the app and CLI read, and zero-dependency tools to validate, assemble and claim a tile.
depends on: —
scripts/gen-dependency-graph.mjs.Dependencies only point down. The language depends on nothing. Types and platform depend on the language. Templates depend on types, platform and the language. Nothing public reaches into the closed engine — that rule is enforced by an import-graph check in the monorepo, so a public package can always be built and tested on its own. The published DSL packages carry semver with a changelog entry on every change; the rest are versioned with the product until they graduate.
Want to build on it today? The template repo starter is a working template repository against the published packages, the language paper is the grammar in full, and Learn in Mosaic Web teaches it interactively.
Next: write a template · the Community M · why rectangles