swarm-engine-core 0.1.6

Core types and orchestration for SwarmEngine
Documentation
//! SwarmEngine Agent 定義
//!
//! Worker/Manager Agent の trait 定義と関連型。
//!
//! # アーキテクチャ概要
//!
//! SwarmEngine は2層の Agent 階層を持ちます:
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────┐
//! │                    ManagerAgent                             │
//! │  observe_and_decide() - N Tick ごとに全体を観察・判断       │
//! │  → Guidance(方針・ヒント)または WorkerInstruction を発行  │
//! └─────────────────────────────────────────────────────────────┘
//!//!              Guidance / WorkerInstruction
//!//! ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
//! │ WorkerAgent │ │ WorkerAgent │ │ WorkerAgent │
//! │             │ │             │ │             │
//! └─────────────┘ └─────────────┘ └─────────────┘
//!       │               │               │
//!       └───────────────┼───────────────┘
//!//!              think_and_act() - 毎 Tick 実行
//! ```
//!
//! # モジュール構成
//!
//! - [`batch`] - BatchInvoker trait と関連型
//! - [`escalation`] - Escalation 関連型
//! - [`manager`] - ManagerAgent trait と関連型
//! - [`worker`] - WorkerAgent trait と関連型

pub mod batch;
pub mod escalation;
pub mod manager;
pub mod manager_impl;
pub mod worker;
pub mod worker_impl;

// Re-exports
pub use batch::{
    BatchDecisionRequest, BatchInvokeError, BatchInvokeResult, BatchInvoker, DecisionResponse,
    ManagerId, WorkerDecisionRequest,
};
pub use escalation::{Escalation, EscalationReason};
pub use manager::{AsyncTaskRequest, ManagementDecision, ManagementStrategy, ManagerAgent};
pub use manager_impl::{
    DefaultBatchManagerAgent, DefaultBatchManagerAgentBuilder, DefaultManagerConfig,
};
pub use worker::{
    AdaptiveScopeStrategy, CacheUpdate, FixedScopeStrategy, Guidance, GuidanceContext, Issue,
    ManagerInstruction, Priority, ProposedOption, RelevantState, ScheduledAction, ScopeStrategy,
    SharedUpdate, TaskDescription, WorkResult, WorkerAgent, WorkerScope, WorkerStateDelta,
};
pub use worker_impl::{
    execute_action, run_bash, run_grep, run_read, run_write, ExtensionAwareWorker, GenericWorker,
    ProgressWorker,
};

// Re-export from other modules (for backward compatibility)
pub use crate::analysis::{Analyzer, DefaultAnalyzer};
pub use crate::context::{
    ActionCandidate, ActionParam, AdjacentStrategy, AllVisibleStrategy, ContextResolver,
    ContextStore, ContextTarget, ContextView, GlobalContext, ManagerContext, NeighborStrategy,
    ResolvedContext, TaskContext, WorkerContext as WorkerCtx, WorkerSummary,
};
// V2 で必要な探索関連型のみ re-export
pub use crate::exploration::{EdgeId, ExplorationTarget, NodeId, TrialPolicy};