pub struct ActAtom<T, E>where
T: ToolExecutor,
E: PhaseEffectSink,{ /* private fields */ }Expand description
Atom that executes a batch of tool calls via the [tool_scheduler]
This atom:
- Emits act.started event
- Schedules all tool calls (emitting tool.started/completed for each):
concurrent by default, serialized within a concurrency class, capped, and
with
cpu_boundtools offloaded to their own task - Handles errors, timeouts, and cancellations gracefully
- Emits act.completed event
- 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>where
T: ToolExecutor,
E: PhaseEffectSink,
impl<T, E> ActAtom<T, E>where
T: ToolExecutor,
E: PhaseEffectSink,
Sourcepub fn new(tool_executor: T, event_emitter: E) -> Self
pub fn new(tool_executor: T, event_emitter: E) -> Self
Create a new ActAtom with default hooks (ConnectionSetup + ClientSideTool).
Sourcepub fn with_file_store(
tool_executor: T,
event_emitter: E,
file_store: Arc<dyn SessionFileSystem>,
) -> Self
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
Sourcepub fn with_context_services(self, services: ToolContextServices) -> Self
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.
Sourcepub fn with_hook(self, hook: Box<dyn PostActHook>) -> Self
pub fn with_hook(self, hook: Box<dyn PostActHook>) -> Self
Add a custom post-act hook.
Sourcepub fn with_final_post_tool_hook(self, hook: Arc<dyn PostToolExecHook>) -> Self
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.
Sourcepub fn with_storage_store(self, store: Arc<dyn SessionStorageStore>) -> Self
pub fn with_storage_store(self, store: Arc<dyn SessionStorageStore>) -> Self
Set the session storage store on this atom
Sourcepub fn with_image_store(self, store: Arc<dyn ImageArtifactStore>) -> Self
pub fn with_image_store(self, store: Arc<dyn ImageArtifactStore>) -> Self
Set the image artifact store on this atom
Sourcepub fn with_provider_credential_store(
self,
store: Arc<dyn ProviderCredentialStore>,
) -> Self
pub fn with_provider_credential_store( self, store: Arc<dyn ProviderCredentialStore>, ) -> Self
Set the provider credential store on this atom
Sourcepub fn with_utility_llm_service(
self,
service: Arc<dyn UtilityLlmService>,
) -> Self
pub fn with_utility_llm_service( self, service: Arc<dyn UtilityLlmService>, ) -> Self
Set the utility LLM service on this atom.
Sourcepub fn with_mcp_invoker(self, invoker: Arc<dyn McpToolInvoker>) -> Self
pub fn with_mcp_invoker(self, invoker: Arc<dyn McpToolInvoker>) -> Self
Set the scoped-MCP tool invoker on this atom (guardrails mcp check).
Sourcepub fn with_egress_service(self, service: Arc<dyn EgressService>) -> Self
pub fn with_egress_service(self, service: Arc<dyn EgressService>) -> Self
Set the outbound egress service on this atom.
Sourcepub fn with_connection_resolver(
self,
resolver: Arc<dyn UserConnectionResolver>,
) -> Self
pub fn with_connection_resolver( self, resolver: Arc<dyn UserConnectionResolver>, ) -> Self
Set the user connection resolver on this atom
Sourcepub fn with_session_store(self, store: Arc<dyn SessionStore>) -> Self
pub fn with_session_store(self, store: Arc<dyn SessionStore>) -> Self
Set session store for context-aware tools.
Sourcepub fn with_agent_store(self, store: Arc<dyn AgentStore>) -> Self
pub fn with_agent_store(self, store: Arc<dyn AgentStore>) -> Self
Set agent store for context-aware tools.
Sourcepub fn with_schedule_store(self, store: Arc<dyn SessionScheduleStore>) -> Self
pub fn with_schedule_store(self, store: Arc<dyn SessionScheduleStore>) -> Self
Set session schedule store for scheduling tools.
Sourcepub fn with_subagent_delegate(
self,
store: Arc<dyn SubagentSessionDelegate>,
) -> Self
pub fn with_subagent_delegate( self, store: Arc<dyn SubagentSessionDelegate>, ) -> Self
Set platform store for org-level management tools.
Sourcepub fn with_leased_resource_store(
self,
store: Arc<dyn LeasedResourceStore>,
) -> Self
pub fn with_leased_resource_store( self, store: Arc<dyn LeasedResourceStore>, ) -> Self
Set leased resource store for lifecycle-managed provider resources.
Sourcepub fn with_session_resource_registry(
self,
registry: Arc<dyn SessionResourceRegistry>,
) -> Self
pub fn with_session_resource_registry( self, registry: Arc<dyn SessionResourceRegistry>, ) -> Self
Set session resource registry.
Sourcepub fn with_session_task_registry(
self,
registry: Arc<dyn SessionTaskRegistry>,
) -> Self
pub fn with_session_task_registry( self, registry: Arc<dyn SessionTaskRegistry>, ) -> Self
Add a session task registry passed to tool contexts.
pub fn with_capability_registry(self, registry: CapabilityRegistry) -> Self
Sourcepub fn with_tool_registry(self, registry: Arc<ToolRegistry>) -> Self
pub fn with_tool_registry(self, registry: Arc<ToolRegistry>) -> Self
Set the active built-in tool registry for meta-tools like spawn_background.
Sourcepub fn with_post_tool_hooks(self, hooks: Vec<Arc<dyn PostToolExecHook>>) -> Self
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.
Sourcepub fn with_pre_tool_hooks(self, hooks: Vec<Arc<dyn PreToolUseHook>>) -> Self
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.
pub fn with_tool_call_hooks(self, hooks: Vec<Arc<dyn ToolCallHook>>) -> Self
Sourcepub fn with_org_id(self, org_id: OrgId) -> Self
pub fn with_org_id(self, org_id: OrgId) -> Self
Set org ID for org-scoped operations.
Sourcepub fn with_network_access(
self,
network_access: Option<NetworkAccessList>,
) -> Self
pub fn with_network_access( self, network_access: Option<NetworkAccessList>, ) -> Self
Set the merged network access list for URL filtering in tools.
Sourcepub fn with_budget_checker(self, checker: Arc<dyn BudgetChecker>) -> Self
pub fn with_budget_checker(self, checker: Arc<dyn BudgetChecker>) -> Self
Set the budget checker for the check_budget tool.
Set the internal payment authority for paid capability tools.
Set the authority used to authorize detached peer-session creation.
Sourcepub fn with_outbound_tool_rate_limiter(
self,
limiter: Arc<dyn OutboundToolRateLimiter>,
) -> Self
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).
Sourcepub fn with_durable_tool_result_store(
self,
store: Arc<dyn DurableToolResultStore>,
) -> Self
pub fn with_durable_tool_result_store( self, store: Arc<dyn DurableToolResultStore>, ) -> Self
Set the durable per-tool-call idempotency store (EVE-530).
Sourcepub fn with_subagent_spawn_store(
self,
store: Arc<dyn SubagentSpawnStore>,
) -> Self
pub fn with_subagent_spawn_store( self, store: Arc<dyn SubagentSpawnStore>, ) -> Self
Set the durable subagent spawn handle store (EVE-535).
Sourcepub fn with_subagent_nesting_policy(self, policy: SubagentNestingPolicy) -> Self
pub fn with_subagent_nesting_policy(self, policy: SubagentNestingPolicy) -> Self
Set the resolved subagent nesting policy for tool contexts.
Sourcepub fn with_reasoning_effort_handle(self, handle: ReasoningEffortHandle) -> Self
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.