pub struct ACPProtocol { /* private fields */ }Expand description
ACP protocol handler for iFlow communication
Implements the Agent Client Protocol (ACP) which defines the interaction between GUI applications and AI agents.
Implementations§
Source§impl ACPProtocol
impl ACPProtocol
Sourcepub fn new(
transport: WebSocketTransport,
message_sender: UnboundedSender<Message>,
timeout_secs: f64,
) -> Self
pub fn new( transport: WebSocketTransport, message_sender: UnboundedSender<Message>, timeout_secs: f64, ) -> Self
Initialize ACP protocol handler
§Arguments
transport- WebSocket transport for communicationmessage_sender- Sender for messages to be processed by the clienttimeout_secs- Timeout in seconds for protocol operations
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Sourcepub fn set_permission_mode(&mut self, mode: PermissionMode)
pub fn set_permission_mode(&mut self, mode: PermissionMode)
Sourcepub async fn initialize(&mut self, options: &IFlowOptions) -> Result<()>
pub async fn initialize(&mut self, options: &IFlowOptions) -> Result<()>
Initialize the protocol connection
Performs the ACP initialization handshake:
- Wait for //ready signal
- Send initialize request with optional configs
- Process initialize response
§Arguments
options- Configuration options
§Returns
Ok(())if initialization was successfulErr(IFlowError)if initialization failed
Sourcepub async fn authenticate(
&mut self,
method_id: &str,
method_info: Option<HashMap<String, String>>,
) -> Result<()>
pub async fn authenticate( &mut self, method_id: &str, method_info: Option<HashMap<String, String>>, ) -> Result<()>
Perform authentication if required
This method should be called if initialize() indicates that authentication is needed (isAuthenticated = False).
§Arguments
method_id- Authentication method IDmethod_info- Optional authentication info
§Returns
Ok(())if authentication was successfulErr(IFlowError)if authentication failed
Sourcepub async fn create_session(
&mut self,
cwd: &str,
mcp_servers: Vec<Value>,
) -> Result<String>
pub async fn create_session( &mut self, cwd: &str, mcp_servers: Vec<Value>, ) -> Result<String>
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Auto Trait Implementations§
impl !Freeze for ACPProtocol
impl !RefUnwindSafe for ACPProtocol
impl Send for ACPProtocol
impl Sync for ACPProtocol
impl Unpin for ACPProtocol
impl !UnwindSafe for ACPProtocol
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
Mutably borrows from an owned value. Read more