tandem_server/runtime/
state.rs1use std::sync::Arc;
2
3use serde_json::Value;
4use tokio::sync::RwLock;
5
6use tandem_core::{
7 AgentRegistry, CancellationRegistry, ConfigStore, EngineLoop, EventBus, PermissionManager,
8 PluginRegistry, Storage,
9};
10use tandem_providers::ProviderRegistry;
11use tandem_runtime::{LspManager, McpRegistry, PtyManager, WorkspaceIndex};
12use tandem_tools::ToolRegistry;
13use tandem_types::HostRuntimeContext;
14
15#[cfg(feature = "browser")]
16use crate::BrowserSubsystem;
17
18#[derive(Clone)]
19pub struct RuntimeState {
20 pub storage: Arc<Storage>,
21 pub config: ConfigStore,
22 pub event_bus: EventBus,
23 pub providers: ProviderRegistry,
24 pub plugins: PluginRegistry,
25 pub agents: AgentRegistry,
26 pub tools: ToolRegistry,
27 pub permissions: PermissionManager,
28 pub mcp: McpRegistry,
29 pub pty: PtyManager,
30 pub lsp: LspManager,
31 pub auth: Arc<RwLock<std::collections::HashMap<String, String>>>,
32 pub logs: Arc<RwLock<Vec<Value>>>,
33 pub workspace_index: WorkspaceIndex,
34 pub cancellations: CancellationRegistry,
35 pub engine_loop: EngineLoop,
36 pub host_runtime_context: HostRuntimeContext,
37 #[cfg(feature = "browser")]
38 pub browser: BrowserSubsystem,
39}