skip to the page

Installation

Loom is two packages. @jam-overture/loom is the framework — the tree, the change model and the Gate — with several entry points behind it. @jam-overture/loom-primitives is the starter library: the one hundred and nine primitives every example on this site is built from.

Install both, plus React to render what they produce and Zod to declare the props of a primitive.

pnpm add @jam-overture/loom @jam-overture/loom-primitives react react-dom zod

You can skip the second one. The framework has no opinion about which primitives exist — it is a vocabulary you register, and the starter library is one somebody already wrote. Every page here uses it because a book about a language needs words in it.

What you actually need

Only the first two are Loom's. The rows carrying a command of their own are the ones you add on the day you reach the page that needs them:

PackageYou need it whenFirst used on
@jam-overture/loom
always. It is the framework: the tree, the change model and the Gate.Installation
@jam-overture/loom-primitives
you want the starter library rather than a vocabulary of your own.Installation
react
you are rendering. The tree itself has no opinion about React.Primitives and the registry
react-dom
you are rendering in a browser. Your framework imports it; your own code need not.—
zod
always. Every primitive declares its props as a Zod schema, validated where a tree becomes an element, and a primitive of your own imports it directly.Primitives and the registry
vitest
$ pnpm add -D vitest
you are writing the tests these pages show you how to write.A primitive of your own
drizzle-orm
postgres
$ pnpm add drizzle-orm postgres
you are persisting trees rather than holding them in memory.Going to production
@anthropic-ai/sdk
$ pnpm add @anthropic-ai/sdk
you want a model to interpret a sentence into a proposal.Connecting a model

A deployment with no database and no model still builds trees, applies deltas and gates proposals. That is not an accident of packaging — the model is a seam, not the center.

The entry points

ImportWhat is behind itFor
@jam-overture/loomThe tree, the delta, the ids, the builders, the Gate and the pipeline. Start here.any app
@jam-overture/loom/reactRendering: a tree to React elements, theme mounting, addressing, render diagnostics.any app
@jam-overture/loom-primitivesThe starter library — the primitives every example on this site is built from. Its own package, installed beside the framework.any app
@jam-overture/loom-primitives/compositionsThe starter library's seventy-two bands under their own names, for assembling a page without going through the catalog.any app
@jam-overture/loom/addressedThe four names a render writes on a published page, and the function that finds the page. Loads nothing, for a browser bundle.hosts
@jam-overture/loom/sdkDefining and registering primitives of your own, and the catalog a model is shown.hosts
@jam-overture/loom/storePersisting trees and revisions: the store contract, and an in-memory implementation.hosts
@jam-overture/loom/postgresThe Postgres store. Same contract, a database behind it.hosts
@jam-overture/loom/writeThe write path: proposing, holding, confirming and applying a change.hosts
@jam-overture/loom/livePulling the project's live pages from Loom and holding them in your server, so an accepted change reaches readers without a deploy.hosts
@jam-overture/loom/signalsReader signals — what a published page reports about how it is read, and the parser a receiver checks them with.hosts
@jam-overture/loom/signals/broadcastThe reader-signal broadcaster alone, for a browser bundle — about 5 KB, with no schema library.hosts
@jam-overture/loom/signals/postgresThe Postgres buffer and counters, for a deployment that keeps what its readers did.hosts
@jam-overture/loom/telemetryThe journal — proposal, provenance, disposition and outcome, recorded as they happen.hosts
@jam-overture/loom/telemetry/postgresThe Postgres journal, for a deployment that keeps its telemetry.hosts
@jam-overture/loom/anthropicThe model seam: an interpreter that turns a sentence into a proposal. Optional.hosts
@jam-overture/loom/openai-compatibleThe model seam for a server that speaks the OpenAI-compatible chat API, such as vLLM or Ollama. Optional.hosts
@jam-overture/loom/cliScaffolding and inspection from a terminal.tooling
@jam-overture/loom/testingFixtures and doubles: the sample trees, clocks and scripted interpreters Loom tests itself with.tooling
@jam-overture/loom/testing/contractsThe suites that tell you whether your own store, hold store or journal keeps its promises.tooling

The split is the important part. @jam-overture/loom is the tree and the change model and knows nothing about React, storage or any model provider. Each of the others is one of those things, behind its own door, so that importing the core never drags a database driver into your bundle.

The last row is the one that is not a door but a second package, and the reason is the same split one step out: the framework does not depend on the library, so the library does not ship inside it. It takes @jam-overture/loom as a peer, which is a package's way of saying there must be exactly one copy of this in your tree — two would be two registries that reject each other's entries.

The table above is the map you need to write your first import. The API reference lists the same doors with the number of names behind each, and says the thing this table cannot: they do not nest, so none of them has the whole package behind it.

TypeScript

The package ships its own types and is written for strict mode. Two settings are worth turning on if they are not already: exactOptionalPropertyTypes and noUncheckedIndexedAccess. The runtime's own source uses both, and its types distinguish "absent" from "present and undefined" in several places where the difference matters.

Nothing throws across a seam. Functions that can fail return a Result:

import { createStarterPrimitiveRegistry } from "@jam-overture/loom-primitives"
import { describeRegistryError } from "@jam-overture/loom/sdk"

const built = createStarterPrimitiveRegistry()

if (!built.ok) {
  throw new Error(`the registry was refused — ${describeRegistryError(built.error)}`)
}

const registry = built.value

That shape repeats everywhere: check ok, read value or error. Rendering is the one place that never fails at all — it always returns an element, and says what it could not honor in a list of diagnostics beside it.