Skip to main content

HostedGrpcClient

Struct HostedGrpcClient 

Source
pub struct HostedGrpcClient { /* private fields */ }

Implementations§

Source§

impl HostedGrpcClient

Source

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.

Source

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.

Source

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.

Source

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

Source

pub async fn get_compare( &mut self, repo_path: &str, from: &str, to: &str, include_semantic: bool, ) -> Result<CompareResponse, ProtocolError>

Source

pub async fn get_blame( &mut self, repo_path: &str, ref: Option<&str>, path: &str, ) -> Result<GetBlameResponse, ProtocolError>

Source

pub async fn list_context( &mut self, repo_path: &str, ref: Option<&str>, prefix: Option<&str>, tag_filter: Option<&str>, ) -> Result<ListContextResponse, ProtocolError>

Source

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>

Source

pub async fn get_context_history( &mut self, repo_path: &str, ref: Option<&str>, annotation_id: &str, ) -> Result<GetContextHistoryResponse, ProtocolError>

Source

pub async fn list_context_suggestions( &mut self, repo_path: &str, ref: Option<&str>, limit: u32, ) -> Result<ListContextSuggestionsResponse, ProtocolError>

Source

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>

Source

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

Source

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.

Source

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.

Source

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

Source

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

Source

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.

Source

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

Source

pub async fn list_refs( &mut self, repo_path: &str, ) -> Result<Vec<RefEntry>, ProtocolError>

Source

pub async fn list_refs_with_revision_addresses( &mut self, repo_path: &str, ) -> Result<Vec<HostedRefEntry>, ProtocolError>

Source

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>

Source

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>

Source

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.

Source

pub async fn pull( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<PullComplete, ProtocolError>

Source

pub async fn pull_profiled( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<(PullComplete, PullProfile), ProtocolError>

Source

pub async fn pull_partial( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, local_thread: Option<&str>, ) -> Result<PullComplete, ProtocolError>

Source

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>

Source

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>

Source

pub async fn fetch_state( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>

Source

pub async fn fetch_state_partial( &mut self, repo: &Repository, repo_path: &str, remote_thread: &str, target_state: StateId, ) -> Result<usize, ProtocolError>

Source

pub async fn hydrate_blob_at_path( &mut self, repo: &Repository, repo_path: &str, reference: &str, path: &str, ) -> Result<Blob, ProtocolError>

Source

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

Source

pub async fn begin_login( &mut self, username: &str, ) -> Result<(String, String, u64), ProtocolError>

Source

pub async fn get_current_user_namespace( &mut self, ) -> Result<HostedNamespaceInfo, ProtocolError>

Source

pub async fn list_spools( &mut self, repos_only: bool, ) -> Result<Vec<SpoolSummary>, ProtocolError>

Source

pub async fn create_namespace( &mut self, kind: &str, slug: &str, parent_path: Option<&str>, display_name: Option<String>, ) -> Result<HostedNamespaceInfo, ProtocolError>

Source

pub async fn create_repository( &mut self, namespace_path: &str, slug: &str, ) -> Result<HostedRepositoryInfo, ProtocolError>

Source

pub async fn update_namespace( &mut self, full_path: &str, new_slug: Option<&str>, display_name: Option<Option<String>>, ) -> Result<HostedNamespaceInfo, ProtocolError>

Source

pub async fn delete_namespace( &mut self, full_path: &str, ) -> Result<(), ProtocolError>

Source

pub async fn update_repository( &mut self, full_path: &str, new_slug: &str, ) -> Result<HostedRepositoryInfo, ProtocolError>

Source

pub async fn delete_repository( &mut self, full_path: &str, ) -> Result<(), ProtocolError>

Source

pub async fn create_grant( &mut self, subject: &str, role: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<HostedGrantInfo, ProtocolError>

Source

pub async fn list_grants( &mut self, resource: Option<&str>, ) -> Result<Vec<HostedGrantInfo>, ProtocolError>

Source

pub async fn update_grant( &mut self, subject: &str, role: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<HostedGrantInfo, ProtocolError>

Source

pub async fn delete_grant( &mut self, subject: &str, namespace_path: Option<&str>, repo_path: Option<&str>, ) -> Result<(), ProtocolError>

Source

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.

Source

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.

Source

pub async fn revoke_approval( &mut self, id: &str, client_operation_id: String, ) -> Result<(), ProtocolError>

Source

pub async fn list_thread_approvals( &mut self, repo_path: &str, source_thread: &str, target_thread: &str, ) -> Result<Vec<ThreadApproval>, ProtocolError>

Source

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 merge into at <source_state>, given the diff touches changed_paths?” The reply lists every unmet requirement and the approvals that counted as valid.

Source

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.

Source

pub async fn list_support_access_grants( &mut self, namespace_path: Option<&str>, repo_path: Option<&str>, include_inactive: bool, ) -> Result<Vec<SupportAccessGrant>, ProtocolError>

Source

pub async fn revoke_support_access( &mut self, id: &str, client_operation_id: String, ) -> Result<(), ProtocolError>

Source

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

Source

pub async fn connect( addr: SocketAddr, config: &ClientConfig, ) -> Result<HostedGrpcClient, ProtocolError>

Source

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§

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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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