OptionalmappingsAG-UI state mappings: project agent state onto entity-graph entities.
OptionalonCalled on stream error.
OptionalonCalled when a full assistant message has been received.
OptionalsessionUnique session id; defaults to a generated id.
Factory that returns an async-iterable (or ReadableStream) of StreamEvents given the current messages. The library calls this on every sendMessage().
OptionaltoolOptional tool provider for function-calling / MCP.
use-chat-session.ts — Core React hook that manages a chat session.
Responsibilities:
This hook is the shared foundation for EntityChat and EntityCopilot.
Hook→Store layering: this hook calls applyAgUiSnapshot / applyAgUiDelta (store writes). It never calls useGraphStore directly — that boundary is maintained in the agent/ module of entity-graph-core.