pub async fn run_agent_loop(
prompts: Vec<AgentMessage>,
context: AgentContext,
config: AgentLoopConfig,
emit: Arc<dyn AgentEmitter>,
stream_fn: StreamFn,
) -> Result<NewMessages, AgentError>Expand description
Run an agent loop starting from a new prompt. Mirrors TS runAgentLoop.
Emits agent_start, turn_start, then message_start/message_end for
each prompt, then drives [run_loop]. Returns the messages produced.