• Async wasm-engine factory — the @causl/causl-wasm-ts/wasm member of the package's TWO adopter-facing graph factories: createCauslWasm() (async, this one) and createCausl() (sync, the main barrel's headline factory, which reaches THIS SAME engine through the src/wasm-registry.ts slot and throws when it cannot). Returns a public seven-method Graph whose commit / read / subscribe / derived-compute run through the wasm backend for the resolved bridge.

    causl/causl-wasm-ts#363 — this paragraph described a 0.4.x "engine trio" in which a TypeScript factory sat beside createCauslWasm() and createCausl() was a sync wrapper around it. createCausl() stopped wrapping anything at #280 (it is construct-the-wasm-engine-or-throw), the TypeScript factory left the public barrel at epic #31 / issue #34, and #279 slice S12 deleted the engine behind it. There is no trio and no engine choice: there is one engine, reached synchronously or asynchronously.

    Shipped: the returned Graph runs over the REAL Rust engine via the FFI bridge — the epic-B #32 loader port (artefact loader + true compile/instantiate split) has LANDED, and every adopter operation resolves from Rust (§18A.3 lift, causl/causl-core-rs#170).

    §18A.12 — the factory is expressed as preload ∘ sync: ONE instantiate codepath, provably equal to preloadCauslWasm(); createCauslWasmSync(), zero drift. The async preloadCauslWasm resolves the artefact + per-graph backend params (the ONE async seam — the real WebAssembly.compile); the synchronous createCauslWasmSync instantiates and builds the Graph with ZERO await. The signature is back-compat-shaped against the rest of the trio so callers keep awaiting it.

    TWO BAGS, both read (causl/causl-wasm-ts#363, causl/causl-wasm-ts#411). This is the only factory that takes a loader bag AND a nested create: CreateCauslOptions. Three options are declared by both (commitHistoryCap, snapshotRetentionCap, batchedFlush) and are accepted in EITHER; when both name one, create wins PER FIELD and a field it omits inherits the loader bag's value. Everything else belongs to exactly one bag: bridge / wasmBaseUrl / fetch / computeImportsUrl / graphName (the wasm backend's engine-side graph name) to the loader bag, and name (the IR graphId the graph closure stamps) plus the rest of CreateCauslOptions to create.

    Parameters

    Returns Promise<Graph>

    import { createCauslWasm } from '@causl/causl-wasm-ts/wasm'
    const graph = await createCauslWasm()
    const a = graph.input('a', 1)
    graph.commit('set', (tx) => tx.set(a, 2)) // a === 2

    WasmEngineUnavailableError when the wasm path cannot be resolved on this host. #280 removed the { fallbackToTs: true } soft path: there is no second engine to degrade to, and one that DISAGREES with the primary (#272) is worse than none.