add HumanInterface

add cli
This commit is contained in:
milan
2026-04-11 15:33:27 +02:00
parent 5bf98a1efc
commit 5aaedbd73f
9 changed files with 156 additions and 29 deletions
+22
View File
@@ -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>>;
}