Skip to main content

RelayClient

Struct RelayClient 

Source
pub struct RelayClient { /* private fields */ }
Expand description

Controller-side connection to the durable ACP relay protocol.

This type does not construct transcript state or request unbounded history. Callers persist bounded attachment pages, then acknowledge only a frontier that is already durable locally.

Implementations§

Source§

impl RelayClient

Source

pub async fn connect( spec: &CommandSpec, expected_session_id: &str, ) -> Result<Self>

Source

pub fn session_id(&self) -> &str

Source

pub const fn supports_project_memory_sync(&self) -> bool

Source

pub fn relay_version(&self) -> &str

Source

pub fn worker_build(&self) -> Option<&str>

Content address of the executable serving this connection, or None from a worker too old to report one. A controller reads None as outdated: it predates the field, so it predates this controller.

Source

pub fn protocol_version(&self) -> u32

Source

pub fn latest_ordinal(&self) -> u64

Source

pub fn latest_digest(&self) -> &str

Source

pub async fn attach( &mut self, after_ordinal: u64, after_digest: impl Into<String>, ) -> Result<RelayAttachment>

Source

pub async fn begin_catch_up( &mut self, after_ordinal: u64, after_digest: impl Into<String>, ) -> Result<RelayCatchUp>

Start a bounded catch-up by capturing the relay frontier before the caller applies anything. Callers persist first_page, request further pages with Self::next_catch_up_page, and may acknowledge the fixed frontier after all of those pages are durable.

Source

pub async fn next_catch_up_page( &mut self, previous: &RelayCursor, frontier: &RelayCursor, ) -> Result<RelayEventPage>

Fetch the next bounded page without chasing events that arrived after frontier was captured. A response may contain such newer events; the returned page is clipped at the exact ordinal-and-digest frontier.

Source

pub async fn acknowledge( &mut self, through_ordinal: u64, through_digest: impl Into<String>, ) -> Result<RelayCursor>

Source

pub async fn status(&mut self) -> Result<RelayOperationalState>

Source

pub async fn credential_state(&mut self) -> Result<CredentialSnapshot>

Return the fingerprint and freshness of this session’s harness credentials without exposing the credential bytes.

Source

pub async fn read_credentials(&mut self) -> Result<Vec<u8>>

Read this session’s credential file. Callers must keep these bytes out of durable relay observations, logs, and archives.

Source

pub async fn install_credentials( &mut self, bytes: &[u8], ) -> Result<CredentialSnapshot>

Install credentials into the harness home fixed by this session’s launch config.

Source

pub async fn github_token_state(&mut self) -> Result<GithubTokenSnapshot>

Source

pub async fn install_github_token( &mut self, token: &str, ) -> Result<GithubTokenSnapshot>

Source

pub async fn remove_github_token(&mut self) -> Result<GithubTokenSnapshot>

Source

pub async fn skills_state(&mut self) -> Result<SkillsSyncState>

Return the fingerprint of this session’s synced skills trees without transferring the tree itself.

Source

pub async fn install_prompt_context(&mut self, text: String) -> Result<()>

Install background text that only the target harness sees, prepended to the next real prompt without creating a synthetic transcript turn.

Source

pub async fn project_memory_snapshot( &mut self, ) -> Result<(ProjectMemorySnapshot, ProjectMemorySnapshot)>

Source

pub async fn install_project_memory_snapshot( &mut self, snapshot: ProjectMemorySnapshot, ) -> Result<()>

Source

pub async fn install_skills( &mut self, archive_bytes: &[u8], ) -> Result<SkillsSyncState>

Replace this session’s synced skills trees with an encoded hel_skills::SkillsArchive. The destination directories are fixed by the session’s launch config and the harness skills whitelist.

Source

pub async fn ensure_attachment( &mut self, reference: &AttachmentRef, ) -> Result<()>

Copy a verified controller blob to this session before admitting its reference.

Source

pub async fn cache_attachment( &mut self, reference: &AttachmentRef, ) -> Result<()>

Recover the local copy needed for queue editing and resubmission.

Source

pub async fn submit( &mut self, command_id: impl Into<String>, command: RelayCommand, ) -> Result<u64>

Source

pub async fn start_reviewer( &mut self, role: Option<&str>, config: ReviewerLaunchConfig, ) -> Result<StartedReviewer>

Start the second-opinion reviewer beside this session, or report the running one when it already matches config.

The reviewer’s profile must already be staged on the target. Starting can take as long as opening any harness session, so this uses the handshake deadline rather than the bookkeeping one.

Source

pub async fn attach_reviewer( &mut self, role: Option<&str>, after_ordinal: u64, after_digest: impl Into<String>, ) -> Result<RelayAttachment>

Replay the reviewer’s journal from a cursor, exactly as Self::attach does for the primary.

Source

pub async fn acknowledge_reviewer( &mut self, role: Option<&str>, through_ordinal: u64, through_digest: impl Into<String>, ) -> Result<RelayCursor>

Advance the reviewer’s acknowledged frontier so its journal can be pruned once the controller has the events durably.

Source

pub async fn submit_to_reviewer( &mut self, role: Option<&str>, command_id: impl Into<String>, command: RelayCommand, ) -> Result<u64>

Queue one command on the reviewer’s own relay.

Source

pub async fn reviewer_status( &mut self, role: Option<&str>, ) -> Result<RelayOperationalState>

Source

pub async fn respond_to_reviewer( &mut self, role: Option<&str>, elicitation_id: String, response: ElicitationResponse, ) -> Result<()>

Answer a form the reviewer’s harness is waiting on.

Source

pub async fn pause_reviewer(&mut self, role: Option<&str>) -> Result<()>

Cancel any reviewer turn in flight and stop its process group, keeping its staged profile, native session and journal for the next review.

Source

pub async fn capture_review_delta( &mut self, role: Option<&str>, baselines: BTreeMap<PathBuf, String>, ) -> Result<Vec<RepoDelta>>

Report what every workspace repository changed since the review baselines the controller holds.

Source

pub async fn advance_review_baseline( &mut self, role: Option<&str>, trees: BTreeMap<PathBuf, String>, ) -> Result<()>

Record the trees a completed review reviewed through, so the next review starts from them.

Source

pub async fn analyze_review_delta( &mut self, role: Option<&str>, repositories: Vec<AnalyzeDeltaRepository>, ) -> Result<String>

Run Bifrost’s semantic diff analysis over the captured trees. It can take minutes on a large changeset, so it carries its own budget.

Source

pub async fn take_lane_dispatches( &mut self, ) -> Result<Vec<ReviewSubagentRequest>>

Collect the specialist lanes the review supervisor asked for since the last call.

Source

pub async fn respond_elicitation( &mut self, elicitation_id: String, response: ElicitationResponse, ) -> Result<()>

Answer an ACP form over the live relay connection. User-entered content is intentionally excluded from the relay’s durable command path.

Source

pub async fn detach(self) -> Result<()>

Trait Implementations§

Source§

impl Drop for RelayClient

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more