diff --git a/server/src/router.rs b/server/src/router.rs index 14b97ab..20e1211 100644 --- a/server/src/router.rs +++ b/server/src/router.rs @@ -133,6 +133,60 @@ impl MemoryHandler { register_resource!(TasksActiveResource); register_prompt!(AnalyzeTechDebtPrompt); + struct PinnedFilesResource; + #[async_trait] + impl McpResource for PinnedFilesResource { + fn uri(&self) -> &'static str { "memory://pinned_files" } + fn name(&self) -> &'static str { "Pinned Files" } + fn description(&self) -> Option<&'static str> { Some("Currently pinned files in the workspace") } + async fn read(&self, state: Arc) -> Result { + let state_clone = Arc::clone(&state); + tokio::task::spawn_blocking(move || { + let items = state_clone.pinned_files.cache.read().unwrap(); + Ok(serde_json::to_string_pretty(&*items).unwrap_or_default()) + }).await.unwrap() + } + } + + struct MilestonesResource; + #[async_trait] + impl McpResource for MilestonesResource { + fn uri(&self) -> &'static str { "memory://milestones" } + fn name(&self) -> &'static str { "Milestones" } + fn description(&self) -> Option<&'static str> { Some("Project milestones and their status") } + async fn read(&self, state: Arc) -> Result { + let state_clone = Arc::clone(&state); + tokio::task::spawn_blocking(move || { + let items = state_clone.milestones.cache.read().unwrap(); + Ok(serde_json::to_string_pretty(&*items).unwrap_or_default()) + }).await.unwrap() + } + } + + struct HandoffRoutinePrompt; + #[async_trait] + impl McpPrompt for HandoffRoutinePrompt { + fn name(&self) -> &'static str { "handoff_routine" } + fn description(&self) -> Option<&'static str> { Some("Initiate the end-of-session handoff and standup report generation") } + async fn get(&self, _args: Value, _state: Arc) -> Result { + Ok(serde_json::json!({ + "messages": [ + { + "role": "user", + "content": { + "type": "text", + "text": "I am logging off. Please invoke the DevOpsSRE subagent to generate a standup report and leave a handoff memo for the next session. Make sure to check active tasks and recent code changes." + } + } + ] + })) + } + } + + register_resource!(PinnedFilesResource); + register_resource!(MilestonesResource); + register_prompt!(HandoffRoutinePrompt); + macro_rules! register { ($module:ident::$handler:ident) => {