@nbiish/cognitive-tools-mcp 10.0.3 → 11.1.3
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/LICENSE +3272 -36
- package/README.md +15 -13
- package/build/index.js +127 -62
- package/build/index.test.js +97 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<hr width="50%">
|
|
5
|
-
|
|
6
5
|
<h3>Support This Project</h3>
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
<table style="border: none; border-collapse: collapse;">
|
|
7
|
+
<tr style="border: none;">
|
|
8
|
+
<td align="center" style="border: none; vertical-align: middle; padding: 20px;">
|
|
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
|
+
</td>
|
|
13
|
+
<td align="center" style="border: none; vertical-align: middle; padding: 20px;">
|
|
14
|
+
<a href="https://www.buymeacoffee.com/nbiish">
|
|
15
|
+
<img src="buy-me-a-coffee.svg" alt="Buy me a coffee" />
|
|
16
|
+
</a>
|
|
17
|
+
</td>
|
|
18
|
+
</tr>
|
|
19
|
+
</table>
|
|
18
20
|
<hr width="50%">
|
|
19
21
|
</div>
|
|
20
22
|
|
|
@@ -217,7 +219,7 @@ Please cite this project using the following BibTeX entry:
|
|
|
217
219
|
```bibtex
|
|
218
220
|
@misc{gikendaasowin-aabajichiganan-mcp2025,
|
|
219
221
|
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},
|
|
220
|
-
title/description = {Gikendaasowin Aabajichiganan MCP Server
|
|
222
|
+
title/description = {Gikendaasowin Aabajichiganan MCP Server},
|
|
221
223
|
type_of_work = {Indigenous digital creation/software incorporating traditional knowledge and cultural expressions},
|
|
222
224
|
year = {2025},
|
|
223
225
|
publisher/source/event = {GitHub repository under tribal sovereignty protections},
|
package/build/index.js
CHANGED
|
@@ -2,80 +2,122 @@
|
|
|
2
2
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
// Comprehensive cognitive strategies from modern-prompting research (2026 Standards)
|
|
7
|
+
export const PROMPTING_STRATEGIES = {
|
|
8
|
+
// Strategies 1-5
|
|
9
|
+
"Cache-Augmented ReAct (CAR-ReAct)": {
|
|
10
|
+
description: "Integrated 'Architectural Caching' where the ReAct loop operates atop a frozen, cached foundation of tools and protocols (Tier 1). Dynamic reasoning (Tier 2) references static knowledge without re-retrieval. Maximizes cache hit rates (>90%) and reduces latency.",
|
|
11
|
+
protocol: "Treat context as tiered: Tier 1 (Static/Frozen) for rules/tools, Tier 2 (Dynamic) for conversation. DO NOT re-output Tier 1 content."
|
|
9
12
|
},
|
|
10
|
-
"
|
|
11
|
-
description: "
|
|
13
|
+
"Adaptive Reasoning Consensus (ARC)": {
|
|
14
|
+
description: "Evaluates the *quality* and *pattern* of the reasoning path, not just final answer voting. Generates 3-7 parallel traces using diverse methodologies (e.g., first-principles vs. precedent) and aggregates based on logical coherence.",
|
|
15
|
+
protocol: "1. Generate 3 diverse reasoning traces. 2. Evaluate coherence of each trace. 3. Weighted aggregation of the best traces."
|
|
12
16
|
},
|
|
13
|
-
"
|
|
14
|
-
description: "
|
|
17
|
+
"Substrate-Native Execution (SNE)": {
|
|
18
|
+
description: "Universal Execution Delegation. Offloads *any* precise task to its native substrate (Code, SQL, API) rather than simulating it. Mandates generation of executable payloads.",
|
|
19
|
+
protocol: "Identify precise subtasks (Math, Data). Delegate to native runtime (Python, SQL). DO NOT simulate execution."
|
|
15
20
|
},
|
|
16
|
-
"
|
|
17
|
-
description: "
|
|
21
|
+
"Recursive Contextual Audit (RCA)": {
|
|
22
|
+
description: "Continuous integrity check against the *entire* cached context. Explicitly maps failures to deviations from Tier 1 knowledge base protocols and generates a 'Correction Vector' to prevent recurrence.",
|
|
23
|
+
protocol: "On failure: 1. Map error to Tier 1 deviation. 2. Generate Correction Vector. 3. Re-attempt with constraint."
|
|
18
24
|
},
|
|
19
|
-
"
|
|
20
|
-
description: "
|
|
25
|
+
"Semantic Information Density (SID)": {
|
|
26
|
+
description: "Optimizes for information entropy. Uses dynamic context assembly (CUC-N score) and Lingua-Native compression (XML/JSON) to maximize knowledge density per token.",
|
|
27
|
+
protocol: "Assess CUC-N score. If high, load full context. Use XML/JSON for data structures. Summarize Tier 2 only."
|
|
21
28
|
},
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
// Strategies 6-10
|
|
30
|
+
"Reflexion (Single-Shot)": {
|
|
31
|
+
description: "Single-shot recursive critique pattern implementing a 'Draft → Reflect → Refine' loop within a single inference pass. Uses uncertainty thresholds (UTD) to trigger deep reflection only when necessary.",
|
|
32
|
+
protocol: `<reflexion_protocol>
|
|
33
|
+
1. **DRAFT:** Generate initial solution path.
|
|
34
|
+
2. **REFLECTION:** Critically evaluate DRAFT against constraints (Logic, Safety, Assumptions).
|
|
35
|
+
3. **REFINEMENT:** Generate FINAL output incorporating fixes.
|
|
36
|
+
*Trigger Rule:* If Confidence > 0.9, skip DRAFT/REFLECTION and output FINAL directly.
|
|
37
|
+
</reflexion_protocol>`
|
|
24
38
|
},
|
|
25
39
|
"ToT-lite (Tree of Thoughts)": {
|
|
26
|
-
description: "Bounded
|
|
40
|
+
description: "Bounded parallel exploration strategy generating 2-3 distinct reasoning paths (branches) within a single context window. Forces explicit comparative evaluation before converging.",
|
|
41
|
+
protocol: `<tot_lite_protocol>
|
|
42
|
+
1. **BRANCHING:** Propose 3 distinct approaches (Idea A, B, C).
|
|
43
|
+
2. **EVALUATION:** Assess each for Feasibility, Risk, Efficiency.
|
|
44
|
+
3. **SELECTION:** Select the single best approach.
|
|
45
|
+
4. **CONVERGENCE:** Develop selected Idea into final solution.
|
|
46
|
+
</tot_lite_protocol>`
|
|
27
47
|
},
|
|
28
48
|
"Metacognitive Prompting (MP)": {
|
|
29
|
-
description: "
|
|
49
|
+
description: "Systematic 'Plan-Monitor-Evaluate' cognitive architecture. Forces explicit definition of success criteria, inserts real-time coherence checks, and mandates final self-graded evaluation.",
|
|
50
|
+
protocol: `<metacognitive_protocol>
|
|
51
|
+
1. **PLAN:** Restate goal, define success criteria.
|
|
52
|
+
2. **MONITOR:** Execute with checkpoints ("Am I aligned?").
|
|
53
|
+
3. **EVALUATE:** Final review against success criteria.
|
|
54
|
+
</metacognitive_protocol>`
|
|
30
55
|
},
|
|
31
56
|
"Automated Prompt Optimization (APO)": {
|
|
32
|
-
description: "
|
|
57
|
+
description: "Closed-loop recursive instruction tuning. Dynamically analyzes task performance to refine prompt constraints. Evolved based on error analysis.",
|
|
58
|
+
protocol: `<apo_protocol>
|
|
59
|
+
*System Meta-Instruction:*
|
|
60
|
+
"Analyze request type. If history of errors, inject specific constraints. Log 'Prompt-Outcome Pair' for future optimization."
|
|
61
|
+
</apo_protocol>`
|
|
33
62
|
},
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
// Strategies 11-15
|
|
64
|
+
"Progressive-Hint Prompting (PHP-v2)": {
|
|
65
|
+
description: "Iterative refinement protocol coupling Complex CoT with stability-based stopping. Uses compressed rationale hints and delta-updates.",
|
|
66
|
+
protocol: "1. Question + Previous Hint. 2. Refine answer. 3. Stop if answer stabilizes."
|
|
36
67
|
},
|
|
37
|
-
"
|
|
38
|
-
description: "
|
|
68
|
+
"Cache-Augmented Generation (CAG-v2)": {
|
|
69
|
+
description: "Hierarchical Semantic Caching managing Prompt, Sub-reasoning, and Retrieval layers. Uses embedding-based keys and Session/Global separation.",
|
|
70
|
+
protocol: "Check Global Cache -> Check Session Cache -> Compute -> Update Caches."
|
|
39
71
|
},
|
|
40
|
-
"
|
|
41
|
-
description: "
|
|
72
|
+
"Cognitive Scaffolding Prompting (CSP-v2)": {
|
|
73
|
+
description: "Deploys Task-Method-Knowledge (TMK) symbolic structures and Meta-Prompting. Defines Goal-Subtask-State architectures.",
|
|
74
|
+
protocol: "Define [Task Goal]. Break into [Subtasks] with [Methods]. Maintain [State Table]."
|
|
42
75
|
},
|
|
43
|
-
"
|
|
44
|
-
description: "
|
|
76
|
+
"Internal Knowledge Synthesis (IKS-v2)": {
|
|
77
|
+
description: "Two-Stage 'Build-then-Answer' protocol. Constructs verifiable Source-Tagged Knowledge Brief before reasoning.",
|
|
78
|
+
protocol: "1. Build Source-Tagged Knowledge Brief (Certain/Uncertain). 2. Answer strictly from Brief."
|
|
45
79
|
},
|
|
46
|
-
"
|
|
47
|
-
description: "
|
|
48
|
-
|
|
49
|
-
"Multimodal Synthesis": {
|
|
50
|
-
description: "Process text/images/data integration. Visual question answering + cross-modal analysis. Broader task solutions."
|
|
51
|
-
},
|
|
52
|
-
"Knowledge Synthesis Prompting (KSP)": {
|
|
53
|
-
description: "Integrate multiple internal domains. Fine-grained coherence validation. Cross-domain knowledge integration."
|
|
54
|
-
},
|
|
55
|
-
"Prompt Compression": {
|
|
56
|
-
description: "LLMLingua for token budget management. Preserve semantic content while reducing length constraints."
|
|
80
|
+
"Multimodal Synthesis (V-CoT)": {
|
|
81
|
+
description: "Visual Chain-of-Thought with explicit Intermediate Visual Artifacts (bounding boxes, scene graphs).",
|
|
82
|
+
protocol: "1. Describe layout (Scene Graph). 2. Answer based on structural understanding."
|
|
57
83
|
}
|
|
58
84
|
};
|
|
59
|
-
class DeliberationEngine {
|
|
85
|
+
export class DeliberationEngine {
|
|
60
86
|
deliberate(input, context) {
|
|
61
|
-
// /// [6-stage self-prompting framework
|
|
87
|
+
// /// [6-stage self-prompting framework with OOReDAct integration and modern prompting strategies]
|
|
62
88
|
const strategiesList = Object.entries(PROMPTING_STRATEGIES)
|
|
63
|
-
.map(([name, strategy]) => `**${name}
|
|
64
|
-
.join('\n');
|
|
65
|
-
return `You are now entering a 6-stage cognitive deliberation process. Please work through each stage systematically:
|
|
89
|
+
.map(([name, strategy]) => `**${name}:**\n${strategy.description}\n*Protocol:*\n${strategy.protocol}`)
|
|
90
|
+
.join('\n\n');
|
|
91
|
+
return `You are now entering a 6-stage cognitive deliberation process with OOReDAct framework integration. Please work through each stage systematically:
|
|
66
92
|
|
|
67
93
|
## Stage 1: Scientific Investigation
|
|
68
94
|
**Your Task:** Analyze the following prompt using scientific methodology:
|
|
69
95
|
- **Prompt:** "${input}"
|
|
96
|
+
${context ? `- **Context:** "${context}"` : ''}
|
|
70
97
|
|
|
71
98
|
**Please identify:**
|
|
72
99
|
1. Core question/problem
|
|
73
100
|
2. Initial hypothesis about the best approach
|
|
74
101
|
3. What type of task this is (computational, reasoning, creative, analysis, planning, general)
|
|
75
102
|
4. Task complexity level (low, medium, high)
|
|
103
|
+
5. Required cognitive frameworks (CUC-N: Complexity, Uncertainty, Consequence, Novelty assessment)
|
|
104
|
+
|
|
105
|
+
## Stage 2: OOReDAct Process - Strategy Evaluation
|
|
76
106
|
|
|
77
|
-
|
|
78
|
-
|
|
107
|
+
### Observe
|
|
108
|
+
Synthesize the facts and observations from the input:
|
|
109
|
+
- What factual information is available?
|
|
110
|
+
- What patterns or relationships are evident?
|
|
111
|
+
- What constraints or requirements are present?
|
|
112
|
+
|
|
113
|
+
### Orient
|
|
114
|
+
Understand the knowledge and context:
|
|
115
|
+
- What domain knowledge is required?
|
|
116
|
+
- What are the contextual factors?
|
|
117
|
+
- What resources and tools are available?
|
|
118
|
+
|
|
119
|
+
### Reason (Strategy Selection)
|
|
120
|
+
You have access to these cognitive techniques:
|
|
79
121
|
|
|
80
122
|
${strategiesList}
|
|
81
123
|
|
|
@@ -87,6 +129,12 @@ For each technique, consider:
|
|
|
87
129
|
|
|
88
130
|
**Selection Rule:** Choose techniques with total scores ≥1.53 for combined effectiveness
|
|
89
131
|
|
|
132
|
+
### Decide
|
|
133
|
+
State your selected strategies and approach based on the evaluation.
|
|
134
|
+
|
|
135
|
+
### Act-Plan
|
|
136
|
+
Plan the implementation steps for your selected cognitive techniques.
|
|
137
|
+
|
|
90
138
|
## Stage 3: Critical Thinking Framework
|
|
91
139
|
Apply rapid validation checks:
|
|
92
140
|
1. **Purpose:** What outcome am I optimizing for?
|
|
@@ -96,36 +144,51 @@ Apply rapid validation checks:
|
|
|
96
144
|
5. **Reliability:** How confident am I in my information sources?
|
|
97
145
|
6. **Assumptions:** What am I taking for granted that could be wrong?
|
|
98
146
|
7. **Implications:** What happens if I'm right? What if I'm wrong?
|
|
147
|
+
8. **Ethical/Cultural:** Are there ethical, legal, or cultural considerations?
|
|
99
148
|
|
|
100
149
|
## Stage 4 & 5: Review Cycles
|
|
101
150
|
- Review your strategy selections against the ≥1.53 threshold
|
|
102
|
-
- Validate your reasoning approach
|
|
103
|
-
-
|
|
151
|
+
- Validate your reasoning approach using consistency checks
|
|
152
|
+
- Apply confidence calibration (0.0-1.0 scale)
|
|
153
|
+
- Refine your methodology based on metacognitive assessment
|
|
104
154
|
|
|
105
155
|
## Stage 6: Final Action Synthesis
|
|
106
|
-
**Present your analysis in this format:**
|
|
156
|
+
**Present your analysis in this structured format:**
|
|
107
157
|
|
|
108
|
-
|
|
158
|
+
### DELIBERATION SUMMARY
|
|
159
|
+
[Your thought process through stages 1-5, including OOReDAct analysis]
|
|
109
160
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
**Strategy Evaluation Results (0.00-0.99 scale):**
|
|
161
|
+
### STRATEGY EVALUATION RESULTS
|
|
162
|
+
**Evaluation Scale (0.00-0.99):**
|
|
113
163
|
[Show your evaluations like:]
|
|
114
164
|
- TechniqueName: solution=X.XX, efficiency=Y.YY, total=Z.ZZ ✓ (if ≥1.53)
|
|
115
165
|
|
|
116
|
-
|
|
166
|
+
### SELECTED COGNITIVE TECHNIQUES
|
|
167
|
+
[List techniques scoring ≥1.53 with rationale]
|
|
168
|
+
|
|
169
|
+
### CONFIDENCE ASSESSMENT
|
|
170
|
+
[Rate confidence 0.0-1.0 with justification]
|
|
117
171
|
|
|
118
|
-
|
|
172
|
+
### IMPLEMENTATION PLAN
|
|
173
|
+
[Structured approach using selected techniques and their specific protocols]
|
|
174
|
+
|
|
175
|
+
### ESTIMATED TOOLS NEEDED
|
|
176
|
+
[1-8 tools for implementation with specific purposes]
|
|
119
177
|
|
|
120
178
|
---
|
|
121
179
|
|
|
122
|
-
**
|
|
180
|
+
**FINAL EXECUTION:** Apply your selected cognitive technique(s) to solve the original problem "${input}" using your enhanced reasoning framework and modern prompting strategies.
|
|
181
|
+
Ensure you FOLLOW the protocols defined for each selected strategy.
|
|
182
|
+
|
|
183
|
+
**Memory Integration:** Use Cache-Augmented Generation principles to maintain context coherence throughout the reasoning process.
|
|
184
|
+
|
|
185
|
+
**Quality Assurance:** Apply Reflexive Analysis to ensure ethical, cultural, and technical considerations are properly addressed.`;
|
|
123
186
|
}
|
|
124
187
|
}
|
|
125
|
-
// MCP Server setup with 6-stage cognitive deliberation framework
|
|
188
|
+
// MCP Server setup with comprehensive 6-stage cognitive deliberation framework and modern prompting strategies
|
|
126
189
|
const server = new Server({
|
|
127
190
|
name: "gikendaasowin-aabajichiganan-mcp",
|
|
128
|
-
version: "
|
|
191
|
+
version: "11.1.0", // Updated version for Strategy 1-15 implementation
|
|
129
192
|
}, {
|
|
130
193
|
capabilities: {
|
|
131
194
|
tools: {},
|
|
@@ -138,7 +201,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
138
201
|
tools: [
|
|
139
202
|
{
|
|
140
203
|
name: "deliberate",
|
|
141
|
-
description: "Advanced cognitive deliberation framework implementing 6-stage processing
|
|
204
|
+
description: "Advanced cognitive deliberation framework implementing 6-stage processing with comprehensive modern prompting strategies (1-15). Features OOReDAct integration, specific execution protocols for each strategy (including Reflexion, ToT-lite, Metacognitive, etc.), and ethical analysis (IDS/CARE).",
|
|
142
205
|
inputSchema: {
|
|
143
206
|
type: "object",
|
|
144
207
|
properties: {
|
|
@@ -182,13 +245,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
182
245
|
}
|
|
183
246
|
throw new Error(`Unknown tool: ${name}`);
|
|
184
247
|
});
|
|
185
|
-
// Start the server
|
|
248
|
+
// Start the server
|
|
186
249
|
async function main() {
|
|
187
250
|
const transport = new StdioServerTransport();
|
|
188
251
|
await server.connect(transport);
|
|
189
|
-
console.error("Gikendaasowin Aabajichiganan MCP server running with
|
|
252
|
+
console.error("Gikendaasowin Aabajichiganan MCP server running with Strategies 1-15 implemented.");
|
|
253
|
+
}
|
|
254
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
255
|
+
main().catch((error) => {
|
|
256
|
+
console.error("Fatal error in main():", error);
|
|
257
|
+
process.exit(1);
|
|
258
|
+
});
|
|
190
259
|
}
|
|
191
|
-
main().catch((error) => {
|
|
192
|
-
console.error("Fatal error in main():", error);
|
|
193
|
-
process.exit(1);
|
|
194
|
-
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { PROMPTING_STRATEGIES, DeliberationEngine } from './index.js';
|
|
3
|
+
describe('Prompting Strategies Implementation (Strategies 1-15)', () => {
|
|
4
|
+
// Strategies 1-5
|
|
5
|
+
it('Strategy 1: CAR-ReAct', () => {
|
|
6
|
+
const strategy = PROMPTING_STRATEGIES["Cache-Augmented ReAct (CAR-ReAct)"];
|
|
7
|
+
expect(strategy).toBeDefined();
|
|
8
|
+
expect(strategy.description).toContain('Tier 1');
|
|
9
|
+
expect(strategy.protocol).toContain('DO NOT re-output Tier 1 content');
|
|
10
|
+
});
|
|
11
|
+
it('Strategy 2: ARC', () => {
|
|
12
|
+
const strategy = PROMPTING_STRATEGIES["Adaptive Reasoning Consensus (ARC)"];
|
|
13
|
+
expect(strategy).toBeDefined();
|
|
14
|
+
expect(strategy.description).toContain('*quality* and *pattern*');
|
|
15
|
+
expect(strategy.protocol).toContain('Weighted aggregation');
|
|
16
|
+
});
|
|
17
|
+
it('Strategy 3: SNE', () => {
|
|
18
|
+
const strategy = PROMPTING_STRATEGIES["Substrate-Native Execution (SNE)"];
|
|
19
|
+
expect(strategy).toBeDefined();
|
|
20
|
+
expect(strategy.description).toContain('Universal Execution Delegation');
|
|
21
|
+
expect(strategy.protocol).toContain('Delegate to native runtime');
|
|
22
|
+
});
|
|
23
|
+
it('Strategy 4: RCA', () => {
|
|
24
|
+
const strategy = PROMPTING_STRATEGIES["Recursive Contextual Audit (RCA)"];
|
|
25
|
+
expect(strategy).toBeDefined();
|
|
26
|
+
expect(strategy.description).toContain('Correction Vector');
|
|
27
|
+
expect(strategy.protocol).toContain('Map error to Tier 1 deviation');
|
|
28
|
+
});
|
|
29
|
+
it('Strategy 5: SID', () => {
|
|
30
|
+
const strategy = PROMPTING_STRATEGIES["Semantic Information Density (SID)"];
|
|
31
|
+
expect(strategy).toBeDefined();
|
|
32
|
+
expect(strategy.description).toContain('information entropy');
|
|
33
|
+
expect(strategy.protocol).toContain('CUC-N score');
|
|
34
|
+
});
|
|
35
|
+
// Strategies 6-10
|
|
36
|
+
it('Strategy 6: Reflexion (Single-Shot)', () => {
|
|
37
|
+
const strategy = PROMPTING_STRATEGIES["Reflexion (Single-Shot)"];
|
|
38
|
+
expect(strategy).toBeDefined();
|
|
39
|
+
expect(strategy.description).toContain('Single-shot recursive critique');
|
|
40
|
+
expect(strategy.protocol).toContain('<reflexion_protocol>');
|
|
41
|
+
expect(strategy.protocol).toContain('DRAFT');
|
|
42
|
+
expect(strategy.protocol).toContain('REFLECTION');
|
|
43
|
+
});
|
|
44
|
+
it('Strategy 7: ToT-lite', () => {
|
|
45
|
+
const strategy = PROMPTING_STRATEGIES["ToT-lite (Tree of Thoughts)"];
|
|
46
|
+
expect(strategy).toBeDefined();
|
|
47
|
+
expect(strategy.description).toContain('Bounded parallel exploration');
|
|
48
|
+
expect(strategy.protocol).toContain('<tot_lite_protocol>');
|
|
49
|
+
});
|
|
50
|
+
it('Strategy 8: Metacognitive Prompting', () => {
|
|
51
|
+
const strategy = PROMPTING_STRATEGIES["Metacognitive Prompting (MP)"];
|
|
52
|
+
expect(strategy).toBeDefined();
|
|
53
|
+
expect(strategy.protocol).toContain('<metacognitive_protocol>');
|
|
54
|
+
expect(strategy.protocol).toContain('PLAN');
|
|
55
|
+
expect(strategy.protocol).toContain('MONITOR');
|
|
56
|
+
});
|
|
57
|
+
it('Strategy 9: APO', () => {
|
|
58
|
+
const strategy = PROMPTING_STRATEGIES["Automated Prompt Optimization (APO)"];
|
|
59
|
+
expect(strategy).toBeDefined();
|
|
60
|
+
expect(strategy.protocol).toContain('<apo_protocol>');
|
|
61
|
+
});
|
|
62
|
+
// Strategies 11-15
|
|
63
|
+
it('Strategy 11: PHP-v2', () => {
|
|
64
|
+
const strategy = PROMPTING_STRATEGIES["Progressive-Hint Prompting (PHP-v2)"];
|
|
65
|
+
expect(strategy).toBeDefined();
|
|
66
|
+
expect(strategy.protocol).toContain('Stop if answer stabilizes');
|
|
67
|
+
});
|
|
68
|
+
it('Strategy 12: CAG-v2', () => {
|
|
69
|
+
const strategy = PROMPTING_STRATEGIES["Cache-Augmented Generation (CAG-v2)"];
|
|
70
|
+
expect(strategy).toBeDefined();
|
|
71
|
+
expect(strategy.protocol).toContain('Session Cache');
|
|
72
|
+
});
|
|
73
|
+
it('Strategy 13: CSP-v2', () => {
|
|
74
|
+
const strategy = PROMPTING_STRATEGIES["Cognitive Scaffolding Prompting (CSP-v2)"];
|
|
75
|
+
expect(strategy).toBeDefined();
|
|
76
|
+
expect(strategy.protocol).toContain('Task Goal');
|
|
77
|
+
expect(strategy.protocol).toContain('State Table');
|
|
78
|
+
});
|
|
79
|
+
it('Strategy 14: IKS-v2', () => {
|
|
80
|
+
const strategy = PROMPTING_STRATEGIES["Internal Knowledge Synthesis (IKS-v2)"];
|
|
81
|
+
expect(strategy).toBeDefined();
|
|
82
|
+
expect(strategy.protocol).toContain('Source-Tagged Knowledge Brief');
|
|
83
|
+
});
|
|
84
|
+
it('Strategy 15: V-CoT', () => {
|
|
85
|
+
const strategy = PROMPTING_STRATEGIES["Multimodal Synthesis (V-CoT)"];
|
|
86
|
+
expect(strategy).toBeDefined();
|
|
87
|
+
expect(strategy.protocol).toContain('Scene Graph');
|
|
88
|
+
});
|
|
89
|
+
it('DeliberationEngine should include protocols in prompt', () => {
|
|
90
|
+
const engine = new DeliberationEngine();
|
|
91
|
+
const result = engine.deliberate('test input');
|
|
92
|
+
// Check for some keys
|
|
93
|
+
expect(result).toContain('**Reflexion (Single-Shot):**');
|
|
94
|
+
expect(result).toContain('*Protocol:*');
|
|
95
|
+
expect(result).toContain('<reflexion_protocol>');
|
|
96
|
+
});
|
|
97
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nbiish/cognitive-tools-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.1.3",
|
|
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",
|