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 new() -> HarnessSessionService
pub fn new() -> HarnessSessionService
Create an empty service instance.
Sourcepub fn with_reduction_store_root(
self,
root: impl Into<PathBuf>,
) -> HarnessSessionService
pub fn with_reduction_store_root( self, root: impl Into<PathBuf>, ) -> HarnessSessionService
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 observe_subagent_approvals(
&mut self,
queue: Arc<Mutex<Vec<QueuedApproval>>>,
)
pub fn observe_subagent_approvals( &mut self, queue: Arc<Mutex<Vec<QueuedApproval>>>, )
ORCH-9: publish the parent’s own subagent-approval queue into
harness.v1.approvals.list.
This is the SAME Arc an crate::Agent pushes into
(Agent::pending_child_approvals), so a host that runs supercode’s own
loop beside this service surfaces those requests through the uniform
door without copying them anywhere.
Sourcepub fn approvals(&self, query: &ApprovalsQuery) -> Vec<ApprovalRow>
pub fn approvals(&self, query: &ApprovalsQuery) -> Vec<ApprovalRow>
ORCH-9: every approval request this service can see, newest last.
Two sources, both live: the requests outstanding on the open runtime
connections, and supercode’s own queued subagent approvals. There is
no file or database source at the pinned harness versions (see
crate::approvals), so a stored or proposal row is never produced.
Sourcepub fn session_index_notifier(&self) -> Arc<Notify> ⓘ
pub fn session_index_notifier(&self) -> Arc<Notify> ⓘ
Return the edge-triggered wakeup used by session-index filesystem subscriptions. Transports can await this instead of polling indexes.
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.