refactor(agent): Simplify AgentState API

* Reduce the number of exported AgentState methods
* Move locking logic into AgentState