Whether unflushed changes are pending.
The root node tag (the welcome/creation state), or undefined if empty.
Number of nodes (states) retained in the tree.
Ancestor tags of a node, nearest-first (excludes the node itself).
Binds a backing store to a fresh, in-memory tree so its nodes can be flushed and its heavy material later evicted/reloaded. Marks every current node dirty so the first flush persists the whole tree. A no-op if the same store is already bound (e.g. on a tree loaded via load).
Child tags of a node (empty for a tip or an absent node).
The serialized commit bytes that produced a node, or undefined.
Decodes the commit MlsMessage that produced a node, or undefined.
The epoch of a node, or undefined if absent.
Persists all unflushed nodes incrementally: each dirty node's light edge record, snapshot, and commit bytes are written under its own keys, plus the meta (root) record. Append-only — already-persisted nodes are untouched, so a save costs O(new nodes), not O(tree). Requires a bound store.
Whether a node with tag exists.
Whether a node is a tip (exists and has no children).
The lowest common ancestor of two nodes (the fork point), or undefined if
they share no ancestor (e.g. live in different trees).
Returns a read-only view of a node, or undefined if absent.
All node tags sitting at epoch.
The parent tag of a node, or undefined for the root / absent node.
The path from the root to tag (inclusive of both), or undefined if the
node is absent or its chain to the root is broken.
Records a commit applied from a retained parent node to its resulting child state, adding (or linking) the child node. Idempotent on the child tag: a duplicate commit re-links without overwriting. Throws if the parent is not already in the tree.
OptionalsenderLeafIndex: numberthe child node tag.
Records an edge from a snapshot captured at branch-build time. Unlike
recordCommit, the child snapshot is supplied pre-serialized — fork
recovery serializes each branch state the instant it is produced, before
ts-mls can zero that state's secrets when exploring its children. Idempotent
on the child tag. Returns false (without recording) when the parent is not
yet in the tree, so a batch can skip a dangling edge instead of throwing.
Sets the root from a ClientState. The root carries no commit edge. Throws if a different root is already set (a tree has exactly one root).
The serialized ClientState snapshot bytes for a node, or undefined if
absent. Served from the in-memory cache, else fetched from the store.
Rehydrates a node's state into a fresh, independent ClientState, or
undefined if no snapshot is retained. Each call decodes a new object, so
callers may mutate/advance it without affecting the tree.
All node tags, in insertion order.
All tip tags (leaf states) — the candidate branches for convergence.
Replaces a node's retained snapshot — used after staging a proposal onto a
node, which updates its unappliedProposals without advancing the epoch.
The new state's confirmation tag MUST equal the node tag (staging a proposal
does not change it). Throws if the node is absent or the tag would change.
The retained group history tree (Marmot v2 full-fork history). Holds every group state ever observed — the canonical branch and every fork — as a tree of ClientState snapshots linked by commit edges. No pruning is performed: the tree retains everything.
The light index (per-node epoch/parent/edge metadata) is always resident. Heavy material (serialized snapshots + commit bytes) is kept in a bounded in-memory LRU and otherwise fetched from a backing key-value store on demand, so memory stays bounded even as the tree grows without limit. Newly recorded nodes are pinned in memory until flush persists them.
Snapshots are stored as bytes, never as live
ClientStateobjects: ts-mls zeroes a parent state's consumed secrets in place when a commit is processed from it, so a retained live object could be corrupted out from under a sibling-branch replay. Re-deriving a state (stateAt) decodes a fresh, independent object every call.