@nbiish/cognitive-tools-mcp 8.9.3 → 8.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +39 -37
  2. package/build/index.js +84 -373
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,9 @@
22
22
  ◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
23
23
  </div>
24
24
 
25
- Revolutionary MCP server with Enhanced 2-Round, 6-Stage Cognitive Deliberation Framework (v8.9.2). The `deliberate` tool implements an **advanced guided notepad** approach with **dynamic prompting strategy evaluation from modern-prompting.mdc** - featuring **MINIMAL filler verbiage** and **maximum LLM freedom** accepting only `input` and `context` parameters. *(Integration guidelines in [`latest.md`](latest.md) are licensed under [LICENSE](LICENSE).)*
25
+ Revolutionary MCP server with Enhanced 2-Round, 6-Stage Cognitive Deliberation Framework (v8.9.6). The `deliberate` tool implements an **LLM-guided cognitive enhancement framework** that prompts LLMs to evaluate and select from **15 modern cognitive techniques** using a **0.00-0.99 scoring system** with **≥1.53 threshold rule** - accepting only `input` and `context` parameters. *(Integration guidelines in [`latest.md`](latest.md) are licensed under [LICENSE](LICENSE).)*
26
+
27
+ **🚀 MAJOR BREAKTHROUGH (v8.9.6):** Complete architectural transformation from hardcoded `CognitiveDeliberationEngine` to LLM-guided `DeliberationEngine`. The tool now functions as a **cognitive framework enhancer** that prompts LLMs to evaluate techniques themselves rather than providing pre-calculated scores, enabling true adaptive reasoning.
26
28
 
27
29
  Known as:
28
30
  - Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
@@ -38,7 +40,7 @@ Both packages are maintained in parallel and receive the same updates. You can u
38
40
 
39
41
  ## ᐴ REPOSITORY STRUCTURE ᔔ [MAZINAAZIWIN] ◈──◆──◇──◆──◈
40
42
 
41
- Current repository structure (v8.9.2):
43
+ Current repository structure (v8.9.6):
42
44
 
43
45
  ```text
44
46
  .
@@ -76,33 +78,33 @@ Current repository structure (v8.9.2):
76
78
 
77
79
  ## ᐴ GASHKITOONAN ᔔ [ENHANCED CAPABILITIES] ◈──◆──◇──◆──◈
78
80
 
79
- ### 🚀 Revolutionary 2-Round, 6-Stage Cognitive Framework (v8.9.2)
81
+ ### 🚀 Revolutionary LLM-Guided Cognitive Framework (v8.9.6)
82
+
83
+ **NEW IN v8.9.6: COMPLETE ARCHITECTURAL TRANSFORMATION**
84
+
85
+ - **LLM-Guided Evaluation:** Tool prompts LLMs to evaluate cognitive techniques rather than providing hardcoded scores
86
+ - **True Adaptive Reasoning:** No pre-calculated evaluations - LLMs determine optimal strategies dynamically
87
+ - **15 Modern Cognitive Techniques:** Complete prompting strategy arsenal from Cache-Augmented Reasoning to Multimodal Synthesis
88
+ - **0.00-0.99 Scoring Framework:** LLMs evaluate solution level + efficiency level with ≥1.53 threshold rule
89
+ - **Iterative Enhancement:** Built-in guidance to return to deliberate after tool usage for continuous improvement
80
90
 
81
- **NEW IN v8.9.2: ADVANCED GUIDED NOTEPAD APPROACH**
91
+ **Revolutionary LLM-Guidance Architecture:**
82
92
 
83
- - **LLM Freedom:** Tool accepts only `input` and `context` - no mode parameter needed
84
- - **Zero Filler Verbiage:** No formatting constraints, headers, or verbose output
85
- - **Dynamic Strategy Selection:** Evaluates modern-prompting.mdc strategies with 0.00-1.00 rating system
86
- - **Auto-Mode Detection:** Automatically determines analyze/decide/synthesize/evaluate approach
87
- - **Pure Cognitive Output:** Raw cognitive processing results for maximum LLM flexibility
93
+ **Framework Delivery Phase:**
88
94
 
89
- **2-Round Processing Architecture:**
95
+ - **6-Stage Structure Presentation** - Complete deliberation framework with critical thinking questions
96
+ - **Cognitive Technique Catalog** - All 15 modern prompting strategies for LLM evaluation
97
+ - **Scoring Instructions** - Clear 0.00-0.99 evaluation criteria with threshold-based selection rules
90
98
 
91
- **Round 1: Foundation Building**
92
- - **Stage 1: Scientific Investigation** - Systematic hypothesis formation with scientific method
93
- - **Stage 2: Initial OOReD** - Multiple reasoning path exploration with Tree-of-Thoughts
99
+ **LLM Processing Phase:**
94
100
 
95
- **Round 2: Refinement & Action**
96
- - **Stage 3: Critical Thinking + Pre-Act** - 10-step framework with tool identification
97
- - **Stage 4: Scientific Review** - Cross-validation of investigation findings
98
- - **Stage 5: OOReD Review** - Multi-path reasoning refinement
99
- - **Stage 6: Final Action** - Comprehensive synthesis with actionable recommendations
101
+ - **Dynamic Technique Selection** - LLM evaluates and scores techniques based on specific problem context
102
+ - **Strategy Combination** - Multiple techniques used when scoring ≥1.53 for enhanced effectiveness
103
+ - **Tool Planning Integration** - Recommendations for tool usage count and re-deliberation timing
104
+ - **Adaptive Implementation** - LLM applies selected cognitive approaches to actual problem solving
100
105
 
101
- **Dynamic Strategy Integration:**
102
- - Evaluates all modern-prompting.mdc strategies during Orient stage
103
- - Assigns solution level (0.00-0.99) + efficiency level (0.00-0.99) ratings
104
- - Uses strategies with combined rating ≥1.42 (combines multiple if ≥1.53)
105
- - Includes natural "tool use before re-deliberation: X" count in output
106
+ **Core Innovation:**
107
+ This breakthrough enables LLMs to **meta-cognitively select** their own reasoning approaches rather than following pre-determined paths, resulting in truly adaptive and context-appropriate problem solving.
106
108
 
107
109
  <div align="center">
108
110
  ◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
@@ -110,33 +112,33 @@ Current repository structure (v8.9.2):
110
112
 
111
113
  ## ᐴ APITENDAAGOZIJIG ᔔ [PERFORMANCE METRICS] ◈──◆──◇──◆──◈
112
114
 
113
- - **Dynamic Strategy Selection:** Evaluates 15+ modern prompting strategies with quantitative rating
114
- - **2-Round Processing:** Foundation building + refinement for comprehensive analysis
115
- - **Enhanced Reliability:** Multi-stage validation reduces cognitive errors significantly
116
- - **Maximum LLM Freedom:** Zero formatting constraints allow natural AI expression
117
- - **Tool Integration:** Natural count suggestions for optimal re-deliberation timing
115
+ - **LLM-Guided Evaluation:** Prompts LLMs to evaluate and score 15+ cognitive techniques dynamically
116
+ - **True Adaptive Reasoning:** No hardcoded evaluations - strategies selected based on problem context
117
+ - **Meta-Cognitive Enhancement:** LLMs learn to select their own optimal reasoning approaches
118
+ - **Iterative Improvement:** Built-in guidance for tool usage and re-deliberation cycles
119
+ - **Threshold-Based Selection:** ≥1.53 scoring rule ensures quality technique combination
118
120
 
119
121
  <div align="center">
120
122
  ◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
121
123
  </div>
122
124
 
123
- ## 🚀 Advanced Guided Notepad Approach (v8.9.2)
125
+ ## 🚀 LLM-Guided Cognitive Enhancement Framework (v8.9.6)
124
126
 
125
- This revolutionary update transforms the deliberation tool into an "advanced guided notepad" that provides cognitive enhancement without constraining AI creativity.
127
+ This revolutionary update transforms the deliberation tool from a hardcoded evaluation system into an **LLM-guided cognitive enhancement framework** that enables true adaptive reasoning.
126
128
 
127
129
  ### Core Innovation
128
130
 
129
- **Pure Cognitive Processing:** The tool now provides generations of cognitive techniques as "hints" to process thoughts better, backed by research and rigor, while allowing LLMs complete freedom in output construction.
131
+ **Meta-Cognitive Selection:** The tool now prompts LLMs to evaluate and select cognitive techniques themselves using a structured 0.00-0.99 scoring system, enabling context-appropriate strategy selection rather than pre-determined approaches.
130
132
 
131
133
  ### Processing Architecture
132
134
 
133
- 1. **Input Analysis:** Auto-determines optimal cognitive processing approach (analyze/decide/synthesize/evaluate)
134
- 2. **Round 1:** Scientific Investigation + Initial OOReD (internal cognitive processing)
135
- 3. **Round 2:** Critical Thinking + Reviews + Final Action (internal cognitive processing)
136
- 4. **Strategy Selection:** Evaluates modern-prompting.mdc techniques with quantitative ratings
137
- 5. **Output:** Concise cognitive results + tool usage recommendations
135
+ 1. **Framework Presentation:** Delivers complete 6-stage deliberation structure with critical thinking questions
136
+ 2. **Technique Catalog:** Presents all 15 modern cognitive techniques for LLM evaluation
137
+ 3. **Scoring Framework:** Guides LLM through solution level + efficiency level evaluation (≥1.53 threshold)
138
+ 4. **Dynamic Selection:** LLM chooses optimal techniques based on specific problem requirements
139
+ 5. **Implementation Guidance:** Provides tool usage recommendations and re-deliberation encouragement
138
140
 
139
- This approach enables LLMs to leverage advanced cognitive frameworks while maintaining their natural problem-solving flow!
141
+ This breakthrough enables LLMs to **learn and adapt their own reasoning approaches** while leveraging advanced cognitive frameworks for enhanced problem-solving capabilities!
140
142
 
141
143
  <div align="center">
142
144
  ◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
package/build/index.js CHANGED
@@ -65,375 +65,94 @@ const PROMPTING_STRATEGIES = {
65
65
  type: "advanced"
66
66
  }
67
67
  };
68
- class CognitiveDeliberationEngine {
69
- // Stage 1: Scientific Investigation
70
- performScientificInvestigation(input, context) {
71
- return `## Scientific Investigation Framework
72
-
73
- **1. Identify Question:** ${this.extractCoreQuestion(input)}
74
-
75
- **2. Form Hypothesis:** ${this.formHypothesis(input, context)}
76
-
77
- **3. Experimental Design:** ${this.designApproach(input, context)}
78
-
79
- **4. Data Analysis Framework:** ${this.establishAnalysisFramework(input)}
80
-
81
- **5. Conclusion Preparation:** ${this.prepareConclusions(input)}`;
82
- }
83
- // Stage 2: Initial OOReD
84
- performInitialOOReD(input, selectedStrategies, context) {
85
- return `## Initial OOReD Process
86
-
87
- **Observe:** Input complexity analysis reveals ${this.analyzeComplexity(input)}. Context depth: ${context ? 'comprehensive' : 'minimal'}. Task characteristics: ${this.identifyTaskType(input)}.
88
-
89
- **Orient:** Solution pathway identification using ${selectedStrategies.join(', ')} strategies. Primary approach: ${this.identifyPrimaryApproach(input, selectedStrategies)}.
90
-
91
- **Reason:** Core reasoning foundation: ${this.establishReasoning(input, selectedStrategies, context)}.
92
-
93
- **Decide:** Action framework: ${this.decideActions(input, context)}`;
94
- }
95
- // Stage 3: Critical Thinking
96
- performCriticalThinking(input, context) {
97
- return `## Critical Thinking Framework
98
-
99
- 1. **Purpose:** ${this.identifyPurpose(input)}
100
- 2. **Precise Question:** ${this.refineQuestion(input)}
101
- 3. **Operating Context:** ${this.establishContext(input, context)}
102
- 4. **Information Needs:** ${this.identifyInformationNeeds(input)}
103
- 5. **Credibility Assessment:** ${this.assessCredibility(input, context)}
104
- 6. **Relevant Concepts:** ${this.identifyRelevantConcepts(input)}
105
- 7. **Preliminary Conclusions:** ${this.drawPreliminaryConclusions(input)}
106
- 8. **Assumptions Analysis:** ${this.analyzeAssumptions(input)}
107
- 9. **Implications:** ${this.identifyImplications(input)}
108
- 10. **Consequences:** ${this.assessConsequences(input)}
109
-
110
- **Pre-Action Tool Planning:** ${this.planToolUsage(input)}`;
111
- }
112
- // Stage 4: Scientific Review
113
- performScientificReview(input, round1Results, context) {
114
- return `## Scientific Review Process
115
-
116
- **Question Validation:** ${this.validateQuestion(input, round1Results)}
117
-
118
- **Hypothesis Refinement:** ${this.refineHypothesis(input, round1Results)}
119
-
120
- **Methodology Assessment:** ${this.assessMethodology(round1Results)}
121
-
122
- **Evidence Evaluation:** ${this.evaluateEvidence(input, context, round1Results)}
123
-
124
- **Conclusion Verification:** ${this.verifyConclusions(round1Results)}`;
125
- }
126
- // Stage 5: OOReD Review
127
- performOOReD_Review(input, round1Results, selectedStrategies, context) {
128
- return `## OOReD Review Process
129
-
130
- **Enhanced Observation:** ${this.enhanceObservation(input, round1Results)}
131
-
132
- **Strategic Reorientation:** ${this.reorient(input, round1Results, selectedStrategies)}
133
-
134
- **Advanced Reasoning:** ${this.advancedReasoning(input, context, round1Results, selectedStrategies)}
135
-
136
- **Final Decision Framework:** ${this.finalDecisionFramework(input, round1Results)}`;
137
- }
138
- // Stage 6: Final Action
139
- performFinalAction(input, allResults, selectedStrategies, context) {
140
- const toolCount = this.calculateToolUsage(input, allResults);
141
- return `## Final Action Synthesis
142
-
143
- **Comprehensive Solution:** ${this.synthesizeSolution(input, context, allResults, selectedStrategies)}
144
-
145
- **Implementation Pathway:** ${this.createImplementationPath(input, allResults)}
146
-
147
- **Verification Framework:** ${this.establishVerification(input, allResults)}
148
-
149
- **Success Metrics:** ${this.defineSuccessMetrics(input, allResults)}
150
-
151
- **Fact-Based Recommendations:** ${this.generateRecommendations(input, context, allResults, selectedStrategies)}
152
-
153
- **tool use before re-deliberation: ${toolCount}**`;
154
- }
155
- // Strategy evaluation system
156
- evaluatePromptingStrategies(input, context) {
157
- const scores = [];
158
- for (const [strategyName, strategy] of Object.entries(PROMPTING_STRATEGIES)) {
159
- const solutionLevel = this.calculateSolutionLevel(input, context, strategy);
160
- const efficiencyLevel = this.calculateEfficiencyLevel(input, strategy);
161
- const totalScore = solutionLevel + efficiencyLevel;
162
- scores.push({
163
- strategy: strategyName,
164
- solutionLevel: parseFloat(solutionLevel.toFixed(2)),
165
- efficiencyLevel: parseFloat(efficiencyLevel.toFixed(2)),
166
- totalScore: parseFloat(totalScore.toFixed(2)),
167
- reasoning: this.generateStrategyReasoning(input, strategy, solutionLevel, efficiencyLevel)
168
- });
169
- }
170
- return scores.sort((a, b) => b.totalScore - a.totalScore);
171
- }
172
- calculateSolutionLevel(input, context, strategy) {
173
- let score = 0.1; // Base score
174
- // Complexity analysis
175
- const complexity = this.analyzeInputComplexity(input);
176
- if (complexity === 'high' && strategy.type === 'advanced')
177
- score += 0.3;
178
- if (complexity === 'medium' && strategy.type === 'primary')
179
- score += 0.25;
180
- if (complexity === 'low')
181
- score += 0.2;
182
- // Task type matching
183
- const taskType = this.identifyTaskType(input);
184
- if (taskType === 'computational' && strategy.description.includes('code'))
185
- score += 0.25;
186
- if (taskType === 'analytical' && strategy.description.includes('reasoning'))
187
- score += 0.2;
188
- if (taskType === 'creative' && strategy.description.includes('synthesis'))
189
- score += 0.15;
190
- // Context utilization
191
- if (context && strategy.description.includes('context'))
192
- score += 0.15;
193
- return Math.min(score, 0.99);
194
- }
195
- calculateEfficiencyLevel(input, strategy) {
196
- let score = 0.1; // Base score
197
- // Processing efficiency
198
- if (strategy.type === 'primary')
199
- score += 0.3; // Primary strategies are more efficient
200
- if (strategy.description.includes('concise'))
201
- score += 0.2;
202
- if (strategy.description.includes('minimal'))
203
- score += 0.15;
204
- // Input length consideration
205
- const inputLength = input.length;
206
- if (inputLength < 200 && !strategy.description.includes('complex'))
207
- score += 0.2;
208
- if (inputLength > 1000 && strategy.description.includes('compression'))
209
- score += 0.25;
210
- // Scalability factors
211
- if (strategy.description.includes('parallel'))
212
- score += 0.1;
213
- if (strategy.description.includes('iterative'))
214
- score -= 0.05; // Slightly less efficient
215
- return Math.min(score, 0.99);
216
- }
217
- generateStrategyReasoning(input, strategy, solutionLevel, efficiencyLevel) {
218
- const taskType = this.identifyTaskType(input);
219
- const complexity = this.analyzeInputComplexity(input);
220
- return `${taskType} task with ${complexity} complexity. Strategy alignment: ${solutionLevel > 0.6 ? 'high' : solutionLevel > 0.4 ? 'medium' : 'low'}. Efficiency rating: ${efficiencyLevel > 0.6 ? 'optimal' : efficiencyLevel > 0.4 ? 'adequate' : 'limited'}.`;
221
- }
222
- // Core cognitive processing method
223
- async performCognitiveDeliberation(input, context) {
224
- // Strategy evaluation
225
- const strategyScores = this.evaluatePromptingStrategies(input, context);
226
- const selectedStrategies = strategyScores
227
- .filter(s => s.totalScore >= 1.42)
228
- .slice(0, strategyScores.filter(s => s.totalScore >= 1.53).length > 1 ? 3 : 1)
229
- .map(s => s.strategy);
230
- if (selectedStrategies.length === 0) {
231
- selectedStrategies.push(strategyScores[0].strategy); // Fallback to highest scoring
232
- }
233
- // Round 1: Stages 1-2
234
- const stage1 = this.performScientificInvestigation(input, context);
235
- const stage2 = this.performInitialOOReD(input, selectedStrategies, context);
236
- const round1Results = `${stage1}\n\n${stage2}`;
237
- // Round 2: Stages 3-6
238
- const stage3 = this.performCriticalThinking(input, context);
239
- const stage4 = this.performScientificReview(input, round1Results, context);
240
- const stage5 = this.performOOReD_Review(input, round1Results, selectedStrategies, context);
241
- const stage6 = this.performFinalAction(input, `${round1Results}\n\n${stage3}\n\n${stage4}\n\n${stage5}`, selectedStrategies, context);
242
- // Final compilation
243
- return `# Cognitive Deliberation Results
244
-
245
- ## Round 1: Foundation
246
- ${round1Results}
247
-
248
- ## Round 2: Advanced Processing
249
- ${stage3}
250
-
251
- ${stage4}
252
-
253
- ${stage5}
254
-
255
- ${stage6}
256
-
257
- ## Strategy Evaluation Summary
258
- **Selected Strategies:** ${selectedStrategies.join(', ')}
259
- **Evaluation Results:** ${strategyScores.slice(0, 3).map(s => `${s.strategy}: ${s.totalScore}`).join(', ')}`;
260
- }
261
- // Helper methods for cognitive processing
262
- extractCoreQuestion(input) {
263
- // Extract the fundamental question or problem from input
264
- const questionMarkers = ['?', 'how', 'what', 'why', 'when', 'where', 'which'];
265
- const hasQuestion = questionMarkers.some(marker => input.toLowerCase().includes(marker));
266
- if (hasQuestion) {
267
- return `Direct question identified in input requiring systematic investigation.`;
268
- }
269
- else {
270
- return `Implicit problem requiring question formulation: What is the optimal approach to address the stated requirements?`;
271
- }
272
- }
273
- formHypothesis(input, context) {
274
- const taskType = this.identifyTaskType(input);
275
- return `Based on ${taskType} task characteristics${context ? ' and provided context' : ''}, hypothesis: The solution requires systematic application of appropriate cognitive frameworks to achieve optimal results.`;
276
- }
277
- designApproach(input, context) {
278
- return `Multi-stage cognitive processing with strategy selection, iterative refinement, and verification protocols.`;
279
- }
280
- establishAnalysisFramework(input) {
281
- return `Qualitative analysis of reasoning coherence, quantitative assessment of solution completeness, validation against success criteria.`;
282
- }
283
- prepareConclusions(input) {
284
- return `Synthesis framework ready for evidence-based conclusions with confidence calibration and uncertainty quantification.`;
285
- }
286
- analyzeComplexity(input) {
287
- if (input.length > 1000)
288
- return 'high cognitive load with multi-faceted requirements';
289
- if (input.length > 500)
290
- return 'moderate complexity requiring structured approach';
291
- return 'manageable complexity with clear pathway identification';
292
- }
293
- identifyTaskType(input) {
294
- const codePatterns = ['code', 'function', 'class', 'method', 'algorithm', 'programming'];
295
- const analyticalPatterns = ['analyze', 'evaluate', 'compare', 'assess', 'examine'];
296
- const creativePatterns = ['design', 'create', 'generate', 'build', 'develop'];
297
- const decisionPatterns = ['choose', 'decide', 'select', 'recommend', 'determine'];
298
- const lowerInput = input.toLowerCase();
299
- if (codePatterns.some(p => lowerInput.includes(p)))
300
- return 'computational';
301
- if (analyticalPatterns.some(p => lowerInput.includes(p)))
302
- return 'analytical';
303
- if (creativePatterns.some(p => lowerInput.includes(p)))
304
- return 'creative';
305
- if (decisionPatterns.some(p => lowerInput.includes(p)))
306
- return 'decision-making';
307
- return 'general-purpose';
308
- }
309
- identifyPrimaryApproach(input, strategies) {
310
- return `${strategies[0]} as primary framework with ${strategies.length > 1 ? 'secondary strategies integrated' : 'focused application'}`;
311
- }
312
- establishReasoning(input, strategies, context) {
313
- return `Multi-strategy reasoning utilizing ${strategies.join(' and ')} approaches for comprehensive solution development${context ? ' with contextual grounding' : ''}.`;
314
- }
315
- decideActions(input, context) {
316
- const toolTypes = ['websearch', 'file manipulation', 'code analysis', 'context synthesis'];
317
- return `Action sequence prioritizing ${toolTypes.slice(0, 2).join(' and ')} based on input requirements.`;
318
- }
319
- identifyPurpose(input) {
320
- return `Primary purpose: Address the core requirements while optimizing for solution quality and implementation feasibility.`;
321
- }
322
- refineQuestion(input) {
323
- return `Refined question: How can the stated objectives be achieved most effectively using available cognitive and technical resources?`;
324
- }
325
- establishContext(input, context) {
326
- return `Operating within ${context ? 'provided contextual framework' : 'general problem-solving context'} with emphasis on practical implementation.`;
327
- }
328
- identifyInformationNeeds(input) {
329
- const needsAnalysis = input.length > 500 ? 'comprehensive domain knowledge' : 'targeted information';
330
- return `Information requirements: ${needsAnalysis}, validation sources, and implementation guidelines.`;
331
- }
332
- assessCredibility(input, context) {
333
- return `Credibility assessment: Input source${context ? ' and context' : ''} evaluated for reliability and completeness. Verification protocols established.`;
334
- }
335
- identifyRelevantConcepts(input) {
336
- return `Key concepts: Domain-specific knowledge, methodological frameworks, implementation patterns, and optimization strategies.`;
337
- }
338
- drawPreliminaryConclusions(input) {
339
- return `Preliminary assessment indicates systematic approach required with iterative refinement and validation checkpoints.`;
340
- }
341
- analyzeAssumptions(input) {
342
- return `Key assumptions: Solution feasibility, resource availability, and standard implementation patterns apply.`;
343
- }
344
- identifyImplications(input) {
345
- return `Solution implications: Systematic implementation required with quality assurance and performance optimization considerations.`;
346
- }
347
- assessConsequences(input) {
348
- return `Implementation consequences: Positive outcomes expected with proper execution, minimal risks with appropriate safeguards.`;
349
- }
350
- planToolUsage(input) {
351
- const toolCount = this.calculateToolUsage(input, '');
352
- return `Tool usage plan: ${toolCount} tools anticipated for comprehensive solution development including websearch, file operations, and analysis tools.`;
353
- }
354
- calculateToolUsage(input, results) {
355
- // Calculate recommended tool usage based on complexity and requirements
356
- let toolCount = 1; // Minimum
357
- const complexity = this.analyzeInputComplexity(input);
358
- if (complexity === 'high')
359
- toolCount += 3;
360
- else if (complexity === 'medium')
361
- toolCount += 2;
362
- else
363
- toolCount += 1;
364
- const taskType = this.identifyTaskType(input);
365
- if (taskType === 'computational')
366
- toolCount += 2;
367
- if (taskType === 'analytical')
368
- toolCount += 1;
369
- if (input.length > 1000)
370
- toolCount += 1;
371
- if (results.length > 2000)
372
- toolCount += 1;
373
- return Math.min(toolCount, 7); // Cap at 7 tools
374
- }
375
- analyzeInputComplexity(input) {
376
- if (input.length > 1000)
377
- return 'high';
378
- if (input.length > 500)
379
- return 'medium';
380
- return 'low';
381
- }
382
- // Stage 4-6 helper methods
383
- validateQuestion(input, round1Results) {
384
- return `Question validation confirms alignment between initial problem identification and cognitive processing results.`;
385
- }
386
- refineHypothesis(input, round1Results) {
387
- return `Hypothesis refinement based on initial processing confirms systematic approach validity with enhanced precision.`;
388
- }
389
- assessMethodology(round1Results) {
390
- return `Methodology assessment indicates appropriate framework selection and implementation pathway optimization.`;
391
- }
392
- evaluateEvidence(input, context, round1Results) {
393
- return `Evidence evaluation confirms reasoning coherence and solution pathway validity${context ? ' with contextual validation' : ''}.`;
394
- }
395
- verifyConclusions(round1Results) {
396
- return `Conclusion verification establishes logical consistency and implementation feasibility across all processing stages.`;
397
- }
398
- enhanceObservation(input, round1Results) {
399
- return `Enhanced observation integrating initial findings with critical thinking framework results for comprehensive understanding.`;
400
- }
401
- reorient(input, round1Results, strategies) {
402
- return `Strategic reorientation utilizing ${strategies.join(' and ')} approaches for optimized solution development.`;
403
- }
404
- advancedReasoning(input, context, round1Results, strategies) {
405
- return `Advanced reasoning synthesis combining ${strategies.length} selected strategies with comprehensive validation protocols.`;
406
- }
407
- finalDecisionFramework(input, round1Results) {
408
- return `Final decision framework established with clear implementation priorities and success verification methods.`;
409
- }
410
- synthesizeSolution(input, context, allResults, strategies) {
411
- return `Comprehensive solution synthesis utilizing ${strategies.join(', ')} strategies for optimal implementation approach${context ? ' within provided contextual framework' : ''}.`;
412
- }
413
- createImplementationPath(input, allResults) {
414
- return `Implementation pathway: systematic execution with iterative validation, quality assurance checkpoints, and optimization opportunities.`;
415
- }
416
- establishVerification(input, allResults) {
417
- return `Verification framework: solution completeness validation, performance assessment, and success criteria confirmation.`;
418
- }
419
- defineSuccessMetrics(input, allResults) {
420
- return `Success metrics: solution quality, implementation efficiency, requirement satisfaction, and stakeholder value delivery.`;
421
- }
422
- generateRecommendations(input, context, allResults, strategies) {
423
- const taskType = this.identifyTaskType(input);
424
- return `Fact-based recommendations: Proceed with ${taskType} implementation using ${strategies[0]} as primary approach. Execute systematic validation. Monitor performance indicators. Iterate based on feedback.`;
68
+ class DeliberationEngine {
69
+ deliberate(input, context) {
70
+ // Generate the deliberation framework that prompts the LLM to evaluate strategies itself
71
+ const availableStrategies = Object.entries(PROMPTING_STRATEGIES)
72
+ .map(([name, strategy]) => `**${name}** (${strategy.type}): ${strategy.description}`)
73
+ .join('\n');
74
+ return `DELIBERATION: You are now entering a 6-stage cognitive deliberation process. Please work through each stage systematically:
75
+
76
+ ## Stage 1: Scientific Investigation
77
+ **Your Task:** Analyze the following input using scientific methodology:
78
+ - **Input:** "${input}"
79
+ ${context ? `- **Context:** "${context}"` : ''}
80
+
81
+ **Please identify:**
82
+ 1. Core question/problem
83
+ 2. Initial hypothesis about the best approach
84
+ 3. What type of task this is (computational, reasoning, creative, analysis, planning, general)
85
+ 4. Task complexity level (low, medium, high)
86
+
87
+ ## Stage 2: OOReD Process - Strategy Evaluation
88
+ **Orient Stage:** You have access to these cognitive techniques:
89
+
90
+ ${availableStrategies}
91
+
92
+ **Your Evaluation Task:**
93
+ For each technique, consider:
94
+ - How well would this technique solve the specific problem? (Solution Level 0.00-0.99)
95
+ - How efficiently can this technique be applied here? (Efficiency Level 0.00-0.99)
96
+ - Total Score = Solution Level + Efficiency Level
97
+
98
+ **Selection Rule:** Choose techniques with total scores ≥1.53 for combined effectiveness
99
+
100
+ ## Stage 3: Critical Thinking Framework
101
+ Apply these questions:
102
+ 1. What is the purpose of my thinking?
103
+ 2. What precise question am I trying to answer?
104
+ 3. Within what context am I operating?
105
+ 4. What information do I need to gather?
106
+ 5. How reliable is this information?
107
+ 6. What concepts are relevant to my thinking?
108
+ 7. What conclusions can I draw?
109
+ 8. What assumptions am I making?
110
+ 9. What are the implications?
111
+ 10. What are the consequences?
112
+
113
+ ## Stage 4 & 5: Review Cycles
114
+ - Review your strategy selections against the ≥1.53 threshold
115
+ - Validate your reasoning approach
116
+ - Refine your methodology
117
+
118
+ ## Stage 6: Final Action Synthesis
119
+ **Present your analysis in this format:**
120
+
121
+ **Selected Cognitive Technique(s):** [List techniques scoring ≥1.53]
122
+
123
+ **Strategy Evaluation Results (0.00-0.99 scale):**
124
+ [Show your evaluations like:]
125
+ - TechniqueName: solution=X.XX, efficiency=Y.YY, total=Z.ZZ ✓ (if ≥1.53)
126
+
127
+ **Estimated Tools Needed:** [1-8 tools for implementation]
128
+
129
+ **Recommended Pair Programmer Tools:**
130
+ - websearch (for current information and validation)
131
+ - file manipulation tools (for code and document management)
132
+ - code analysis tools (for computational problem solving)
133
+ - context synthesis tools (for information integration)
134
+ - debugging and testing tools (for solution verification)
135
+
136
+ Return to 'deliberate' after using the following tools: [Your estimated tool count]
137
+
138
+ # To accomplish Task:
139
+ [Describe the task using your selected cognitive approach]
140
+
141
+ ---
142
+
143
+ **Now:** Apply your selected cognitive technique(s) to actually solve the original problem "${input}" using your enhanced reasoning framework.`;
425
144
  }
426
145
  }
427
146
  // MCP Server setup
428
147
  const server = new Server({
429
148
  name: "gikendaasowin-aabajichiganan-mcp",
430
- version: "8.9.1",
149
+ version: "8.9.4",
431
150
  }, {
432
151
  capabilities: {
433
152
  tools: {},
434
153
  },
435
154
  });
436
- const deliberationEngine = new CognitiveDeliberationEngine();
155
+ const deliberationEngine = new DeliberationEngine();
437
156
  // List available tools
438
157
  server.setRequestHandler(ListToolsRequestSchema, async () => {
439
158
  return {
@@ -463,12 +182,12 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
463
182
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
464
183
  const { name, arguments: args } = request.params;
465
184
  if (name === "deliberate") {
185
+ const { input, context } = args;
186
+ if (!input || typeof input !== "string") {
187
+ throw new Error("Input is required and must be a string");
188
+ }
466
189
  try {
467
- const { input, context } = args;
468
- if (!input || typeof input !== "string") {
469
- throw new Error("Input parameter is required and must be a string");
470
- }
471
- const result = await deliberationEngine.performCognitiveDeliberation(input, context);
190
+ const result = deliberationEngine.deliberate(input, context);
472
191
  return {
473
192
  content: [
474
193
  {
@@ -479,15 +198,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
479
198
  };
480
199
  }
481
200
  catch (error) {
482
- return {
483
- content: [
484
- {
485
- type: "text",
486
- text: `Error in cognitive deliberation: ${error instanceof Error ? error.message : String(error)}`,
487
- },
488
- ],
489
- isError: true,
490
- };
201
+ throw new Error(`Deliberation failed: ${error}`);
491
202
  }
492
203
  }
493
204
  throw new Error(`Unknown tool: ${name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbiish/cognitive-tools-mcp",
3
- "version": "8.9.3",
3
+ "version": "8.9.8",
4
4
  "description": "Revolutionary Single-Tool-Call MCP server with Enhanced 6-Stage Cognitive Deliberation Framework combining Scientific Investigation, OOReD, and Critical Thinking methodologies with DYNAMIC prompting strategy evaluation system (CoT, ToT, Self-Consistency, Meta-Prompting, Role-Based).",
5
5
  "private": false,
6
6
  "type": "module",