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 {
12        params: ElicitationParams,
13        response_tx: oneshot::Sender<ElicitationResponse>,
14    },
15    PromptDone(StopReason),
16    PromptError(Error),
17    AuthenticateComplete {
18        method_id: String,
19    },
20    AuthenticateFailed {
21        method_id: String,
22        error: String,
23    },
24    SessionsListed {
25        sessions: Vec<acp::SessionInfo>,
26    },
27    SessionLoaded {
28        session_id: acp::SessionId,
29        config_options: Vec<acp::SessionConfigOption>,
30    },
31    NewSessionCreated {
32        session_id: acp::SessionId,
33        config_options: Vec<acp::SessionConfigOption>,
34    },
35    ConnectionClosed,
36}