@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.
- package/README.md +39 -37
- package/build/index.js +84 -373
- 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.
|
|
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.
|
|
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
|
|
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
|
-
**
|
|
91
|
+
**Revolutionary LLM-Guidance Architecture:**
|
|
82
92
|
|
|
83
|
-
|
|
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
|
-
**
|
|
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
|
-
**
|
|
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
|
-
**
|
|
96
|
-
- **
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
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
|
-
**
|
|
102
|
-
-
|
|
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
|
-
- **
|
|
114
|
-
- **
|
|
115
|
-
- **
|
|
116
|
-
- **
|
|
117
|
-
- **
|
|
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
|
-
## 🚀
|
|
125
|
+
## 🚀 LLM-Guided Cognitive Enhancement Framework (v8.9.6)
|
|
124
126
|
|
|
125
|
-
This revolutionary update transforms the deliberation tool
|
|
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
|
-
**
|
|
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. **
|
|
134
|
-
2. **
|
|
135
|
-
3. **
|
|
136
|
-
4. **
|
|
137
|
-
5. **
|
|
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
|
|
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
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
**
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
**
|
|
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.
|
|
149
|
+
version: "8.9.4",
|
|
431
150
|
}, {
|
|
432
151
|
capabilities: {
|
|
433
152
|
tools: {},
|
|
434
153
|
},
|
|
435
154
|
});
|
|
436
|
-
const deliberationEngine = new
|
|
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
|
|
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
|
-
|
|
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
|
+
"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",
|