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
impl RelayClient
pub async fn connect( spec: &CommandSpec, expected_session_id: &str, ) -> Result<Self>
pub fn session_id(&self) -> &str
pub const fn supports_project_memory_sync(&self) -> bool
pub fn relay_version(&self) -> &str
Sourcepub fn worker_build(&self) -> Option<&str>
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.
pub fn protocol_version(&self) -> u32
pub fn latest_ordinal(&self) -> u64
pub fn latest_digest(&self) -> &str
pub async fn attach( &mut self, after_ordinal: u64, after_digest: impl Into<String>, ) -> Result<RelayAttachment>
Sourcepub async fn begin_catch_up(
&mut self,
after_ordinal: u64,
after_digest: impl Into<String>,
) -> Result<RelayCatchUp>
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.
Sourcepub async fn next_catch_up_page(
&mut self,
previous: &RelayCursor,
frontier: &RelayCursor,
) -> Result<RelayEventPage>
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.
pub async fn acknowledge( &mut self, through_ordinal: u64, through_digest: impl Into<String>, ) -> Result<RelayCursor>
pub async fn status(&mut self) -> Result<RelayOperationalState>
Sourcepub async fn credential_state(&mut self) -> Result<CredentialSnapshot>
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.
Sourcepub async fn read_credentials(&mut self) -> Result<Vec<u8>>
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.
Sourcepub async fn install_credentials(
&mut self,
bytes: &[u8],
) -> Result<CredentialSnapshot>
pub async fn install_credentials( &mut self, bytes: &[u8], ) -> Result<CredentialSnapshot>
Install credentials into the harness home fixed by this session’s launch config.
pub async fn github_token_state(&mut self) -> Result<GithubTokenSnapshot>
pub async fn install_github_token( &mut self, token: &str, ) -> Result<GithubTokenSnapshot>
pub async fn remove_github_token(&mut self) -> Result<GithubTokenSnapshot>
Sourcepub async fn skills_state(&mut self) -> Result<SkillsSyncState>
pub async fn skills_state(&mut self) -> Result<SkillsSyncState>
Return the fingerprint of this session’s synced skills trees without transferring the tree itself.
Sourcepub async fn install_prompt_context(&mut self, text: String) -> Result<()>
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.
pub async fn project_memory_snapshot( &mut self, ) -> Result<(ProjectMemorySnapshot, ProjectMemorySnapshot)>
pub async fn install_project_memory_snapshot( &mut self, snapshot: ProjectMemorySnapshot, ) -> Result<()>
Sourcepub async fn install_skills(
&mut self,
archive_bytes: &[u8],
) -> Result<SkillsSyncState>
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.
pub async fn submit( &mut self, command_id: impl Into<String>, command: RelayCommand, ) -> Result<u64>
Sourcepub async fn start_reviewer(
&mut self,
role: Option<&str>,
config: ReviewerLaunchConfig,
) -> Result<StartedReviewer>
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.
Sourcepub async fn attach_reviewer(
&mut self,
role: Option<&str>,
after_ordinal: u64,
after_digest: impl Into<String>,
) -> Result<RelayAttachment>
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.
Sourcepub async fn acknowledge_reviewer(
&mut self,
role: Option<&str>,
through_ordinal: u64,
through_digest: impl Into<String>,
) -> Result<RelayCursor>
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.
Sourcepub async fn submit_to_reviewer(
&mut self,
role: Option<&str>,
command_id: impl Into<String>,
command: RelayCommand,
) -> Result<u64>
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.
pub async fn reviewer_status( &mut self, role: Option<&str>, ) -> Result<RelayOperationalState>
Sourcepub async fn respond_to_reviewer(
&mut self,
role: Option<&str>,
elicitation_id: String,
response: ElicitationResponse,
) -> Result<()>
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.
Sourcepub async fn pause_reviewer(&mut self, role: Option<&str>) -> Result<()>
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.
Sourcepub async fn capture_review_delta(
&mut self,
role: Option<&str>,
baselines: BTreeMap<PathBuf, String>,
) -> Result<Vec<RepoDelta>>
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.
Sourcepub async fn advance_review_baseline(
&mut self,
role: Option<&str>,
trees: BTreeMap<PathBuf, String>,
) -> Result<()>
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.
Sourcepub async fn analyze_review_delta(
&mut self,
role: Option<&str>,
repositories: Vec<AnalyzeDeltaRepository>,
) -> Result<String>
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.
Sourcepub async fn take_lane_dispatches(
&mut self,
) -> Result<Vec<ReviewSubagentRequest>>
pub async fn take_lane_dispatches( &mut self, ) -> Result<Vec<ReviewSubagentRequest>>
Collect the specialist lanes the review supervisor asked for since the last call.
Sourcepub async fn respond_elicitation(
&mut self,
elicitation_id: String,
response: ElicitationResponse,
) -> Result<()>
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.
pub async fn detach(self) -> Result<()>
Trait Implementations§
Source§impl Drop for RelayClient
impl Drop for RelayClient
Auto Trait Implementations§
impl !RefUnwindSafe for RelayClient
impl !UnwindSafe for RelayClient
impl Freeze for RelayClient
impl Send for RelayClient
impl Sync for RelayClient
impl Unpin for RelayClient
impl UnsafeUnpin for RelayClient
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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