Skip to main content

acp_utils/client/
event.rs

1use acp::Error;
2use acp::Responder;
3use acp::schema::{SessionUpdate, StopReason};
4use agent_client_protocol as acp;
5use agent_client_protocol::schema::{SessionConfigOption, SessionId, SessionInfo};
6
7use crate::notifications::{
8    AuthMethodsUpdatedParams, ContextClearedParams, ContextUsageParams, ElicitationParams, ElicitationResponse,
9    McpNotification, SubAgentProgressParams,
10};
11
12/// Events forwarded from the ACP connection to the main event loop.
13pub enum AcpEvent {
14    SessionUpdate(Box<SessionUpdate>),
15    ContextCleared(ContextClearedParams),
16    ContextUsage(ContextUsageParams),
17    SubAgentProgress(SubAgentProgressParams),
18    AuthMethodsUpdated(AuthMethodsUpdatedParams),
19    McpNotification(McpNotification),
20    ElicitationRequest { params: ElicitationParams, responder: Responder<ElicitationResponse> },
21    PromptDone(StopReason),
22    PromptError(Error),
23    AuthenticateComplete { method_id: String },
24    AuthenticateFailed { method_id: String, error: String },
25    SessionsListed { sessions: Vec<SessionInfo> },
26    SessionLoaded { session_id: SessionId, config_options: Vec<SessionConfigOption> },
27    NewSessionCreated { session_id: SessionId, config_options: Vec<SessionConfigOption> },
28    ConnectionClosed,
29}