pub struct AppState {Show 51 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 automations_v2: Arc<RwLock<HashMap<String, AutomationV2Spec>>>,
pub automation_v2_runs: Arc<RwLock<HashMap<String, AutomationV2RunRecord>>>,
pub workflow_plans: Arc<RwLock<HashMap<String, WorkflowPlan>>>,
pub workflow_plan_drafts: Arc<RwLock<HashMap<String, WorkflowPlanDraftRecord>>>,
pub bug_monitor_config: Arc<RwLock<BugMonitorConfig>>,
pub bug_monitor_drafts: Arc<RwLock<HashMap<String, BugMonitorDraftRecord>>>,
pub bug_monitor_incidents: Arc<RwLock<HashMap<String, BugMonitorIncidentRecord>>>,
pub bug_monitor_posts: Arc<RwLock<HashMap<String, BugMonitorPostRecord>>>,
pub bug_monitor_runtime_status: Arc<RwLock<BugMonitorRuntimeStatus>>,
pub workflows: Arc<RwLock<WorkflowRegistry>>,
pub workflow_runs: Arc<RwLock<HashMap<String, WorkflowRunRecord>>>,
pub workflow_hook_overrides: Arc<RwLock<HashMap<String, bool>>>,
pub workflow_dispatch_seen: Arc<RwLock<HashMap<String, u64>>>,
pub routine_session_policies: Arc<RwLock<HashMap<String, RoutineSessionPolicy>>>,
pub automation_v2_session_runs: Arc<RwLock<HashMap<String, String>>>,
pub token_cost_per_1k_usd: f64,
pub routines_path: PathBuf,
pub routine_history_path: PathBuf,
pub routine_runs_path: PathBuf,
pub automations_v2_path: PathBuf,
pub automation_v2_runs_path: PathBuf,
pub bug_monitor_config_path: PathBuf,
pub bug_monitor_drafts_path: PathBuf,
pub bug_monitor_incidents_path: PathBuf,
pub bug_monitor_posts_path: PathBuf,
pub workflow_runs_path: PathBuf,
pub workflow_hook_overrides_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,
pub pack_manager: Arc<PackManager>,
pub capability_resolver: Arc<CapabilityResolver>,
pub preset_registry: Arc<PresetRegistry>,
}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>>>§automations_v2: Arc<RwLock<HashMap<String, AutomationV2Spec>>>§automation_v2_runs: Arc<RwLock<HashMap<String, AutomationV2RunRecord>>>§workflow_plans: Arc<RwLock<HashMap<String, WorkflowPlan>>>§workflow_plan_drafts: Arc<RwLock<HashMap<String, WorkflowPlanDraftRecord>>>§bug_monitor_config: Arc<RwLock<BugMonitorConfig>>§bug_monitor_drafts: Arc<RwLock<HashMap<String, BugMonitorDraftRecord>>>§bug_monitor_incidents: Arc<RwLock<HashMap<String, BugMonitorIncidentRecord>>>§bug_monitor_posts: Arc<RwLock<HashMap<String, BugMonitorPostRecord>>>§bug_monitor_runtime_status: Arc<RwLock<BugMonitorRuntimeStatus>>§workflows: Arc<RwLock<WorkflowRegistry>>§workflow_runs: Arc<RwLock<HashMap<String, WorkflowRunRecord>>>§workflow_hook_overrides: Arc<RwLock<HashMap<String, bool>>>§workflow_dispatch_seen: Arc<RwLock<HashMap<String, u64>>>§routine_session_policies: Arc<RwLock<HashMap<String, RoutineSessionPolicy>>>§automation_v2_session_runs: Arc<RwLock<HashMap<String, String>>>§token_cost_per_1k_usd: f64§routines_path: PathBuf§routine_history_path: PathBuf§routine_runs_path: PathBuf§automations_v2_path: PathBuf§automation_v2_runs_path: PathBuf§bug_monitor_config_path: PathBuf§bug_monitor_drafts_path: PathBuf§bug_monitor_incidents_path: PathBuf§bug_monitor_posts_path: PathBuf§workflow_runs_path: PathBuf§workflow_hook_overrides_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: HostRuntimeContext§pack_manager: Arc<PackManager>§capability_resolver: Arc<CapabilityResolver>§preset_registry: Arc<PresetRegistry>Implementations§
Source§impl AppState
impl AppState
pub async fn browser_status(&self) -> BrowserStatus
pub async fn browser_smoke_test( &self, url: Option<String>, ) -> Result<BrowserSmokeTestResult>
pub async fn install_browser_sidecar( &self, ) -> Result<BrowserSidecarInstallResult>
pub async fn browser_health_summary(&self) -> BrowserHealthSummary
pub async fn close_browser_sessions_for_owner( &self, owner_session_id: &str, ) -> usize
pub async fn close_all_browser_sessions(&self) -> usize
pub async fn register_browser_tools(&self) -> Result<()>
Source§impl AppState
impl AppState
pub fn new_starting(attempt_id: String, in_process: bool) -> Self
pub fn is_ready(&self) -> bool
pub async fn wait_until_ready_or_failed( &self, attempts: usize, sleep_ms: u64, ) -> 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>
pub async fn add_active_session_id( &self, run_id: &str, session_id: String, ) -> Option<RoutineRunRecord>
pub async fn clear_active_session_id( &self, run_id: &str, session_id: &str, ) -> Option<RoutineRunRecord>
pub async fn load_automations_v2(&self) -> Result<()>
pub async fn persist_automations_v2(&self) -> Result<()>
pub async fn load_automation_v2_runs(&self) -> Result<()>
pub async fn persist_automation_v2_runs(&self) -> Result<()>
pub async fn load_bug_monitor_config(&self) -> Result<()>
pub async fn persist_bug_monitor_config(&self) -> Result<()>
pub async fn bug_monitor_config(&self) -> BugMonitorConfig
pub async fn put_bug_monitor_config( &self, config: BugMonitorConfig, ) -> Result<BugMonitorConfig>
pub async fn load_bug_monitor_drafts(&self) -> Result<()>
pub async fn persist_bug_monitor_drafts(&self) -> Result<()>
pub async fn load_bug_monitor_incidents(&self) -> Result<()>
pub async fn persist_bug_monitor_incidents(&self) -> Result<()>
pub async fn load_bug_monitor_posts(&self) -> Result<()>
pub async fn persist_bug_monitor_posts(&self) -> Result<()>
pub async fn list_bug_monitor_incidents( &self, limit: usize, ) -> Vec<BugMonitorIncidentRecord>
pub async fn get_bug_monitor_incident( &self, incident_id: &str, ) -> Option<BugMonitorIncidentRecord>
pub async fn put_bug_monitor_incident( &self, incident: BugMonitorIncidentRecord, ) -> Result<BugMonitorIncidentRecord>
pub async fn list_bug_monitor_posts( &self, limit: usize, ) -> Vec<BugMonitorPostRecord>
pub async fn get_bug_monitor_post( &self, post_id: &str, ) -> Option<BugMonitorPostRecord>
pub async fn put_bug_monitor_post( &self, post: BugMonitorPostRecord, ) -> Result<BugMonitorPostRecord>
pub async fn update_bug_monitor_runtime_status( &self, update: impl FnOnce(&mut BugMonitorRuntimeStatus), ) -> BugMonitorRuntimeStatus
pub async fn list_bug_monitor_drafts( &self, limit: usize, ) -> Vec<BugMonitorDraftRecord>
pub async fn get_bug_monitor_draft( &self, draft_id: &str, ) -> Option<BugMonitorDraftRecord>
pub async fn put_bug_monitor_draft( &self, draft: BugMonitorDraftRecord, ) -> Result<BugMonitorDraftRecord>
pub async fn submit_bug_monitor_draft( &self, submission: BugMonitorSubmission, ) -> Result<BugMonitorDraftRecord>
pub async fn update_bug_monitor_draft_status( &self, draft_id: &str, next_status: &str, reason: Option<&str>, ) -> Result<BugMonitorDraftRecord>
pub async fn bug_monitor_status(&self) -> BugMonitorStatus
pub async fn load_workflow_runs(&self) -> Result<()>
pub async fn persist_workflow_runs(&self) -> Result<()>
pub async fn load_workflow_hook_overrides(&self) -> Result<()>
pub async fn persist_workflow_hook_overrides(&self) -> Result<()>
pub async fn reload_workflows(&self) -> Result<Vec<WorkflowValidationMessage>>
pub async fn workflow_registry(&self) -> WorkflowRegistry
pub async fn list_workflows(&self) -> Vec<WorkflowSpec>
pub async fn get_workflow(&self, workflow_id: &str) -> Option<WorkflowSpec>
pub async fn list_workflow_hooks( &self, workflow_id: Option<&str>, ) -> Vec<WorkflowHookBinding>
pub async fn set_workflow_hook_enabled( &self, binding_id: &str, enabled: bool, ) -> Result<Option<WorkflowHookBinding>>
pub async fn put_workflow_run(&self, run: WorkflowRunRecord) -> Result<()>
pub async fn update_workflow_run( &self, run_id: &str, update: impl FnOnce(&mut WorkflowRunRecord), ) -> Option<WorkflowRunRecord>
pub async fn list_workflow_runs( &self, workflow_id: Option<&str>, limit: usize, ) -> Vec<WorkflowRunRecord>
pub async fn get_workflow_run(&self, run_id: &str) -> Option<WorkflowRunRecord>
pub async fn put_automation_v2( &self, automation: AutomationV2Spec, ) -> Result<AutomationV2Spec>
pub async fn get_automation_v2( &self, automation_id: &str, ) -> Option<AutomationV2Spec>
pub async fn put_workflow_plan(&self, plan: WorkflowPlan)
pub async fn get_workflow_plan(&self, plan_id: &str) -> Option<WorkflowPlan>
pub async fn put_workflow_plan_draft(&self, draft: WorkflowPlanDraftRecord)
pub async fn get_workflow_plan_draft( &self, plan_id: &str, ) -> Option<WorkflowPlanDraftRecord>
pub async fn list_automations_v2(&self) -> Vec<AutomationV2Spec>
pub async fn delete_automation_v2( &self, automation_id: &str, ) -> Result<Option<AutomationV2Spec>>
pub async fn create_automation_v2_run( &self, automation: &AutomationV2Spec, trigger_type: &str, ) -> Result<AutomationV2RunRecord>
pub async fn get_automation_v2_run( &self, run_id: &str, ) -> Option<AutomationV2RunRecord>
pub async fn list_automation_v2_runs( &self, automation_id: Option<&str>, limit: usize, ) -> Vec<AutomationV2RunRecord>
pub async fn claim_next_queued_automation_v2_run( &self, ) -> Option<AutomationV2RunRecord>
pub async fn update_automation_v2_run( &self, run_id: &str, update: impl FnOnce(&mut AutomationV2RunRecord), ) -> Option<AutomationV2RunRecord>
pub async fn add_automation_v2_session( &self, run_id: &str, session_id: &str, ) -> Option<AutomationV2RunRecord>
pub async fn clear_automation_v2_session( &self, run_id: &str, session_id: &str, ) -> Option<AutomationV2RunRecord>
pub async fn forget_automation_v2_sessions(&self, session_ids: &[String])
pub async fn add_automation_v2_instance( &self, run_id: &str, instance_id: &str, ) -> Option<AutomationV2RunRecord>
pub async fn clear_automation_v2_instance( &self, run_id: &str, instance_id: &str, ) -> Option<AutomationV2RunRecord>
pub async fn apply_provider_usage_to_runs( &self, session_id: &str, prompt_tokens: u64, completion_tokens: u64, total_tokens: u64, )
pub async fn evaluate_automation_v2_misfires(&self, now_ms: u64) -> Vec<String>
Methods from Deref<Target = RuntimeState>§
pub async fn browser_status(&self) -> BrowserStatus
pub async fn browser_smoke_test( &self, url: Option<String>, ) -> Result<BrowserSmokeTestResult>
pub async fn install_browser_sidecar( &self, ) -> Result<BrowserSidecarInstallResult>
pub async fn browser_health_summary(&self) -> BrowserHealthSummary
pub async fn close_browser_sessions_for_owner( &self, owner_session_id: &str, ) -> usize
pub async fn close_all_browser_sessions(&self) -> usize
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