pub struct OrchaStorage { /* private fields */ }Expand description
Storage for orcha sessions backed by SQLite
Implementations§
Source§impl OrchaStorage
impl OrchaStorage
Sourcepub async fn new(config: OrchaStorageConfig) -> Result<Self, String>
pub async fn new(config: OrchaStorageConfig) -> Result<Self, String>
Create new storage with the given configuration
Sourcepub async fn create_session(
&self,
session_id: SessionId,
model: String,
working_directory: String,
rules: Option<String>,
max_retries: u32,
agent_mode: AgentMode,
tree_id: Option<String>,
) -> Result<SessionInfo, String>
pub async fn create_session( &self, session_id: SessionId, model: String, working_directory: String, rules: Option<String>, max_retries: u32, agent_mode: AgentMode, tree_id: Option<String>, ) -> Result<SessionInfo, String>
Create a new session
Sourcepub async fn get_session(
&self,
session_id: &SessionId,
) -> Result<SessionInfo, String>
pub async fn get_session( &self, session_id: &SessionId, ) -> Result<SessionInfo, String>
Get session info
Sourcepub async fn update_state(
&self,
session_id: &SessionId,
state: SessionState,
) -> Result<(), String>
pub async fn update_state( &self, session_id: &SessionId, state: SessionState, ) -> Result<(), String>
Update session state
Sourcepub async fn increment_retry(
&self,
session_id: &SessionId,
) -> Result<u32, String>
pub async fn increment_retry( &self, session_id: &SessionId, ) -> Result<u32, String>
Increment retry count
Sourcepub async fn list_sessions(&self) -> Vec<SessionInfo>
pub async fn list_sessions(&self) -> Vec<SessionInfo>
List all sessions
Sourcepub async fn delete_session(&self, session_id: &SessionId) -> Result<(), String>
pub async fn delete_session(&self, session_id: &SessionId) -> Result<(), String>
Delete a session
Sourcepub async fn create_agent(
&self,
session_id: &SessionId,
claudecode_session_id: String,
subtask: String,
is_primary: bool,
parent_agent_id: Option<AgentId>,
) -> Result<AgentInfo, String>
pub async fn create_agent( &self, session_id: &SessionId, claudecode_session_id: String, subtask: String, is_primary: bool, parent_agent_id: Option<AgentId>, ) -> Result<AgentInfo, String>
Create a new agent for a session
Sourcepub async fn list_agents(
&self,
session_id: &SessionId,
) -> Result<Vec<AgentInfo>, String>
pub async fn list_agents( &self, session_id: &SessionId, ) -> Result<Vec<AgentInfo>, String>
List all agents for a session
Sourcepub async fn update_agent_state(
&self,
agent_id: &AgentId,
state: AgentState,
) -> Result<(), String>
pub async fn update_agent_state( &self, agent_id: &AgentId, state: AgentState, ) -> Result<(), String>
Update agent state
Auto Trait Implementations§
impl Freeze for OrchaStorage
impl !RefUnwindSafe for OrchaStorage
impl Send for OrchaStorage
impl Sync for OrchaStorage
impl Unpin for OrchaStorage
impl UnsafeUnpin for OrchaStorage
impl !UnwindSafe for OrchaStorage
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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