pub struct HostedGrpcClient { /* private fields */ }Implementations§
Source§impl HostedGrpcClient
impl HostedGrpcClient
Sourcepub fn authenticated_username(&self) -> Option<String>
pub fn authenticated_username(&self) -> Option<String>
The authenticated hosted username (the bearer token’s principal:<subject>
subject). weft stamps discussion turns with Principal::new(username, ""),
so this is the author name our own pushed turns carry server-side — the
identity the discussion-sync bridge uses to recognize turns we published.
None for an anonymous/unsigned client.
Sourcepub async fn open_discussion(
&mut self,
repo_path: &str,
change_id: ChangeId,
file: &str,
symbol: &str,
body: &str,
visibility: &str,
client_operation_id: String,
) -> Result<HostedDiscussion, ProtocolError>
pub async fn open_discussion( &mut self, repo_path: &str, change_id: ChangeId, file: &str, symbol: &str, body: &str, visibility: &str, client_operation_id: String, ) -> Result<HostedDiscussion, ProtocolError>
Open a hosted discussion anchored at change_id’s state, seeded with
body as the first turn. Caller-authenticated + PoP-signed.
Sourcepub async fn append_turn(
&mut self,
repo_path: &str,
discussion_id: &str,
body: &str,
client_operation_id: String,
) -> Result<HostedDiscussion, ProtocolError>
pub async fn append_turn( &mut self, repo_path: &str, discussion_id: &str, body: &str, client_operation_id: String, ) -> Result<HostedDiscussion, ProtocolError>
Append body as a new turn on an existing hosted discussion.
Caller-authenticated + PoP-signed.
Sourcepub async fn list_discussions_by_state(
&mut self,
repo_path: &str,
change_id: ChangeId,
status: &str,
) -> Result<Vec<HostedDiscussion>, ProtocolError>
pub async fn list_discussions_by_state( &mut self, repo_path: &str, change_id: ChangeId, status: &str, ) -> Result<Vec<HostedDiscussion>, ProtocolError>
List hosted discussions anchored at change_id’s state. status is one
of open | resolved | all | orphaned.
Source§impl HostedGrpcClient
impl HostedGrpcClient
pub async fn get_compare( &mut self, repo_path: &str, from: &str, to: &str, include_semantic: bool, ) -> Result<CompareResponse, ProtocolError>
pub async fn get_blame( &mut self, repo_path: &str, ref: Option<&str>, path: &str, ) -> Result<GetBlameResponse, ProtocolError>
pub async fn list_context( &mut self, repo_path: &str, ref: Option<&str>, prefix: Option<&str>, tag_filter: Option<&str>, ) -> Result<ListContextResponse, ProtocolError>
pub async fn set_context( &mut self, repo_path: &str, path: &str, target_state_id: Option<&str>, scope: AnnotationScope, kind: ContextAnnotationKind, tags: Vec<String>, content: &str, agent_provider: Option<&str>, agent_model: Option<&str>, client_operation_id: String, ) -> Result<SetContextResponse, ProtocolError>
pub async fn get_context_history( &mut self, repo_path: &str, ref: Option<&str>, annotation_id: &str, ) -> Result<GetContextHistoryResponse, ProtocolError>
pub async fn list_context_suggestions( &mut self, repo_path: &str, ref: Option<&str>, limit: u32, ) -> Result<ListContextSuggestionsResponse, ProtocolError>
pub async fn revise_context( &mut self, repo_path: &str, annotation_id: &str, content: &str, tags: Vec<String>, agent_provider: Option<&str>, agent_model: Option<&str>, kind: ContextAnnotationKind, client_operation_id: String, ) -> Result<ReviseContextResponse, ProtocolError>
pub async fn supersede_context( &mut self, repo_path: &str, annotation_id: &str, path: Option<&str>, target_state_id: Option<&str>, scope: AnnotationScope, tags: Vec<String>, content: &str, agent_provider: Option<&str>, agent_model: Option<&str>, kind: ContextAnnotationKind, client_operation_id: String, ) -> Result<SupersedeContextResponse, ProtocolError>
Source§impl HostedGrpcClient
impl HostedGrpcClient
Sourcepub async fn sign_state(
&mut self,
repo_path: &str,
state_id: &StateId,
kind: ReviewKind,
scope: ReviewScope,
justification: &str,
algorithm: &str,
public_key: Vec<u8>,
signature: Vec<u8>,
signed_at_unix: i64,
client_operation_id: String,
) -> Result<SignStateResponse, ProtocolError>
pub async fn sign_state( &mut self, repo_path: &str, state_id: &StateId, kind: ReviewKind, scope: ReviewScope, justification: &str, algorithm: &str, public_key: Vec<u8>, signature: Vec<u8>, signed_at_unix: i64, client_operation_id: String, ) -> Result<SignStateResponse, ProtocolError>
Mint a hosted review signature over state_id. signature/public_key
are the raw bytes the caller already computed over the canonical
signing_payload (byte-identical to the server’s reconstruction), so the
server verifies the exact same signature the local review sign wrote.
Sourcepub async fn record_verdict(
&mut self,
repo_path: &str,
state_id: &StateId,
verdict: Verdict,
scope: ReviewScope,
reason: &str,
algorithm: &str,
public_key: Vec<u8>,
signature: Vec<u8>,
signed_at_unix: i64,
client_operation_id: String,
) -> Result<RecordVerdictResponse, ProtocolError>
pub async fn record_verdict( &mut self, repo_path: &str, state_id: &StateId, verdict: Verdict, scope: ReviewScope, reason: &str, algorithm: &str, public_key: Vec<u8>, signature: Vec<u8>, signed_at_unix: i64, client_operation_id: String, ) -> Result<RecordVerdictResponse, ProtocolError>
Record a signed SIGN/HOLD/REJECT reviewer verdict over state_id.
Decoupled from status — returns the same state. Same signing model as
Self::sign_state.
Sourcepub async fn list_review_signatures(
&mut self,
repo_path: &str,
state_id: &StateId,
) -> Result<ListSignaturesResponse, ProtocolError>
pub async fn list_review_signatures( &mut self, repo_path: &str, state_id: &StateId, ) -> Result<ListSignaturesResponse, ProtocolError>
List hosted review signatures recorded against state_id. Read-only,
authenticated (unsigned tier).
Source§impl HostedGrpcClient
impl HostedGrpcClient
pub async fn hydrate_pulled_state( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>
Source§impl HostedGrpcClient
impl HostedGrpcClient
Sourcepub async fn open_session(
addr: SocketAddr,
user_config: &UserConfig,
server_key: Option<String>,
) -> Result<HostedGrpcClient, Error>
pub async fn open_session( addr: SocketAddr, user_config: &UserConfig, server_key: Option<String>, ) -> Result<HostedGrpcClient, Error>
Open a usable hosted session in one call: resolve auth, build the
validated client config, connect, and evaluate eligible stored-authority
renewal. Callers that must prevalidate the config before irreversible
work build a HostedSession first, then HostedSession::connect.
Sourcepub async fn open_session_with_insecure(
addr: SocketAddr,
user_config: &UserConfig,
server_key: Option<String>,
allow_insecure: bool,
) -> Result<HostedGrpcClient, Error>
pub async fn open_session_with_insecure( addr: SocketAddr, user_config: &UserConfig, server_key: Option<String>, allow_insecure: bool, ) -> Result<HostedGrpcClient, Error>
Like [open_session], but allows cleartext to non-loopback when
allow_insecure is true (CLI --insecure / remote insecure = true).
Source§impl HostedGrpcClient
impl HostedGrpcClient
pub async fn list_refs( &mut self, repo_path: &str, ) -> Result<Vec<RefEntry>, ProtocolError>
pub async fn list_refs_with_revision_addresses( &mut self, repo_path: &str, ) -> Result<Vec<HostedRefEntry>, ProtocolError>
pub async fn update_ref( &mut self, repo_path: &str, name: &str, is_thread: bool, old_value: Option<StateId>, new_value: StateId, force: bool, thread_metadata: Option<&ThreadRecord>, client_operation_id: String, ) -> Result<RefUpdated, ProtocolError>
pub async fn push( &mut self, repo: &Repository, repo_path: &str, local_state: StateId, target_thread: &str, force: bool, client_operation_id: String, ) -> Result<PushComplete, ProtocolError>
Sourcepub async fn push_git_overlay_mirror(
&mut self,
repo: &Repository,
repo_path: &str,
local_state: StateId,
target_thread: &str,
force: bool,
progress: &Progress,
client_operation_id: String,
) -> Result<PushComplete, ProtocolError>
pub async fn push_git_overlay_mirror( &mut self, repo: &Repository, repo_path: &str, local_state: StateId, target_thread: &str, force: bool, progress: &Progress, client_operation_id: String, ) -> Result<PushComplete, ProtocolError>
Push ALL git-overlay refs (every branch, tag, note, and other ref)
in one shot: a single multi-root pack followed by N checkpoint-less
ref updates (git-mirror mode). This is the DEFAULT hosted git-overlay
push path (#846) — the git format is shipped straight through weft’s
git lane with no native conversion. Native heddle conversion stays
opt-in via heddle adopt.
Per-ref remote expectations are read from the server ListRefs
response so each ref update carries the compare-and-set precondition
the server currently holds.
progress drives the live push line (packing → uploading bytes →
writing N refs); pass Progress::null for machine-readable / non-TTY
callers.
pub async fn pull( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<PullComplete, ProtocolError>
pub async fn pull_profiled( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<(PullComplete, PullProfile), ProtocolError>
pub async fn pull_partial( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<PullComplete, ProtocolError>
pub async fn pull_with_depth_and_materialization( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, depth: Option<u32>, materialization: PullMaterialization, ) -> Result<PullComplete, ProtocolError>
pub async fn pull_with_depth( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, depth: Option<u32>, ) -> Result<PullComplete, ProtocolError>
pub async fn fetch_state( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>
pub async fn fetch_state_partial( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>
pub async fn hydrate_blob_at_path( &mut self, repo: &Repository, repo_path: &str, reference: &str, path: &str, ) -> Result<Blob, ProtocolError>
pub async fn hydrate_missing_blobs_for_state( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>
Source§impl HostedGrpcClient
impl HostedGrpcClient
pub async fn begin_login( &mut self, username: &str, ) -> Result<(String, String, u64), ProtocolError>
pub async fn get_current_user_namespace( &mut self, ) -> Result<HostedNamespaceInfo, ProtocolError>
pub async fn list_spools( &mut self, repos_only: bool, ) -> Result<Vec<SpoolSummary>, ProtocolError>
pub async fn create_namespace( &mut self, kind: &str, slug: &str, parent_path: Option<&str>, display_name: Option<String>, ) -> Result<HostedNamespaceInfo, ProtocolError>
pub async fn create_repository( &mut self, namespace_path: &str, slug: &str, ) -> Result<HostedRepositoryInfo, ProtocolError>
pub async fn update_namespace( &mut self, full_path: &str, new_slug: Option<&str>, display_name: Option<Option<String>>, ) -> Result<HostedNamespaceInfo, ProtocolError>
pub async fn delete_namespace( &mut self, full_path: &str, ) -> Result<(), ProtocolError>
pub async fn update_repository( &mut self, full_path: &str, new_slug: &str, ) -> Result<HostedRepositoryInfo, ProtocolError>
pub async fn delete_repository( &mut self, full_path: &str, ) -> Result<(), ProtocolError>
pub async fn create_grant( &mut self, subject: &str, role: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<HostedGrantInfo, ProtocolError>
pub async fn list_grants( &mut self, resource: Option<&str>, ) -> Result<Vec<HostedGrantInfo>, ProtocolError>
pub async fn update_grant( &mut self, subject: &str, role: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<HostedGrantInfo, ProtocolError>
pub async fn delete_grant( &mut self, subject: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<(), ProtocolError>
Sourcepub async fn create_invitation(
&mut self,
email: &str,
namespace_path: &str,
role: &str,
) -> Result<Invitation, ProtocolError>
pub async fn create_invitation( &mut self, email: &str, namespace_path: &str, role: &str, ) -> Result<Invitation, ProtocolError>
Track D — create a pending invitation. Returns the raw proto type to keep the surface narrow until we settle on a domain shape.
Sourcepub async fn approve_thread(
&mut self,
repo_path: &str,
source_thread: &str,
target_thread: &str,
source_state: &str,
note: Option<&str>,
client_operation_id: String,
) -> Result<ThreadApproval, ProtocolError>
pub async fn approve_thread( &mut self, repo_path: &str, source_thread: &str, target_thread: &str, source_state: &str, note: Option<&str>, client_operation_id: String, ) -> Result<ThreadApproval, ProtocolError>
Record an approval for (source_thread → target_thread) at
the source’s current source_state. The server’s gate decides
later whether this approval counts against any matching
policy’s requirements.
pub async fn revoke_approval( &mut self, id: &str, client_operation_id: String, ) -> Result<(), ProtocolError>
pub async fn list_thread_approvals( &mut self, repo_path: &str, source_thread: &str, target_thread: &str, ) -> Result<Vec<ThreadApproval>, ProtocolError>
Sourcepub async fn check_merge_eligibility(
&mut self,
repo_path: &str,
source_thread: &str,
target_thread: &str,
source_state: &str,
gated_action: &str,
changed_paths: Vec<String>,
author_user_id: Option<&str>,
) -> Result<CheckMergeEligibilityResponse, ProtocolError>
pub async fn check_merge_eligibility( &mut self, repo_path: &str, source_thread: &str, target_thread: &str, source_state: &str, gated_action: &str, changed_paths: Vec<String>, author_user_id: Option<&str>, ) -> Result<CheckMergeEligibilityResponse, ProtocolError>
Ask the server “can changed_paths?” The
reply lists every unmet requirement and the approvals that
counted as valid.
Sourcepub async fn grant_support_access(
&mut self,
operator_email: &str,
namespace_path: Option<&str>,
repo_path: Option<&str>,
ttl_seconds: u32,
reason: &str,
client_operation_id: String,
) -> Result<SupportAccessGrant, ProtocolError>
pub async fn grant_support_access( &mut self, operator_email: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ttl_seconds: u32, reason: &str, client_operation_id: String, ) -> Result<SupportAccessGrant, ProtocolError>
Phase C: grant a Heddle staff member temporary admin on a
namespace or repo. Exactly one of namespace_path or
repo_path should be set.
pub async fn list_support_access_grants( &mut self, namespace_path: Option<&str>, repo_path: Option<&str>, include_inactive: bool, ) -> Result<Vec<SupportAccessGrant>, ProtocolError>
pub async fn revoke_support_access( &mut self, id: &str, client_operation_id: String, ) -> Result<(), ProtocolError>
Sourcepub async fn resolve_monorepo(
&mut self,
root_path: &str,
max_depth: Option<u32>,
) -> Result<MonorepoNode, ProtocolError>
pub async fn resolve_monorepo( &mut self, root_path: &str, max_depth: Option<u32>, ) -> Result<MonorepoNode, ProtocolError>
Recursively resolve the monorepo rooted at root_path into the caller’s
coherent visible slice (per-child visibility, cycle guard, depth bound).
max_depth is an optional recursion bound (server clamps to
MONOREPO_MAX_DEPTH). Returns the root MonorepoNode — the whole tree
the monorepo-clone planner walks.
Source§impl HostedGrpcClient
impl HostedGrpcClient
pub async fn connect( addr: SocketAddr, config: &ClientConfig, ) -> Result<HostedGrpcClient, ProtocolError>
Sourcepub fn with_human_signature_callback(
self,
callback: Arc<dyn Fn(HumanSignatureRequest) -> Result<WebAuthnAssertion, ProtocolError> + Sync + Send>,
) -> HostedGrpcClient
pub fn with_human_signature_callback( self, callback: Arc<dyn Fn(HumanSignatureRequest) -> Result<WebAuthnAssertion, ProtocolError> + Sync + Send>, ) -> HostedGrpcClient
Register the app’s WebAuthn signer for the destructive (human) tier.
Invoked when a signed RPC is rejected with x-heddle-sig-required: human;
the callback produces a request_signing::WebAuthnAssertion over the
same action and the call is retried once. With no callback registered, a
human-tier rejection surfaces a typed error (no loop). The CLI wires a
terminal-prompt implementation; tapestry a browser ceremony.
Auto Trait Implementations§
impl !Freeze for HostedGrpcClient
impl !RefUnwindSafe for HostedGrpcClient
impl !UnwindSafe for HostedGrpcClient
impl Send for HostedGrpcClient
impl Sync for HostedGrpcClient
impl Unpin for HostedGrpcClient
impl UnsafeUnpin for HostedGrpcClient
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request