pub struct PlatformDefinition { /* private fields */ }Expand description
Shared definition of the Everruns platform surface.
PlatformDefinition lets an embedder decide which capabilities, LLM
drivers, connection providers, built-in harness templates, and platform
service factories exist at runtime. Server and worker code should consume
the same definition so the control plane and execution plane stay aligned.
§Example
use everruns_core::{
BuiltInCapabilityDefinition, BuiltInHarnessDefinition, BuiltInHarnessRole,
DriverRegistry, PlatformDefinition,
};
let mut drivers = DriverRegistry::new();
everruns_openai::register_driver(&mut drivers);
let platform = PlatformDefinition::builder()
.driver_registry(drivers)
.capability(everruns_core::CurrentTimeCapability)
.add_built_in_harness(
BuiltInHarnessDefinition::new(
"minimal",
"Minimal",
"Small default harness for an embedded deployment.",
"You are a helpful assistant.",
)
.with_roles([BuiltInHarnessRole::Base, BuiltInHarnessRole::Default])
.with_capabilities([BuiltInCapabilityDefinition::new("current_time")]),
)
.build();Implementations§
Source§impl PlatformDefinition
impl PlatformDefinition
Sourcepub fn new(
capability_registry: CapabilityRegistry,
driver_registry: DriverRegistry,
) -> Self
pub fn new( capability_registry: CapabilityRegistry, driver_registry: DriverRegistry, ) -> Self
Create a platform definition from explicit registries.
Sourcepub fn builder() -> PlatformDefinitionBuilder
pub fn builder() -> PlatformDefinitionBuilder
Create a builder for fluent platform composition.
Sourcepub fn capability_registry(&self) -> &CapabilityRegistry
pub fn capability_registry(&self) -> &CapabilityRegistry
Immutable access to the capability registry.
Sourcepub fn capability_registry_mut(&mut self) -> &mut CapabilityRegistry
pub fn capability_registry_mut(&mut self) -> &mut CapabilityRegistry
Mutable access to the capability registry.
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 connection_providers(&self) -> &ConnectionProviderRegistry
pub fn connection_providers(&self) -> &ConnectionProviderRegistry
Immutable access to the connection-provider registry.
Sourcepub fn connection_providers_mut(&mut self) -> &mut ConnectionProviderRegistry
pub fn connection_providers_mut(&mut self) -> &mut ConnectionProviderRegistry
Mutable access to the connection-provider registry.
Sourcepub fn built_in_harnesses(&self) -> &[BuiltInHarnessDefinition]
pub fn built_in_harnesses(&self) -> &[BuiltInHarnessDefinition]
Built-in harness templates provisioned by this platform.
Sourcepub fn built_in_harnesses_mut(&mut self) -> &mut Vec<BuiltInHarnessDefinition>
pub fn built_in_harnesses_mut(&mut self) -> &mut Vec<BuiltInHarnessDefinition>
Mutable access to the built-in harness templates.
Sourcepub fn egress_service(&self) -> Arc<dyn EgressService> ⓘ
pub fn egress_service(&self) -> Arc<dyn EgressService> ⓘ
System-wide outbound network boundary.
Sourcepub fn email_sender(&self) -> Arc<dyn EmailSender> ⓘ
pub fn email_sender(&self) -> Arc<dyn EmailSender> ⓘ
System-wide email sender for product and operational flows.
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 platform-selected session filesystem implementation.
Sourcepub fn add_built_in_harness(&mut self, harness: BuiltInHarnessDefinition)
pub fn add_built_in_harness(&mut self, harness: BuiltInHarnessDefinition)
Append a built-in harness template.
Sourcepub fn harness_for_role(
&self,
role: BuiltInHarnessRole,
) -> Option<&BuiltInHarnessDefinition>
pub fn harness_for_role( &self, role: BuiltInHarnessRole, ) -> Option<&BuiltInHarnessDefinition>
Find the first built-in harness with the requested role.
Trait Implementations§
Source§impl Clone for PlatformDefinition
impl Clone for PlatformDefinition
Source§fn clone(&self) -> PlatformDefinition
fn clone(&self) -> PlatformDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlatformDefinition
impl Debug for PlatformDefinition
Auto Trait Implementations§
impl !RefUnwindSafe for PlatformDefinition
impl !UnwindSafe for PlatformDefinition
impl Freeze for PlatformDefinition
impl Send for PlatformDefinition
impl Sync for PlatformDefinition
impl Unpin for PlatformDefinition
impl UnsafeUnpin for PlatformDefinition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request