UNPKG

vibe-coder-mcp

Version:

Production-ready MCP server with complete agent integration, multi-transport support, and comprehensive development automation tools for AI-assisted workflows.

77 lines (76 loc) 2.58 kB
export class AutoCompleter { tools = []; commands = [ '/help', '/quit', '/exit', '/clear', '/history', '/tools', '/status', '/export', '/save', '/load' ]; commonPhrases = [ 'research', 'create', 'generate', 'analyze', 'map', 'curate', 'list', 'show', 'explain', 'help me with', 'how to', 'what is', 'can you' ]; setTools(tools) { this.tools = tools; } setCommands(commands) { this.commands = commands; } complete(line) { const completions = []; const lowerLine = line.toLowerCase(); if (line.startsWith('/')) { completions.push(...this.commands.filter(cmd => cmd.toLowerCase().startsWith(lowerLine))); } else { const words = line.split(' '); const lastWord = words[words.length - 1].toLowerCase(); if (words.length === 1) { completions.push(...this.commonPhrases.filter(phrase => phrase.toLowerCase().startsWith(lastWord))); } if (line.includes('use') || line.includes('run') || line.includes('execute')) { completions.push(...this.tools.filter(tool => tool.toLowerCase().includes(lastWord))); } if (lowerLine.includes('research')) { completions.push('research TypeScript best practices', 'research React hooks', 'research Node.js performance'); } else if (lowerLine.includes('generate')) { completions.push('generate PRD', 'generate user stories', 'generate task list', 'generate rules'); } else if (lowerLine.includes('create')) { completions.push('create fullstack app', 'create React component', 'create API endpoint'); } else if (lowerLine.includes('map')) { completions.push('map codebase', 'map dependencies', 'map architecture'); } } const uniqueCompletions = [...new Set(completions)].sort(); return [uniqueCompletions, line]; } getSuggestions() { return [ 'Try: "research [topic]" to search for information', 'Try: "generate PRD for [product]" to create requirements', 'Try: "map codebase" to analyze code structure', 'Try: "/help" to see all commands', 'Try: "/tools" to list available tools' ]; } }