pub struct CognitionRuntime { /* private fields */ }Expand description
In-memory cognition runtime for perpetual persona swarms.
Implementations§
Source§impl CognitionRuntime
impl CognitionRuntime
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Build runtime from environment feature flags.
Sourcepub fn new_with_options(options: CognitionRuntimeOptions) -> Self
pub fn new_with_options(options: CognitionRuntimeOptions) -> Self
Build runtime from explicit options.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether cognition is enabled by feature flag.
Sourcepub fn subscribe_events(&self) -> Receiver<ThoughtEvent>
pub fn subscribe_events(&self) -> Receiver<ThoughtEvent>
Subscribe to thought events for streaming.
Sourcepub async fn start(
&self,
req: Option<StartCognitionRequest>,
) -> Result<CognitionStatus>
pub async fn start( &self, req: Option<StartCognitionRequest>, ) -> Result<CognitionStatus>
Start the perpetual cognition loop.
Sourcepub async fn stop(&self, reason: Option<String>) -> Result<CognitionStatus>
pub async fn stop(&self, reason: Option<String>) -> Result<CognitionStatus>
Stop the perpetual cognition loop.
Sourcepub async fn create_persona(
&self,
req: CreatePersonaRequest,
) -> Result<PersonaRuntimeState>
pub async fn create_persona( &self, req: CreatePersonaRequest, ) -> Result<PersonaRuntimeState>
Create a persona record.
Sourcepub async fn spawn_child(
&self,
parent_id: &str,
req: SpawnPersonaRequest,
) -> Result<PersonaRuntimeState>
pub async fn spawn_child( &self, parent_id: &str, req: SpawnPersonaRequest, ) -> Result<PersonaRuntimeState>
Spawn a child persona under an existing parent.
Sourcepub async fn reap_persona(
&self,
persona_id: &str,
req: ReapPersonaRequest,
) -> Result<ReapPersonaResponse>
pub async fn reap_persona( &self, persona_id: &str, req: ReapPersonaRequest, ) -> Result<ReapPersonaResponse>
Reap one persona or the full descendant tree.
Sourcepub async fn latest_snapshot(&self) -> Option<MemorySnapshot>
pub async fn latest_snapshot(&self) -> Option<MemorySnapshot>
Get latest memory snapshot, if any.
Sourcepub async fn lineage_graph(&self) -> LineageGraph
pub async fn lineage_graph(&self) -> LineageGraph
Build lineage graph from current persona state.
Sourcepub async fn status(&self) -> CognitionStatus
pub async fn status(&self) -> CognitionStatus
Return a summary status.
Sourcepub fn set_tools(&mut self, registry: Arc<ToolRegistry>)
pub fn set_tools(&mut self, registry: Arc<ToolRegistry>)
Set the tool registry for capability-based tool execution.
Sourcepub async fn get_beliefs(&self) -> HashMap<String, Belief>
pub async fn get_beliefs(&self) -> HashMap<String, Belief>
Get current beliefs.
Sourcepub async fn get_belief(&self, id: &str) -> Option<Belief>
pub async fn get_belief(&self, id: &str) -> Option<Belief>
Get a single belief by ID.
Sourcepub async fn get_attention_queue(&self) -> Vec<AttentionItem>
pub async fn get_attention_queue(&self) -> Vec<AttentionItem>
Get the current attention queue.
Sourcepub async fn get_proposals(&self) -> HashMap<String, Proposal>
pub async fn get_proposals(&self) -> HashMap<String, Proposal>
Get all proposals.
Sourcepub async fn get_workspace(&self) -> GlobalWorkspace
pub async fn get_workspace(&self) -> GlobalWorkspace
Get the current global workspace.
Sourcepub async fn get_receipts(&self) -> Vec<DecisionReceipt>
pub async fn get_receipts(&self) -> Vec<DecisionReceipt>
Get decision receipts.
Sourcepub async fn approve_proposal(&self, proposal_id: &str) -> Result<()>
pub async fn approve_proposal(&self, proposal_id: &str) -> Result<()>
Approve a Critical-risk proposal for execution.
Sourcepub async fn get_governance(&self) -> SwarmGovernance
pub async fn get_governance(&self) -> SwarmGovernance
Get governance settings.
Sourcepub async fn get_persona(&self, id: &str) -> Option<PersonaRuntimeState>
pub async fn get_persona(&self, id: &str) -> Option<PersonaRuntimeState>
Get persona state for a specific persona.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CognitionRuntime
impl !RefUnwindSafe for CognitionRuntime
impl Send for CognitionRuntime
impl Sync for CognitionRuntime
impl Unpin for CognitionRuntime
impl !UnwindSafe for CognitionRuntime
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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