Skip to main content

agent_kernel/
runtime.rs

1use crate::agent::Agent;
2use crate::message::Message;
3use crate::BoxFuture;
4
5/// Single-agent response primitive.
6///
7/// Extreme minimalism principle: exactly one method.
8/// The kernel provides no convergence logic, no memory injection, no streaming —
9/// all policy decisions belong to the caller.
10///
11/// `BoxFuture` is used instead of `async_trait` to keep the kernel dependency-free
12/// (no `async_trait` macro dep).
13pub trait AgentRuntime: Send + Sync {
14    /// Invoke the agent with the full conversation history and return its response.
15    fn respond<'a>(
16        &'a self,
17        agent: &'a Agent,
18        history: &'a [Message],
19    ) -> BoxFuture<'a, anyhow::Result<String>>;
20}