pub struct SpawnAgentTool { /* private fields */ }Expand description
The spawn_agent tool. It is registered on StaticToolRegistry and shared across
sessions of the owning AgentCore via process_tools (it is not a process-global
singleton — a single process may host multiple AgentCore instances, each with its
own copy). At construction time it captures everything needed to run a nested turn,
because ToolContext only carries cwd/fs/shell/http/cancel/current_model, not the
provider registry, policy, or tool set.
Implementations§
Source§impl SpawnAgentTool
impl SpawnAgentTool
Sourcepub fn new(
profiles: Arc<BTreeMap<String, SubagentProfile>>,
registry: Arc<ProviderRegistry>,
policy: Arc<dyn SandboxPolicy>,
process_tools: Arc<dyn ToolRegistry>,
base_prompt: Option<String>,
) -> Self
pub fn new( profiles: Arc<BTreeMap<String, SubagentProfile>>, registry: Arc<ProviderRegistry>, policy: Arc<dyn SandboxPolicy>, process_tools: Arc<dyn ToolRegistry>, base_prompt: Option<String>, ) -> Self
Constructs a spawn_agent tool. When profiles is empty, the caller should
not register this tool (the profile enum in the schema will be an empty set,
so calls will always fail) — see Self::has_profiles.
Sourcepub fn has_profiles(profiles: &BTreeMap<String, SubagentProfile>) -> bool
pub fn has_profiles(profiles: &BTreeMap<String, SubagentProfile>) -> bool
Whether any profiles were discovered. The assembler uses this to decide whether to register this tool.
Trait Implementations§
Source§impl Tool for SpawnAgentTool
impl Tool for SpawnAgentTool
Source§fn schema(&self) -> &ToolSchema
fn schema(&self) -> &ToolSchema
Tool metadata. Returns a reference to avoid allocating on every call.
Source§fn safety_hint(&self, _args: &Value) -> SafetyClass
fn safety_hint(&self, _args: &Value) -> SafetyClass
Provides a safety-level hint to the sandbox policy without actually executing the
tool. Read more
Source§fn describe<'a>(
&'a self,
args: &'a Value,
_ctx: ToolContext<'a>,
) -> BoxFuture<'a, ToolCallDescription>
fn describe<'a>( &'a self, args: &'a Value, _ctx: ToolContext<'a>, ) -> BoxFuture<'a, ToolCallDescription>
Generates a “self-description” before execution, for display to the ACP client. Read more
Source§fn execute(&self, args: Value, ctx: ToolContext<'_>) -> ToolStream
fn execute(&self, args: Value, ctx: ToolContext<'_>) -> ToolStream
Initiates a tool call and returns an event stream. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SpawnAgentTool
impl !UnwindSafe for SpawnAgentTool
impl Freeze for SpawnAgentTool
impl Send for SpawnAgentTool
impl Sync for SpawnAgentTool
impl Unpin for SpawnAgentTool
impl UnsafeUnpin for SpawnAgentTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more