1use aether_core::core::Prompt;
2use mcp_utils::client::ServerInstructions;
3use std::path::Path;
4
5pub async fn build_system_prompt(
6 roots_path: &Path,
7 instructions: Vec<ServerInstructions>,
8 prompt_patterns: Vec<String>,
9) -> Result<String, String> {
10 let parts = vec![
11 Prompt::from_globs(prompt_patterns, roots_path.to_path_buf()),
12 Prompt::mcp_instructions(instructions),
13 ];
14
15 Prompt::build_all(&parts)
16 .await
17 .map_err(|e| format!("Failed to build system prompt: {e}"))
18}