22 lines
671 B
Rust
22 lines
671 B
Rust
pub mod cli;
|
|
|
|
use thiserror::Error;
|
|
use own_mcp::mcp::chat::PermissionAnswer;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum HumanInterfaceError {
|
|
#[error(transparent)]
|
|
IoError(std::io::Error),
|
|
#[error("other error in human interface: {0}")]
|
|
Other(String)
|
|
}
|
|
|
|
pub trait HumanInterface {
|
|
fn agent_message(&mut self, message: String);
|
|
|
|
fn expect_user_message(&mut self) -> impl Future<Output = Result<String, HumanInterfaceError>>;
|
|
|
|
fn ask_for_permission(&self, mcp_server_name: String, tool_name:String) -> impl Future<Output = Result<PermissionAnswer, HumanInterfaceError>>;
|
|
|
|
fn run(&mut self) -> impl Future<Output = Result<(), HumanInterfaceError>>;
|
|
} |