pub struct SimpleEventSink;Expand description
Simple event sink that prints to stdout.
A minimal sink for CLI tools, debugging, or batch processing. Prints LLM text output directly to stdout with basic formatting.
§Limitations
This sink is non-interactive and cannot handle:
- Permission requests: Use with
AutoApprovePolicyto auto-approve - User interactions: Use with
AutoApprovePolicyto auto-cancel
If you need interactive permission prompts or user questions, use
ChannelEventSink with a proper frontend (TUI, WebSocket, etc.).
§Output Format
| Event | Output |
|---|---|
TextChunk | Prints text directly (no newline) |
Complete | Prints newline |
Error | Prints to stderr with “Error: “ prefix |
ToolExecuting | Prints “[Tool: name]” |
ToolCompleted | Prints errors only |
PermissionRequired | Warning - use AutoApprovePolicy |
UserInteractionRequired | Warning - use AutoApprovePolicy |
| Other events | Silently ignored |
§Example
ⓘ
use agent_core_runtime::agent::{
AgentCore, SimpleEventSink, ChannelInputSource, AutoApprovePolicy
};
// Simple CLI agent - must use AutoApprovePolicy
agent.run_with_frontend(
SimpleEventSink::new(),
input_source,
AutoApprovePolicy::new(), // Required for non-interactive sink
)?;Implementations§
Trait Implementations§
Source§impl Clone for SimpleEventSink
impl Clone for SimpleEventSink
Source§fn clone(&self) -> SimpleEventSink
fn clone(&self) -> SimpleEventSink
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for SimpleEventSink
impl Default for SimpleEventSink
Source§fn default() -> SimpleEventSink
fn default() -> SimpleEventSink
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimpleEventSink
impl RefUnwindSafe for SimpleEventSink
impl Send for SimpleEventSink
impl Sync for SimpleEventSink
impl Unpin for SimpleEventSink
impl UnwindSafe for SimpleEventSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more