UNPKG

@andrebuzeli/advanced-memory-markdown-mcp

Version:

Advanced Memory Bank MCP v3.1.5 - Sistema avançado de gerenciamento de memória com isolamento de projetos por IDE, sincronização sob demanda, backup a cada 30min, apenas arquivos .md principais sincronizados, pasta reasoning temporária com limpeza automát

80 lines (79 loc) 2.95 kB
/** * Sequential Thinking - Clean version without file persistence * Processes structured problem analysis without creating JSON files */ import { VERSION } from '../version.js'; export class SequentialThinking { version = VERSION; constructor() { // No dependencies needed - pure in-memory processing } /** * Process a single thought in the sequential thinking chain * CLEAN VERSION: No file persistence, pure in-memory processing */ async processThought(thought, thoughtNumber, totalThoughts, nextThoughtNeeded, isRevision, revisesThought) { try { // Determine status based on progress let status = 'processing'; if (thoughtNumber === totalThoughts && !nextThoughtNeeded) { status = 'complete'; } else if (isRevision) { status = 'revising'; } else if (thoughtNumber > totalThoughts * 0.8) { status = 'concluding'; } return { thoughtNumber, totalThoughts, content: this.enhanceThought(thought, thoughtNumber, totalThoughts), status, nextThoughtNeeded, }; } catch (error) { throw new Error(`Sequential thinking failed: ${error instanceof Error ? error.message : String(error)}`); } } /** * Enhance thought with context and analysis */ enhanceThought(thought, thoughtNumber, totalThoughts) { const progress = (thoughtNumber / totalThoughts) * 100; const stage = this.getThoughtStage(thoughtNumber, totalThoughts); return `[${stage}] ${thought} **Progress:** ${progress.toFixed(1)}% (${thoughtNumber}/${totalThoughts}) **Stage Analysis:** ${this.getStageDescription(stage)}`; } /** * Determine the current stage of thinking */ getThoughtStage(thoughtNumber, totalThoughts) { const ratio = thoughtNumber / totalThoughts; if (ratio <= 0.2) return 'Problem Definition'; if (ratio <= 0.4) return 'Analysis'; if (ratio <= 0.6) return 'Solution Generation'; if (ratio <= 0.8) return 'Evaluation'; return 'Conclusion'; } /** * Get description for the current stage */ getStageDescription(stage) { const descriptions = { 'Problem Definition': 'Understanding and defining the core problem', 'Analysis': 'Breaking down the problem into components', 'Solution Generation': 'Developing potential solutions and approaches', 'Evaluation': 'Assessing solutions and their implications', 'Conclusion': 'Finalizing insights and recommendations' }; return descriptions[stage] || 'Processing current thought'; } } //# sourceMappingURL=sequential-thinking.js.map