Optional
callbacksOptional partial set of lifecycle callbacks for the state, allowing customization of state events.
Optional
docOptional description for documentation purposes, aiding in state usage understanding.
Function to retrieve or compute the default state value.
Optional
getOptional function to retrieve the current state, with a fallback to the default state. Overrides default state retrieval behavior if provided.
Optional
middlewaresOptional array of middleware functions to process the state during lifecycle operations.
Optional
persistOptional flag to enable serialization of state values to persistent storage (e.g., hard drive).
Optional
setOptional function to set or update the state. Overrides default state setting behavior if provided.
Optional
sharedOptional flag indicating whether the state can be shared across multiple agents.
The unique name of the state within the swarm.
Interface representing the schema for state management. Defines the configuration and behavior of a state within the swarm.