pub struct AppState {Show 19 fields
pub run_manager: SessionManager,
pub session_store: Arc<dyn SessionStorage>,
pub events: Arc<EventLog>,
pub idempotency: Arc<IdempotencyStore>,
pub inference: Arc<Inference>,
pub checkpoint_store: Arc<CheckpointStore>,
pub models: Arc<Vec<Model>>,
pub default_model: Option<Model>,
pub tool_approval_policy: ToolApprovalPolicy,
pub started_at: Instant,
pub mcp_client: Option<Arc<McpClient>>,
pub mcp_tools: Arc<RwLock<Vec<Tool>>>,
pub mcp_server_shutdown_tx: Option<Sender<()>>,
pub mcp_proxy_shutdown_tx: Option<Sender<()>>,
pub sandbox_config: Option<SandboxConfig>,
pub base_system_prompt: Option<String>,
pub context_budget: ContextBudget,
pub project_dir: Option<String>,
pub skills_context: Arc<RwLock<Vec<ContextFile>>>,
/* private fields */
}Fields§
§run_manager: SessionManager§session_store: Arc<dyn SessionStorage>Durable session/checkpoint backend (SQLite/remote API).
events: Arc<EventLog>§idempotency: Arc<IdempotencyStore>§inference: Arc<Inference>§checkpoint_store: Arc<CheckpointStore>Server-side latest-envelope cache (stakai::Message + runtime metadata).
models: Arc<Vec<Model>>§default_model: Option<Model>§tool_approval_policy: ToolApprovalPolicy§started_at: Instant§mcp_client: Option<Arc<McpClient>>§mcp_tools: Arc<RwLock<Vec<Tool>>>§mcp_server_shutdown_tx: Option<Sender<()>>§mcp_proxy_shutdown_tx: Option<Sender<()>>§sandbox_config: Option<SandboxConfig>§base_system_prompt: Option<String>§context_budget: ContextBudget§project_dir: Option<String>Base directory for project context discovery (AGENTS.md, APPS.md).
Falls back to process cwd if not set. Should be set to the directory
where stakpak up was run so gateway sessions can discover project files.
skills_context: Arc<RwLock<Vec<ContextFile>>>Cached remote skill context files (currently fetched from the remote skills endpoint contract) and injected into new sessions as baseline context.
Implementations§
Source§impl AppState
impl AppState
pub fn new( session_store: Arc<dyn SessionStorage>, events: Arc<EventLog>, idempotency: Arc<IdempotencyStore>, inference: Arc<Inference>, models: Vec<Model>, default_model: Option<Model>, tool_approval_policy: ToolApprovalPolicy, ) -> Self
pub fn with_mcp( self, mcp_client: Arc<McpClient>, mcp_tools: Vec<Tool>, mcp_server_shutdown_tx: Option<Sender<()>>, mcp_proxy_shutdown_tx: Option<Sender<()>>, ) -> Self
pub fn with_sandbox(self, sandbox_config: SandboxConfig) -> Self
pub fn with_base_system_prompt(self, prompt: Option<String>) -> Self
pub fn with_context_budget(self, budget: ContextBudget) -> Self
pub fn with_project_dir(self, dir: Option<String>) -> Self
pub fn with_skills(self, context_files: Vec<ContextFile>) -> Self
pub fn with_checkpoint_store( self, checkpoint_store: Arc<CheckpointStore>, ) -> Self
pub async fn current_skills(&self) -> Vec<ContextFile>
pub async fn replace_skills(&self, context_files: Vec<ContextFile>)
pub async fn current_mcp_tools(&self) -> Vec<Tool>
pub async fn refresh_mcp_tools(&self) -> Result<usize, String>
pub fn uptime_seconds(&self) -> u64
pub fn resolve_model(&self, requested: Option<&str>) -> Option<Model>
pub async fn set_pending_tools( &self, session_id: Uuid, run_id: Uuid, tool_calls: Vec<ProposedToolCall>, )
pub async fn clear_pending_tools(&self, session_id: Uuid, run_id: Uuid)
pub async fn pending_tools( &self, session_id: Uuid, ) -> Option<PendingToolApprovals>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request