Skip to main content

acp_utils/client/
event.rs

1use acp::{Error, ExtNotification, SessionUpdate, StopReason};
2use agent_client_protocol as acp;
3use tokio::sync::oneshot;
4
5use crate::notifications::{ElicitationParams, ElicitationResponse};
6
7/// Events forwarded from the ACP connection to the main event loop.
8pub enum AcpEvent {
9    SessionUpdate(Box<SessionUpdate>),
10    ExtNotification(ExtNotification),
11    ElicitationRequest { params: ElicitationParams, response_tx: oneshot::Sender<ElicitationResponse> },
12    PromptDone(StopReason),
13    PromptError(Error),
14    AuthenticateComplete { method_id: String },
15    AuthenticateFailed { method_id: String, error: String },
16    SessionsListed { sessions: Vec<acp::SessionInfo> },
17    SessionLoaded { session_id: acp::SessionId, config_options: Vec<acp::SessionConfigOption> },
18    NewSessionCreated { session_id: acp::SessionId, config_options: Vec<acp::SessionConfigOption> },
19    ConnectionClosed,
20}