Defined in: Synapse.ts:13
The Synapse class is the core execution engine of the rules system. It processes logic defined in scripts by coordinating between the Registry (Neuron) and the state (ExecutionContext).
Constructors
Constructor
new Synapse(
_neuron,_hookEmitter?):Synapse
Defined in: Synapse.ts:20
Initializes a new execution engine.
Parameters
_neuron
The registry containing all element definitions.
_hookEmitter?
Optional global lifecycle hook emitter.
Returns
Synapse
Methods
execute()
execute(
script,context,runtimeHookEmitter?):ExecutionResult<number>
Defined in: Synapse.ts:33
Executes a script logic against a provided context.
Parameters
script
The serializable script defining the logic rules.
context
The shared state object to pass through the execution.
runtimeHookEmitter?
Optional one-time hook emitter for this specific execution.
Returns
ExecutionResult<number>
An ExecutionResult containing the final context and the number of successfully executed rules.
