AgentProvider
AgentProvider is the root component for the Agent SDK. It sets up the chat engine, theming, and provides context to all child components.
Keep AgentProvider mounted
AgentProvider holds all conversation state: messages, streaming status, session tokens, and tool approval state. Mount it high in your component tree and keep it mounted for the lifetime of your app. Unmounting the provider resets all state.
To show or hide the chat UI, toggle AgentPanel's open prop or conditionally render AgentChat. Both can be mounted and unmounted freely without losing conversation data.