Skip to main content

ActAtom

Struct ActAtom 

Source
pub struct ActAtom<T, E>{ /* private fields */ }
Expand description

Atom that executes a batch of tool calls via the [tool_scheduler]

This atom:

  1. Emits act.started event
  2. Schedules all tool calls (emitting tool.started/completed for each): concurrent by default, serialized within a concurrency class, capped, and with cpu_bound tools offloaded to their own task
  3. Handles errors, timeouts, and cancellations gracefully
  4. Emits act.completed event
  5. Returns comprehensive results for all tools

Tool results are emitted as events and returned in ActResult. Messages are derived from events by the message store.

Implementations§

Source§

impl<T, E> ActAtom<T, E>

Source

pub fn new(tool_executor: T, event_emitter: E) -> Self

Create a new ActAtom with default hooks (ConnectionSetup + ClientSideTool).

Source

pub fn with_file_store( tool_executor: T, event_emitter: E, file_store: Arc<dyn SessionFileSystem>, ) -> Self

Create a new ActAtom with a file store for context-aware tools

Source

pub fn with_context_services(self, services: ToolContextServices) -> Self

Replace the complete runtime-owned service snapshot used for every per-call ToolContext. Production hosts should prefer this over assembling individual services on the atom.

Source

pub fn with_hook(self, hook: Box<dyn PostActHook>) -> Self

Add a custom post-act hook.

Source

pub fn with_final_post_tool_hook(self, hook: Arc<dyn PostToolExecHook>) -> Self

Add a runtime-owned final post-tool hook. Hosts use this for portable policies that must run after capability hooks but before the hard output limit.

Source

pub fn with_storage_store(self, store: Arc<dyn SessionStorageStore>) -> Self

Set the session storage store on this atom

Source

pub fn with_image_store(self, store: Arc<dyn ImageArtifactStore>) -> Self

Set the image artifact store on this atom

Source

pub fn with_provider_credential_store( self, store: Arc<dyn ProviderCredentialStore>, ) -> Self

Set the provider credential store on this atom

Source

pub fn with_utility_llm_service( self, service: Arc<dyn UtilityLlmService>, ) -> Self

Set the utility LLM service on this atom.

Source

pub fn with_mcp_invoker(self, invoker: Arc<dyn McpToolInvoker>) -> Self

Set the scoped-MCP tool invoker on this atom (guardrails mcp check).

Source

pub fn with_egress_service(self, service: Arc<dyn EgressService>) -> Self

Set the outbound egress service on this atom.

Source

pub fn with_connection_resolver( self, resolver: Arc<dyn UserConnectionResolver>, ) -> Self

Set the user connection resolver on this atom

Source

pub fn with_session_store(self, store: Arc<dyn SessionStore>) -> Self

Set session store for context-aware tools.

Source

pub fn with_agent_store(self, store: Arc<dyn AgentStore>) -> Self

Set agent store for context-aware tools.

Source

pub fn with_schedule_store(self, store: Arc<dyn SessionScheduleStore>) -> Self

Set session schedule store for scheduling tools.

Source

pub fn with_subagent_delegate( self, store: Arc<dyn SubagentSessionDelegate>, ) -> Self

Set platform store for org-level management tools.

Source

pub fn with_leased_resource_store( self, store: Arc<dyn LeasedResourceStore>, ) -> Self

Set leased resource store for lifecycle-managed provider resources.

Source

pub fn with_session_resource_registry( self, registry: Arc<dyn SessionResourceRegistry>, ) -> Self

Set session resource registry.

Source

pub fn with_session_task_registry( self, registry: Arc<dyn SessionTaskRegistry>, ) -> Self

Add a session task registry passed to tool contexts.

Source

pub fn with_capability_registry(self, registry: CapabilityRegistry) -> Self

Source

pub fn with_tool_registry(self, registry: Arc<ToolRegistry>) -> Self

Set the active built-in tool registry for meta-tools like spawn_background.

Source

pub fn with_post_tool_hooks(self, hooks: Vec<Arc<dyn PostToolExecHook>>) -> Self

Add capability-contributed post-tool-exec hooks. Callers should pass hooks from the active capabilities for this session, not from the full platform registry.

Source

pub fn with_pre_tool_hooks(self, hooks: Vec<Arc<dyn PreToolUseHook>>) -> Self

Add capability-contributed pre-tool-use hooks. Pre-hooks fire before each tool call and can mutate or block it; see act_hooks::PreToolUseHook and knowledge/runtime-resources/user-hooks.md.

Source

pub fn with_tool_call_hooks(self, hooks: Vec<Arc<dyn ToolCallHook>>) -> Self

Source

pub fn with_org_id(self, org_id: OrgId) -> Self

Set org ID for org-scoped operations.

Source

pub fn with_network_access( self, network_access: Option<NetworkAccessList>, ) -> Self

Set the merged network access list for URL filtering in tools.

Source

pub fn with_budget_checker(self, checker: Arc<dyn BudgetChecker>) -> Self

Set the budget checker for the check_budget tool.

Source

pub fn with_payment_authority( self, authority: Arc<dyn PaymentAuthority>, ) -> Self

Set the internal payment authority for paid capability tools.

Source

pub fn with_session_creation_authority( self, authority: Arc<dyn SessionCreationAuthority>, ) -> Self

Set the authority used to authorize detached peer-session creation.

Source

pub fn with_outbound_tool_rate_limiter( self, limiter: Arc<dyn OutboundToolRateLimiter>, ) -> Self

Set the per-org outbound tool-call rate limiter (TM-TOOL-009).

Source

pub fn with_durable_tool_result_store( self, store: Arc<dyn DurableToolResultStore>, ) -> Self

Set the durable per-tool-call idempotency store (EVE-530).

Source

pub fn with_subagent_spawn_store( self, store: Arc<dyn SubagentSpawnStore>, ) -> Self

Set the durable subagent spawn handle store (EVE-535).

Source

pub fn with_subagent_nesting_policy(self, policy: SubagentNestingPolicy) -> Self

Set the resolved subagent nesting policy for tool contexts.

Source

pub fn with_reasoning_effort_handle(self, handle: ReasoningEffortHandle) -> Self

Set the live reasoning-effort handle (EVE-595). When set, each tool’s ToolContext receives a clone so a tool can change the reasoning effort mid-turn for subsequent LLM steps in the same turn.

Source§

impl<T, E> ActAtom<T, E>
where T: ToolExecutor + Send + Sync + 'static, E: EventEmitter + Send + Sync + 'static,

Source

pub fn name(&self) -> &'static str

Stable phase name used by logs and durable activity adapters.

Source

pub async fn execute(&self, input: ActInput) -> Result<ActResult>

Execute one scheduled tool-call batch through injected contracts.

Auto Trait Implementations§

§

impl<T, E> !RefUnwindSafe for ActAtom<T, E>

§

impl<T, E> !UnwindSafe for ActAtom<T, E>

§

impl<T, E> Freeze for ActAtom<T, E>

§

impl<T, E> Send for ActAtom<T, E>

§

impl<T, E> Sync for ActAtom<T, E>

§

impl<T, E> Unpin for ActAtom<T, E>

§

impl<T, E> UnsafeUnpin for ActAtom<T, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more