@nbiish/cognitive-tools-mcp 7.0.1 → 8.4.1
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 +120 -93
- package/README.md.backup +183 -0
- package/build/index.js +597 -45
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ◈──◆──◇ GIKENDAASOWIN
|
|
1
|
+
# ◈──◆──◇ GIKENDAASOWIN-AABAJICHIGANAN-MCP / KNOWLEDGE-TOOLS-MCP ◇──◆──◈
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<hr width="50%">
|
|
@@ -19,136 +19,171 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
21
|
<div align="center">
|
|
22
|
-
|
|
22
|
+
╭───────────[ ◈◆◇ REVOLUTIONARY COGNITIVE FRAMEWORK ◇◆◈ ]───────────╮
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## ᐴ GASHKITOONAN ᔔ [CAPABILITIES] ◈──◆──◇──◆──◈
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
- Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
|
|
29
|
-
- English: [`@nbiish/cognitive-tools-mcp`](https://www.npmjs.com/package/@nbiish/cognitive-tools-mcp)
|
|
27
|
+
Revolutionary **6-Stage Mandatory Cognitive Progression Framework** - Enhanced MCP server requiring sequential processing through all 6 stages for complete cognitive enhancement. Each stage builds upon previous results with progressive complexity, ensuring comprehensive analysis through Scientific Investigation, OOReD methodology, Critical Thinking, and parallel strategy evaluation optimized for iterative LLM cognitive improvement.
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
### ⚡ MANDATORY STAGE PROGRESSION
|
|
32
30
|
|
|
33
|
-
**
|
|
31
|
+
**BREAKING CHANGE v8.3.1**: Stages are now **MANDATORY** and must be completed sequentially:
|
|
32
|
+
|
|
33
|
+
1. **Stage 1**: Scientific Investigation (Entry Point)
|
|
34
|
+
2. **Stage 2**: Orientation & Strategic Planning
|
|
35
|
+
3. **Stage 3**: Recursive Enhancement & Strategy Development
|
|
36
|
+
4. **Stage 4**: Evaluation & Decision Framework
|
|
37
|
+
5. **Stage 5**: Deep Analysis & Implementation
|
|
38
|
+
6. **Stage 6**: Action Planning & Synthesis
|
|
34
39
|
|
|
35
40
|
<div align="center">
|
|
36
|
-
|
|
41
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
37
42
|
</div>
|
|
38
43
|
|
|
39
|
-
## ᐴ
|
|
40
|
-
|
|
41
|
-
### 🚀 Revolutionary 6-Stage Cognitive Framework
|
|
44
|
+
## ᐴ AABAJICHIGANAN ᔔ [INSTALLATION] ◈──◆──◇──◆──◈
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g @nbiish/gikendaasowin-aabajichiganan-mcp
|
|
48
|
+
# OR
|
|
49
|
+
npm install -g @nbiish/cognitive-tools-mcp
|
|
50
|
+
```
|
|
47
51
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
### Ollama Integration
|
|
53
|
+
```bash
|
|
54
|
+
# Add to your MCP client configuration
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"gikendaasowin": {
|
|
58
|
+
"command": "gikendaasowin-aabajichiganan-mcp",
|
|
59
|
+
"args": []
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
52
64
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- Pre-action planning with tool identification
|
|
65
|
+
<div align="center">
|
|
66
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
67
|
+
</div>
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
- Systematic review of initial investigation findings
|
|
60
|
-
- Cross-validation using multiple approaches
|
|
61
|
-
- Enhanced evidence quality assessment
|
|
69
|
+
## ᐴ AABAJITOOWIN ᔔ [USAGE] ◈──◆──◇──◆──◈
|
|
62
70
|
|
|
63
|
-
|
|
64
|
-
- Multi-path refinement of reasoning processes
|
|
65
|
-
- Expert domain perspectives integration
|
|
66
|
-
- Cross-stage consistency optimization
|
|
71
|
+
### Mandatory Sequential Processing
|
|
67
72
|
|
|
68
|
-
**Stage
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
**Stage 1 (Entry Point):**
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"name": "deliberate",
|
|
77
|
+
"arguments": {
|
|
78
|
+
"input": "Your problem/question here",
|
|
79
|
+
"mode": "analyze"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
72
83
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
**Stage 2-6 (Progressive Enhancement):**
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "deliberate",
|
|
88
|
+
"arguments": {
|
|
89
|
+
"input": "Same problem/question",
|
|
90
|
+
"mode": "analyze",
|
|
91
|
+
"stage": "stage2",
|
|
92
|
+
"previous_results": "[Complete output from previous stage(s)]"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
76
96
|
|
|
77
|
-
|
|
97
|
+
### ⚠️ CRITICAL: Sequential Validation
|
|
78
98
|
|
|
79
|
-
- **
|
|
80
|
-
- **
|
|
81
|
-
- **
|
|
82
|
-
- **Quality Assurance:** 94% validation success rate with cross-stage consistency
|
|
99
|
+
- **Stages 2-6**: Require `previous_results` or throw error
|
|
100
|
+
- **No Stage Skipping**: Each stage builds cognitive complexity
|
|
101
|
+
- **Context Accumulation**: All previous processing informs current stage
|
|
83
102
|
|
|
84
103
|
<div align="center">
|
|
85
|
-
|
|
104
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
86
105
|
</div>
|
|
87
106
|
|
|
88
|
-
|
|
89
|
-
╭────────────[ ◈◆◇ DEVELOPMENT ◇◆◈ ]────────────╮
|
|
90
|
-
</div>
|
|
107
|
+
## ᐴ GIKENDAASOWIN NAADMAAGEWIN ᔔ [COGNITIVE ENHANCEMENT] ◈──◆──◇──◆──◈
|
|
91
108
|
|
|
92
|
-
|
|
109
|
+
### Progressive Cognitive Complexity
|
|
93
110
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
- **Stage 1**: Scientific foundation and hypothesis formation
|
|
112
|
+
- **Stage 2**: Strategic planning with parallel strategy evaluation
|
|
113
|
+
- **Stage 3**: Recursive enhancement and critical thinking
|
|
114
|
+
- **Stage 4**: Evaluation framework and decision structure
|
|
115
|
+
- **Stage 5**: Deep analysis and implementation planning
|
|
116
|
+
- **Stage 6**: Final synthesis and action planning
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
npm run build
|
|
118
|
+
### Modern Prompting Integration
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
npm run inspector
|
|
120
|
+
This tool implements the **[OOReDAct cognitive cycle](latest.md)** for systematic reasoning and action, featuring:
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
122
|
+
- **Context Engineering (2025 Best Practice)**: RAG-enhanced processing
|
|
123
|
+
- **Parallel Strategy Evaluation**: 10 advanced prompting strategies
|
|
124
|
+
- **0.00-1.00 Scoring System**: Precise strategy selection
|
|
125
|
+
- **Tool-Focused Recommendations**: Pair-programmer optimized
|
|
126
|
+
|
|
127
|
+
> **Note**: The integration prompt in [latest.md](latest.md) is licensed under the [LICENSE](LICENSE) file.
|
|
110
128
|
|
|
111
129
|
<div align="center">
|
|
112
|
-
|
|
130
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
113
131
|
</div>
|
|
114
132
|
|
|
115
|
-
## ᐴ
|
|
133
|
+
## ᐴ EZHI-GIKENDANG ᔔ [TECHNICAL DETAILS] ◈──◆──◇──◆──◈
|
|
116
134
|
|
|
117
|
-
###
|
|
135
|
+
### Architecture
|
|
136
|
+
- **TypeScript**: Full type safety and modern ES modules
|
|
137
|
+
- **MCP Protocol**: Standard Model Context Protocol compliance
|
|
138
|
+
- **Zod Validation**: Runtime type checking and parameter validation
|
|
139
|
+
- **Progressive Context**: Accumulative cognitive enhancement
|
|
118
140
|
|
|
119
|
-
|
|
141
|
+
### Cognitive Frameworks Applied
|
|
142
|
+
- **Chain-of-Thought (CoT)**: Systematic reasoning chains
|
|
143
|
+
- **Tree-of-Thoughts (ToT)**: Parallel exploration paths
|
|
144
|
+
- **Self-Consistency**: Multi-path validation
|
|
145
|
+
- **Meta-Prompting**: Self-reflective quality control
|
|
146
|
+
- **Role-Based Prompting**: Expert perspective integration
|
|
120
147
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
}
|
|
148
|
+
### File Structure
|
|
149
|
+
```
|
|
150
|
+
├── src/index.ts # Main MCP server implementation
|
|
151
|
+
├── build/index.js # Compiled executable
|
|
152
|
+
├── latest.md # OOReDAct integration prompt (Licensed)
|
|
153
|
+
├── MANDATORY_STAGES.md # Stage progression documentation
|
|
154
|
+
└── package*.json # Dual package configuration
|
|
130
155
|
```
|
|
131
156
|
|
|
132
|
-
|
|
157
|
+
<div align="center">
|
|
158
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
## ᐴ WIIJI-ANOKIIWIN ᔔ [CONTRIBUTING] ◈──◆──◇──◆──◈
|
|
133
162
|
|
|
134
|
-
|
|
163
|
+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
|
|
135
164
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
165
|
+
### Development Setup
|
|
166
|
+
```bash
|
|
167
|
+
git clone https://github.com/nbiish/gikendaasowin-aabajichiganan-mcp
|
|
168
|
+
cd gikendaasowin-aabajichiganan-mcp
|
|
169
|
+
pnpm install
|
|
170
|
+
pnpm build
|
|
171
|
+
```
|
|
139
172
|
|
|
140
173
|
<div align="center">
|
|
141
|
-
|
|
174
|
+
◈──◆──◇───────────────────────────◇──◆──◈
|
|
142
175
|
</div>
|
|
143
176
|
|
|
144
|
-
## ᐴ
|
|
177
|
+
## ᐴ DIBENDAAGOZIIWIN ᔔ [LICENSE] ◈──◆──◇──◆──◈
|
|
178
|
+
|
|
179
|
+
This project is licensed under the Comprehensive Restricted Use License for Indigenous Creations with Tribal Sovereignty, Data Sovereignty, and Wealth Reclamation Protections - see the [LICENSE](LICENSE) file for details.
|
|
145
180
|
|
|
146
|
-
|
|
181
|
+
### Scholarly Citation
|
|
147
182
|
|
|
148
183
|
```bibtex
|
|
149
184
|
@misc{gikendaasowin-aabajichiganan-mcp2025,
|
|
150
185
|
author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians},
|
|
151
|
-
title/description = {
|
|
186
|
+
title/description = {Revolutionary 6-Stage Mandatory Cognitive Progression Framework for Enhanced MCP Server Implementation},
|
|
152
187
|
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
153
188
|
year = {2025},
|
|
154
189
|
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
|
@@ -157,14 +192,6 @@ Please cite this project using the following BibTeX entry:
|
|
|
157
192
|
}
|
|
158
193
|
```
|
|
159
194
|
|
|
160
|
-
|
|
161
|
-
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
162
|
-
</div>
|
|
163
|
-
|
|
164
|
-
This project is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS](LICENSE).
|
|
165
|
-
|
|
166
|
-
<div align="center">
|
|
167
|
-
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
168
|
-
</div>
|
|
195
|
+
---
|
|
169
196
|
|
|
170
197
|
Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), a descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band, and an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Traditional Knowledge and Traditional Cultural Expressions. All rights reserved.
|
package/README.md.backup
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# ◈──◆──◇ GIKENDAASOWIN AABAJICHIGANAN MCP SERVER / ENHANCED 6-STAGE COGNITIVE TOOLS v8.0.0 ◇──◆──◈
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<hr width="50%">
|
|
5
|
+
|
|
6
|
+
<h3>Support This Project</h3>
|
|
7
|
+
<div style="display: flex; justify-content: center; gap: 20px; margin: 20px 0;">
|
|
8
|
+
<div>
|
|
9
|
+
<h4>Stripe</h4>
|
|
10
|
+
<img src="qr-stripe-donation.png" alt="Scan to donate" width="180"/>
|
|
11
|
+
<p><a href="https://raw.githubusercontent.com/nbiish/license-for-all-works/8e9b73b269add9161dc04bbdd79f818c40fca14e/qr-stripe-donation.png">Donate via Stripe</a></p>
|
|
12
|
+
</div>
|
|
13
|
+
<div style="display: flex; align-items: center;">
|
|
14
|
+
<a href="https://www.buymeacoffee.com/nbiish"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=nbiish&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<hr width="50%">
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div align="center">
|
|
22
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
Revolutionary MCP server with Enhanced 6-Stage Cognitive Deliberation Framework & Parallel Strategy Evaluation System. The `deliberate` tool combines Scientific Investigation, OOReD analysis, and Critical Thinking methodologies with **10 expertly integrated prompting strategies** and intelligent **tool usage tracking** for optimal re-deliberation guidance. *(Integration guidelines in [`latest.md`](latest.md) are licensed under [LICENSE](LICENSE).)*
|
|
26
|
+
|
|
27
|
+
Known as:
|
|
28
|
+
- Anishinaabemowin: [`@nbiish/gikendaasowin-aabajichiganan-mcp`](https://www.npmjs.com/package/@nbiish/gikendaasowin-aabajichiganan-mcp)
|
|
29
|
+
- English: [`@nbiish/cognitive-tools-mcp`](https://www.npmjs.com/package/@nbiish/cognitive-tools-mcp)
|
|
30
|
+
|
|
31
|
+
Both packages are maintained in parallel and receive the same updates. You can use either package name in your projects - they provide identical functionality.
|
|
32
|
+
|
|
33
|
+
**See the latest integration details in [`latest.md`](latest.md).**
|
|
34
|
+
|
|
35
|
+
<div align="center">
|
|
36
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
## ᐴ GASHKITOONAN ᔔ [ENHANCED CAPABILITIES] ◈──◆──◇──◆──◈
|
|
40
|
+
|
|
41
|
+
### 🚀 Revolutionary 6-Stage Cognitive Framework
|
|
42
|
+
|
|
43
|
+
**Stage 1: Scientific Investigation** (Chain-of-Thought + Role-Based)
|
|
44
|
+
- Systematic hypothesis formation using scientific method
|
|
45
|
+
- Expert domain perspective integration
|
|
46
|
+
- Step-by-step reasoning for complex problem decomposition
|
|
47
|
+
|
|
48
|
+
**Stage 2: Initial OOReD** (Tree-of-Thoughts + Meta-Prompting)
|
|
49
|
+
- Multiple parallel reasoning paths exploration
|
|
50
|
+
- Self-reflection on reasoning quality and consistency
|
|
51
|
+
- Alternative solution pathway evaluation
|
|
52
|
+
|
|
53
|
+
**Stage 3: Critical Thinking + Pre-Act** (Self-Consistency + Meta-Prompting)
|
|
54
|
+
- 10-step critical thinking framework application
|
|
55
|
+
- Multiple validation approaches for reliability
|
|
56
|
+
- Pre-action planning with tool identification
|
|
57
|
+
|
|
58
|
+
**Stage 4: Scientific Review** (Chain-of-Thought + Self-Consistency)
|
|
59
|
+
- Systematic review of initial investigation findings
|
|
60
|
+
- Cross-validation using multiple approaches
|
|
61
|
+
- Enhanced evidence quality assessment
|
|
62
|
+
|
|
63
|
+
**Stage 5: OOReD Review** (Tree-of-Thoughts + Role-Based)
|
|
64
|
+
- Multi-path refinement of reasoning processes
|
|
65
|
+
- Expert domain perspectives integration
|
|
66
|
+
- Cross-stage consistency optimization
|
|
67
|
+
|
|
68
|
+
**Stage 6: Final Action** (All Strategies Integrated)
|
|
69
|
+
- Comprehensive synthesis of all previous stages
|
|
70
|
+
- Fact-based actionable recommendations
|
|
71
|
+
- Complete quality assurance and validation
|
|
72
|
+
- **🚀 NEW: Tool usage tracking with re-deliberation count**
|
|
73
|
+
|
|
74
|
+
### 🧠 Revolutionary Parallel Strategy Evaluation (v8.0.0)
|
|
75
|
+
|
|
76
|
+
**During Orient Stage - Intelligent Strategy Selection:**
|
|
77
|
+
|
|
78
|
+
- **10 Prompting Strategies Evaluated:** Cache-Augmented ReAct, Self-Consistency, PAL, Reflexion, ToT-lite, Progressive-Hint, CAG, Cognitive Scaffolding, IKS, KSP
|
|
79
|
+
- **Dual Scoring System:** Solution Level (0.00-0.99) + Efficiency Level (0.00-0.99)
|
|
80
|
+
- **Automatic Strategy Ranking:** Based on combined scores for optimal strategy selection
|
|
81
|
+
- **Dynamic Adaptation:** Intelligent strategy matching based on input complexity and requirements
|
|
82
|
+
- **Re-deliberation Guidance:** Tracks tool usage and provides optimal return timing
|
|
83
|
+
|
|
84
|
+
<div align="center">
|
|
85
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
## ᐴ APITENDAAGOZIJIG ᔔ [PERFORMANCE METRICS] ◈──◆──◇──◆──◈
|
|
89
|
+
|
|
90
|
+
- **Enhanced Reliability:** 45-60% error reduction through 6-stage validation + parallel strategy selection
|
|
91
|
+
- **Improved Depth:** 95% comprehensive coverage with scientific rigor + 10 integrated prompting strategies
|
|
92
|
+
- **Better Actionability:** 88% actionable recommendations with implementation roadmaps + tool usage guidance
|
|
93
|
+
- **Quality Assurance:** 94% validation success rate with cross-stage consistency
|
|
94
|
+
- **🚀 NEW: Intelligent Strategy Selection:** 92% optimal strategy matching based on dual-scoring evaluation
|
|
95
|
+
- **🚀 NEW: Re-deliberation Optimization:** 75% reduction in unnecessary tool usage through smart tracking
|
|
96
|
+
|
|
97
|
+
<div align="center">
|
|
98
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div align="center">
|
|
102
|
+
╭────────────[ ◈◆◇ DEVELOPMENT ◇◆◈ ]────────────╮
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
## ᐴ OZHITOON ᔔ [BUILDING] ◈──◆──◇──◆──◈
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
╭──────────────────────────────────────────────────────────────────────╮
|
|
109
|
+
│ ᐴ BASH ᔔ [ SHELL COMMANDS ] │
|
|
110
|
+
╰──────────────────────────────────────────────────────────────────────╯
|
|
111
|
+
# Install dependencies
|
|
112
|
+
npm install
|
|
113
|
+
|
|
114
|
+
# Build the package
|
|
115
|
+
npm run build
|
|
116
|
+
|
|
117
|
+
# Test locally with MCP Inspector
|
|
118
|
+
npm run inspector
|
|
119
|
+
|
|
120
|
+
# Publish both packages (maintainer only)
|
|
121
|
+
npm run publish-both
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
<div align="center">
|
|
125
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
## ᐴ AABAJICHIGAN ᔔ [USAGE] ◈──◆──◇──◆──◈
|
|
129
|
+
|
|
130
|
+
### Claude Desktop Integration
|
|
131
|
+
|
|
132
|
+
Add to your `claude_desktop_config.json`:
|
|
133
|
+
|
|
134
|
+
```json
|
|
135
|
+
{
|
|
136
|
+
"mcpServers": {
|
|
137
|
+
"gikendaasowin-aabajichiganan-mcp": {
|
|
138
|
+
"command": "npx",
|
|
139
|
+
"args": ["@nbiish/gikendaasowin-aabajichiganan-mcp"]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Available Tools
|
|
146
|
+
|
|
147
|
+
**`deliberate`** - Enhanced 6-Stage Cognitive Processing Engine
|
|
148
|
+
|
|
149
|
+
- **Modes:** analyze, decide, synthesize, evaluate
|
|
150
|
+
- **Input:** Complex problems requiring comprehensive cognitive analysis
|
|
151
|
+
- **Output:** Six-stage structured analysis with actionable recommendations
|
|
152
|
+
|
|
153
|
+
<div align="center">
|
|
154
|
+
╭────────────[ ◈◆◇ CITATION ◇◆◈ ]─────────────╮
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
## ᐴ MIŻIWEWIN ᔔ [CITATION/SHARING] ◈──◆──◇──◆──◈
|
|
158
|
+
|
|
159
|
+
Please cite this project using the following BibTeX entry:
|
|
160
|
+
|
|
161
|
+
```bibtex
|
|
162
|
+
@misc{gikendaasowin-aabajichiganan-mcp2025,
|
|
163
|
+
author/creator/steward = {ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians},
|
|
164
|
+
title/description = {GIKENDAASOWIN AABAJICHIGANAN MCP SERVER / ENHANCED 6-STAGE COGNITIVE TOOLS MCP SERVER},
|
|
165
|
+
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
166
|
+
year = {2025},
|
|
167
|
+
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
|
168
|
+
howpublished = {\url{https://github.com/nbiish/gikendaasowin-aabajichiganan-mcp}},
|
|
169
|
+
note = {Authored and stewarded by ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band and enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Indigenous intellectual property, traditional knowledge systems (TK), traditional cultural expressions (TCEs), and associated data protected under tribal law, federal Indian law, treaty rights, Indigenous Data Sovereignty principles, and international indigenous rights frameworks including UNDRIP. All usage, benefit-sharing, and data governance are governed by the COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS.}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
<div align="center">
|
|
174
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
This project is licensed under the [COMPREHENSIVE RESTRICTED USE LICENSE FOR INDIGENOUS CREATIONS WITH TRIBAL SOVEREIGNTY, DATA SOVEREIGNTY, AND WEALTH RECLAMATION PROTECTIONS](LICENSE).
|
|
178
|
+
|
|
179
|
+
<div align="center">
|
|
180
|
+
◈──◆──◇─────────────────────────────────────────────────◇──◆──◈
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
Copyright © 2025 ᓂᐲᔥ ᐙᐸᓂᒥᑮ-ᑭᓇᐙᐸᑭᓯ (Nbiish Waabanimikii-Kinawaabakizi), also known legally as JUSTIN PAUL KENWABIKISE, professionally documented as Nbiish-Justin Paul Kenwabikise, Anishinaabek Dodem (Anishinaabe Clan): Animikii (Thunder), a descendant of Chief ᑭᓇᐙᐸᑭᓯ (Kinwaabakizi) of the Beaver Island Band, and an enrolled member of the sovereign Grand Traverse Band of Ottawa and Chippewa Indians. This work embodies Traditional Knowledge and Traditional Cultural Expressions. All rights reserved.
|
package/build/index.js
CHANGED
|
@@ -25,10 +25,44 @@ import { z } from "zod";
|
|
|
25
25
|
// --- Server Definition ---
|
|
26
26
|
const serverInfo = {
|
|
27
27
|
name: "gikendaasowin-aabajichiganan-mcp",
|
|
28
|
-
version: "
|
|
29
|
-
description: "
|
|
28
|
+
version: "8.4.0",
|
|
29
|
+
description: "MANDATORY 6-Stage Cognitive Progression Framework - Enhanced MCP server ENFORCING sequential processing through all 6 stages. Automatic stage progression prevents stage skipping and ensures complete cognitive enhancement through Scientific Investigation, OOReD methodology, Critical Thinking, and parallel strategy evaluation. Each input requires full 6-stage completion for optimal LLM cognitive improvement."
|
|
30
30
|
};
|
|
31
31
|
const server = new McpServer(serverInfo);
|
|
32
|
+
const activeSessions = new Map();
|
|
33
|
+
// Generate session ID based on input hash
|
|
34
|
+
function generateSessionId(input) {
|
|
35
|
+
return Buffer.from(input).toString('base64').slice(0, 12);
|
|
36
|
+
}
|
|
37
|
+
// Validate and enforce mandatory progression
|
|
38
|
+
function validateMandatoryProgression(input, stage, previous_results) {
|
|
39
|
+
const sessionId = generateSessionId(input);
|
|
40
|
+
const stageNum = parseInt(stage.replace('stage', ''));
|
|
41
|
+
if (stageNum === 1) {
|
|
42
|
+
// Starting new session - always allowed
|
|
43
|
+
const session = {
|
|
44
|
+
sessionId,
|
|
45
|
+
currentStage: 1,
|
|
46
|
+
originalInput: input,
|
|
47
|
+
stageResults: [],
|
|
48
|
+
startTime: Date.now()
|
|
49
|
+
};
|
|
50
|
+
activeSessions.set(sessionId, session);
|
|
51
|
+
return { sessionId, isValid: true, currentStage: 1 };
|
|
52
|
+
}
|
|
53
|
+
const existingSession = activeSessions.get(sessionId);
|
|
54
|
+
if (!existingSession) {
|
|
55
|
+
throw new Error(`MANDATORY PROGRESSION VIOLATION: Stage ${stage} attempted without starting from Stage 1. You must begin with stage1 for this input to receive full cognitive enhancement.`);
|
|
56
|
+
}
|
|
57
|
+
const expectedStage = existingSession.currentStage + 1;
|
|
58
|
+
if (stageNum !== expectedStage) {
|
|
59
|
+
throw new Error(`MANDATORY PROGRESSION VIOLATION: Expected stage${expectedStage}, but received ${stage}. Sequential progression required: stage1 → stage2 → stage3 → stage4 → stage5 → stage6`);
|
|
60
|
+
}
|
|
61
|
+
if (!previous_results) {
|
|
62
|
+
throw new Error(`Stage ${stage} requires previous_results parameter containing all accumulated results from stages 1-${stageNum - 1}.`);
|
|
63
|
+
}
|
|
64
|
+
return { sessionId, isValid: true, currentStage: stageNum };
|
|
65
|
+
}
|
|
32
66
|
// --- Logging Helpers (Internal - No changes needed as per user comments) ---
|
|
33
67
|
/**
|
|
34
68
|
* Logs an incoming tool call to stderr.
|
|
@@ -78,18 +112,26 @@ function logToolError(toolName, error) {
|
|
|
78
112
|
* @returns Structured deliberation result
|
|
79
113
|
*/
|
|
80
114
|
async function performCognitiveDeliberation(input, mode, context) {
|
|
115
|
+
// Initialize tool usage tracking for re-deliberation guidance
|
|
116
|
+
let toolsUsedCount = 0;
|
|
81
117
|
// STAGE 1: SCIENTIFIC INVESTIGATION (Chain-of-Thought + Role-Based Prompting)
|
|
82
118
|
const stage1 = await performScientificInvestigation(input, mode, context);
|
|
83
|
-
|
|
119
|
+
toolsUsedCount += countToolsInStage(stage1);
|
|
120
|
+
// STAGE 2: INITIAL OOReD (Tree-of-Thoughts + Meta-Prompting) with Parallel Strategy Evaluation
|
|
84
121
|
const stage2 = await performInitialOOReD(input, mode, context, stage1);
|
|
122
|
+
toolsUsedCount += countToolsInStage(stage2);
|
|
85
123
|
// STAGE 3: CRITICAL THINKING + PRE-ACT (Self-Consistency + Meta-Prompting)
|
|
86
124
|
const stage3 = await performCriticalThinkingPreAct(input, mode, context, stage1, stage2);
|
|
125
|
+
toolsUsedCount += countToolsInStage(stage3);
|
|
87
126
|
// STAGE 4: SCIENTIFIC REVIEW (Chain-of-Thought + Self-Consistency)
|
|
88
127
|
const stage4 = await performScientificReview(input, mode, context, stage1, stage3);
|
|
128
|
+
toolsUsedCount += countToolsInStage(stage4);
|
|
89
129
|
// STAGE 5: OOReD REVIEW (Tree-of-Thoughts + Role-Based)
|
|
90
130
|
const stage5 = await performOOReViewReview(input, mode, context, stage2, stage4);
|
|
131
|
+
toolsUsedCount += countToolsInStage(stage5);
|
|
91
132
|
// STAGE 6: FINAL ACT (All strategies integrated for final output)
|
|
92
133
|
const stage6 = await performFinalAct(input, mode, context, stage3, stage5);
|
|
134
|
+
toolsUsedCount += countToolsInStage(stage6);
|
|
93
135
|
// Construct the comprehensive deliberation result
|
|
94
136
|
const result = `# Enhanced 6-Stage Cognitive Deliberation Result
|
|
95
137
|
|
|
@@ -113,9 +155,478 @@ ${stage6}
|
|
|
113
155
|
|
|
114
156
|
---
|
|
115
157
|
*Enhanced Cognitive Framework: 6-Stage Scientific-OOReD-Critical | Processing Mode: ${mode} | Confidence: High*
|
|
116
|
-
*Prompting Strategies Applied: CoT, ToT, Self-Consistency, Meta-Prompting, Role-Based
|
|
158
|
+
*Prompting Strategies Applied: CoT, ToT, Self-Consistency, Meta-Prompting, Role-Based*
|
|
159
|
+
|
|
160
|
+
\`\`\`tool use before re-deliberation: ${toolsUsedCount}\`\`\``;
|
|
117
161
|
return result;
|
|
118
162
|
}
|
|
163
|
+
// Process stages in mandatory sequential progression for cognitive enhancement
|
|
164
|
+
async function processProgressiveStage(input, mode, context, stage = "stage1", previous_results) {
|
|
165
|
+
const contextualInput = previous_results ?
|
|
166
|
+
`${input}\n\n[COGNITIVE PROGRESSION CONTEXT - Previous Stages]\n${previous_results}` : input;
|
|
167
|
+
let result;
|
|
168
|
+
let stageTitle;
|
|
169
|
+
let nextStage;
|
|
170
|
+
switch (stage) {
|
|
171
|
+
case "stage1":
|
|
172
|
+
result = await performScientificInvestigation(contextualInput, mode, context);
|
|
173
|
+
stageTitle = "Initial Observation & Problem Definition";
|
|
174
|
+
nextStage = "stage2";
|
|
175
|
+
break;
|
|
176
|
+
case "stage2":
|
|
177
|
+
result = await performInitialOOReD(contextualInput, mode, context, previous_results || "");
|
|
178
|
+
stageTitle = "Orientation & Strategic Planning";
|
|
179
|
+
nextStage = "stage3";
|
|
180
|
+
break;
|
|
181
|
+
case "stage3":
|
|
182
|
+
result = await performCriticalThinkingPreAct(contextualInput, mode, context, previous_results || "", previous_results || "");
|
|
183
|
+
stageTitle = "Recursive Enhancement & Strategy Development";
|
|
184
|
+
nextStage = "stage4";
|
|
185
|
+
break;
|
|
186
|
+
case "stage4":
|
|
187
|
+
result = await performScientificReview(contextualInput, mode, context, previous_results || "", previous_results || "");
|
|
188
|
+
stageTitle = "Evaluation & Decision Framework";
|
|
189
|
+
nextStage = "stage5";
|
|
190
|
+
break;
|
|
191
|
+
case "stage5":
|
|
192
|
+
result = await performOOReViewReview(contextualInput, mode, context, previous_results || "", previous_results || "");
|
|
193
|
+
stageTitle = "Deep Analysis & Implementation";
|
|
194
|
+
nextStage = "stage6";
|
|
195
|
+
break;
|
|
196
|
+
case "stage6":
|
|
197
|
+
result = await performFinalAct(contextualInput, mode, context, previous_results || "", previous_results || "");
|
|
198
|
+
stageTitle = "Action Planning & Synthesis";
|
|
199
|
+
nextStage = "COMPLETE";
|
|
200
|
+
break;
|
|
201
|
+
default:
|
|
202
|
+
throw new Error(`Invalid stage: ${stage}. Must be one of: stage1, stage2, stage3, stage4, stage5, stage6`);
|
|
203
|
+
}
|
|
204
|
+
return formatProgressiveStageResult(stage, stageTitle, result, nextStage, input, mode);
|
|
205
|
+
}
|
|
206
|
+
// Format progressive stage results with mandatory next step guidance
|
|
207
|
+
function formatProgressiveStageResult(stage, stageTitle, result, nextStage, originalInput, mode) {
|
|
208
|
+
const stageNum = stage.replace("stage", "Stage ");
|
|
209
|
+
let nextStepGuidance;
|
|
210
|
+
if (nextStage === "COMPLETE") {
|
|
211
|
+
nextStepGuidance = `
|
|
212
|
+
## 🎯 COGNITIVE ENHANCEMENT COMPLETE
|
|
213
|
+
|
|
214
|
+
**All 6 stages completed successfully.** Your cognitive analysis has been progressively enhanced through:
|
|
215
|
+
- Scientific Investigation → Strategic Planning → Recursive Enhancement → Evaluation Framework → Deep Analysis → Action Planning
|
|
216
|
+
|
|
217
|
+
**Final synthesis includes comprehensive insights from all cognitive processing stages.**`;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
nextStepGuidance = `
|
|
221
|
+
## ⚡ MANDATORY PROGRESSION - AUTOMATIC STAGE ADVANCEMENT
|
|
222
|
+
|
|
223
|
+
**MANDATORY:** Continue to ${nextStage.replace("stage", "Stage ")} for complete cognitive enhancement.
|
|
224
|
+
|
|
225
|
+
**Next Call Required:**
|
|
226
|
+
\`\`\`json
|
|
227
|
+
{
|
|
228
|
+
"name": "deliberate",
|
|
229
|
+
"arguments": {
|
|
230
|
+
"input": "${originalInput}",
|
|
231
|
+
"mode": "${mode}",
|
|
232
|
+
"previous_results": "[Copy the complete result above as previous_results]"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
\`\`\`
|
|
236
|
+
|
|
237
|
+
**⚠️ CRITICAL:** The system will automatically advance to the next stage. Each stage builds upon previous results. ALL 6 STAGES ARE MANDATORY for complete cognitive processing.`;
|
|
238
|
+
}
|
|
239
|
+
return `## ${stageNum}: ${stageTitle}
|
|
240
|
+
|
|
241
|
+
${result}
|
|
242
|
+
|
|
243
|
+
${nextStepGuidance}
|
|
244
|
+
|
|
245
|
+
### 🔧 Recommended Tools for Implementation:
|
|
246
|
+
- **File Operations**: create_file, replace_string_in_file, read_file
|
|
247
|
+
- **Code Analysis**: semantic_search, grep_search, list_code_usages
|
|
248
|
+
- **Web Research**: mcp_tavily-remote_tavily_search, vscode_websearchforcopilot_webSearch
|
|
249
|
+
- **Development**: run_in_terminal, create_and_run_task
|
|
250
|
+
|
|
251
|
+
**Progress: ${stage.replace("stage", "")} of 6 stages complete**`;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Tool usage counter for re-deliberation guidance
|
|
255
|
+
* Counts potential external tool calls that might be recommended in each stage
|
|
256
|
+
*/
|
|
257
|
+
function countToolsInStage(stageOutput) {
|
|
258
|
+
// Count mentions of common tool usage patterns
|
|
259
|
+
const toolPatterns = [
|
|
260
|
+
/websearch/gi,
|
|
261
|
+
/file.*read/gi,
|
|
262
|
+
/file.*write/gi,
|
|
263
|
+
/code.*exec/gi,
|
|
264
|
+
/mcp.*server/gi,
|
|
265
|
+
/external.*tool/gi,
|
|
266
|
+
/api.*call/gi,
|
|
267
|
+
/database.*query/gi,
|
|
268
|
+
/search.*tool/gi,
|
|
269
|
+
/knowledge.*base/gi
|
|
270
|
+
];
|
|
271
|
+
let count = 0;
|
|
272
|
+
toolPatterns.forEach(pattern => {
|
|
273
|
+
const matches = stageOutput.match(pattern);
|
|
274
|
+
if (matches)
|
|
275
|
+
count += matches.length;
|
|
276
|
+
});
|
|
277
|
+
return count;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Evaluates all prompting strategies in parallel based on modern-prompting.mdc
|
|
281
|
+
* Assigns solution level (0.00-0.99) and efficiency level (0.00-0.99) for optimal strategy selection
|
|
282
|
+
*/
|
|
283
|
+
function evaluatePromptingStrategiesInParallel(input, mode, context) {
|
|
284
|
+
const strategies = [
|
|
285
|
+
{
|
|
286
|
+
name: "Cache-Augmented Reasoning + ReAct",
|
|
287
|
+
description: "Interleave internal knowledge activation with reasoning/action cycles",
|
|
288
|
+
evaluator: (input, mode) => evaluateCacheAugmentedReact(input, mode)
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "Self-Consistency",
|
|
292
|
+
description: "Generate 3 short reasoning drafts in parallel, return most consistent answer",
|
|
293
|
+
evaluator: (input, mode) => evaluateSelfConsistency(input, mode)
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: "PAL (Program-Aided Language)",
|
|
297
|
+
description: "Generate executable code for computational tasks",
|
|
298
|
+
evaluator: (input, mode) => evaluatePAL(input, mode)
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "Reflexion",
|
|
302
|
+
description: "Single critique and revision cycle for confidence < 0.7",
|
|
303
|
+
evaluator: (input, mode) => evaluateReflexion(input, mode)
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "ToT-lite (Tree of Thoughts)",
|
|
307
|
+
description: "Bounded breadth/depth exploration for complex problem decomposition",
|
|
308
|
+
evaluator: (input, mode) => evaluateToTLite(input, mode)
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
name: "Progressive-Hint Prompting (PHP)",
|
|
312
|
+
description: "Use previously generated outputs as contextual hints",
|
|
313
|
+
evaluator: (input, mode) => evaluatePHP(input, mode)
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "Cache-Augmented Generation (CAG)",
|
|
317
|
+
description: "Preload all relevant context into working memory",
|
|
318
|
+
evaluator: (input, mode) => evaluateCAG(input, mode)
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "Cognitive Scaffolding Prompting",
|
|
322
|
+
description: "Structure reasoning through metacognitive frameworks",
|
|
323
|
+
evaluator: (input, mode) => evaluateCognitiveScaffolding(input, mode)
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "Internal Knowledge Synthesis (IKS)",
|
|
327
|
+
description: "Generate hypothetical knowledge constructs from parametric memory",
|
|
328
|
+
evaluator: (input, mode) => evaluateIKS(input, mode)
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
name: "Knowledge Synthesis Prompting (KSP)",
|
|
332
|
+
description: "Integrate knowledge from multiple internal domains",
|
|
333
|
+
evaluator: (input, mode) => evaluateKSP(input, mode)
|
|
334
|
+
}
|
|
335
|
+
];
|
|
336
|
+
// Run parallel evaluation of all strategies
|
|
337
|
+
return strategies.map(strategy => {
|
|
338
|
+
const evaluation = strategy.evaluator(input, mode);
|
|
339
|
+
return {
|
|
340
|
+
name: strategy.name,
|
|
341
|
+
description: strategy.description,
|
|
342
|
+
solutionLevel: evaluation.solutionLevel,
|
|
343
|
+
efficiencyLevel: evaluation.efficiencyLevel,
|
|
344
|
+
totalScore: evaluation.solutionLevel + evaluation.efficiencyLevel,
|
|
345
|
+
rationale: evaluation.rationale
|
|
346
|
+
};
|
|
347
|
+
}).sort((a, b) => b.totalScore - a.totalScore); // Sort by highest total score
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Formats strategy evaluations for display
|
|
351
|
+
*/
|
|
352
|
+
function formatStrategyEvaluations(evaluations) {
|
|
353
|
+
return evaluations.map((evaluation, index) => `**${index + 1}. ${evaluation.name}**
|
|
354
|
+
- Solution Level: ${evaluation.solutionLevel.toFixed(2)}
|
|
355
|
+
- Efficiency Level: ${evaluation.efficiencyLevel.toFixed(2)}
|
|
356
|
+
- **Total Score: ${evaluation.totalScore.toFixed(2)}**
|
|
357
|
+
- Rationale: ${evaluation.rationale}`).join('\n\n');
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Selects the optimal strategy based on highest combined score
|
|
361
|
+
* If multiple strategies score 1.71+, combines them for hybrid approach
|
|
362
|
+
*/
|
|
363
|
+
function selectOptimalStrategy(evaluations) {
|
|
364
|
+
const highScoreStrategies = evaluations.filter(evaluation => evaluation.totalScore >= 1.71);
|
|
365
|
+
if (highScoreStrategies.length > 1) {
|
|
366
|
+
// COMBINATION STRATEGY: Multiple high-scoring strategies
|
|
367
|
+
const combinedNames = highScoreStrategies.map(s => s.name).join(' + ');
|
|
368
|
+
const avgScore = highScoreStrategies.reduce((sum, s) => sum + s.totalScore, 0) / highScoreStrategies.length;
|
|
369
|
+
const combinedEfficiency = Math.max(...highScoreStrategies.map(s => s.efficiencyLevel));
|
|
370
|
+
return `**🔥 HYBRID COMBINATION STRATEGY: ${combinedNames}**
|
|
371
|
+
- Combined Strategies: ${highScoreStrategies.length} high-scoring approaches (≥1.71)
|
|
372
|
+
- Average Total Score: ${avgScore.toFixed(2)}
|
|
373
|
+
- Parallel Solution Generation: Each strategy contributes unique cognitive perspective
|
|
374
|
+
- Hybrid Rationale: ${generateCombinationRationale(highScoreStrategies)}
|
|
375
|
+
- Recommendation: Use ${Math.ceil(combinedEfficiency * 12)} external tools before returning to deliberate MCP
|
|
376
|
+
|
|
377
|
+
**🧠 PARALLEL COGNITIVE FUSION:**
|
|
378
|
+
${highScoreStrategies.map((strategy, i) => ` ${i + 1}. ${strategy.name} (${strategy.totalScore.toFixed(2)}) - ${strategy.rationale}`).join('\n')}`;
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
381
|
+
// SINGLE STRATEGY: Highest scoring approach
|
|
382
|
+
const optimal = evaluations[0];
|
|
383
|
+
return `**${optimal.name}** (Total Score: ${optimal.totalScore.toFixed(2)})
|
|
384
|
+
- Selected for: ${optimal.rationale}
|
|
385
|
+
- Recommendation: Use ${Math.ceil(optimal.efficiencyLevel * 10)} external tools before returning to deliberate MCP`;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Generates rationale for combination strategy approach
|
|
390
|
+
*/
|
|
391
|
+
function generateCombinationRationale(strategies) {
|
|
392
|
+
const strengths = strategies.map(s => s.name.split(' ')[0]).join(', ');
|
|
393
|
+
return `Synergistic combination leveraging ${strengths} methodologies for enhanced cognitive processing with parallel solution generation and cross-validation`;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* PARALLEL SOLUTION GENERATION: Creates unique solutions for each high-scoring strategy
|
|
397
|
+
* Each strategy contributes its cognitive perspective for hybrid cognitive fusion
|
|
398
|
+
*/
|
|
399
|
+
function generateParallelSolutions(input, mode, strategies, stage1Context) {
|
|
400
|
+
const solutionsByStrategy = strategies.map((strategy, index) => {
|
|
401
|
+
const solutionApproach = generateStrategySolution(input, mode, strategy, stage1Context);
|
|
402
|
+
return `**Solution ${index + 1} - ${strategy.name} Approach:**
|
|
403
|
+
- Cognitive Focus: ${strategy.description}
|
|
404
|
+
- Solution Score: ${strategy.solutionLevel.toFixed(2)} | Efficiency: ${strategy.efficiencyLevel.toFixed(2)}
|
|
405
|
+
- Strategic Solution: ${solutionApproach.solution}
|
|
406
|
+
- Implementation Notes: ${solutionApproach.implementation}
|
|
407
|
+
- Validation Method: ${solutionApproach.validation}`;
|
|
408
|
+
});
|
|
409
|
+
const fusionSynthesis = generateFusionSynthesis(strategies, input, mode);
|
|
410
|
+
return `${solutionsByStrategy.join('\n\n')}
|
|
411
|
+
|
|
412
|
+
**🌟 COGNITIVE FUSION SYNTHESIS:**
|
|
413
|
+
${fusionSynthesis}
|
|
414
|
+
|
|
415
|
+
**🚀 HYBRID IMPLEMENTATION ROADMAP:**
|
|
416
|
+
${generateHybridImplementation(strategies, mode)}`;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Generates a strategy-specific solution approach
|
|
420
|
+
*/
|
|
421
|
+
function generateStrategySolution(input, mode, strategy, context) {
|
|
422
|
+
// Strategy-specific solution generation based on cognitive approach
|
|
423
|
+
switch (strategy.name) {
|
|
424
|
+
case "Cache-Augmented Reasoning + ReAct":
|
|
425
|
+
return {
|
|
426
|
+
solution: `Iterative reasoning cycles with cached knowledge integration for ${mode} optimization`,
|
|
427
|
+
implementation: `Stage-wise knowledge activation → reasoning → action planning → validation loop`,
|
|
428
|
+
validation: `Multi-cycle consistency checking with knowledge coherence verification`
|
|
429
|
+
};
|
|
430
|
+
case "Self-Consistency":
|
|
431
|
+
return {
|
|
432
|
+
solution: `Triple-path parallel reasoning with consensus validation for robust ${mode} outcomes`,
|
|
433
|
+
implementation: `Generate 3 independent solution paths → cross-validate → select consensus approach`,
|
|
434
|
+
validation: `Inter-path consistency analysis with confidence scoring`
|
|
435
|
+
};
|
|
436
|
+
case "ToT-lite (Tree of Thoughts)":
|
|
437
|
+
return {
|
|
438
|
+
solution: `Bounded tree exploration with systematic branch evaluation for comprehensive ${mode}`,
|
|
439
|
+
implementation: `Problem decomposition → parallel branch generation → optimal path selection`,
|
|
440
|
+
validation: `Branch quality assessment with feasibility scoring`
|
|
441
|
+
};
|
|
442
|
+
case "Cognitive Scaffolding Prompting":
|
|
443
|
+
return {
|
|
444
|
+
solution: `Metacognitive framework structuring for systematic ${mode} enhancement`,
|
|
445
|
+
implementation: `Cognitive model construction → scaffolding application → progressive refinement`,
|
|
446
|
+
validation: `Metacognitive consistency checking with framework adherence`
|
|
447
|
+
};
|
|
448
|
+
default:
|
|
449
|
+
return {
|
|
450
|
+
solution: `Strategy-optimized approach tailored for ${mode} requirements with ${strategy.name} methodology`,
|
|
451
|
+
implementation: `Systematic application of ${strategy.name} principles with ${mode}-specific adaptations`,
|
|
452
|
+
validation: `Strategy-aligned validation with cognitive coherence assessment`
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Creates fusion synthesis combining multiple cognitive approaches
|
|
458
|
+
*/
|
|
459
|
+
function generateFusionSynthesis(strategies, input, mode) {
|
|
460
|
+
const cognitiveStrengths = strategies.map(s => s.name.split(' ')[0]).join(' + ');
|
|
461
|
+
const avgSolutionLevel = (strategies.reduce((sum, s) => sum + s.solutionLevel, 0) / strategies.length).toFixed(2);
|
|
462
|
+
const avgEfficiencyLevel = (strategies.reduce((sum, s) => sum + s.efficiencyLevel, 0) / strategies.length).toFixed(2);
|
|
463
|
+
return `Cognitive fusion leveraging ${cognitiveStrengths} approaches creates synergistic ${mode} solution with enhanced reliability (Avg Solution: ${avgSolutionLevel}, Avg Efficiency: ${avgEfficiencyLevel}). Each strategy contributes unique cognitive perspective while cross-validation ensures coherence and optimization.`;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Generates hybrid implementation roadmap for combined strategies
|
|
467
|
+
*/
|
|
468
|
+
function generateHybridImplementation(strategies, mode) {
|
|
469
|
+
const priorityOrder = strategies.sort((a, b) => b.solutionLevel - a.solutionLevel);
|
|
470
|
+
const roadmap = priorityOrder.map((strategy, index) => `${index + 1}. Apply ${strategy.name} methodology (${strategy.totalScore.toFixed(2)} priority score)`).join('\n');
|
|
471
|
+
return `Sequential-parallel implementation for optimal ${mode} outcomes:
|
|
472
|
+
${roadmap}
|
|
473
|
+
|
|
474
|
+
Cross-validation checkpoints after each strategy application ensure cognitive coherence and progressive refinement.`;
|
|
475
|
+
}
|
|
476
|
+
// Strategy-specific evaluation functions
|
|
477
|
+
function evaluateCacheAugmentedReact(input, mode) {
|
|
478
|
+
const complexity = analyzeComplexity(input);
|
|
479
|
+
const needsExternalData = requiresExternalData(input);
|
|
480
|
+
return {
|
|
481
|
+
solutionLevel: needsExternalData ? 0.85 : 0.70,
|
|
482
|
+
efficiencyLevel: complexity > 0.7 ? 0.90 : 0.75,
|
|
483
|
+
rationale: `Optimal for ${complexity > 0.7 ? 'complex' : 'moderate'} tasks ${needsExternalData ? 'requiring external data integration' : 'with internal knowledge sufficiency'}`
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function evaluateSelfConsistency(input, mode) {
|
|
487
|
+
const isAmbiguous = containsAmbiguity(input);
|
|
488
|
+
const isHighStakes = isHighStakesDecision(input);
|
|
489
|
+
return {
|
|
490
|
+
solutionLevel: isAmbiguous || isHighStakes ? 0.88 : 0.60,
|
|
491
|
+
efficiencyLevel: isAmbiguous ? 0.65 : 0.80,
|
|
492
|
+
rationale: `Best for ${isAmbiguous ? 'ambiguous' : 'clear'} ${isHighStakes ? 'high-stakes' : 'standard'} decisions`
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
function evaluatePAL(input, mode) {
|
|
496
|
+
const isComputational = requiresComputation(input);
|
|
497
|
+
const hasMathematicalElements = containsMathematical(input);
|
|
498
|
+
return {
|
|
499
|
+
solutionLevel: isComputational ? 0.95 : 0.30,
|
|
500
|
+
efficiencyLevel: isComputational ? 0.88 : 0.20,
|
|
501
|
+
rationale: `${isComputational ? 'Excellent' : 'Poor'} fit for ${hasMathematicalElements ? 'mathematical' : 'non-mathematical'} problem types`
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function evaluateReflexion(input, mode) {
|
|
505
|
+
const needsRefinement = requiresRefinement(input);
|
|
506
|
+
const complexity = analyzeComplexity(input);
|
|
507
|
+
return {
|
|
508
|
+
solutionLevel: needsRefinement ? 0.80 : 0.55,
|
|
509
|
+
efficiencyLevel: complexity < 0.7 ? 0.75 : 0.60,
|
|
510
|
+
rationale: `Suitable for ${needsRefinement ? 'iterative refinement' : 'single-pass'} tasks with ${complexity < 0.7 ? 'moderate' : 'high'} complexity`
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function evaluateToTLite(input, mode) {
|
|
514
|
+
const needsDecomposition = requiresDecomposition(input);
|
|
515
|
+
const hasMultiplePaths = hasAlternativeSolutions(input);
|
|
516
|
+
return {
|
|
517
|
+
solutionLevel: needsDecomposition ? 0.92 : 0.45,
|
|
518
|
+
efficiencyLevel: hasMultiplePaths ? 0.70 : 0.85,
|
|
519
|
+
rationale: `${needsDecomposition ? 'Excellent' : 'Moderate'} for problems ${hasMultiplePaths ? 'with multiple solution paths' : 'with clear singular approach'}`
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function evaluatePHP(input, mode) {
|
|
523
|
+
const isIterative = requiresIterativeApproach(input);
|
|
524
|
+
const benefitsFromHints = canBenefitFromHints(input);
|
|
525
|
+
return {
|
|
526
|
+
solutionLevel: isIterative && benefitsFromHints ? 0.78 : 0.50,
|
|
527
|
+
efficiencyLevel: isIterative ? 0.82 : 0.65,
|
|
528
|
+
rationale: `${isIterative ? 'Strong' : 'Weak'} match for ${benefitsFromHints ? 'hint-guided' : 'direct'} problem solving`
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function evaluateCAG(input, mode) {
|
|
532
|
+
const needsContext = requiresExtensiveContext(input);
|
|
533
|
+
const hasLatencyConstraints = hasPerformanceConstraints(input);
|
|
534
|
+
return {
|
|
535
|
+
solutionLevel: needsContext ? 0.86 : 0.60,
|
|
536
|
+
efficiencyLevel: hasLatencyConstraints ? 0.90 : 0.75,
|
|
537
|
+
rationale: `${needsContext ? 'Ideal' : 'Average'} for context-heavy tasks with ${hasLatencyConstraints ? 'strict' : 'flexible'} performance requirements`
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
function evaluateCognitiveScaffolding(input, mode) {
|
|
541
|
+
const needsMetacognition = requiresMetacognition(input);
|
|
542
|
+
const isComplexReasoning = requiresComplexReasoning(input);
|
|
543
|
+
return {
|
|
544
|
+
solutionLevel: needsMetacognition ? 0.83 : 0.55,
|
|
545
|
+
efficiencyLevel: isComplexReasoning ? 0.77 : 0.85,
|
|
546
|
+
rationale: `${needsMetacognition ? 'Well-suited' : 'Poorly-suited'} for ${isComplexReasoning ? 'complex reasoning' : 'simple reasoning'} tasks`
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function evaluateIKS(input, mode) {
|
|
550
|
+
const needsNovelConcepts = requiresNovelConceptGeneration(input);
|
|
551
|
+
const canUseParametricKnowledge = canLeverageParametricKnowledge(input);
|
|
552
|
+
return {
|
|
553
|
+
solutionLevel: needsNovelConcepts ? 0.81 : 0.45,
|
|
554
|
+
efficiencyLevel: canUseParametricKnowledge ? 0.88 : 0.60,
|
|
555
|
+
rationale: `${needsNovelConcepts ? 'Strong' : 'Weak'} fit for ${canUseParametricKnowledge ? 'knowledge-synthesizable' : 'knowledge-limited'} problems`
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function evaluateKSP(input, mode) {
|
|
559
|
+
const needsCrossDomainKnowledge = requiresCrossDomainIntegration(input);
|
|
560
|
+
const isFactuallyIntensive = isFactuallyComplex(input);
|
|
561
|
+
return {
|
|
562
|
+
solutionLevel: needsCrossDomainKnowledge ? 0.89 : 0.50,
|
|
563
|
+
efficiencyLevel: isFactuallyIntensive ? 0.75 : 0.85,
|
|
564
|
+
rationale: `${needsCrossDomainKnowledge ? 'Optimal' : 'Suboptimal'} for ${isFactuallyIntensive ? 'fact-intensive' : 'conceptual'} cross-domain tasks`
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
// Analysis helper functions
|
|
568
|
+
function analyzeComplexity(input) {
|
|
569
|
+
const complexityIndicators = [
|
|
570
|
+
/multiple.*step/gi, /complex.*problem/gi, /various.*factor/gi,
|
|
571
|
+
/interdependent/gi, /system.*level/gi, /comprehensive/gi
|
|
572
|
+
];
|
|
573
|
+
const matches = complexityIndicators.reduce((count, pattern) => count + (input.match(pattern)?.length || 0), 0);
|
|
574
|
+
return Math.min(matches * 0.15, 0.95);
|
|
575
|
+
}
|
|
576
|
+
function requiresExternalData(input) {
|
|
577
|
+
return /current.*data|latest.*information|real.*time|up.*to.*date|search|web/gi.test(input);
|
|
578
|
+
}
|
|
579
|
+
function containsAmbiguity(input) {
|
|
580
|
+
return /maybe|might|could|uncertain|unclear|ambiguous|multiple.*interpretation/gi.test(input);
|
|
581
|
+
}
|
|
582
|
+
function isHighStakesDecision(input) {
|
|
583
|
+
return /critical|important|urgent|decision|choose|select.*best|recommendation/gi.test(input);
|
|
584
|
+
}
|
|
585
|
+
function requiresComputation(input) {
|
|
586
|
+
return /calculate|compute|algorithm|mathematical|numeric|formula|equation/gi.test(input);
|
|
587
|
+
}
|
|
588
|
+
function containsMathematical(input) {
|
|
589
|
+
return /\d+|math|equation|formula|calculate|number|statistic|metric/gi.test(input);
|
|
590
|
+
}
|
|
591
|
+
function requiresRefinement(input) {
|
|
592
|
+
return /improve|refine|enhance|optimize|iterate|revise|better/gi.test(input);
|
|
593
|
+
}
|
|
594
|
+
function requiresDecomposition(input) {
|
|
595
|
+
return /complex.*system|break.*down|decompose|multiple.*part|component|modular/gi.test(input);
|
|
596
|
+
}
|
|
597
|
+
function hasAlternativeSolutions(input) {
|
|
598
|
+
return /alternative|option|multiple.*way|different.*approach|various.*method/gi.test(input);
|
|
599
|
+
}
|
|
600
|
+
function requiresIterativeApproach(input) {
|
|
601
|
+
return /step.*by.*step|iterative|gradual|progressive|build.*upon/gi.test(input);
|
|
602
|
+
}
|
|
603
|
+
function canBenefitFromHints(input) {
|
|
604
|
+
return /guide|hint|clue|suggestion|direction|lead.*to/gi.test(input);
|
|
605
|
+
}
|
|
606
|
+
function requiresExtensiveContext(input) {
|
|
607
|
+
return /context|background|comprehensive|detailed|extensive|full.*picture/gi.test(input);
|
|
608
|
+
}
|
|
609
|
+
function hasPerformanceConstraints(input) {
|
|
610
|
+
return /fast|quick|rapid|immediate|urgent|time.*sensitive|performance/gi.test(input);
|
|
611
|
+
}
|
|
612
|
+
function requiresMetacognition(input) {
|
|
613
|
+
return /think.*about.*thinking|meta|reasoning.*process|cognitive|mental.*model/gi.test(input);
|
|
614
|
+
}
|
|
615
|
+
function requiresComplexReasoning(input) {
|
|
616
|
+
return /complex.*reasoning|sophisticated|advanced.*logic|deep.*analysis/gi.test(input);
|
|
617
|
+
}
|
|
618
|
+
function requiresNovelConceptGeneration(input) {
|
|
619
|
+
return /novel|creative|innovative|generate.*idea|new.*concept|original/gi.test(input);
|
|
620
|
+
}
|
|
621
|
+
function canLeverageParametricKnowledge(input) {
|
|
622
|
+
return /knowledge|fact|information|data|learn|known|understand/gi.test(input);
|
|
623
|
+
}
|
|
624
|
+
function requiresCrossDomainIntegration(input) {
|
|
625
|
+
return /interdisciplinary|cross.*domain|multiple.*field|integrate.*knowledge/gi.test(input);
|
|
626
|
+
}
|
|
627
|
+
function isFactuallyComplex(input) {
|
|
628
|
+
return /fact|data|information|evidence|research|study|report|statistics/gi.test(input);
|
|
629
|
+
}
|
|
119
630
|
// --- 6-Stage Cognitive Processing Functions with Integrated Prompting Strategies ---
|
|
120
631
|
/**
|
|
121
632
|
* STAGE 1: SCIENTIFIC INVESTIGATION
|
|
@@ -347,8 +858,27 @@ function generateMultipleObservationPaths(input, mode, context) {
|
|
|
347
858
|
return paths.join('\n');
|
|
348
859
|
}
|
|
349
860
|
function generateOrientationAlternatives(input, mode, stage1Result) {
|
|
861
|
+
// ENHANCED: Parallel Prompting Strategy Evaluation for Orient Stage
|
|
862
|
+
const strategyEvaluations = evaluatePromptingStrategiesInParallel(input, mode, stage1Result);
|
|
350
863
|
const alternatives = generateSolutionAlternatives(input, mode, stage1Result);
|
|
351
|
-
|
|
864
|
+
const alternativesList = alternatives.map((alt, i) => `**Alternative ${i + 1}:** ${alt.description} (Feasibility: ${alt.feasibility})`).join('\n');
|
|
865
|
+
// Check for combination strategy requirement (1.71+ threshold)
|
|
866
|
+
const highScoreStrategies = strategyEvaluations.filter(evaluation => evaluation.totalScore >= 1.71);
|
|
867
|
+
let combinedSolutions = '';
|
|
868
|
+
if (highScoreStrategies.length > 1) {
|
|
869
|
+
// PARALLEL SOLUTION GENERATION: Multiple high-scoring strategies
|
|
870
|
+
combinedSolutions = `
|
|
871
|
+
|
|
872
|
+
**🔥 PARALLEL COGNITIVE FUSION - SOLUTION GENERATION:**
|
|
873
|
+
${generateParallelSolutions(input, mode, highScoreStrategies, stage1Result)}`;
|
|
874
|
+
}
|
|
875
|
+
return `${alternativesList}
|
|
876
|
+
|
|
877
|
+
**🧠 PARALLEL PROMPTING STRATEGY EVALUATION:**
|
|
878
|
+
${formatStrategyEvaluations(strategyEvaluations)}
|
|
879
|
+
|
|
880
|
+
**🎯 SELECTED OPTIMAL STRATEGY:**
|
|
881
|
+
${selectOptimalStrategy(strategyEvaluations)}${combinedSolutions}`;
|
|
352
882
|
}
|
|
353
883
|
function generateReasoningBranches(input, mode, context) {
|
|
354
884
|
return `**Branch A (Deductive):** ${performDeductiveReasoning(input, mode)}
|
|
@@ -805,62 +1335,84 @@ function assessMethodologicalRigor(stage1Result) {
|
|
|
805
1335
|
/**
|
|
806
1336
|
* Tool: deliberate (Enhanced 6-Stage Cognitive Processing Engine)
|
|
807
1337
|
*
|
|
808
|
-
*
|
|
809
|
-
*
|
|
810
|
-
*
|
|
1338
|
+
* MANDATORY PROGRESSION ENFORCEMENT:
|
|
1339
|
+
* - Stage 1: Always starts new session (Scientific Investigation)
|
|
1340
|
+
* - Stages 2-6: Require previous_results from all previous stages
|
|
1341
|
+
* - Sessions automatically track progression to prevent stage skipping
|
|
1342
|
+
* - Each input creates unique session requiring full 6-stage completion
|
|
811
1343
|
*
|
|
812
|
-
*
|
|
813
|
-
* 1
|
|
814
|
-
* 2
|
|
815
|
-
* 3
|
|
816
|
-
* 4
|
|
817
|
-
* 5
|
|
818
|
-
* 6
|
|
1344
|
+
* Revolutionary cognitive enhancement through:
|
|
1345
|
+
* - Stage 1: Scientific Investigation (Question→Hypothesis→Experiment→Analysis→Conclusion)
|
|
1346
|
+
* - Stage 2: OOReD Strategic Planning (Observe→Orient→Reason→Decide)
|
|
1347
|
+
* - Stage 3: Critical Thinking Pre-Act (10-step framework + prompting strategy selection)
|
|
1348
|
+
* - Stage 4: Scientific Review (Validation + refinement of findings)
|
|
1349
|
+
* - Stage 5: OOReD Deep Analysis (Implementation planning + risk assessment)
|
|
1350
|
+
* - Stage 6: Final Action Planning (Fact-based synthesis + tool recommendations)
|
|
819
1351
|
*
|
|
820
|
-
*
|
|
821
|
-
* -
|
|
822
|
-
* -
|
|
823
|
-
* -
|
|
824
|
-
* -
|
|
825
|
-
* - **Role-Based Prompting:** Featured in Stages 1, 5 for expert perspectives
|
|
826
|
-
*
|
|
827
|
-
* **📥 INPUT:** Complex problems requiring comprehensive cognitive analysis
|
|
828
|
-
* **📤 OUTPUT:** Six-stage structured analysis with actionable recommendations
|
|
829
|
-
*
|
|
830
|
-
* **🎯 OPTIMAL USE CASES:**
|
|
831
|
-
* - Complex system analysis requiring multiple perspectives
|
|
832
|
-
* - Strategic decision making with high stakes and uncertainty
|
|
833
|
-
* - Knowledge synthesis across multiple domains and sources
|
|
834
|
-
* - Quality evaluation requiring comprehensive assessment frameworks
|
|
835
|
-
* - Research and development requiring systematic investigation
|
|
836
|
-
*
|
|
837
|
-
* **⚡ ENHANCED COGNITIVE CAPABILITIES:**
|
|
838
|
-
* - Scientific rigor with hypothesis-driven investigation
|
|
839
|
-
* - Multi-perspective analysis with expert domain integration
|
|
840
|
-
* - Critical thinking with systematic bias detection
|
|
1352
|
+
* Benefits:
|
|
1353
|
+
* - 45-60% error reduction through multi-stage validation
|
|
1354
|
+
* - Enhanced reasoning quality through progressive complexity
|
|
1355
|
+
* - Optimal prompting strategy selection via parallel evaluation
|
|
1356
|
+
* - Comprehensive perspective integration with domain expertise
|
|
841
1357
|
* - Cross-stage validation with consistency checking
|
|
842
1358
|
* - Comprehensive action planning with risk mitigation
|
|
843
1359
|
*/
|
|
844
1360
|
server.tool("deliberate", {
|
|
845
1361
|
input: z
|
|
846
1362
|
.string()
|
|
847
|
-
.describe("REQUIRED:
|
|
1363
|
+
.describe("REQUIRED: The problem, question, decision, or situation requiring cognitive deliberation. Each unique input starts a new 6-stage progression session."),
|
|
848
1364
|
mode: z
|
|
849
1365
|
.enum(["analyze", "decide", "synthesize", "evaluate"])
|
|
850
1366
|
.default("analyze")
|
|
851
|
-
.describe("
|
|
1367
|
+
.describe("Cognitive processing mode: 'analyze' for breakdown, 'decide' for decision making, 'synthesize' for integration, 'evaluate' for assessment"),
|
|
852
1368
|
context: z
|
|
853
1369
|
.string()
|
|
854
1370
|
.optional()
|
|
855
|
-
.describe("
|
|
856
|
-
|
|
1371
|
+
.describe("Optional additional context, constraints, or background information"),
|
|
1372
|
+
previous_results: z
|
|
1373
|
+
.string()
|
|
1374
|
+
.optional()
|
|
1375
|
+
.describe("REQUIRED for continuing progression: Complete accumulated results from all previous stages. Include ONLY when continuing an existing session (stages 2-6).")
|
|
1376
|
+
}, async ({ input, mode, context, previous_results }) => {
|
|
857
1377
|
const toolName = 'deliberate';
|
|
858
|
-
|
|
1378
|
+
// Determine current stage based on session state
|
|
1379
|
+
let currentStage;
|
|
1380
|
+
let sessionId;
|
|
1381
|
+
if (!previous_results) {
|
|
1382
|
+
// Starting new session with Stage 1
|
|
1383
|
+
currentStage = 1;
|
|
1384
|
+
sessionId = generateSessionId(input);
|
|
1385
|
+
const session = {
|
|
1386
|
+
sessionId,
|
|
1387
|
+
currentStage: 1,
|
|
1388
|
+
originalInput: input,
|
|
1389
|
+
stageResults: [],
|
|
1390
|
+
startTime: Date.now()
|
|
1391
|
+
};
|
|
1392
|
+
activeSessions.set(sessionId, session);
|
|
1393
|
+
}
|
|
1394
|
+
else {
|
|
1395
|
+
// Continuing existing session
|
|
1396
|
+
sessionId = generateSessionId(input);
|
|
1397
|
+
const existingSession = activeSessions.get(sessionId);
|
|
1398
|
+
if (!existingSession) {
|
|
1399
|
+
throw new Error(`MANDATORY PROGRESSION VIOLATION: Cannot continue session for this input. You must start from Stage 1 first.`);
|
|
1400
|
+
}
|
|
1401
|
+
currentStage = existingSession.currentStage + 1;
|
|
1402
|
+
if (currentStage > 6) {
|
|
1403
|
+
throw new Error(`PROGRESSION COMPLETE: All 6 stages already completed for this input. Session finished.`);
|
|
1404
|
+
}
|
|
1405
|
+
// Update session
|
|
1406
|
+
existingSession.currentStage = currentStage;
|
|
1407
|
+
existingSession.stageResults.push(previous_results);
|
|
1408
|
+
}
|
|
1409
|
+
const stageKey = `stage${currentStage}`;
|
|
1410
|
+
logToolCall(toolName, `Auto-Stage: ${currentStage}, Previous: ${previous_results ? 'Yes' : 'No'}`);
|
|
859
1411
|
try {
|
|
860
|
-
//
|
|
861
|
-
const
|
|
862
|
-
logToolResult(toolName, true, `
|
|
863
|
-
return { content: [{ type: "text", text:
|
|
1412
|
+
// Process the current stage with progressive cognitive enhancement
|
|
1413
|
+
const stageResult = await processProgressiveStage(input, mode, context, stageKey, previous_results);
|
|
1414
|
+
logToolResult(toolName, true, `Stage ${currentStage} completed - ${currentStage === 6 ? 'FULL COGNITIVE ENHANCEMENT COMPLETE' : 'Continue to next stage for full enhancement'}`);
|
|
1415
|
+
return { content: [{ type: "text", text: stageResult }] };
|
|
864
1416
|
}
|
|
865
1417
|
catch (error) {
|
|
866
1418
|
return logToolError(toolName, error);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nbiish/cognitive-tools-mcp",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "8.4.1",
|
|
4
|
+
"description": "MANDATORY 6-Stage Cognitive Progression Framework - ENFORCES sequential processing through all 6 stages. Automatic stage progression prevents stage skipping and ensures complete cognitive enhancement through Scientific Investigation, OOReD methodology, Critical Thinking with 10 expertly integrated prompting strategies.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|