Skip to main content

LocalSessionRunner

Trait LocalSessionRunner 

Source
pub trait LocalSessionRunner: Send + Sync {
    // Required methods
    fn create_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        harness_id: HarnessId,
        agent_id: Option<AgentId>,
        title: Option<&'life1 str>,
        locale: Option<&'life2 str>,
        parent_session_id: Option<SessionId>,
    ) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn send_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        content: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_sessions<'life0, 'async_trait>(
        &'life0 self,
        limit: Option<usize>,
        agent_id: Option<AgentId>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Session>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_session<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_messages<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PlatformMessage>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_session_status<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Drives real local sessions for the platform store. An embedder implements this over its InProcessRuntime (or a thin wrapper) so subagent spawning can create child sessions, run turns, and read back session state. This is the seam that keeps the platform store honest without it owning the runtime.

Required Methods§

Source

fn create_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, harness_id: HarnessId, agent_id: Option<AgentId>, title: Option<&'life1 str>, locale: Option<&'life2 str>, parent_session_id: Option<SessionId>, ) -> Pin<Box<dyn Future<Output = Result<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create a child/local session and persist it in the session catalog.

Source

fn send_message<'life0, 'life1, 'async_trait>( &'life0 self, session_id: SessionId, content: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deliver a user message and run a turn to completion.

Source

fn list_sessions<'life0, 'async_trait>( &'life0 self, limit: Option<usize>, agent_id: Option<AgentId>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Session>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List sessions known to the runner. Optionally filtered by agent.

Source

fn get_session<'life0, 'async_trait>( &'life0 self, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Look up a single session by id.

Source

fn get_messages<'life0, 'async_trait>( &'life0 self, session_id: SessionId, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PlatformMessage>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read recent messages (most recent first) as platform messages.

Source

fn get_session_status<'life0, 'async_trait>( &'life0 self, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Current session status string, or None if the session is unknown.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§