pub struct HostComposition { /* private fields */ }Expand description
The execution surface a deployment runs with.
HostComposition lets an embedder decide which capabilities, LLM drivers
and host services exist at runtime. Server and worker code compose the same
shape so the control plane and execution plane stay aligned.
§Example
use everruns_provider::driver_registry::DriverRegistry;
use everruns_host::HostComposition;
let mut drivers = DriverRegistry::new();
everruns_openai::register_driver(&mut drivers);
let composition = HostComposition::builder()
.driver_registry(drivers)
.capability(everruns_builtins::HumanIntentCapability)
.build();Implementations§
Source§impl HostComposition
impl HostComposition
Sourcepub fn new(
capability_registry: CapabilityRegistry,
driver_registry: DriverRegistry,
) -> Self
pub fn new( capability_registry: CapabilityRegistry, driver_registry: DriverRegistry, ) -> Self
Create a composition from explicit registries.
Sourcepub fn builder() -> HostCompositionBuilder
pub fn builder() -> HostCompositionBuilder
Create a builder for fluent composition.
Sourcepub fn capability_registry(&self) -> Arc<CapabilityRegistry> ⓘ
pub fn capability_registry(&self) -> Arc<CapabilityRegistry> ⓘ
A consistent snapshot of the capability registry.
The snapshot is cheap to hold and never changes underneath its holder, so a turn assembled from one either sees a dynamically registered capability or does not — never a partially built registry.
Sourcepub fn register_capability(
&self,
capability: Arc<dyn Capability>,
) -> Result<(), CapabilityError>
pub fn register_capability( &self, capability: Arc<dyn Capability>, ) -> Result<(), CapabilityError>
Register a capability on a live composition (EVE-917).
Callable through a shared handle, so a host holding
Arc<InProcessRuntime> can make a capability discovered mid-session
known to the runtime. Registration is not activation: the id becomes
resolvable, and activate_capability still decides per-session
enablement.
Duplicate canonical ids and alias collisions are rejected and leave the existing registry untouched.
Sourcepub fn register_capability_overriding(&self, capability: Arc<dyn Capability>)
pub fn register_capability_overriding(&self, capability: Arc<dyn Capability>)
Register a capability with composition-time replace semantics.
Re-registering a canonical id overrides the previous implementation,
matching CapabilityRegistry::register_arc. Use
HostComposition::register_capability for anything registered after
the deployment is assembled, where a silent override would hide a bug.
Sourcepub fn is_capability_registered(&self, id: &str) -> bool
pub fn is_capability_registered(&self, id: &str) -> bool
Whether a canonical id or alias already resolves in this composition.
Lets a host skip registration for a capability that is already present without matching on error strings.
Sourcepub fn driver_registry(&self) -> &DriverRegistry
pub fn driver_registry(&self) -> &DriverRegistry
Immutable access to the driver registry.
Sourcepub fn driver_registry_mut(&mut self) -> &mut DriverRegistry
pub fn driver_registry_mut(&mut self) -> &mut DriverRegistry
Mutable access to the driver registry.
Sourcepub fn egress_service(&self) -> Arc<dyn EgressService> ⓘ
pub fn egress_service(&self) -> Arc<dyn EgressService> ⓘ
System-wide outbound network boundary.
Sourcepub fn utility_llm_service(&self) -> Arc<dyn UtilityLlmService> ⓘ
pub fn utility_llm_service(&self) -> Arc<dyn UtilityLlmService> ⓘ
System-wide utility LLM service for capability internals.
Sourcepub fn session_file_system_factory(&self) -> Arc<dyn SessionFileSystemFactory> ⓘ
pub fn session_file_system_factory(&self) -> Arc<dyn SessionFileSystemFactory> ⓘ
Factory for the composition-selected session filesystem implementation.
Trait Implementations§
Source§impl Clone for HostComposition
Clones are independent compositions.
impl Clone for HostComposition
Clones are independent compositions.
They start from the same registry snapshot — cheap, since the snapshot is
shared until one side writes — but a capability registered on a clone is not
visible to the original. That keeps the pre-EVE-917 behaviour of
#[derive(Clone)], where each clone owned its own registry.