@codewithdan/ai-repo-adventure-mcp
Version:
MCP server for AI-powered code repository exploration through interactive storytelling
44 lines (41 loc) ⢠1.67 kB
JavaScript
/**
* Shared utilities for MCP tools
*/
export function formatInitialResponse(projectInfo, isUsingConfig = false) {
const configMessage = isUsingConfig
? "\nšÆ Using adventure.config.json for guided exploration"
: "";
return `š **Welcome to AI Repo Adventures!**
You've discovered **${projectInfo.fileCount} files** of digital wisdom!${configMessage}
**Choose Your Adventure Theme:**
š **1. Space Exploration** - Navigate through cosmic codebases as a space explorer
š° **2. Mythical Kingdom** - Journey through magical realms of code
šļø **3. Ancient Civilization** - Explore mystical programming temples
š» **4. Developer Journey** - Modern tech-focused code exploration
*Next step: Use the 'choose_theme' tool with your preferred theme (1-4 or theme name)*`;
}
export function formatThemeResponse(story, questTitles) {
return {
theme_selected: true,
story,
available_quests: questTitles,
next_step: "Use the 'explore_quest' tool to begin your first quest"
};
}
export function formatQuestResponse(result) {
return {
quest_completed: true,
narrative: result.narrative,
files_explored: result.filesExplored,
progress: result.progress,
next_step: result.remainingQuests > 0
? "Use 'explore_quest' tool to continue your adventure or 'view_progress' to check your status"
: "Congratulations! You've completed all quests. Use 'view_progress' to see your final results."
};
}
export function formatProgressResponse(progress) {
return {
progress_summary: progress
};
}
//# sourceMappingURL=shared.js.map