Skip to main content

Module interface

Module interface 

Source
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

Structs§

AutoApprovePolicy
Auto-approve all permission requests.
ChannelEventSink
Event sink backed by an async channel.
ChannelInputSource
Input source backed by an async channel.
DenyAllPolicy
Deny all permission requests.
InteractivePolicy
Interactive policy - always ask the user.
SendError
Error when sending an event fails.
SimpleEventSink
Simple event sink that prints to stdout.

Enums§

PolicyDecision
Decision from a permission policy.

Traits§

EventSink
Receives events from the agent engine and delivers them to a consumer.
InputSource
Provides input from a consumer to the agent engine.
PermissionPolicy
Policy for handling permission requests.