pub struct AcpSessionStore { /* private fields */ }Implementations§
Source§impl AcpSessionStore
impl AcpSessionStore
pub fn new(db: Database) -> AcpSessionStore
Sourcepub async fn get(
&self,
session_id: &str,
) -> Result<Option<AcpSessionRow>, ServerError>
pub async fn get( &self, session_id: &str, ) -> Result<Option<AcpSessionRow>, ServerError>
Load a session by ID.
Sourcepub async fn get_history(
&self,
session_id: &str,
) -> Result<Vec<Value>, ServerError>
pub async fn get_history( &self, session_id: &str, ) -> Result<Vec<Value>, ServerError>
Load session history from the database.
Sourcepub async fn list(
&self,
workspace_id: Option<&str>,
limit: Option<usize>,
) -> Result<Vec<AcpSessionRow>, ServerError>
pub async fn list( &self, workspace_id: Option<&str>, limit: Option<usize>, ) -> Result<Vec<AcpSessionRow>, ServerError>
List sessions, optionally filtered by workspace.
Sourcepub async fn append_history(
&self,
session_id: &str,
notification: Value,
) -> Result<(), ServerError>
pub async fn append_history( &self, session_id: &str, notification: Value, ) -> Result<(), ServerError>
Append a notification to session history.
Sourcepub async fn create(
&self,
params: CreateAcpSessionParams<'_>,
) -> Result<(), ServerError>
pub async fn create( &self, params: CreateAcpSessionParams<'_>, ) -> Result<(), ServerError>
Persist a newly created session to the database.
Called immediately after AcpManager::create_session so the session
survives server restarts and is visible in the session list.
Sourcepub async fn rename(
&self,
session_id: &str,
name: &str,
) -> Result<(), ServerError>
pub async fn rename( &self, session_id: &str, name: &str, ) -> Result<(), ServerError>
Rename a session in the database.
Sourcepub async fn set_routa_agent_id(
&self,
session_id: &str,
routa_agent_id: Option<&str>,
) -> Result<(), ServerError>
pub async fn set_routa_agent_id( &self, session_id: &str, routa_agent_id: Option<&str>, ) -> Result<(), ServerError>
Persist or update the ROUTA agent mapping for a session.
Sourcepub async fn set_provider_session_id(
&self,
session_id: &str,
provider_session_id: Option<&str>,
) -> Result<(), ServerError>
pub async fn set_provider_session_id( &self, session_id: &str, provider_session_id: Option<&str>, ) -> Result<(), ServerError>
Persist or update the provider-native session id for a session.
Sourcepub async fn delete(&self, session_id: &str) -> Result<(), ServerError>
pub async fn delete(&self, session_id: &str) -> Result<(), ServerError>
Delete a session (and its history) from the database.
Sourcepub async fn set_first_prompt_sent(
&self,
session_id: &str,
) -> Result<(), ServerError>
pub async fn set_first_prompt_sent( &self, session_id: &str, ) -> Result<(), ServerError>
Mark a session’s first_prompt_sent flag as true.
Called after the user sends the first real prompt so the session is no longer treated as “empty” in context views.
Sourcepub async fn save_history(
&self,
session_id: &str,
history: &[Value],
) -> Result<(), ServerError>
pub async fn save_history( &self, session_id: &str, history: &[Value], ) -> Result<(), ServerError>
Overwrite the full message history for a session.
Called after a prompt turn completes to flush the in-memory history
accumulated by AcpManager::push_to_history into the database.
Auto Trait Implementations§
impl Freeze for AcpSessionStore
impl RefUnwindSafe for AcpSessionStore
impl Send for AcpSessionStore
impl Sync for AcpSessionStore
impl Unpin for AcpSessionStore
impl UnsafeUnpin for AcpSessionStore
impl UnwindSafe for AcpSessionStore
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 more