use std::sync::Arc;
use elicitation::{ElicitClient, ElicitResult, Elicitation};
use rmcp::ServiceExt;
use std::path::PathBuf;
#[tokio::main]
async fn main() -> ElicitResult<()> {
tracing_subscriber::fmt()
.with_env_filter("pathbuf=debug,elicitation=debug")
.init();
tracing::info!("Starting PathBuf elicitation example");
let service = ().serve(rmcp::transport::stdio()).await.expect("Failed to create MCP client");
let peer = service.peer();
let client = ElicitClient::new(Arc::new(peer.clone()));
tracing::info!("=== Eliciting file path ===");
let file_path: PathBuf = PathBuf::elicit(&client).await?;
tracing::info!(?file_path, "Elicited file path");
println!("File path: {}", file_path.display());
tracing::info!("=== Eliciting directory path ===");
let dir_path: PathBuf = PathBuf::elicit(&client).await?;
tracing::info!(?dir_path, "Elicited directory path");
println!("Directory path: {}", dir_path.display());
tracing::info!("=== Eliciting optional config path ===");
let config_path: Option<PathBuf> = Option::<PathBuf>::elicit(&client).await?;
tracing::info!(?config_path, "Elicited optional path");
match config_path {
Some(path) => println!("Config path: {}", path.display()),
None => println!("No config path provided"),
}
tracing::info!("Example complete!");
Ok(())
}