Re-exports the canonical seven-method API — createCausl,
graph.input, graph.derived, graph.commit, graph.read,
graph.subscribe, graph.explain — together with the second-tier
extensions justified individually on the Graph interface
(subscribeCommits, commitLog, exportModel, simulate,
snapshot, hydrate, readAt, snapshotAt, now), the structured error classes
for the race-class catalogue, and the CauslModel IR plus its
JSON Schema document — the bridge from the TypeScript engine to the
Rust causl-check bounded model checker.
Consumers should rely on this barrel; deep imports into individual
modules are not part of the supported surface.
One engine, and createCausl() is construct-or-throw
@causl/causl-wasm-ts is driven by the Rust→WASM core (SPEC §18A.13), and
as of 0.5.0 (causl/causl-wasm-ts#280) that is the ONLY engine it
ships. The CUT (epic #31 / issue #34) removed the TypeScript engine factory
from this barrel; 0.5.0 removed the two options that still reached the
TypeScript floor (CreateCauslOptions.engine, CreateCauslOptions.backend) and
withdrew the SPEC §18A.13.1 capability fallback that used to substitute the
floor on a host where WasmGC could not instantiate. The two supported
public entry points are:
createCausl(options) — the default factory, and synchronous.
It returns the real wasm engine when @causl/causl-wasm-ts/wasm has been
preloaded for the default bridge, and otherwise throws during
construction — before any Graph is returned, with no partially-built
graph and no async window. There is no TypeScript-floor return value any
more.
createCauslWasm(options) — the async wasm factory, exported
from the @causl/causl-wasm-ts/wasm subpath (kept out of the main bundle).
This is the SPEC §18A backend contract: the same seven-method
spine, driven by the Rust→WASM core through a thin marshalling
bridge.
awaitpreloadCauslWasm() // ONCE, at app init — and in your test setup constgraph = createCausl()
Four construction failures are possible. For the three ENGINE-REACHABILITY
ones, branch on err.code, never on instanceof, because the main
bundle's WasmEngineUnavailableError twin cannot extend the /wasm class
(the bundle-no-wasm-leak gate):
CAUSL_WASM_ENGINE_UNAVAILABLE (the /wasm subpath was never imported in
this process, or the host cannot instantiate WasmGC) and
CAUSL_WASM_NOT_PRELOADED (imported, but preloadCauslWasm() never
resolved). isCauslEngineUnavailable is the guard for both.
The fourth is not about the engine at all: CAUSL_REMOVED_ENGINE_OPTION
(RemovedEngineOptionError), raised when the options bag still
carries engine / backend / fallbackToTs / fallbackToJs — the four
0.5.0 removed. It is ONE class from one module, so instanceof is a
correct test here; isRemovedEngineOption is provided so both families
read alike. The ## [0.5.0] section of CHANGELOG.md is the authoritative
failure contract and numbered migration.
The pure-TS closure still exists INTERNALLY (the wasm path wraps it as its
structural / handle / dependency layer) but is not a public engine choice
and is no longer a fallback; deleting it outright is EPIC
causl/causl-wasm-ts#275 and has not landed. loadWasmBackend is
not an adopter entry point — it is a determinism-gate shim that wraps a
plain instance of that same closure, it does not satisfy createCausl()'s
preload precondition, and the backend option that consumed its return
value was removed in 0.5.0. See the
@causl/causl-wasm-ts/wasm
module for preloadCauslWasm, createCauslWasmSync, BackendEngine and
the Bridge FFI surface.
Public-surface barrel for
@causl/causl-wasm-ts.Re-exports the canonical seven-method API —
createCausl,graph.input,graph.derived,graph.commit,graph.read,graph.subscribe,graph.explain— together with the second-tier extensions justified individually on theGraphinterface (subscribeCommits,commitLog,exportModel,simulate,snapshot,hydrate,readAt,snapshotAt,now), the structured error classes for the race-class catalogue, and the CauslModel IR plus its JSON Schema document — the bridge from the TypeScript engine to the Rustcausl-checkbounded model checker.Consumers should rely on this barrel; deep imports into individual modules are not part of the supported surface.
One engine, and
createCausl()is construct-or-throw@causl/causl-wasm-tsis driven by the Rust→WASM core (SPEC §18A.13), and as of 0.5.0 (causl/causl-wasm-ts#280) that is the ONLY engine it ships. The CUT (epic #31 / issue #34) removed the TypeScript engine factory from this barrel; 0.5.0 removed the two options that still reached the TypeScript floor (CreateCauslOptions.engine,CreateCauslOptions.backend) and withdrew the SPEC §18A.13.1 capability fallback that used to substitute the floor on a host where WasmGC could not instantiate. The two supported public entry points are:createCausl(options)— the default factory, and synchronous. It returns the real wasm engine when@causl/causl-wasm-ts/wasmhas been preloaded for the default bridge, and otherwise throws during construction — before anyGraphis returned, with no partially-built graph and no async window. There is no TypeScript-floor return value any more.createCauslWasm(options)— the async wasm factory, exported from the@causl/causl-wasm-ts/wasmsubpath (kept out of the main bundle). This is the SPEC §18A backend contract: the same seven-method spine, driven by the Rust→WASM core through a thin marshalling bridge.The boot sequence is one
await, once:Four construction failures are possible. For the three ENGINE-REACHABILITY ones, branch on
err.code, never oninstanceof, because the main bundle'sWasmEngineUnavailableErrortwin cannot extend the/wasmclass (the bundle-no-wasm-leak gate):CAUSL_WASM_ENGINE_UNAVAILABLE(the/wasmsubpath was never imported in this process, or the host cannot instantiate WasmGC) andCAUSL_WASM_NOT_PRELOADED(imported, butpreloadCauslWasm()never resolved).isCauslEngineUnavailableis the guard for both.The fourth is not about the engine at all:
CAUSL_REMOVED_ENGINE_OPTION(RemovedEngineOptionError), raised when the options bag still carriesengine/backend/fallbackToTs/fallbackToJs— the four 0.5.0 removed. It is ONE class from one module, soinstanceofis a correct test here;isRemovedEngineOptionis provided so both families read alike. The## [0.5.0]section ofCHANGELOG.mdis the authoritative failure contract and numbered migration.The pure-TS closure still exists INTERNALLY (the wasm path wraps it as its structural / handle / dependency layer) but is not a public engine choice and is no longer a fallback; deleting it outright is EPIC
causl/causl-wasm-ts#275and has not landed.loadWasmBackendis not an adopter entry point — it is a determinism-gate shim that wraps a plain instance of that same closure, it does not satisfycreateCausl()'s preload precondition, and thebackendoption that consumed its return value was removed in 0.5.0. See the@causl/causl-wasm-ts/wasmmodule forpreloadCauslWasm,createCauslWasmSync,BackendEngineand theBridgeFFI surface.