Repository navigation
Zenith 0.0.11
A plain-text design format and a deterministic engine that agents and people edit, check, and render to PNG, SVG, and PDF.
Added
.zenformat — KDL v2 text withproject,tokens,styles,document, andpageblocks. Every node carries a stable id.zenith newscaffolds a valid document. The first edit stamps a ULIDdoc-idinto the file.- Unknown nodes pass through unchanged, for forward compatibility.
zenith fmtwrites the canonical form.
- Design tokens —
color(sRGB and native CMYK),dimension,number,fontFamily,fontWeight,gradient,shadow,filter, andmask. Aliases chain, and a cycle is a diagnostic. - Node set —
rect,ellipse,line,polygon,polyline,text,code,image,frame,group,pattern,shape,connector,chart,instance,field,footnote,toc, andtable. - Typography —
rustybuzzshaping with bundled Noto Sans and Noto Sans Mono, and font fallback.- Knuth–Liang hyphenation, drop caps, tab leaders, text runaround, and threaded text across
chained boxes. - Inline spans: bold, italic, underline, strikethrough, highlight, inline code, and links.
text src=reads body copy from a.mdor.txtfile.format="markdown"parses inline marks and block structure.block role=sets per-role typography at document, page, or text scope.- A missing glyph reports
font.glyph_missing.
- Knuth–Liang hyphenation, drop caps, tab leaders, text runaround, and threaded text across
- Visual effects — linear and radial gradients, layered shadows, Gaussian blur, feathered masks, and 12 Porter-Duff blend modes. Also opacity cascade, per-corner radius, and image fit, clip shape, and object position.
- Anchors — 9-point placement against the page, a safe zone, the parent, or a sibling. Precedence is zone, then sibling, then parent, then page. Anchors resolve to explicit geometry. A node without an anchor renders the same as hand-placed coordinates.
- Recipes — a
recipesblock records how a generated motif was made: kind, seed, generator, params, palette tokens, and expanded node ids. Typed recipe transactions edit it. - Transaction engine (
zenith tx) — a typed op set for fill, stroke, geometry, structure, alignment, pages, tokens, find-replace, and more.- Dry-run is the default.
--applywrites the file. - It enforces referential integrity and id uniqueness.
- Each run reports a source diff, moved and resized boxes, affected ids, and an audit record.
zenith fixapplies machine fixes for diagnostics, also dry-run by default.
- Dry-run is the default.
- Deterministic rendering (
zenith render) — the same bytes in give the same bytes out on any machine. The render path has no time, no randomness, noHashMap, nounsafe, and no C dependencies.- PNG through tiny-skia: one page, all pages, or facing-page spreads.
- Self-contained SVG with outlined text and embedded assets.
- Vector PDF with native DeviceRGB and CMYK, MediaBox, TrimBox, BleedBox, and no timestamps. Text is selectable and searchable, and links are clickable. Effects the PDF model lacks rasterize their enclosing scope, and a report lists each fallback.
--scenedumps the scene IR as JSON.
- Validation (
zenith validate) — 70+ checks, each with a stable code, a message, the node id, and the source location.- Three severities: Error blocks rendering, Warning still renders, and Advisory is informational.
- Checks cover references, raw visual literals instead of tokens, overflow, margins and safe zones, APCA contrast, colorspace and bleed, and the
variants,recipes, andprovenanceblocks. --jsongives agents a machine-readable result.
- Variants and data merge — one design gives many outputs, deterministically.
zenith variantexpands avariantsblock into named sizes, with per-target overrides. Output is PNG or SVG plus a.zencompanion and azenith-variant-manifest-v1manifest.zenith mergerenders one design per CSV row fromrole="data.<column>"bindings, for text and image columns. It writes a per-row report and a byte-reproducible manifest.
- Connectors — arrows whose endpoints derive from their
fromandtonodes, so they reroute when a node moves.- Named and divided outline anchors, and page
portsthat project through instances. straight,orthogonal, and obstacle-avoidingavoidroutes.- Self-loops, arrowheads, and
line-jumps="arc"or"gap"at crossings.
- Named and divided outline anchors, and page
- Libraries — packs export
<package>#<item>items of kindcomponent,token, oraction.- Embedded packs:
@zenith/flowchart,@zenith/filters,@zenith/masks,@zenith/brand-kit, and@zenith/icons-lucide(1745 icons). - A pack is a
.zenfile or a directory of*.svg. SVG icons convert to editablepathnodes. zenith library searchranks name over alias over tag.library addrecordslibrariesandprovenance.
- Embedded packs:
- History and versions — per-document history off the render path.
undoandredowalk an ephemeral session timeline of full snapshots.versionsaves a named, content-addressed checkpoint (SHA-256 and DEFLATE).restoretakes a name or a revspec.syncrecords an edit made outside the engine.- Scratch candidates (
scratch,candidate,promote,finalize) and portable.zenithbundlefiles (bundle,unbundle).
- CLI — the
zenithbinary. Every command takes--json, andzenith schemadescribes the authorable surface.- Author:
new,validate,fmt,tokens,inspect. - Render:
render. Edit:tx,fix,edit. - Variants:
variant,merge. Library:library list,search,show,add. Theme:theme new. - History:
history,undo,redo,version,restore,sync. Workspace:scratch,candidate,promote,finalize,bundle,unbundle. - Agent:
plugin install,plugin uninstall,plugin list,mcp.plugin installwrites a skill or rule file for Claude Code, Codex, OpenCode, Cursor, and other agents.
- Author:
- MCP server (
zenith mcp) — the full author loop as MCP tools, fromzenith_schematozenith_renderandzenith_merge.- Results are trimmed JSON. Large and binary outputs return as resource links into a content-addressed store.
- Six
zenith_editor_*tools drive editor sessions: open, command, render, sessions, close, and attach to a runningzenith edit. - Stdio is the default transport. The
httpfeature adds Streamable HTTP at/mcpwith a bearer token, loopback bind, Host and Origin checks, an 8 MiB body cap, and--rootconfinement. - The npm package
@zenitheditor/zenith-mcplaunches it throughnpx.server.jsonlists it in the MCP registry.
- Browser editor (
zenith edit) — source and rendered canvas side by side. The source text is the source of truth.- Security: a 64-hex token from the OS RNG, new on every run, travels in the URL fragment and as a
Bearerheader only. The server binds to loopback unless--allow-remote. It checks Host and Origin. - Files: the engine reads only under the document's directory or
--root...and escaping symlinks are errors. - Ctrl-C,
SIGTERM, andSIGHUPstop a clean session with exit code 0. With unsaved edits, the first signal warns, and a second discards them and exits with 130. - Panels: pages and layers, inspector, and diagnostics. A draggable divider and fullscreen buttons resize the split view.
- Canvas: click, Shift-click, and band selection. Move, resize, and rotate one node or several as one selection, with snapping to nodes and the page.
- Every canvas and inspector edit is a transaction. It patches the text in place and keeps comments and layout.
- The canvas renders only the visible region at device resolution.
- Undo and redo cover typing and canvas edits in one history. Agents drive the same session over
POST /api/cmd.
- Security: a 64-hex token from the OS RNG, new on every run, travels in the URL fragment and as a
- Static editor site — the same page with the engine as a
wasm32-wasip1module in a Worker, and no server. It opens and saves files on the user's disk.build-static-editor.mjsbuilds the site and writes a CSP_headersfile. - Wasm parity — the wasm engine and native
zenith editgive equal results on every example: the PNG SHA-256, diagnostics, a viewport render, and the text after each scripted gesture. An end-to-end test checks this. - Crates — 14 crates on crates.io: 13 libraries and
zenith-tool, which installs thezenithbinary.- Libraries:
zenith-geometry,zenith-core,zenith-layout,zenith-raster,zenith-perception,zenith-scene,zenith-render,zenith-tx,zenith-session,zenith-zpx,zenith-producers,zenith-pipeline, andzenith-editor. zenith-editor-wasmis not published.
- Libraries:
Full diff: v0.0.10...v0.0.11