Skip to main content

LoongKernel

Struct LoongKernel 

Source
pub struct LoongKernel<P: PolicyEngine> { /* private fields */ }

Implementations§

Source§

impl<P: PolicyEngine> LoongKernel<P>

Source

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.

Source

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.

Source

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.

Source

pub fn with_runtime( policy: P, clock: Arc<dyn Clock>, audit: Arc<dyn AuditSink>, ) -> Self

Source

pub fn register_pack( &mut self, pack: VerticalPackManifest, ) -> Result<(), KernelError>

Source

pub fn get_namespace(&self, pack_id: &str) -> Option<&Namespace>

Source

pub fn register_policy_extension<E: PolicyExtension + 'static>( &mut self, extension: E, )

Source

pub fn register_harness_adapter<A: HarnessAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn register_core_connector_adapter<A: CoreConnectorAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn register_connector_extension_adapter<A: ConnectorExtensionAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn set_default_core_connector_adapter( &mut self, name: &str, ) -> Result<(), KernelError>

Source

pub fn register_core_runtime_adapter<A: CoreRuntimeAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn register_runtime_extension_adapter<A: RuntimeExtensionAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn set_default_core_runtime_adapter( &mut self, name: &str, ) -> Result<(), KernelError>

Source

pub fn register_core_tool_adapter<A: CoreToolAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn register_tool_extension_adapter<A: ToolExtensionAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn set_default_core_tool_adapter( &mut self, name: &str, ) -> Result<(), KernelError>

Source

pub fn register_core_memory_adapter<A: CoreMemoryAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn register_memory_extension_adapter<A: MemoryExtensionAdapter + 'static>( &mut self, adapter: A, )

Source

pub fn set_default_core_memory_adapter( &mut self, name: &str, ) -> Result<(), KernelError>

Source

pub fn build(self) -> Kernel<P>

Source

pub fn issue_token( &self, pack_id: &str, agent_id: &str, ttl_s: u64, ) -> Result<CapabilityToken, KernelError>

Source

pub fn issue_scoped_token( &self, pack_id: &str, agent_id: &str, allowed_capabilities: &BTreeSet<Capability>, ttl_s: u64, ) -> Result<CapabilityToken, KernelError>

Source

pub fn revoke_token( &self, token_id: &str, actor_agent_id: Option<&str>, ) -> Result<(), KernelError>

Source

pub fn revoke_generation(&self, below: u64)

Source

pub fn record_audit_event( &self, agent_id: Option<&str>, kind: AuditEventKind, ) -> Result<(), KernelError>

Source

pub fn authorize_operation( &self, pack_id: &str, token: &CapabilityToken, plane: ExecutionPlane, tier: PlaneTier, primary_adapter: &str, delegated_core_adapter: Option<&str>, operation: &str, required_capabilities: &BTreeSet<Capability>, ) -> Result<(), KernelError>

Source

pub async fn execute_task( &self, pack_id: &str, token: &CapabilityToken, task: TaskIntent, ) -> Result<KernelDispatch, KernelError>

Source

pub async fn execute_connector_core( &self, pack_id: &str, token: &CapabilityToken, core_name: Option<&str>, command: ConnectorCommand, ) -> Result<ConnectorDispatch, KernelError>

Source

pub async fn execute_connector_extension( &self, pack_id: &str, token: &CapabilityToken, extension_name: &str, core_name: Option<&str>, command: ConnectorCommand, ) -> Result<ConnectorDispatch, KernelError>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.