Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kernel API Reference

The kernel layer (mofa-kernel) provides core abstractions and types.

Modules

agent

Core agent traits and types.

components

Agent components like tools and memory.

plugin

Plugin system interfaces.

Core Types

#![allow(unused)]
fn main() {
// Agent states
pub enum AgentState {
    Created,
    Ready,
    Executing,
    Paused,
    Error,
    Shutdown,
}

// Capabilities
pub struct AgentCapabilities {
    pub tags: Vec<String>,
    pub input_type: InputType,
    pub output_type: OutputType,
    pub max_concurrency: usize,
}

// Error handling
pub type AgentResult<T> = Result<T, AgentError>;

pub enum AgentError {
    InitializationFailed(String),
    ExecutionFailed(String),
    InvalidInput(String),
    ToolNotFound(String),
    Timeout,
    // ...
}
}

Feature Flags

The kernel has no optional features—it always provides the minimal core.

See Also