pub struct ConfiguredSource { /* private fields */ }Expand description
The default source: sessions basis builds itself, on the process’s runtime.
Implementations§
Source§impl ConfiguredSource
impl ConfiguredSource
pub fn new(template: Option<SessionTemplate>) -> Self
Trait Implementations§
Source§impl SessionSource for ConfiguredSource
impl SessionSource for ConfiguredSource
Source§fn resume<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
cwd: PathBuf,
mcp: Vec<McpServer>,
) -> Pin<Box<dyn Future<Output = Result<PreparedRun, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resume<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
cwd: PathBuf,
mcp: Vec<McpServer>,
) -> Pin<Box<dyn Future<Output = Result<PreparedRun, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The workspace comes from the client’s cwd and the conversation from
an id the client kept, and nothing here pairs them: a client is free to
send a cwd that has nothing to do with the session it names.
Workspace::resume is what refuses that pairing — it compares the
persisted agent’s own base directory against the workspace’s identity
and answers RunError::WorkspaceMismatch — which is where the check
belongs, since a resume states that workspace’s policy and tool
audience onto whatever it picks up.
Source§fn list_sessions<'life0, 'async_trait>(
&'life0 self,
cwd: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistedSession>, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_sessions<'life0, 'async_trait>(
&'life0 self,
cwd: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<Vec<PersistedSession>, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reads mentra’s store directly. Building a session to enumerate sessions would resolve a model over the network to answer a question about files on disk.
This depends on a conversation being tagged with
store::runtime_identifier for its
workspace, and every session opened here is: Runtime::mint states the
identifier per session, so the shared runtime this source runs on files
each session/new under the cwd it was opened for.
A conversation that has been resumed and run again stays on this
list too: mentra 0.27 retains a persisted agent’s own stored runtime
identifier through every later save (basis::store has the account),
so a row this source’s shared runtime resumed re-files under this
workspace’s own tag rather than the runtime’s.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Writes to mentra’s store directly, for the reason
list_sessions reads it directly: opening a
workspace to delete a record would resolve a model over the network to
answer a question about files on disk — and would fail for want of a
credential on a connection that has done nothing but list.
Source§fn create<'life0, 'async_trait>(
&'life0 self,
cwd: PathBuf,
mcp: Vec<McpServer>,
) -> Pin<Box<dyn Future<Output = Result<PreparedRun, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
cwd: PathBuf,
mcp: Vec<McpServer>,
) -> Pin<Box<dyn Future<Output = Result<PreparedRun, RunError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
cwd, for session/new, with the MCP servers
the client configured for this session.