add HumanInterface
add cli
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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(&self, message: String);
|
||||
|
||||
fn expect_user_message(&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(&self) -> impl Future<Output = Result<(), HumanInterfaceError>>;
|
||||
}
|
||||
Reference in New Issue
Block a user