readonlystate:AgentHarnessStatePort<State>
On the Agent Runtime
The runtime adapter builds the port fromhost, which carries the protected members of the Agent class.
get()callsgetState(). Until a state is written, it returnsinitialState().merge()callssetState(), whichhostcarries asmergeState. The patch follows RFC 7396, sonulldeletes a key.replace()callsreplaceState(). Nothing of the previous state survives.merge()andreplace()run the class’sonStateChanged()after the write commits.
AgentHarnessStatePort
Existing persistent Agent state semantics.merge() and replace() include the Agent’s post-commit state-change hook.
They may therefore reject after the new value is already persistent; callers
must read state before deciding whether a rejected mutation can be retried.
Type Parameters
Methods
get()
get():ReturnsPromise<State>
Promise<State>
merge()
merge(Parameterspatch):Promise<State>
Returns
Promise<State>
replace()
replace(Parametersstate):Promise<State>
Returns
Promise<State>