Expand description
Core agent abstractions and extensions
This module provides the minimal core interfaces that all agents implement. Following microkernel principles, the core is kept minimal with optional extensions for additional capabilities.
§Core Trait
MoFAAgent: The core agent interface (id, name, capabilities, execute, etc.)
§Extension Traits
AgentLifecycle: pause, resume, interruptAgentMessaging: handle_message, handle_eventAgentPluginSupport: plugin management
§Example
ⓘ
use mofa_sdk::kernel::MoFAAgent;
#[async_trait::async_trait]
impl MoFAAgent for MyAgent {
fn id(&self) -> &str { "my-agent" }
fn name(&self) -> &str { "My Agent" }
// ... other methods
}Core abstractions and infrastructure from mofa-kernel.
This module is a normalized, comprehensive facade over mofa-kernel with
structured submodules and curated top-level re-exports.
Modules§
- agent
- bus
- config
- core
- execution_
events - 执行事件类型
- lifecycle
- 生命周期事件类型
- message
- message_
events - 消息事件类型
- plugin
- plugin_
events - 插件事件类型
- state_
events - 状态事件类型
- storage
Structs§
- Agent
Bus - 通信总线核心结构体
- Agent
Capabilities - Agent 能力描述
- Agent
Capabilities Builder - Agent 能力构建器
- Agent
Config - AgentConfig - Agent 配置
- Agent
Context - 核心执行上下文 (Core Agent Context)
- Agent
Metadata - Agent 元数据
- Agent
Output - Agent 输出类型
- Agent
Requirements - Agent 需求描述
- Agent
Requirements Builder - Agent 需求构建器
- Agent
Schema Config - Agent 配置
- Agent
Stats - Agent 统计信息
- Chat
Completion Request - LLM 聊天完成请求
- Chat
Completion Response - LLM 聊天完成响应
- Chat
Message - 聊天消息
- Config
Loader - 配置加载器
- Context
Config - 上下文配置
- Core
Agent Message - Agent 消息
- Error
Context - 错误上下文
- Event
Builder - 事件构建器
- Event
Bus - 事件总线
- Global
Event - 全局事件类型
- HotReload
Config - 热加载配置
- Memory
Item - 记忆项 (搜索结果)
- Memory
Stats - 记忆统计
- Message
- 对话消息
- Message
Metadata - 消息元数据
- Plugin
Context - 插件执行上下文
- Plugin
Metadata - 插件元数据
- Reasoning
Result - 推理结果
- Reasoning
Step - 推理步骤
- Task
Request - Token
Usage - Token 使用统计
- Tool
Call - LLM 工具调用
- Tool
Definition - LLM 工具定义
- Tool
Descriptor - 工具描述符 (用于列表展示)
- Tool
Input - 工具输入
- Tool
Metadata - 工具元数据
- Tool
Result - 工具执行结果
- Tool
Usage - 工具使用记录
Enums§
- Agent
Error - Agent 错误类型
- Agent
Event - Agent
Input - Agent 输入类型
- Agent
Message - Agent
State - Agent 状态机
- Agent
Type - Agent 类型
- Config
Format - 配置格式
- Coordination
Pattern - 协调模式
- Error
Category - 错误分类
- Global
Error - 全局错误类型
- Global
Message - 全局消息类型
- Health
Status - Agent 健康状态
- Input
Type - 支持的输入类型
- Interrupt
Result - 中断处理结果
- Memory
Value - 记忆值类型
- Message
Content - 消息内容类型
- Message
Role - 消息角色
- Output
Content - 输出内容类型
- Output
Type - 支持的输出类型
- Plugin
Event - 插件事件
- Plugin
State - 插件状态
- Plugin
Type - 插件类型枚举
- Reasoning
Step Type - 推理步骤类型
- Reasoning
Strategy - 推理策略
- Reload
Event - 热加载事件
- Reload
Strategy - 热加载策略
- Scheduling
Status - Stream
Control Command - Stream
Type - Task
Priority - Task
Status
Traits§
- Agent
Factory - Agent 工厂 Trait
- Agent
Lifecycle - Agent 生命周期扩展
- Agent
Messaging - Agent 消息处理扩展
- Agent
Plugin - 核心插件 trait
- Agent
Plugin Support - Agent 插件支持扩展
- Coordinator
- 协调器 Trait
- LLMProvider
- LLM Provider trait - 定义 LLM 提供商接口
- Memory
- 记忆组件 Trait
- MoFA
Agent - MoFA Agent 统一接口
- Reasoner
- 推理器 Trait
- Storage
- Generic storage trait for key-value operations
- Tool
- 统一工具 Trait
Type Aliases§
- Agent
Result - Agent 操作结果类型
- DynAgent
- 动态分发的 MoFAAgent
- Global
Result - 全局结果类型
- Plugin
Result - 插件执行结果