Skip to main content

DynamicCliAgentStore

Trait DynamicCliAgentStore 

Source
pub trait DynamicCliAgentStore: Send + Sync {
Show 23 methods // Provided methods fn save_team<'life0, 'life1, 'async_trait>( &'life0 self, _team: &'life1 TeamRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn add_team_post<'life0, 'life1, 'async_trait>( &'life0 self, _post: &'life1 TeamPostRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn conversation_team<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _lead_agent: &'life2 str, _max_posts: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<SavedTeam>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn save_dynamic_cli_agent<'life0, 'life1, 'async_trait>( &'life0 self, _agent: &'life1 DynamicCliAgent, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn list_dynamic_cli_agents<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DynamicCliAgent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn delete_dynamic_cli_agent<'life0, 'async_trait>( &'life0 self, _id: i64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn update_dynamic_cli_agent<'life0, 'life1, 'async_trait>( &'life0 self, _agent: &'life1 DynamicCliAgent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn log_cli_agent_start<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, _task_id: Option<&'life1 str>, _session_id: &'life2 str, _agent_name: &'life3 str, _prompt_summary: &'life4 str, _working_dir: Option<&'life5 str>, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait { ... } fn log_cli_agent_complete<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _exit_code: Option<i32>, _output_summary: &'life1 str, _success: bool, _duration_secs: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn note_cli_agent_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _id: i64, _run_id: &'life1 str, _mode: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn note_cli_agent_task<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _task: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_cli_agent_thread<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _thread: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_cli_agent_keeps_session<'life0, 'async_trait>( &'life0 self, _id: i64, _kept: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_cli_agent_run_tag<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _run_tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn set_cli_agent_session<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _agent_session: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn record_cli_agent_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _id: i64, _seq: i64, _kind: &'life1 str, _data: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn cli_agent_run<'life0, 'life1, 'async_trait>( &'life0 self, _run_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CliAgentRun>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn latest_cli_agent_run_in_thread<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _thread: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn latest_kept_cli_agent_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _agent_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn latest_cli_agent_run_by<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _agent_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn get_cli_agent_events<'life0, 'async_trait>( &'life0 self, _id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<CliAgentEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_cli_agent_invocations<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<CliAgentInvocation>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn cleanup_stale_cli_agent_invocations<'life0, 'async_trait>( &'life0 self, _max_age_hours: i64, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Runtime-managed CLI agents persistence + invocation logs.

Provided Methods§

Source

fn save_team<'life0, 'life1, 'async_trait>( &'life0 self, _team: &'life1 TeamRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Keep team as it stands now: its bookkeeping and every member (replacing what was kept of them).

Source

fn add_team_post<'life0, 'life1, 'async_trait>( &'life0 self, _post: &'life1 TeamPostRecord, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Keep one post of a team’s board (once; a post kept again is left as it was).

Source

fn conversation_team<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _lead_agent: &'life2 str, _max_posts: usize, ) -> Pin<Box<dyn Future<Output = Result<Option<SavedTeam>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The team conversation session_id’s lead lead_agent coordinated most recently, with its newest max_posts posts.

Source

fn save_dynamic_cli_agent<'life0, 'life1, 'async_trait>( &'life0 self, _agent: &'life1 DynamicCliAgent, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a dynamically added CLI agent.

Source

fn list_dynamic_cli_agents<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<DynamicCliAgent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all dynamic CLI agents.

Source

fn delete_dynamic_cli_agent<'life0, 'async_trait>( &'life0 self, _id: i64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete a dynamic CLI agent by ID.

Source

fn update_dynamic_cli_agent<'life0, 'life1, 'async_trait>( &'life0 self, _agent: &'life1 DynamicCliAgent, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update a dynamic CLI agent.

Source

fn log_cli_agent_start<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, _task_id: Option<&'life1 str>, _session_id: &'life2 str, _agent_name: &'life3 str, _prompt_summary: &'life4 str, _working_dir: Option<&'life5 str>, ) -> Pin<Box<dyn Future<Output = Result<i64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Log the start of a CLI agent invocation. Returns the invocation ID.

Source

fn log_cli_agent_complete<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _exit_code: Option<i32>, _output_summary: &'life1 str, _success: bool, _duration_secs: f64, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Log the completion of a CLI agent invocation.

Source

fn note_cli_agent_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _id: i64, _run_id: &'life1 str, _mode: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Invocation id is run run_id in the runtime’s records, launched in mode (its permission mode’s stored name, when one applies).

Source

fn note_cli_agent_task<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _task: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

What invocation id was asked, whole: the task its run view shows.

Source

fn set_cli_agent_thread<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _thread: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Invocation id continues the thread whose first run is thread.

Source

fn set_cli_agent_keeps_session<'life0, 'async_trait>( &'life0 self, _id: i64, _kept: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether invocation id’s agent keeps its session where a later run can continue it.

Source

fn set_cli_agent_run_tag<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _run_tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The tag invocation id’s processes carry in their environment (AIDAEMON_CLI_RUN), kept at its spawn: what finds them after a stop the daemon did not see coming.

Source

fn set_cli_agent_session<'life0, 'life1, 'async_trait>( &'life0 self, _id: i64, _agent_session: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The agent’s own session (Claude Code’s session id, Codex’s thread id, an ACP session id): what resumes it or finds its own transcript.

Source

fn record_cli_agent_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _id: i64, _seq: i64, _kind: &'life1 str, _data: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Keep one event of invocation id, in order (seq).

Source

fn cli_agent_run<'life0, 'life1, 'async_trait>( &'life0 self, _run_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CliAgentRun>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The invocation that is run run_id in the runtime’s records, when one is.

Source

fn latest_cli_agent_run_in_thread<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _thread: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The latest run id in conversation session_id belonging to thread (matching either run_id = thread or thread_id = thread).

Source

fn latest_kept_cli_agent_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _agent_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The latest run of conversation session_id by agent agent_name that kept its agent’s session (a follow-up can go on from it).

Source

fn latest_cli_agent_run_by<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _session_id: &'life1 str, _agent_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

The latest run of conversation session_id by agent agent_name, however it ended (or still working).

Source

fn get_cli_agent_events<'life0, 'async_trait>( &'life0 self, _id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<CliAgentEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Invocation id’s events, in order.

Source

fn get_cli_agent_invocations<'life0, 'async_trait>( &'life0 self, _limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<CliAgentInvocation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get recent CLI agent invocations (most recent first).

Source

fn cleanup_stale_cli_agent_invocations<'life0, 'async_trait>( &'life0 self, _max_age_hours: i64, ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Auto-close stale CLI agent invocations that never completed (e.g. crashed worker).

Implementations should mark rows with completed_at IS NULL and older than max_age_hours as completed with success=false.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§