pub struct Invocation {
pub targets: Vec<Target>,
pub context: ContextScope,
pub join: Join,
pub executor: ExecutorHint,
pub tools: ToolPolicy,
}Expand description
One agent dispatch — synchronous or asynchronous, single or fan-out, local or remote. The orchestrator validates this at the entry point and then stamps the resolved fields onto the child task row(s).
Fields§
§targets: Vec<Target>1..N targets. Join::Single requires exactly 1; the others accept
any positive count.
context: ContextScopeWhat the child task sees on its first turn.
join: JoinHow the parent waits.
executor: ExecutorHintWhich orchestrator runs the agent loop. Auto resolves at
invocation time from (agent.runtime ∩ caller.runtime ∩ available
runners). Force is for tests and debugging.
tools: ToolPolicyTool inheritance policy for the child. Defaults to Inherit
(external = ["*"] — child borrows the parent session’s full
external tool pool, like claude-code’s useExactTools).
Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn validate(&self) -> Result<(), InvocationValidationError>
pub fn validate(&self) -> Result<(), InvocationValidationError>
One-shot validation called at the orchestrator’s entry point. Downstream code can assume the invariants below hold:
targets.len() >= 1Join::Single⇒targets.len() == 1- every target has a non-empty agent identity
Source§impl Invocation
impl Invocation
Sourcepub fn single(target: Target) -> Self
pub fn single(target: Target) -> Self
Build a Join::Single invocation. The simplest path; matches
today’s default call_agent({agent, prompt}).
Sourcepub fn detached(targets: Vec<Target>) -> Self
pub fn detached(targets: Vec<Target>) -> Self
Build a Join::Detached fire-and-forget. Cancellation cascades
from the parent (no opt-out yet).
Sourcepub fn with_context(self, context: ContextScope) -> Self
pub fn with_context(self, context: ContextScope) -> Self
Builder: set context scope.
Sourcepub fn with_executor(self, executor: ExecutorHint) -> Self
pub fn with_executor(self, executor: ExecutorHint) -> Self
Builder: set executor hint.
Sourcepub fn with_tools(self, tools: ToolPolicy) -> Self
pub fn with_tools(self, tools: ToolPolicy) -> Self
Builder: set tool policy.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more