Skip to main content

bamboo_engine/runtime/managers/
prompt.rs

1use async_trait::async_trait;
2use bamboo_agent_core::Session;
3
4use crate::runtime::config::AgentLoopConfig;
5
6/// Result of prompt assembly.
7#[derive(Debug, Clone)]
8pub struct PromptAssemblyOutput {
9    pub effective_system_prompt: String,
10    pub skill_context: String,
11    pub tool_guide_context: String,
12}
13
14/// Manages system prompt assembly.
15///
16/// Responsible for composing the effective system prompt from base prompt,
17/// workspace context, instruction context, env context, skill context,
18/// tool guide, and external memory sections.
19#[async_trait]
20pub trait PromptManager: Send + Sync {
21    /// Assemble the full system prompt for the given session and config.
22    async fn assemble_prompt(
23        &self,
24        session: &mut Session,
25        config: &AgentLoopConfig,
26    ) -> PromptAssemblyOutput;
27
28    /// Refresh external memory injection into an existing system message.
29    async fn refresh_external_memory(&self, session: &mut Session, config: &AgentLoopConfig);
30
31    /// Refresh the task list section in the system prompt.
32    fn refresh_task_list(&self, session: &mut Session);
33}