Skip to main content

swarm_engine_core/agent/
mod.rs

1//! SwarmEngine Agent 定義
2//!
3//! Worker/Manager Agent の trait 定義と関連型。
4//!
5//! # アーキテクチャ概要
6//!
7//! SwarmEngine は2層の Agent 階層を持ちます:
8//!
9//! ```text
10//! ┌─────────────────────────────────────────────────────────────┐
11//! │                    ManagerAgent                             │
12//! │  observe_and_decide() - N Tick ごとに全体を観察・判断       │
13//! │  → Guidance(方針・ヒント)または WorkerInstruction を発行  │
14//! └─────────────────────────────────────────────────────────────┘
15//!                            │
16//!              Guidance / WorkerInstruction
17//!                            ▼
18//! ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
19//! │ WorkerAgent │ │ WorkerAgent │ │ WorkerAgent │
20//! │             │ │             │ │             │
21//! └─────────────┘ └─────────────┘ └─────────────┘
22//!       │               │               │
23//!       └───────────────┼───────────────┘
24//!                       ▼
25//!              think_and_act() - 毎 Tick 実行
26//! ```
27//!
28//! # モジュール構成
29//!
30//! - [`batch`] - BatchInvoker trait と関連型
31//! - [`escalation`] - Escalation 関連型
32//! - [`manager`] - ManagerAgent trait と関連型
33//! - [`worker`] - WorkerAgent trait と関連型
34
35pub mod batch;
36pub mod escalation;
37pub mod manager;
38pub mod manager_impl;
39pub mod worker;
40pub mod worker_impl;
41
42// Re-exports
43pub use batch::{
44    BatchDecisionRequest, BatchInvokeError, BatchInvokeResult, BatchInvoker, DecisionResponse,
45    ManagerId, WorkerDecisionRequest,
46};
47pub use escalation::{Escalation, EscalationReason};
48pub use manager::{AsyncTaskRequest, ManagementDecision, ManagementStrategy, ManagerAgent};
49pub use manager_impl::{
50    DefaultBatchManagerAgent, DefaultBatchManagerAgentBuilder, DefaultManagerConfig,
51};
52pub use worker::{
53    AdaptiveScopeStrategy, CacheUpdate, FixedScopeStrategy, Guidance, GuidanceContext, Issue,
54    ManagerInstruction, Priority, ProposedOption, RelevantState, ScheduledAction, ScopeStrategy,
55    SharedUpdate, TaskDescription, WorkResult, WorkerAgent, WorkerScope, WorkerStateDelta,
56};
57pub use worker_impl::{
58    execute_action, run_bash, run_grep, run_read, run_write, ExtensionAwareWorker, GenericWorker,
59    ProgressWorker,
60};
61
62// Re-export from other modules (for backward compatibility)
63pub use crate::analysis::{Analyzer, DefaultAnalyzer};
64pub use crate::context::{
65    ActionCandidate, ActionParam, AdjacentStrategy, AllVisibleStrategy, ContextResolver,
66    ContextStore, ContextTarget, ContextView, GlobalContext, ManagerContext, NeighborStrategy,
67    ResolvedContext, TaskContext, WorkerContext as WorkerCtx, WorkerSummary,
68};
69// V2 で必要な探索関連型のみ re-export
70pub use crate::exploration::{EdgeId, ExplorationTarget, NodeId, TrialPolicy};