Skip to main content

BridgeApi

Struct BridgeApi 

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

Local agent bridge for Snaga desktop connections

Implementations§

Source§

impl BridgeApi

Source

pub async fn bridge_delegate( &self, body: &BridgeDelegateRequest, ) -> Result<BridgeDelegateResponse>

Delegate task to bridge agent

POST /api/v1/bridge/delegate

Source

pub async fn bridge_deregister( &self, body: &BridgeDeregisterRequest, ) -> Result<BridgeDeregisterResponse>

Deregister bridge agent

POST /api/v1/bridge/deregister

Source

pub async fn bridge_heartbeat( &self, body: &BridgeHeartbeatRequest, ) -> Result<BridgeHeartbeatResponse>

Bridge heartbeat

Idempotent liveness ping for the bridge connection. 404 on missing connection is intentional — drives the client to re-register rather than reusing a stale identity.

POST /api/v1/bridge/heartbeat

Source

pub async fn bridge_poll( &self, params: &BridgePollParams, ) -> Result<BridgePollResponse>

Long-poll for pending bridge tasks

Long-poll up to platform-configured POLL_TIMEOUT_MS. Returns 200 with tasks if any are pending, or 204 No Content on timeout (client should re-poll immediately).

GET /api/v1/bridge/poll

Source

pub async fn bridge_register( &self, body: &BridgeRegisterRequest, ) -> Result<BridgeRegisterResponse>

Register bridge agent (Snaga CLI handshake)

Registers a long-lived bridge agent for the calling tenant. Returns 201 on first registration, 200 on reconnect of an existing machine_id. Tenant-scoped only — no scope enforcement.

POST /api/v1/bridge/register

Source

pub async fn bridge_status(&self) -> Result<BridgeStatusResponse>

Get bridge connection status

GET /api/v1/bridge/status

Source

pub async fn bridge_web_socket(&self) -> Result<Value>

Bridge WebSocket upgrade endpoint for the Snaga CLI

WebSocket upgrade. Long-lived bidirectional channel between a snaga serve CLI and the platform. Server delivers tasks, client streams capabilities and tool results. Auth via Sec-WebSocket-Protocol: uarp.\<base64(api_key)\> subprotocol.

GET /api/v1/bridge/ws

Source

pub async fn get_bridge_task_approval( &self, task_id: &str, params: &GetBridgeTaskApprovalParams, ) -> Result<GetBridgeTaskApprovalResponse>

Get approval status

GET /api/v1/bridge/tasks/{taskId}/approval

Source

pub async fn list_bridge_agents(&self) -> Result<Vec<BridgeAgentSummary>>

List bridge agents

GET /api/v1/bridge/agents

Source

pub async fn push_bridge_task_events( &self, task_id: &str, body: &Value, ) -> Result<PushBridgeTaskEventsResponse>

Push task events

POST /api/v1/bridge/tasks/{taskId}/events

Source

pub async fn update_bridge_agent_capability( &self, agent_id: &str, body: &UpdateBridgeAgentCapabilityRequest, ) -> Result<UpdateBridgeAgentCapabilityResponse>

Update agent capabilities

POST /api/v1/bridge/agents/{agentId}/capability

Trait Implementations§

Source§

impl Clone for BridgeApi

Source§

fn clone(&self) -> BridgeApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BridgeApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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