pub struct AgentRuntimeBuilder { /* private fields */ }Expand description
Holds agent runtime builder application-layer state or configuration. Use it with the documented coordinator methods; run, journal, event, provider, or port effects are called out on those methods rather than on construction.
Implementations§
Source§impl AgentRuntimeBuilder
impl AgentRuntimeBuilder
Sourcepub fn providers(self, providers: ProviderRegistry) -> Self
pub fn providers(self, providers: ProviderRegistry) -> Self
Returns an updated value with providers configured. This stores a provider registry in the builder and performs no provider calls.
Sourcepub fn provider<P>(
self,
route_id: impl Into<String>,
provider: P,
) -> Result<Self, AgentError>where
P: ProviderAdapter + 'static,
pub fn provider<P>(
self,
route_id: impl Into<String>,
provider: P,
) -> Result<Self, AgentError>where
P: ProviderAdapter + 'static,
Returns an updated value with provider configured. This adds one provider adapter to the builder registry and performs no provider calls.
Sourcepub fn package_resolver<R>(self, resolver: R) -> Selfwhere
R: RuntimePackageResolver + 'static,
pub fn package_resolver<R>(self, resolver: R) -> Selfwhere
R: RuntimePackageResolver + 'static,
Returns an updated value with package resolver configured. This is builder configuration only; it stores the resolver for future run starts and performs no I/O.
Sourcepub fn default_package_id(self, package_id: RuntimePackageId) -> Self
pub fn default_package_id(self, package_id: RuntimePackageId) -> Self
Returns an updated value with default package id configured. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcepub fn package(self, package: RuntimePackage) -> Self
pub fn package(self, package: RuntimePackage) -> Self
Returns an updated value with package configured. This reads or configures runtime state without executing a provider or tool.
Sourcepub fn default_package(self, package: RuntimePackage) -> Self
pub fn default_package(self, package: RuntimePackage) -> Self
Returns an updated value with default package configured. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcepub fn journal<J>(self, journal: J) -> Selfwhere
J: RunJournal + 'static,
pub fn journal<J>(self, journal: J) -> Selfwhere
J: RunJournal + 'static,
Returns an updated value with journal configured. This reads or configures runtime state without executing a provider or tool.
Sourcepub fn event_bus<E>(self, event_bus: E) -> Selfwhere
E: AgentEventBus + 'static,
pub fn event_bus<E>(self, event_bus: E) -> Selfwhere
E: AgentEventBus + 'static,
Returns an updated value with event bus configured. This stores the event-bus port in the builder and does not publish events.
Sourcepub fn content<C>(self, content: C) -> Self
pub fn content<C>(self, content: C) -> Self
Returns an updated value with content configured. This reads or configures runtime state without executing a provider or tool.
Sourcepub fn policy<P>(self, policy: P) -> Selfwhere
P: RuntimePolicyPort + 'static,
pub fn policy<P>(self, policy: P) -> Selfwhere
P: RuntimePolicyPort + 'static,
Returns policy for the current value. This is a read-only or data-construction helper unless the method body explicitly calls a port or store.
Sourcepub fn output_sink<S>(self, sink: S) -> Result<Self, AgentError>where
S: OutputSinkPort + 'static,
pub fn output_sink<S>(self, sink: S) -> Result<Self, AgentError>where
S: OutputSinkPort + 'static,
Returns output sink for the current value. This is a read-only or data-construction helper unless the method body explicitly calls a port or store.
Sourcepub fn tool_route(self, route: ToolRoute) -> Self
pub fn tool_route(self, route: ToolRoute) -> Self
Adds one tool route to the runtime’s app-facing tool execution configuration. The route is validated against the effective runtime package only when a model-requested tool call is lowered.
Sourcepub fn tool_routes(self, routes: impl IntoIterator<Item = ToolRoute>) -> Self
pub fn tool_routes(self, routes: impl IntoIterator<Item = ToolRoute>) -> Self
Replaces the runtime’s configured tool routes. This is builder configuration only and does not execute or resolve tools.
Sourcepub fn tool_executors(self, executors: ToolExecutorRegistry) -> Self
pub fn tool_executors(self, executors: ToolExecutorRegistry) -> Self
Replaces the runtime’s configured tool executor registry. This is builder configuration only and does not execute tools.
Sourcepub fn tool_executor(
self,
executor: Arc<dyn ToolExecutor>,
) -> Result<Self, AgentError>
pub fn tool_executor( self, executor: Arc<dyn ToolExecutor>, ) -> Result<Self, AgentError>
Adds one tool executor to the runtime’s configured executor registry. This stores the executor behind the public port and does not execute it.
Sourcepub fn tool_policy<P>(self, policy: P) -> Selfwhere
P: ToolPolicyPort + 'static,
pub fn tool_policy<P>(self, policy: P) -> Selfwhere
P: ToolPolicyPort + 'static,
Configures the runtime’s tool policy port. This is builder configuration only and does not evaluate policy.
Sourcepub fn approval_dispatcher<D>(self, dispatcher: D) -> Selfwhere
D: ApprovalDispatcher + 'static,
pub fn approval_dispatcher<D>(self, dispatcher: D) -> Selfwhere
D: ApprovalDispatcher + 'static,
Configures the host-owned approval dispatcher used by approval-gated tool execution.
Configures a shared host-owned approval dispatcher.
Sourcepub fn hook_executor_registry<R>(self, registry: R) -> Selfwhere
R: HookExecutorRegistry + 'static,
pub fn hook_executor_registry<R>(self, registry: R) -> Selfwhere
R: HookExecutorRegistry + 'static,
Returns hook executor registry for the current value. This stores the registry for future run starts and hook invocation; it does not invoke hook executors.
Sourcepub fn build(self) -> Result<AgentRuntime, AgentError>
pub fn build(self) -> Result<AgentRuntime, AgentError>
Finishes builder validation and returns the configured value. This is data-only unless the surrounding builder explicitly documents adapter or store access.