@agent-ix/quire-wasm
v0.3.0
Published
WebAssembly bindings for quire-rs (parse, extract, validate) — powers spec-editor live preview.
Readme
quire-wasm
WebAssembly bindings for quire-rs — the parsing, extraction, and validation engine that powers the Filament/Quire spec-artifact ecosystem.
Purpose: give spec-editor and other browser/Node consumers the
canonical parse/extract/validate pipeline so the editor agrees
byte-for-byte with the quire CLI and the Python reference parser.
No render surface. The render/templating feature was removed from
quire-rs(commite0811a8). There is norenderorrenderFromBlobexport; the module blob is{ manifest, schemas }(notemplates).
Public surface
import init, {
parseDocument,
extract,
validate_archetype as validate,
extractFromBlob,
validateFromBlob,
} from "@agent-ix/quire-wasm";
await init(); // load the .wasm
const doc = parseDocument(md);
// Filesystem-rooted (Node target):
const records = extract("FR", "/path/to/module", md);
validate("FR", "/path/to/module", { id: "FR-001", /* ... */ }); // throws on violation
// In-memory module blob (browser / --target web):
const moduleBlob = {
manifest: "<raw manifest.yaml text>",
schemas: { "schemas/fr-frontmatter.schema.json": "<schema json>" },
};
const recs = extractFromBlob("FR", moduleBlob, md);
validateFromBlob("FR", moduleBlob, { id: "FR-001", /* ... */ });Two shapes
- Module-blob (
extractFromBlob,validateFromBlob): pass an in-memory{ manifest, schemas }object — the filesystem-free path used by--target web. Builds an inlineRegistryviaquire_rs::Registry::from_inline_parts(manifest, schemas). - Filesystem-rooted (
extract,validate_archetype): pass amoduleRootpath string. Works underwasm-pack --target nodejs(real fs) and any embedding that polyfillsfsvia WASI.
parseDocument is filesystem-free and works everywhere.
Install
npm install @agent-ix/quire-wasm # from GitHub PackagesBuild
make build # wasm-pack build --target web --release (browser)
make build-node # wasm-pack build --target nodejs --release (Node)
make test # wasm-pack test --node (extract/validate parity vs quire-rs)
make ci # full local CI gate (fmt + lint + test + deny + audit)wasm-pack is required: cargo install wasm-pack.
License
MIT
