HookContext#
- class brainstate.HookContext(operation, state_ref, timestamp=time(), metadata=dict())[source]#
Base context object passed to all hooks.
This context provides information about the hook execution environment, including the operation type, the state being operated on, timing information, and user-defined metadata.
- operation#
Type of operation (‘read’, ‘write_before’, ‘write_after’, ‘restore’, ‘init’)
- Type:
Literal['read','write_before','write_after','restore','init']
- state_ref#
Weak reference to the State instance (avoids circular references)
- Type: