Collects all variables referenced by expressions across all premises, indexed both by variable ID and by symbol.
An object with variableIds, byId, and bySymbol indexes.
Returns all expressions across all premises, sorted by ID.
An array of expression entities.
Returns an expression by ID from any premise, or undefined if not
found.
The expression ID to look up.
The expression entity, or undefined.
Returns the premise ID that contains the given expression, or
undefined.
The expression ID to look up.
The owning premise ID, or undefined.
Returns all expressions that reference the given variable ID, across all premises.
The variable ID to search for.
An array of referencing expression entities.
Returns true if an expression with the given ID exists in any
premise.
The expression ID to check.
Whether the expression exists.
Returns the root expression from each premise that has one.
An array of root expression entities.
Patches application-specific fields onto an expression across all premises, then marks the expression and its ancestors dirty so the next checksum flush recomputes from the patched values.
This is the public API for consumers that need to attach app-level
metadata (e.g. creatorId, createdOn) to expressions synthesized
by the engine's auto-normalization. It resolves the owning premise
internally, applies the patch in place, and marks the expression
dirty — callers cannot patch without marking or mark without
patching (atomic patch-and-mark).
The ID of the expression to patch.
Fields to merge into the expression via Object.assign.
The generic Partial<TExpr> ensures type compatibility with the
engine's expression type (which includes app-specific fields when
the engine is instantiated with a consumer-supplied expression type).
Cross-premise expression lookups and analysis.