Skip to main content

mofa_kernel/core/
mod.rs

1//! 核心类型定义
2//!
3//! 此模块包含 Agent 相关的核心配置和元数据类型。
4
5pub use crate::agent::{
6    AgentContext, AgentEvent, AgentInput, AgentOutput, AgentState, types::InterruptResult,
7};
8
9/// AgentConfig - Agent 配置
10///
11/// 定义 Agent 的基本配置信息。
12#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Default)]
13pub struct AgentConfig {
14    pub agent_id: String,
15    pub name: String,
16    pub node_config: std::collections::HashMap<String, String>,
17}
18
19impl AgentConfig {
20    pub fn new(agent_id: &str, name: &str) -> Self {
21        Self {
22            agent_id: agent_id.to_string(),
23            name: name.to_string(),
24            node_config: std::collections::HashMap::new(),
25        }
26    }
27}