pub struct HarnessSessionService { /* private fields */ }Expand description
Stateful persisted-session service. Each instance owns its follow subscriptions; discovery and loading remain read-only.
Implementations§
Source§impl HarnessSessionService
impl HarnessSessionService
Sourcepub fn with_reduction_store_root(self, root: impl Into<PathBuf>) -> Self
pub fn with_reduction_store_root(self, root: impl Into<PathBuf>) -> Self
Override the trusted, service-owned store used for durable reduction
bundles. Embedders and tests use this to keep all writes inside an
explicitly selected root; the CLI otherwise uses the normal
$SUPERCODE_HOME/sessions location.
Sourcepub fn handle(&mut self, request: Value) -> Value
pub fn handle(&mut self, request: Value) -> Value
Handle one JSON-RPC 2.0 request and return one JSON-RPC response.
Sourcepub async fn handle_async(&mut self, request: Value) -> Value
pub async fn handle_async(&mut self, request: Value) -> Value
Handle either a persisted-session request or an asynchronous live runtime request.
Sourcepub fn poll(&mut self) -> Vec<Value>
pub fn poll(&mut self) -> Vec<Value>
Poll all active subscriptions once and return zero or more JSON-RPC notifications. Recoverable follower errors are delivered as events.
Sourcepub async fn poll_session_runtime_states(&mut self) -> Vec<Value>
pub async fn poll_session_runtime_states(&mut self) -> Vec<Value>
Report each followed session’s live-runtime lifecycle state on that session’s own subscription, emitting only when the state changes.
A growing transcript is not evidence that an agent is working, so the
state comes from the live-runtime registry and nowhere else. A followed
session with no registered Supercode runtime — a harness running outside
Supercode — reports persisted, which says plainly that its activity is
unknown rather than guessing at it. These events carry no sequence
number and no transcript content; they never interleave with the
content follower’s sequenced stream.
Sourcepub async fn poll_session_activities(&mut self) -> Vec<Value>
pub async fn poll_session_activities(&mut self) -> Vec<Value>
Poll normalized activity subscriptions, emitting only proven state transitions. Every subscription is bulk-sampled so stock-harness process and registry discovery happens once per UI, not once per row.
Sourcepub fn poll_session_indexes(&mut self) -> Vec<Value>
pub fn poll_session_indexes(&mut self) -> Vec<Value>
Drain native-store invalidations and emit revisioned descriptor deltas. An idle subscription performs no catalog or transcript reads between its minute-scale recovery reconciliations.
Sourcepub async fn poll_runtimes(&mut self) -> Vec<Value>
pub async fn poll_runtimes(&mut self) -> Vec<Value>
Non-blockingly sample one event from every connected live runtime.