@abraca/schema
v2.10.0
Published
One declaration of doc-types — generates TypeScript, JSON Schema, Rust, MCP tool, and Markdown reference output.
Readme
@abraca/schema
The canonical page-type schema spec for Abracadabra. One Zod declaration per doc-type generates TypeScript, a JSON-Schema bundle, Rust, Swift, and Markdown — so every language validates the same shapes. Zero runtime dependencies.
Documentation
Full, code-derived documentation lives in docs/ — the registry model, the
universal meta object, all 16 page types, the query DSL, CRDT markers, the plugin
manifest validator, and the codegen pipeline. It is the source of truth (more
authoritative than any prose page-type guide).
At a glance
import { defineSchema, Kanban, Doc } from "@abraca/schema";
const schema = defineSchema({ types: [Kanban, Doc] });
schema.validateMeta("kanban", meta); // {ok:true} for unknown types (Rule 4)- 16 page types — doc, prose, kanban, gallery, table, outline, checklist, graph, timeline, calendar, map, dashboard, chart, sheets, slides, overview.
- Additive / opt-in — no aggregate schema; compose the subset you need; unknown types are never rejected, known types are closed (
additionalProperties:false). query.tsis the wire contract the Rust server's query engine mirrors.
::
The generated JSON-Schema bundle (
registry/v1.json) is the real cross-language contract — consumed by the RustSchemaValidationExtensionand MCP tool schemas. Never hand-editsrc/generated/**; runpnpm schema:gen(CI verifies).yjs/zodare peer deps.
License
MIT.
