pub struct AppState {Show 25 fields
pub runtime: Arc<OnceLock<RuntimeState>>,
pub startup: Arc<RwLock<StartupState>>,
pub in_process_mode: Arc<AtomicBool>,
pub api_token: Arc<RwLock<Option<String>>>,
pub engine_leases: Arc<RwLock<HashMap<String, EngineLease>>>,
pub run_registry: RunRegistry,
pub run_stale_ms: u64,
pub memory_records: Arc<RwLock<HashMap<String, GovernedMemoryRecord>>>,
pub memory_audit_log: Arc<RwLock<Vec<MemoryAuditEvent>>>,
pub missions: Arc<RwLock<HashMap<String, MissionState>>>,
pub shared_resources: Arc<RwLock<HashMap<String, SharedResourceRecord>>>,
pub shared_resources_path: PathBuf,
pub routines: Arc<RwLock<HashMap<String, RoutineSpec>>>,
pub routine_history: Arc<RwLock<HashMap<String, Vec<RoutineHistoryEvent>>>>,
pub routine_runs: Arc<RwLock<HashMap<String, RoutineRunRecord>>>,
pub routine_session_policies: Arc<RwLock<HashMap<String, RoutineSessionPolicy>>>,
pub routines_path: PathBuf,
pub routine_history_path: PathBuf,
pub routine_runs_path: PathBuf,
pub agent_teams: AgentTeamRuntime,
pub web_ui_enabled: Arc<AtomicBool>,
pub web_ui_prefix: Arc<RwLock<String>>,
pub server_base_url: Arc<RwLock<String>>,
pub channels_runtime: Arc<Mutex<ChannelRuntime>>,
pub host_runtime_context: HostRuntimeContext,
}Fields§
§runtime: Arc<OnceLock<RuntimeState>>§startup: Arc<RwLock<StartupState>>§in_process_mode: Arc<AtomicBool>§api_token: Arc<RwLock<Option<String>>>§engine_leases: Arc<RwLock<HashMap<String, EngineLease>>>§run_registry: RunRegistry§run_stale_ms: u64§memory_records: Arc<RwLock<HashMap<String, GovernedMemoryRecord>>>§memory_audit_log: Arc<RwLock<Vec<MemoryAuditEvent>>>§missions: Arc<RwLock<HashMap<String, MissionState>>>§routines: Arc<RwLock<HashMap<String, RoutineSpec>>>§routine_history: Arc<RwLock<HashMap<String, Vec<RoutineHistoryEvent>>>>§routine_runs: Arc<RwLock<HashMap<String, RoutineRunRecord>>>§routine_session_policies: Arc<RwLock<HashMap<String, RoutineSessionPolicy>>>§routines_path: PathBuf§routine_history_path: PathBuf§routine_runs_path: PathBuf§agent_teams: AgentTeamRuntime§web_ui_enabled: Arc<AtomicBool>§web_ui_prefix: Arc<RwLock<String>>§server_base_url: Arc<RwLock<String>>§channels_runtime: Arc<Mutex<ChannelRuntime>>§host_runtime_context: HostRuntimeContextImplementations§
Source§impl AppState
impl AppState
pub fn new_starting(attempt_id: String, in_process: bool) -> Self
pub fn is_ready(&self) -> bool
pub fn mode_label(&self) -> &'static str
pub fn configure_web_ui(&self, enabled: bool, prefix: String)
pub fn web_ui_enabled(&self) -> bool
pub fn web_ui_prefix(&self) -> String
pub fn set_server_base_url(&self, base_url: String)
pub fn server_base_url(&self) -> String
pub async fn api_token(&self) -> Option<String>
pub async fn set_api_token(&self, token: Option<String>)
pub async fn startup_snapshot(&self) -> StartupSnapshot
pub fn host_runtime_context(&self) -> HostRuntimeContext
pub async fn set_phase(&self, phase: impl Into<String>)
pub async fn mark_ready(&self, runtime: RuntimeState) -> Result<()>
pub async fn mark_failed( &self, phase: impl Into<String>, error: impl Into<String>, )
pub async fn channel_statuses(&self) -> HashMap<String, ChannelStatus>
pub async fn restart_channel_listeners(&self) -> Result<()>
pub async fn load_routines(&self) -> Result<()>
pub async fn load_routine_history(&self) -> Result<()>
pub async fn load_routine_runs(&self) -> Result<()>
pub async fn persist_routines(&self) -> Result<()>
pub async fn persist_routine_history(&self) -> Result<()>
pub async fn persist_routine_runs(&self) -> Result<()>
pub async fn put_routine( &self, routine: RoutineSpec, ) -> Result<RoutineSpec, RoutineStoreError>
pub async fn list_routines(&self) -> Vec<RoutineSpec>
pub async fn get_routine(&self, routine_id: &str) -> Option<RoutineSpec>
pub async fn delete_routine( &self, routine_id: &str, ) -> Result<Option<RoutineSpec>, RoutineStoreError>
pub async fn evaluate_routine_misfires( &self, now_ms: u64, ) -> Vec<RoutineTriggerPlan>
pub async fn mark_routine_fired( &self, routine_id: &str, fired_at_ms: u64, ) -> Option<RoutineSpec>
pub async fn append_routine_history(&self, event: RoutineHistoryEvent)
pub async fn list_routine_history( &self, routine_id: &str, limit: usize, ) -> Vec<RoutineHistoryEvent>
pub async fn create_routine_run( &self, routine: &RoutineSpec, trigger_type: &str, run_count: u32, status: RoutineRunStatus, detail: Option<String>, ) -> RoutineRunRecord
pub async fn get_routine_run(&self, run_id: &str) -> Option<RoutineRunRecord>
pub async fn list_routine_runs( &self, routine_id: Option<&str>, limit: usize, ) -> Vec<RoutineRunRecord>
pub async fn claim_next_queued_routine_run(&self) -> Option<RoutineRunRecord>
pub async fn set_routine_session_policy( &self, session_id: String, run_id: String, routine_id: String, allowed_tools: Vec<String>, )
pub async fn routine_session_policy( &self, session_id: &str, ) -> Option<RoutineSessionPolicy>
pub async fn clear_routine_session_policy(&self, session_id: &str)
pub async fn update_routine_run_status( &self, run_id: &str, status: RoutineRunStatus, reason: Option<String>, ) -> Option<RoutineRunRecord>
pub async fn append_routine_run_artifact( &self, run_id: &str, artifact: RoutineRunArtifact, ) -> Option<RoutineRunRecord>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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