Appends a user turn, executes the model/tool loop, and commits state.
Streams a user turn and commits state when the final done chunk arrives.
Clears non-system history while preserving running totals.
Serializes the conversation for storage or transport.
Returns the full message list including the pinned system prompt.
Exports the conversation as a markdown transcript.
StaticrestoreRestores a conversation from a serialized snapshot.
Stateful conversation wrapper that handles history, tool execution, persistence, and running token/cost totals.
Example