1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Agent Orchestrator - 主子智能体协调器
//!
//! 基于 a3s-event 实现的统一事件总线,支持:
//! - 实时监控所有子智能体的行为、规划和执行
//! - 主智能体动态控制子智能体(暂停、恢复、取消、参数调整)
//! - 可插拔的事件 provider(默认内存,可选 NATS)
//!
//! ## 架构
//!
//! ```text
//! AgentOrchestrator (主智能体)
//! ↓ 订阅事件
//! ┌───────────────────────────────┐
//! │ a3s-event EventBus │
//! │ (Memory / NATS / Custom) │
//! └───────────────────────────────┘
//! ↑ 发布事件 ↓ 控制信号
//! SubAgentWrapper (子智能体)
//! ```
//!
//! ## 使用示例
//!
//! ```rust,ignore
//! use a3s_code_core::orchestrator::{AgentOrchestrator, SubAgentConfig};
//!
//! # async fn example() -> anyhow::Result<()> {
//! // 创建 orchestrator (默认使用内存 provider)
//! let orchestrator = AgentOrchestrator::new_memory();
//!
//! // 订阅所有事件
//! let mut events = orchestrator.subscribe_all().await?;
//!
//! // 启动子智能体
//! let handle = orchestrator.spawn_subagent(SubAgentConfig {
//! agent_type: "general".to_string(),
//! description: "Analyze code".to_string(),
//! prompt: "Use glob to find Python files".to_string(),
//! permissive: true,
//! max_steps: Some(10),
//! }).await?;
//!
//! // 监控事件
//! tokio::spawn(async move {
//! while let Some(event) = events.recv().await {
//! println!("Event: {:?}", event);
//! }
//! });
//!
//! // 控制子智能体
//! orchestrator.pause_subagent(&handle.id).await?;
//! orchestrator.resume_subagent(&handle.id).await?;
//!
//! # Ok(())
//! # }
//! ```
pub use crateTeamRole;
pub use ;
pub use ;
pub use ControlSignal;
pub use ;
pub use SubAgentHandle;
pub use SubAgentState;
pub use SubAgentWrapper;