Files
storkit/server/src/http/context.rs

21 lines
545 B
Rust
Raw Normal View History

use crate::agents::AgentPool;
2026-02-16 16:24:21 +00:00
use crate::state::SessionState;
use crate::store::JsonFileStore;
use crate::workflow::WorkflowState;
2026-02-16 16:24:21 +00:00
use poem::http::StatusCode;
use std::sync::Arc;
#[derive(Clone)]
pub struct AppContext {
pub state: Arc<SessionState>,
pub store: Arc<JsonFileStore>,
pub workflow: Arc<std::sync::Mutex<WorkflowState>>,
pub agents: Arc<AgentPool>,
2026-02-16 16:24:21 +00:00
}
pub type OpenApiResult<T> = poem::Result<T>;
pub fn bad_request(message: String) -> poem::Error {
poem::Error::from_string(message, StatusCode::BAD_REQUEST)
}