feat: add imperative AgentInstance lifecycle (#2436)