Agui State Reducer
Applies AG-UI STATE_SNAPSHOT and STATE_DELTA events to a DataModel. This is the agent-level state channel, separate from A2UI's per-surface data model — apps that use CoAgent-style shared state should instantiate one reducer per logical state store.
The reducer also exposes an outbound flow of JSON Patches generated by local UI edits (see writeLocal); callers forward these to the agent (e.g. by reusing them as the next run's state payload, or by emitting them on a custom AG-UI side channel).