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
//! Agent coordination tools
//!
//! Tools for spawning sub-agents and tracking task progress.
//!
//! ## AgentRuntime
//!
//! The [`AgentRuntime`] trait enables the TaskTool to delegate sub-agent execution
//! to a real agent runtime. Without an injected runtime, TaskTool operates in a
//! no-op mode that returns a placeholder response.
//!
//! ```rust,no_run
//! use sombrax_agentic_core::tools::agent::{AgentRuntime, SubAgentRequest, SubAgentResponse};
//! use sombrax_agentic_core::tools::{ToolContext, TaskTool};
//! use std::sync::Arc;
//!
//! // Your runtime implementation
//! struct MyRuntime;
//!
//! #[async_trait::async_trait]
//! impl AgentRuntime for MyRuntime {
//! async fn spawn_subagent(&self, request: SubAgentRequest) -> Result<SubAgentResponse, String> {
//! // Delegate to your agent registry/orchestrator
//! todo!()
//! }
//! }
//!
//! // Wire up the TaskTool
//! let context = ToolContext::new("session".into(), std::path::PathBuf::from("."));
//! let runtime: Arc<dyn AgentRuntime> = Arc::new(MyRuntime);
//! let task_tool = TaskTool::new(context).with_runtime(runtime);
//! ```
pub use ;
pub use ;
pub use ;