Expand description
Engine Interface Abstractions
This module defines the contract between the agent engine and external consumers (TUI, servers, CLI tools, etc.).
§Architecture
The interface is message-based and transport-agnostic:
Consumer Interface Engine
│ │
│◄─────── EventSink ────────────────│ (events out)
│ │
│─────── InputSource ──────────────►│ (input in)
│ │
│◄────── PermissionRegistry ───────►│ (request/response)§Components
EventSink- Receives events from the engine (text, tools, errors)InputSource- Provides input to the engine (user messages, commands)PermissionPolicy- Automatic handling of permission requests
§Built-in Implementations
ChannelEventSink- Channel-backed sink (default, used by TUI)ChannelInputSource- Channel-backed source (default, used by TUI)- [
StdoutEventSink] - Simple stdout sink for CLI tools AutoApprovePolicy- Auto-approve all permissions (headless/trusted)DenyAllPolicy- Deny all permissions (sandboxed)InteractivePolicy- Always ask user (default for TUI)
Structs§
- Auto
Approve Policy - Auto-approve all permission requests.
- Channel
Event Sink - Event sink backed by an async channel.
- Channel
Input Source - Input source backed by an async channel.
- Deny
AllPolicy - Deny all permission requests.
- Interactive
Policy - Interactive policy - always ask the user.
- Send
Error - Error when sending an event fails.
- Simple
Event Sink - Simple event sink that prints to stdout.
Enums§
- Policy
Decision - Decision from a permission policy.
Traits§
- Event
Sink - Receives events from the agent engine and delivers them to a consumer.
- Input
Source - Provides input from a consumer to the agent engine.
- Permission
Policy - Policy for handling permission requests.