pub struct RemoteBridge {
pub state: Arc<RwLock<BridgeState>>,
pub device_status: Arc<RwLock<Option<DeviceStatus>>>,
pub org_policies: Arc<RwLock<Option<OrgPolicies>>>,
pub permission_relay: PermissionRelay,
/* private fields */
}Expand description
Remote control bridge
Maintains communication with the backend using either Supabase Realtime (preferred) or HTTP polling (fallback).
Fields§
§state: Arc<RwLock<BridgeState>>Current bridge connection state.
device_status: Arc<RwLock<Option<DeviceStatus>>>Device allowlist status from last authentication.
org_policies: Arc<RwLock<Option<OrgPolicies>>>Organization policies from last authentication.
permission_relay: PermissionRelayPermission relay for remote tool-approval prompts.
Implementations§
Source§impl RemoteBridge
impl RemoteBridge
Sourcepub fn new(
config: BridgeConfig,
agent_spawner: Option<Arc<dyn AgentSpawner>>,
) -> Self
pub fn new( config: BridgeConfig, agent_spawner: Option<Arc<dyn AgentSpawner>>, ) -> Self
Create a new remote bridge
§Arguments
config- Bridge configuration with all injected platform valuesagent_spawner- Optional agent spawner for remote agent creation
Sourcepub async fn connection_mode(&self) -> ConnectionMode
pub async fn connection_mode(&self) -> ConnectionMode
Get current connection mode
Sourcepub async fn state(&self) -> BridgeState
pub async fn state(&self) -> BridgeState
Get current bridge state
Sourcepub async fn protocol_version(&self) -> String
pub async fn protocol_version(&self) -> String
Get the negotiated protocol version
Sourcepub async fn has_capability(&self, cap: ProtocolCapability) -> bool
pub async fn has_capability(&self, cap: ProtocolCapability) -> bool
Check if a capability is enabled in the negotiated protocol
Sourcepub async fn enabled_capabilities(&self) -> Vec<ProtocolCapability>
pub async fn enabled_capabilities(&self) -> Vec<ProtocolCapability>
Get all enabled capabilities
Sourcepub async fn send_permission_request(
&self,
agent_id: &str,
tool_name: &str,
action: &str,
details: Value,
) -> Result<PermissionDecision>
pub async fn send_permission_request( &self, agent_id: &str, tool_name: &str, action: &str, details: Value, ) -> Result<PermissionDecision>
Send a permission request to the remote user and wait for their decision.
Returns Ok(decision) if the user responds within the timeout,
or Ok(PermissionDecision { approved: false, .. }) on timeout.
Sourcepub fn set_shutdown_tx(&mut self, tx: Sender<()>)
pub fn set_shutdown_tx(&mut self, tx: Sender<()>)
Set the shutdown signal sender (for external shutdown control)
Trait Implementations§
Source§impl Clone for RemoteBridge
impl Clone for RemoteBridge
Source§fn clone(&self) -> RemoteBridge
fn clone(&self) -> RemoteBridge
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more