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.

closedMosaic DesktopMosaic Webthe CLIthe render engine
the line
opentemplatesplatformtypesthe m0 languagethe Community M
01
The language
The m0 string — every layout is one line of rectangles. Parser, validator, algebra, file formats and the builders that produce m0. This is the substrate; everything else sits on it.
@m0saic/dsl

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: —

@m0saic/dsl-stdlib

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

@m0saic/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

@m0saic/dsl-visual-tests

The golden visual-test harness and the DSL coverage suite — pixel-diffed, pinned to one rasterizer, the proof that the grammar renders the same everywhere.

depends on: dsl · dsl-file-formats · dsl-stdlib

02
Contracts and platform
The shared vocabulary and the plumbing. Types every package agrees on, plus the layer that loads documents, resolves assets and template repos, speaks the share-link wire format, and records local telemetry — in the open, so you can read exactly what leaves your machine.
@m0saic/types

Canonical TypeScript types for documents, sources, templates, outputs and telemetry. The lowest-level public surface; nothing below it but the DSL.

depends on: dsl

@m0saic/momo-types

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

@m0saic/platform

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

@m0saic/text

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

@m0saic/dictionary

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

03
Templates
What people actually render. A template is a TypeScript function that returns a document: a layout string, one source per tile, typed props the editor turns into controls. The runtime helpers, the knowledge base an agent reads before writing one, the built-in library, and the community library.
@m0saic/template-utils

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

@m0saic/knowledge

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: —

@m0saic/templates

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

@m0saic/dsl-react

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)

@m0saic/community-templates

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

04
Community
The brand mark itself is a layout, and every tile of it is a slot someone can claim.
@m0saic/community-m

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. Public since v2026.09.0; tiles are claimed by pull request there.

depends on: —

Every public package and what it depends on, with the closed render engine at the top as the one consumer. Arrows point to the dependency; nothing points up, and nothing public points at the engine. The engine pulls from this graph, one WebAssembly library for SVG rasterizing, and the ffmpeg binary it fetches on request — nothing else. Every node is on npm and public on GitHub: the language from m0saic-dsl/m0, everything above it from m0saic-project. Generated from the monorepo package map by 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