pub struct LoongKernel<P: PolicyEngine> { /* private fields */ }Implementations§
Source§impl<P: PolicyEngine> LoongKernel<P>
impl<P: PolicyEngine> LoongKernel<P>
Sourcepub fn new(policy: P) -> Self
pub fn new(policy: P) -> Self
Safe convenience constructor for callers that do not need to customize runtime components. This defaults to in-memory audit rather than silent audit dropping.
Sourcepub fn new_with_in_memory_audit(policy: P) -> (Self, Arc<InMemoryAuditSink>)
pub fn new_with_in_memory_audit(policy: P) -> (Self, Arc<InMemoryAuditSink>)
Construct a kernel with the default system clock and an inspectable in-memory audit sink.
Sourcepub fn new_without_audit(policy: P) -> Self
pub fn new_without_audit(policy: P) -> Self
Construct a kernel that intentionally discards audit events.
This is reserved for narrow fixture paths where callers explicitly do not need audit assertions or evidence retention.
pub fn with_runtime( policy: P, clock: Arc<dyn Clock>, audit: Arc<dyn AuditSink>, ) -> Self
pub fn register_pack( &mut self, pack: VerticalPackManifest, ) -> Result<(), KernelError>
pub fn get_namespace(&self, pack_id: &str) -> Option<&Namespace>
pub fn register_policy_extension<E: PolicyExtension + 'static>( &mut self, extension: E, )
pub fn register_harness_adapter<A: HarnessAdapter + 'static>( &mut self, adapter: A, )
pub fn register_core_connector_adapter<A: CoreConnectorAdapter + 'static>( &mut self, adapter: A, )
pub fn register_connector_extension_adapter<A: ConnectorExtensionAdapter + 'static>( &mut self, adapter: A, )
pub fn set_default_core_connector_adapter( &mut self, name: &str, ) -> Result<(), KernelError>
pub fn register_core_runtime_adapter<A: CoreRuntimeAdapter + 'static>( &mut self, adapter: A, )
pub fn register_runtime_extension_adapter<A: RuntimeExtensionAdapter + 'static>( &mut self, adapter: A, )
pub fn set_default_core_runtime_adapter( &mut self, name: &str, ) -> Result<(), KernelError>
pub fn register_core_tool_adapter<A: CoreToolAdapter + 'static>( &mut self, adapter: A, )
pub fn register_tool_extension_adapter<A: ToolExtensionAdapter + 'static>( &mut self, adapter: A, )
pub fn set_default_core_tool_adapter( &mut self, name: &str, ) -> Result<(), KernelError>
pub fn register_core_memory_adapter<A: CoreMemoryAdapter + 'static>( &mut self, adapter: A, )
pub fn register_memory_extension_adapter<A: MemoryExtensionAdapter + 'static>( &mut self, adapter: A, )
pub fn set_default_core_memory_adapter( &mut self, name: &str, ) -> Result<(), KernelError>
pub fn build(self) -> Kernel<P>
pub fn issue_token( &self, pack_id: &str, agent_id: &str, ttl_s: u64, ) -> Result<CapabilityToken, KernelError>
pub fn issue_scoped_token( &self, pack_id: &str, agent_id: &str, allowed_capabilities: &BTreeSet<Capability>, ttl_s: u64, ) -> Result<CapabilityToken, KernelError>
pub fn revoke_token( &self, token_id: &str, actor_agent_id: Option<&str>, ) -> Result<(), KernelError>
pub fn revoke_generation(&self, below: u64)
pub fn record_audit_event( &self, agent_id: Option<&str>, kind: AuditEventKind, ) -> Result<(), KernelError>
pub async fn execute_task( &self, pack_id: &str, token: &CapabilityToken, task: TaskIntent, ) -> Result<KernelDispatch, KernelError>
pub async fn execute_connector_core( &self, pack_id: &str, token: &CapabilityToken, core_name: Option<&str>, command: ConnectorCommand, ) -> Result<ConnectorDispatch, KernelError>
pub async fn execute_connector_extension( &self, pack_id: &str, token: &CapabilityToken, extension_name: &str, core_name: Option<&str>, command: ConnectorCommand, ) -> Result<ConnectorDispatch, KernelError>
pub async fn execute_runtime_core( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, core_name: Option<&str>, request: RuntimeCoreRequest, ) -> Result<RuntimeCoreOutcome, KernelError>
pub async fn execute_runtime_extension( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, extension_name: &str, core_name: Option<&str>, request: RuntimeExtensionRequest, ) -> Result<RuntimeExtensionOutcome, KernelError>
pub async fn execute_tool_core( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, core_name: Option<&str>, request: ToolCoreRequest, ) -> Result<ToolCoreOutcome, KernelError>
pub async fn execute_tool_extension( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, extension_name: &str, core_name: Option<&str>, request: ToolExtensionRequest, ) -> Result<ToolExtensionOutcome, KernelError>
pub async fn execute_memory_core( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, core_name: Option<&str>, request: MemoryCoreRequest, ) -> Result<MemoryCoreOutcome, KernelError>
pub async fn execute_memory_extension( &self, pack_id: &str, token: &CapabilityToken, required_capabilities: &BTreeSet<Capability>, extension_name: &str, core_name: Option<&str>, request: MemoryExtensionRequest, ) -> Result<MemoryExtensionOutcome, KernelError>
Trait Implementations§
Source§impl<P: PolicyEngine> AsRef<LoongKernel<P>> for Kernel<P>
impl<P: PolicyEngine> AsRef<LoongKernel<P>> for Kernel<P>
Source§fn as_ref(&self) -> &LoongKernel<P>
fn as_ref(&self) -> &LoongKernel<P>
Converts this type into a shared reference of the (usually inferred) input type.
Auto Trait Implementations§
impl<P> !Freeze for LoongKernel<P>
impl<P> !RefUnwindSafe for LoongKernel<P>
impl<P> Send for LoongKernel<P>
impl<P> Sync for LoongKernel<P>
impl<P> Unpin for LoongKernel<P>where
P: Unpin,
impl<P> UnsafeUnpin for LoongKernel<P>where
P: UnsafeUnpin,
impl<P> !UnwindSafe for LoongKernel<P>
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
Mutably borrows from an owned value. Read more