Skip to main content

agent_core_runtime/agent/interface/
mod.rs

1//! Engine Interface Abstractions
2//!
3//! This module defines the contract between the agent engine and external
4//! consumers (TUI, servers, CLI tools, etc.).
5//!
6//! # Architecture
7//!
8//! The interface is message-based and transport-agnostic:
9//!
10//! ```text
11//! Consumer          Interface           Engine
12//!    │                                    │
13//!    │◄─────── EventSink ────────────────│  (events out)
14//!    │                                    │
15//!    │─────── InputSource ──────────────►│  (input in)
16//!    │                                    │
17//!    │◄────── PermissionRegistry ───────►│  (request/response)
18//! ```
19//!
20//! # Components
21//!
22//! - [`EventSink`] - Receives events from the engine (text, tools, errors)
23//! - [`InputSource`] - Provides input to the engine (user messages, commands)
24//! - [`PermissionPolicy`] - Automatic handling of permission requests
25//!
26//! # Built-in Implementations
27//!
28//! - [`ChannelEventSink`] - Channel-backed sink (default, used by TUI)
29//! - [`ChannelInputSource`] - Channel-backed source (default, used by TUI)
30//! - [`StdoutEventSink`] - Simple stdout sink for CLI tools
31//! - [`AutoApprovePolicy`] - Auto-approve all permissions (headless/trusted)
32//! - [`DenyAllPolicy`] - Deny all permissions (sandboxed)
33//! - [`InteractivePolicy`] - Always ask user (default for TUI)
34
35mod policy;
36mod sink;
37mod source;
38
39pub use policy::{AutoApprovePolicy, DenyAllPolicy, InteractivePolicy, PermissionPolicy, PolicyDecision};
40pub use sink::{ChannelEventSink, EventSink, SendError, SimpleEventSink};
41pub use source::{ChannelInputSource, InputSource};