Paragraph compositor for the browser. Beam-search line breaking with syntactic protection, contour-shaped rag, hanging punctuation, and post-render self-verification — the engine behind typeset.us, running live on every page of the site it ships from.
The browser types. It doesn't read. The case, set by its own subject: typeset.us/essay.
One line, any site:
<script src="https://typeset.us/go.js" defer></script>Version-pinned with subresource integrity — the canonical snippet with the
current hash lives in public/sri.json, and published
pins are permanent: bytes never change, files are never removed.
Or from npm — ESM, CJS, and global builds with types:
npm install typeset.usThe engine grades its own output. Typeset.audit() returns [] when a page
has no overflows, no orphaned last words, and no weak line ends — a
machine-checkable definition of done. Paragraphs report what happened via
data-ts-outcome (composed, fallback:*, skipped:*) and flag
data-typeset-done when decided. Full integration contract for humans and
agents: typeset.us/for-agents.
src/lib/typeset.ts— the engine. Everything shipped is generated from it.src/app/— the Next.js site (typeset.us). The site runs the same engine it ships.public/go.js,public/go@x.y.z.js,public/sri.json— generated drop-ins and their hashes (npm run build:dist).packages/typeset.us/— the npm package.docs/BINDING.md— how the phrase-binding weight was derived, and what the evidence does not support.CHANGELOG.md— what changed, including the bugs.
npm run dev # site at localhost:3000
npm run build:dist # regenerate go.js, typeset.min.js, esm + npm artifacts
npm test # playwright: composition gates on the shipped bundles
npm run bench # engine benchmarksMIT © Dustin York — typeset.us/support