use onde::inference::EngineStatus;
use crate::maybe::{MaybeSend, MaybeSync};
use crate::{AgentReply, ApprovalRequest, ChatReply, ToolCall, ToolExecutionResult};
pub trait EventSink: MaybeSend + MaybeSync + 'static {
fn status_changed(
&self,
_status: EngineStatus,
_model_name: Option<&str>,
_error: Option<&str>,
) {
}
fn replied(&self, _reply: &ChatReply) {}
fn text_delta(&self, _delta: &str) {}
fn tool_requested(&self, _call: &ToolCall) {}
fn approval_requested(&self, _request: &ApprovalRequest) {}
fn tool_started(&self, _call: &ToolCall) {}
fn tool_finished(&self, _result: &ToolExecutionResult) {}
fn agent_replied(&self, _reply: &AgentReply) {}
fn warning(&self, _message: &str) {}
}
pub use EventSink as StatusSink;
#[derive(Debug, Clone, Copy, Default)]
pub struct NoopSink;
impl EventSink for NoopSink {}
#[cfg(test)]
mod tests {
use super::*;
struct Bare;
impl EventSink for Bare {}
#[test]
fn text_delta_defaults_to_a_no_op() {
Bare.text_delta("hello");
NoopSink.text_delta("hello");
}
}