pub struct BridgeApi { /* private fields */ }Expand description
Local agent bridge for Snaga desktop connections
Implementations§
Source§impl BridgeApi
impl BridgeApi
Sourcepub async fn bridge_delegate(
&self,
body: &BridgeDelegateRequest,
) -> Result<BridgeDelegateResponse>
pub async fn bridge_delegate( &self, body: &BridgeDelegateRequest, ) -> Result<BridgeDelegateResponse>
Delegate task to bridge agent
POST /api/v1/bridge/delegate
Sourcepub async fn bridge_deregister(
&self,
body: &BridgeDeregisterRequest,
) -> Result<BridgeDeregisterResponse>
pub async fn bridge_deregister( &self, body: &BridgeDeregisterRequest, ) -> Result<BridgeDeregisterResponse>
Deregister bridge agent
POST /api/v1/bridge/deregister
Sourcepub async fn bridge_heartbeat(
&self,
body: &BridgeHeartbeatRequest,
) -> Result<BridgeHeartbeatResponse>
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
Sourcepub async fn bridge_poll(
&self,
params: &BridgePollParams,
) -> Result<BridgePollResponse>
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
Sourcepub async fn bridge_register(
&self,
body: &BridgeRegisterRequest,
) -> Result<BridgeRegisterResponse>
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
Sourcepub async fn bridge_status(&self) -> Result<BridgeStatusResponse>
pub async fn bridge_status(&self) -> Result<BridgeStatusResponse>
Get bridge connection status
GET /api/v1/bridge/status
Sourcepub async fn bridge_web_socket(&self) -> Result<Value>
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
Sourcepub async fn get_bridge_task_approval(
&self,
task_id: &str,
params: &GetBridgeTaskApprovalParams,
) -> Result<GetBridgeTaskApprovalResponse>
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
Sourcepub async fn list_bridge_agents(&self) -> Result<Vec<BridgeAgentSummary>>
pub async fn list_bridge_agents(&self) -> Result<Vec<BridgeAgentSummary>>
List bridge agents
GET /api/v1/bridge/agents
Sourcepub async fn push_bridge_task_events(
&self,
task_id: &str,
body: &Value,
) -> Result<PushBridgeTaskEventsResponse>
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
Sourcepub async fn update_bridge_agent_capability(
&self,
agent_id: &str,
body: &UpdateBridgeAgentCapabilityRequest,
) -> Result<UpdateBridgeAgentCapabilityResponse>
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