1use std::{path::Path, rc::Rc};
2
3use agent_client_protocol as acp;
4use anyhow::Result;
5use gpui::{AsyncApp, Entity, Task};
6use project::Project;
7use ui::App;
8
9use crate::AcpThread;
10
11pub trait AgentConnection {
12 fn new_thread(
13 self: Rc<Self>,
14 project: Entity<Project>,
15 cwd: &Path,
16 cx: &mut AsyncApp,
17 ) -> Task<Result<Entity<AcpThread>>>;
18
19 fn authenticate(&self, cx: &mut App) -> Task<Result<()>>;
20
21 fn prompt(&self, params: acp::PromptArguments, cx: &mut App) -> Task<Result<()>>;
22
23 fn cancel(&self, session_id: &acp::SessionId, cx: &mut App);
24}