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: 15 packages, all on npm, from two public homes — the language at m0saic-dsl/m0 and everything above it under the m0saic-project org (the substrate in m0saic-packages, the community libraries, and the iteration corpus the templates were designed in). 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. At 2.x; majors are rare and deliberate — the one package the whole system agrees on.
depends on: —
Builders, transforms and queries that produce m0 strings — placeRects, golden, weightedSplit, bakeInsets, the QR and barcode generators, SVG and bitmap to m0. If it emits m0, it lives here.
depends on: dsl · dsl-file-formats
The on-disk transport: parse and serialize .m0, .m0c, .m0p and .m0v — a bare layout, a layout with labels and masks, a pack of them, a vocabulary — plus the agent annotation shapes those files carry.
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
The typed agent layer: the annotation block an agent leaves on a layout — note, question, regions, a typed context, the human's response and comments — narrowed from the wire shapes the file formats own.
depends on: dsl-file-formats
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 bundled deterministic fonts, so text in a layout is geometry too and renders identically on every machine.
depends on: dsl · dsl-stdlib
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 knowledge base as plain Markdown — the m0 handbook, the engine mental models and the template-authoring contract. The template-repo starters install it beside your code, and the CLI's MCP server serves it as knowledge_search. Point a coding agent at its README first.
depends on: —
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
The Layout → React bridge: an m0 layout's labeled regions as absolutely-positioned React boxes, so a layout designed in Mosaic becomes the structure of a page. Early and small.
depends on: dsl · react (peer)
Community-contributed templates, one folder per publisher, ids @handle/pack/slug/vN. Public as signed snapshots — the CLI and Desktop verify the release signature before granting the namespace; a PR is the submission. The same snapshot is on npm.
depends on: dsl · dsl-stdlib · platform · template-utils · types
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. Every package carries a changelog entry on every change. The language packages carry their own semver (dsl 2.x, dsl-stdlib 3.x); the rest publish at 0.x in lockstep with the CLI line they ship with, so the version on npm tells you which m0saic they were cut for.
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