pub struct RpcContext {
pub config: Arc<RwLock<Config>>,
pub sessions: Arc<SessionStore>,
pub session_backend: Option<Arc<dyn SessionBackend>>,
pub memory: Option<Arc<dyn Memory>>,
pub cost_tracker: Option<Arc<CostTracker>>,
pub event_tx: Option<Sender<Value>>,
pub reload_tx: Option<Sender<bool>>,
pub approval_pending: Arc<ApprovalPendingMap>,
pub tui_registry: Arc<TuiRegistry>,
pub acp_session_store: Option<Arc<AcpSessionStore>>,
}Expand description
Daemon-wide state shared across all RPC connections.
Fields§
§config: Arc<RwLock<Config>>Live config behind a read-write lock so config/set can mutate
without a full daemon reload. Mirrors the gateway’s
Arc<RwLock<Config>> pattern.
sessions: Arc<SessionStore>In-memory session store for active RPC sessions.
session_backend: Option<Arc<dyn SessionBackend>>Persistent session backend (SQLite / JSONL) for history and
session metadata. None when persistence is disabled.
memory: Option<Arc<dyn Memory>>Memory subsystem (dyn Memory from zeroclaw-api).
cost_tracker: Option<Arc<CostTracker>>Cost tracking. None when cost tracking is disabled.
event_tx: Option<Sender<Value>>Daemon-wide event broadcast. RPC handlers subscribe to forward
events as JSON-RPC notifications (logs/subscribe).
reload_tx: Option<Sender<bool>>Write true to trigger a daemon-level config reload. Mirrors
the gateway’s /admin/reload mechanism.
approval_pending: Arc<ApprovalPendingMap>In-flight approval requests waiting for session/approve RPC calls.
tui_registry: Arc<TuiRegistry>Live TUI client registry. Tracks connected TUI sessions by UID. Source of truth for “which TUIs are connected right now.”
acp_session_store: Option<Arc<AcpSessionStore>>ACP session persistence. Opened (and the DB file created) at
daemon boot under <data_dir>/sessions/acp-sessions.db. None
when the store could not be opened (read-only FS, bad perms) —
callers must treat persistence as best-effort.
Auto Trait Implementations§
impl Freeze for RpcContext
impl !RefUnwindSafe for RpcContext
impl Send for RpcContext
impl Sync for RpcContext
impl Unpin for RpcContext
impl UnsafeUnpin for RpcContext
impl !UnwindSafe for RpcContext
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more