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 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.

@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.

The boot sequence is one await, once:

import { preloadCauslWasm } from '@causl/causl-wasm-ts/wasm'
import { createCausl } from '@causl/causl-wasm-ts'

await preloadCauslWasm() // ONCE, at app init — and in your test setup
const graph = 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.

Classes

CauslError
CommitInProgressError
CycleError
DerivedComputeError
DerivedRegistrationStackOverflowError
DisposalDuringCommitError
DuplicateNodeError
HydrationSchemaError
InvalidGraphNameError
InvalidNodeHandleError
InvariantViolationError
NodeDisposedError
NodeHasDependentsError
NonDeterministicComputeError
NotAnInputNodeError
RemovedEngineOptionError
RetainedValueUnavailableError
StaleTxError
UndeclaredDependencyError
UnknownNodeError
WasmEngineUnavailableError
WasmInstancePoisonedError

Interfaces

AdaptThresholds
Bridge
BridgeFeatures
CauslCapabilityFallbackEvent
CauslFlags
CauslModel
Commit
CreateCauslOptions
CycleExplanation
DepFrame
DerivedExplanation
DerivedNode
DerivedOptions
EngineTelemetry
ExportModelOptions
Graph
GraphSnapshot
GraphStats
InputExplanation
InputNode
IRBridge
IRCallFrame
IRCallGraph
IRCommit
IRDerived
IRDispose
IRInput
IRRead
IRScope
IRSubscribe
IRSubscribeCallback
IRTxSet
IRUnsubscribe
LiveExplanation
ObserverErrorContext
SimulateResultClean
SimulateResultFailed
SubscribeOptions
Tx
WasmObjectHandle
WasmStringHandle
WireTemporal

Type Aliases

BridgeId
CauslEngineErrorCode
CauslModelJsonSchema
CauslRemovedEngineOptionCode
CauslTsFallbackReason
CodePointIndex
CodeUnitIndex
Compute
Explanation
GraphTime
IREvent
IRGraphId
IRNode
IRNodeId
Node
NodeId
Observer
ObserverErrorHandler
ParseResult
RetentionResult
SimulateResult
SubscribeReadsObserver
Unsubscribe
ValueMap
WasmHandle
WireTemporalKind
WireValue

Variables

CAUSL_MODEL_SCHEMA
causlModelJsonSchema
DEFAULT_THRESHOLDS
GRAPH_ID_REGEX
VERSION

Functions

asDerivedComputeError
createCausl
detectBridge
isCauslEngineUnavailable
isRemovedEngineOption
onCauslCapabilityFallback
parseCauslModel
shouldMigrate