Skip to main content

acp_utils/client/
event.rs

1use acp::Responder;
2use acp::schema::v1::{SessionUpdate, StopReason};
3use agent_client_protocol as acp;
4use agent_client_protocol::schema::v1::{CreateElicitationRequest, CreateElicitationResponse, SessionId};
5
6use crate::notifications::{
7    AuthMethodsUpdatedParams, ContextClearedParams, ContextCompactionParams, McpNotification, SessionUsageParams,
8    SubAgentProgressParams,
9};
10
11/// Events forwarded from the ACP connection to the main event loop.
12pub enum AcpEvent {
13    SessionUpdate { session_id: SessionId, update: Box<SessionUpdate> },
14    ContextCleared(ContextClearedParams),
15    ContextCompaction(ContextCompactionParams),
16    SubAgentProgress(SubAgentProgressParams),
17    SessionUsage(Box<SessionUsageParams>),
18    AuthMethodsUpdated(AuthMethodsUpdatedParams),
19    McpNotification(McpNotification),
20    ElicitationRequest { params: Box<CreateElicitationRequest>, responder: Responder<CreateElicitationResponse> },
21    PromptCompleted(StopReason),
22    ConnectionClosed,
23}