use std::collections::HashMap; use std::sync::Arc; use common::configuration::{Agent, FilterPipeline, Listener, ModelAlias, SpanAttributes}; use common::llm_providers::LlmProviders; use tokio::sync::RwLock; use crate::router::orchestrator::OrchestratorService; use crate::state::StateStorage; /// Shared application state bundled into a single Arc-wrapped struct. /// /// Instead of cloning 8+ individual `Arc`s per connection, a single /// `Arc` is cloned once and passed to the request handler. pub struct AppState { pub orchestrator_service: Arc, pub model_aliases: Option>, pub llm_providers: Arc>, pub agents_list: Option>, pub listeners: Vec, pub state_storage: Option>, pub llm_provider_url: String, pub span_attributes: Option, /// Shared HTTP client for upstream LLM requests (connection pooling / keep-alive). pub http_client: reqwest::Client, pub filter_pipeline: Arc, /// When false, agentic signal analysis is skipped on LLM responses to save CPU. /// Controlled by `overrides.disable_signals` in plano config. pub signals_enabled: bool, }