use std::sync::Arc;
use serde_json::Value;
use tokio::sync::RwLock;
use tandem_core::{
AgentRegistry, CancellationRegistry, ConfigStore, EngineLoop, EventBus, PermissionManager,
PluginRegistry, Storage,
};
use tandem_providers::ProviderRegistry;
use tandem_runtime::{LspManager, McpRegistry, PtyManager, WorkspaceIndex};
use tandem_tools::ToolRegistry;
use tandem_types::HostRuntimeContext;
#[cfg(feature = "browser")]
use crate::BrowserSubsystem;
#[derive(Clone)]
pub struct RuntimeState {
pub storage: Arc<Storage>,
pub config: ConfigStore,
pub event_bus: EventBus,
pub providers: ProviderRegistry,
pub plugins: PluginRegistry,
pub agents: AgentRegistry,
pub tools: ToolRegistry,
pub permissions: PermissionManager,
pub mcp: McpRegistry,
pub pty: PtyManager,
pub lsp: LspManager,
pub auth: Arc<RwLock<std::collections::HashMap<String, String>>>,
pub logs: Arc<RwLock<Vec<Value>>>,
pub workspace_index: WorkspaceIndex,
pub cancellations: CancellationRegistry,
pub engine_loop: EngineLoop,
pub host_runtime_context: HostRuntimeContext,
#[cfg(feature = "browser")]
pub browser: BrowserSubsystem,
}