Skip to main content

acp_utils/client/
event.rs

1use crate::notifications::{
2    AuthMethodsUpdatedParams, ContextClearedParams, GitDiffEventPayload, McpNotification, SubAgentProgressParams,
3};
4use agent_client_protocol::Responder;
5use agent_client_protocol::schema::v2::{
6    CreateElicitationRequest, CreateElicitationResponse, UpdateSessionNotification,
7};
8
9/// Events forwarded from the ACP connection to the main event loop.
10pub enum AcpEvent {
11    SessionUpdate(Box<UpdateSessionNotification>),
12    ContextCleared(ContextClearedParams),
13    SubAgentProgress(SubAgentProgressParams),
14    AuthMethodsUpdated(AuthMethodsUpdatedParams),
15    McpNotification(McpNotification),
16    GitDiffEvent(GitDiffEventPayload),
17    ElicitationRequest { params: Box<CreateElicitationRequest>, responder: Responder<CreateElicitationResponse> },
18    ConnectionClosed,
19}
20
21impl From<UpdateSessionNotification> for AcpEvent {
22    fn from(notification: UpdateSessionNotification) -> Self {
23        Self::SessionUpdate(Box::new(notification))
24    }
25}