@nbiish/cognitive-tools-mcp 8.4.1 → 8.4.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/README.md CHANGED
@@ -28,7 +28,7 @@ Revolutionary **6-Stage Mandatory Cognitive Progression Framework** - Enhanced M
28
28
 
29
29
  ### ⚡ MANDATORY STAGE PROGRESSION
30
30
 
31
- **BREAKING CHANGE v8.3.1**: Stages are now **MANDATORY** and must be completed sequentially:
31
+ **BREAKING CHANGE v8.4.2**: Stages are now **MANDATORY** and must be completed sequentially:
32
32
 
33
33
  1. **Stage 1**: Scientific Investigation (Entry Point)
34
34
  2. **Stage 2**: Orientation & Strategic Planning
@@ -117,7 +117,7 @@ npm install -g @nbiish/cognitive-tools-mcp
117
117
 
118
118
  ### Modern Prompting Integration
119
119
 
120
- This tool implements the **[OOReDAct cognitive cycle](latest.md)** for systematic reasoning and action, featuring:
120
+ This tool implements the cognitive cycle described in our [latest.md](latest.md) for systematic reasoning and action, featuring:
121
121
 
122
122
  - **Context Engineering (2025 Best Practice)**: RAG-enhanced processing
123
123
  - **Parallel Strategy Evaluation**: 10 advanced prompting strategies
package/build/index.js CHANGED
@@ -1294,12 +1294,12 @@ function assessMethodologicalRigor(stage1Result) {
1294
1294
  * - Multiple validation approaches for reliability
1295
1295
  * - Pre-action planning with tool identification
1296
1296
  *
1297
- * **STAGE 4 - Scientific Review:** Chain-of-Thought + Self-Consistency
1297
+ * **STAGE 4 - SCIENTIFIC REVIEW:** Chain-of-Thought + Self-Consistency
1298
1298
  * - Systematic review of initial investigation findings
1299
1299
  * - Cross-validation using multiple approaches
1300
1300
  * - Enhanced evidence quality assessment
1301
1301
  *
1302
- * **STAGE 5 - OOReD Review:** Tree-of-Thoughts + Role-Based Prompting
1302
+ * **STAGE 5 - OOReD REVIEW:** Tree-of-Thoughts + Role-Based Prompting
1303
1303
  * - Multi-path refinement of reasoning processes
1304
1304
  * - Expert domain perspectives integration
1305
1305
  * - Cross-stage consistency optimization
@@ -1375,43 +1375,45 @@ server.tool("deliberate", {
1375
1375
  .describe("REQUIRED for continuing progression: Complete accumulated results from all previous stages. Include ONLY when continuing an existing session (stages 2-6).")
1376
1376
  }, async ({ input, mode, context, previous_results }) => {
1377
1377
  const toolName = 'deliberate';
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.`);
1378
+ logToolCall(toolName, `Mode: ${mode}, Previous Results: ${previous_results ? 'Yes' : 'No'}`);
1379
+ try {
1380
+ const sessionId = generateSessionId(input);
1381
+ let session = activeSessions.get(sessionId);
1382
+ let currentStage;
1383
+ let contextualInput = input;
1384
+ let accumulatedResults = previous_results || "";
1385
+ if (!session || !previous_results) {
1386
+ // Start a new session at Stage 1
1387
+ currentStage = 1;
1388
+ session = {
1389
+ sessionId,
1390
+ currentStage: 1,
1391
+ originalInput: input,
1392
+ stageResults: [],
1393
+ startTime: Date.now()
1394
+ };
1395
+ activeSessions.set(sessionId, session);
1396
+ logToolCall(toolName, `New session started: ${sessionId}, Stage: 1`);
1400
1397
  }
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.`);
1398
+ else {
1399
+ // Continue existing session
1400
+ currentStage = session.currentStage + 1;
1401
+ if (currentStage > 6) {
1402
+ return { content: [{ type: "text", text: "PROGRESSION COMPLETE: All 6 stages already completed for this input. Session finished." }] };
1403
+ }
1404
+ // Use the provided previous_results as the full context
1405
+ accumulatedResults = previous_results;
1406
+ contextualInput = `${input}\n\n[COGNITIVE PROGRESSION CONTEXT - Previous Stages]\n${accumulatedResults}`;
1407
+ logToolCall(toolName, `Continuing session: ${sessionId}, Advancing to Stage: ${currentStage}`);
1404
1408
  }
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'}`);
1411
- try {
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'}`);
1409
+ const stageKey = `stage${currentStage}`;
1410
+ // Process the current stage
1411
+ const stageResult = await processProgressiveStage(contextualInput, mode, context, stageKey, accumulatedResults);
1412
+ // Update session state
1413
+ session.currentStage = currentStage;
1414
+ session.stageResults.push(stageResult); // Append the full result of the current stage
1415
+ activeSessions.set(sessionId, session);
1416
+ logToolResult(toolName, true, `Stage ${currentStage} completed`);
1415
1417
  return { content: [{ type: "text", text: stageResult }] };
1416
1418
  }
1417
1419
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbiish/cognitive-tools-mcp",
3
- "version": "8.4.1",
3
+ "version": "8.4.3",
4
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",