Skip to main content

Crate faf_wasm_sdk

Crate faf_wasm_sdk 

Source
Expand description

FAF WASM SDK — the kernel for the edge.

A thin wasm-bindgen shell over the workspace kernel: scoring is faf-kernel, the binary form is faf-fafb. No scoring or format logic lives here — the same engine that runs in the CLI and the MCP server runs in the browser and at the edge, so there is nothing to drift.

7 pure-function exports. No classes. JSON / bytes in, JSON / bytes out.

§Usage (JavaScript)

import init, { sdk_version, score_faf, validate_faf,
    compile_fafb, decompile_fafb, score_fafb, fafb_info } from 'faf-wasm-sdk';

await init();
const result = score_faf(yamlContent);   // JSON string (always-33 Mk4)
const bytes  = compile_fafb(yamlContent); // Uint8Array (FAFb v2)
const json   = decompile_fafb(bytes);     // JSON string

Functions§

compile_fafb
Compile YAML to a FAFb v2 binary — returns Uint8Array.
decompile_fafb
Decompile a FAFb binary to JSON (full content) — returns JSON string.
fafb_info
Get FAFb file info (header + section metadata, no content) — returns JSON.
score_faf
Score FAF YAML content with the Mk4 kernel (always-33) — returns JSON.
score_fafb
Score a FAFb binary — returns JSON string (same shape as score_faf).
sdk_version
Get SDK version.
validate_faf
Validate FAF YAML content — true if it parses as a YAML mapping.