@gotza02/seq-thinking 1.1.3 β†’ 1.1.5

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
@@ -1,98 +1,44 @@
1
1
  # MCP Sequential Thinking with Swarm Coordination
2
2
 
3
- [![Version](https://img.shields.io/badge/version-1.1.0-blue.svg)](https://github.com/yourusername/mcp-sequential-thinking)
3
+ [![Version](https://img.shields.io/badge/version-1.1.5-blue.svg)](https://www.npmjs.com/package/@gotza02/seq-thinking)
4
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
6
6
 
7
- Advanced Sequential Thinking MCP Tool with Swarm Agent Coordination - A superior alternative to Claude's sequential thinking capabilities, integrated with real LLM power via your favorite CLI tools.
7
+ **Advanced Sequential Thinking MCP Server** with integrated Swarm Intelligence. This tool empowers your AI environment with structured reasoning, self-correction, and a coordinated team of specialized agents, leveraging your existing local LLM CLI tools.
8
8
 
9
- ## Overview
9
+ ## πŸš€ Key Features
10
10
 
11
- This system provides advanced sequential thinking capabilities with:
11
+ * **🧠 Advanced Sequential Thinking**: Supports branching, merging, and pruning of thought paths.
12
+ * **πŸ€– Swarm Intelligence**: Coordinates specialized agents (**Reasoner**, **Critic**, **Synthesizer**, **Meta-Reasoner**) to solve complex problems.
13
+ * **πŸ”Œ BYO-LLM (Bring Your Own LLM)**: Connects directly to **Gemini**, **Claude**, **Kimi**, and **OpenCode** via their CLI toolsβ€”no extra API keys required if you're already logged in.
14
+ * **πŸ”„ Auto-Fallback & Robustness**: Automatically switches providers if one fails (e.g., `gemini` -> `claude`). Includes retry logic for resilient task execution.
15
+ * **πŸ’Ύ Persistence**: Automatically saves sessions and agent states to disk (`./data/`), allowing you to resume complex reasoning tasks anytime.
16
+ * **πŸ” Self-Correction**: Proactively detects logical fallacies and confidence dips, triggering corrective actions.
12
17
 
13
- - **Real LLM Integration**: Connects directly to Gemini, Claude (Claude Code), Kimi, and OpenCode via CLI.
14
- - **Self-Correction Loops**: Automatically detect and fix reasoning errors.
15
- - **Parallel Hypothesis Generation**: Explore multiple reasoning paths simultaneously.
16
- - **Meta-Reasoning**: Reflect on and improve the thinking process.
17
- - **Adaptive Granularity**: Adjust detail level based on problem complexity.
18
- - **Persistence Layer**: All thinking sessions and agent states are saved to disk.
19
- - **Swarm Agent Coordination**: Multiple specialized agents working together with retry logic.
18
+ ## πŸ“¦ Quick Start (NPX)
20
19
 
21
- ## AI System Instructions
20
+ You can run this MCP server directly using `npx` without cloning the repository. This is the recommended method.
22
21
 
23
- This project includes a [SYSTEM_INSTRUCTIONS.md](./SYSTEM_INSTRUCTIONS.md) file specifically designed to guide AI models on how to use these tools effectively. It covers initialization, branching, and swarm delegation strategies.
24
-
25
- ## Architecture
26
-
27
- ```
28
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
29
- β”‚ MCP TOOL INTERFACE β”‚
30
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
31
- β”‚ β”‚ Sequential β”‚ β”‚ Swarm β”‚ β”‚ Tool Registry β”‚ β”‚
32
- β”‚ β”‚ Thinking β”‚ β”‚ Coordinationβ”‚ β”‚ β”‚ β”‚
33
- β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
34
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
35
- β”‚ β”‚
36
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
37
- β”‚ β”‚ ORCHESTRATION ENGINE β”‚
38
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
39
- β”‚ β”‚State Managerβ”‚ β”‚ Flow Control β”‚ β”‚ Scheduler β”‚ β”‚
40
- β”‚ β”‚(Persistence)β”‚ β”‚ (Retry Logic)β”‚ β”‚ β”‚ β”‚
41
- β”‚ β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
42
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
43
- β”‚
44
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
45
- β”‚ β”‚ SWARM AGENT COORDINATOR β”‚
46
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
47
- β”‚ β”‚ Reasoner β”‚ β”‚ Critic β”‚ β”‚ Synthesizer β”‚ β”‚
48
- β”‚ β”‚ Agents β”‚ β”‚ Agents β”‚ β”‚ Agents β”‚ β”‚
49
- β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
50
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
51
- β”‚ β”‚ β”‚
52
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
53
- β”‚ LLM ADAPTER (CLI BRIDGE) β”‚
54
- β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
55
- β”‚ β”‚ Gemini β”‚ β”‚ Claude β”‚ β”‚ Kimi β”‚ β”‚ OpenCode β”‚ β”‚
56
- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
57
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
58
- ```
59
-
60
- ## LLM Providers (CLI Integration)
61
-
62
- The system is designed to use LLMs that you have already logged into via your command line. This simplifies authentication and leverages your existing CLI tools.
63
-
64
- Supported Providers:
65
- - **gemini**: Uses `gemini ask "..."`
66
- - **claude**: Uses `claude "..." --non-interactive` (Compatible with Claude Code)
67
- - **kimi**: Uses `kimi chat "..."`
68
- - **opencode**: Uses `opencode ask "..."`
69
-
70
- ## Installation
22
+ **Prerequisites:** Node.js v18 or higher.
71
23
 
72
24
  ```bash
73
- # Clone the repository
74
- git clone https://github.com/yourusername/mcp-sequential-thinking.git
75
- cd mcp-sequential-thinking
76
-
77
- # Install dependencies
78
- npm install
79
-
80
- # Build the project
81
- npm run build
25
+ npx -y @gotza02/seq-thinking
82
26
  ```
83
27
 
84
- ## Configuration (MCP JSON)
28
+ ## βš™οΈ MCP Configuration
29
+
30
+ To use this tool with MCP clients (like **Claude Desktop**, **Cline**, or **Cursor**), add the following configuration to your settings file.
85
31
 
86
- Add this to your MCP settings file (e.g., `claude_desktop_config.json`, `gemini-cli.json`, or Kimi's `mcp.json`):
32
+ **For Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
87
33
 
88
34
  ```json
89
35
  {
90
36
  "mcpServers": {
91
37
  "advanced-thinking": {
92
- "command": "node",
93
- "args": ["/absolute/path/to/dist/mcp-server.js"],
38
+ "command": "npx",
39
+ "args": ["-y", "@gotza02/seq-thinking"],
94
40
  "env": {
95
- "provider": "gemini",
41
+ "provider": "gemini,claude",
96
42
  "MOCK_LLM": "false"
97
43
  }
98
44
  }
@@ -104,84 +50,73 @@ Add this to your MCP settings file (e.g., `claude_desktop_config.json`, `gemini-
104
50
 
105
51
  | Variable | Description | Default | Example |
106
52
  |----------|-------------|---------|---------|
107
- | `provider` | The LLM provider(s) to use. Supports comma-separated list for **auto-fallback**. | `gemini` | `gemini,claude,kimi` |
108
- | `MOCK_LLM` | If `true`, returns mock data instead of calling the CLI (useful for testing) | `false` | `true` |
109
-
110
- ### Multi-Provider Auto-Fallback
111
-
112
- You can specify multiple providers in the `provider` environment variable to enable automatic failover. This is crucial for maintaining system reliability when one API is rate-limited or down.
53
+ | `provider` | Comma-separated list of LLM CLIs to use. The system tries them in order. | `gemini` | `gemini,claude,kimi` |
54
+ | `MOCK_LLM` | If `true`, returns mock responses (for testing without API costs). | `false` | `true` |
113
55
 
114
- **Example Configuration:**
115
- ```json
116
- "env": {
117
- "provider": "gemini,claude,kimi"
118
- }
119
- ```
120
-
121
- **How it works:**
122
- 1. The system first tries `gemini`.
123
- 2. If `gemini` fails (e.g., Error 429 Rate Limit), it automatically logs a warning.
124
- 3. The system immediately retries with `claude`.
125
- 4. If `claude` fails, it tries `kimi`.
126
- 5. The first successful response is used.
127
-
128
- ### Dynamic Provider Selection
56
+ **Supported CLI Tools:**
57
+ * **Gemini:** Requires `gemini` CLI installed and authenticated.
58
+ * **Claude:** Requires `claude` (Claude Code) CLI installed and authenticated.
59
+ * **Kimi:** Requires `kimi` CLI.
60
+ * **OpenCode:** Requires `opencode` CLI.
129
61
 
130
- You can also specify a provider dynamically when delegating tasks, overriding the default environment setting:
62
+ ## πŸ› οΈ Usage
131
63
 
132
- ```typescript
133
- // Example usage in code
134
- await server.handleSequentialThinking({
135
- operation: 'delegate_to_swarm',
136
- // ... other params ...
137
- modelProvider: 'claude' // Force use of Claude for this specific task
138
- });
139
- ```
140
-
141
- ## Persistence
64
+ This server provides two main tools to your AI client:
142
65
 
143
- Thinking sessions are automatically persisted to the `./data` directory.
144
- - **Sessions**: Stored in `./data/sessions/`
145
- - **Agents**: Stored in `./data/agents/`
66
+ ### 1. `advanced_sequential_thinking`
67
+ The core thinking engine.
68
+ * **Operations:** `initialize`, `add_thought`, `branch_thought`, `self_correct`, `complete_session`, etc.
69
+ * **Use Case:** Deep, step-by-step problem solving with ability to backtrack.
146
70
 
147
- This ensures that your reasoning state is preserved even if the MCP server restarts.
71
+ ### 2. `swarm_agent_coordination`
72
+ The workforce manager.
73
+ * **Operations:** `register_agent`, `assign_task`, `reach_consensus`, `resolve_conflict`.
74
+ * **Use Case:** Delegating sub-tasks to specialized "virtual experts" (e.g., asking a "Critic" agent to review a plan).
148
75
 
149
- ## Enhanced Swarm Logic
76
+ ## πŸ‘¨β€πŸ’» Development & Local Installation
150
77
 
151
- - **Automated Retries**: Tasks assigned to agents will automatically retry up to 3 times with exponential backoff on failure.
152
- - **Intelligent Context**: When reaching consensus, agents receive current swarm statistics and history of previous votes to make more informed decisions.
153
- - **Async Workflow**: All operations are non-blocking, ensuring the MCP server remains responsive during long reasoning tasks.
78
+ If you want to modify the code or contribute:
154
79
 
155
- ## API Documentation
80
+ ```bash
81
+ # Clone the repository
82
+ git clone https://github.com/yourusername/mcp-sequential-thinking.git
83
+ cd mcp-sequential-thinking
156
84
 
157
- *(Standard Sequential Thinking and Swarm Coordination operations are supported as documented in the internal tool definitions)*
85
+ # Install dependencies
86
+ npm install
158
87
 
159
- ## Testing
88
+ # Build the project
89
+ npm run build
160
90
 
161
- ```bash
162
- # Run tests with mock LLM responses
91
+ # Run tests
163
92
  export MOCK_LLM=true
164
93
  npm test
165
94
  ```
166
95
 
167
- ## License
96
+ ## πŸ—οΈ Architecture
97
+
98
+ The system is built on a modular architecture:
99
+ * **Orchestration Layer:** Manages state, flow control, and error handling.
100
+ * **Swarm Coordinator:** Assigns tasks based on agent capabilities and availability.
101
+ * **Thought Graph:** A directed acyclic graph (DAG) representing the reasoning process.
102
+ * **LLM Adapter:** A unified interface for communicating with various CLI-based models.
103
+
104
+ ## πŸ“ Changelog
168
105
 
169
- MIT License - see [LICENSE](LICENSE) file for details.
106
+ ### v1.1.5 (2026-02-03)
107
+ - **Doc:** Updated README to prioritize `npx` usage for easier installation.
108
+ - **Doc:** Updated MCP configuration examples to use `npx` command.
170
109
 
171
- ## Changelog
110
+ ### v1.1.4 (2026-02-03)
111
+ - **Fix:** Fixed a critical bug in `MetaReasoningAgent` that caused crashes when analyzing thoughts with missing confidence data.
112
+ - **Improvement:** Enhanced robustness of `overall` confidence calculation across all agents.
113
+ - **Doc:** Updated README with comprehensive usage and testing instructions.
172
114
 
173
115
  ### v1.1.3 (2026-02-03)
174
- - **Feature**: Added **Multi-Provider Auto-Fallback**. Specify multiple providers (e.g., `gemini,claude`) in env to automatically switch if one fails.
175
- - **Feature**: Added **Dynamic Provider Selection**. Users can now specify `modelProvider` in `delegate_to_swarm` to override defaults per task.
176
- - **Fix**: Resolved syntax errors in Agent classes.
177
- - **Fix**: Improved TypeScript type safety and added missing `await` keywords.
178
- - **Improvement**: Replaced all console logs with a structured `Logger`.
179
-
180
- ### v1.1.0 (2026-02-03)
181
- - Added CLI-based LLM Adapters (Gemini, Claude, Kimi, OpenCode).
182
- - Implemented Disk Persistence for sessions and agents.
183
- - Added Task Retry logic in Swarm Coordinator.
184
- - Updated all tests to support asynchronous operations.
185
-
186
- ### v1.0.0 (2025-02-03)
187
- - Initial release with core swarm and sequential thinking logic.
116
+ - **Feature:** Multi-Provider Auto-Fallback.
117
+ - **Feature:** Dynamic Provider Selection per task.
118
+ - **Refactor:** Replaced console logs with structured `Logger`.
119
+
120
+ ## πŸ“„ License
121
+
122
+ MIT License - see [LICENSE](LICENSE) file for details.
@@ -0,0 +1,68 @@
1
+ {
2
+ "config": {
3
+ "id": "1770117726716-lrnm415",
4
+ "name": "LogicMaster",
5
+ "type": "reasoner",
6
+ "subtype": "chain_of_thought",
7
+ "capabilities": [
8
+ {
9
+ "name": "chain_of_thought",
10
+ "description": "Step-by-step reasoning",
11
+ "confidence": 0.9,
12
+ "performanceMetrics": {
13
+ "tasksCompleted": 0,
14
+ "averageQuality": 0,
15
+ "averageTimeMs": 0
16
+ }
17
+ },
18
+ {
19
+ "name": "tree_of_thought",
20
+ "description": "Explore multiple reasoning paths",
21
+ "confidence": 0.85,
22
+ "performanceMetrics": {
23
+ "tasksCompleted": 0,
24
+ "averageQuality": 0,
25
+ "averageTimeMs": 0
26
+ }
27
+ },
28
+ {
29
+ "name": "analogical_reasoning",
30
+ "description": "Reason by analogy",
31
+ "confidence": 0.8,
32
+ "performanceMetrics": {
33
+ "tasksCompleted": 0,
34
+ "averageQuality": 0,
35
+ "averageTimeMs": 0
36
+ }
37
+ },
38
+ {
39
+ "name": "abductive_reasoning",
40
+ "description": "Inference to best explanation",
41
+ "confidence": 0.75,
42
+ "performanceMetrics": {
43
+ "tasksCompleted": 0,
44
+ "averageQuality": 0,
45
+ "averageTimeMs": 0
46
+ }
47
+ },
48
+ {
49
+ "name": "problem_solving",
50
+ "description": "General problem-solving",
51
+ "confidence": 0.8,
52
+ "performanceMetrics": {
53
+ "tasksCompleted": 0,
54
+ "averageQuality": 0,
55
+ "averageTimeMs": 0
56
+ }
57
+ }
58
+ ],
59
+ "maxConcurrentTasks": 3,
60
+ "confidenceThreshold": 0.7,
61
+ "metadata": {
62
+ "createdAt": "2026-02-03T11:22:06.716Z",
63
+ "version": "1.0.0",
64
+ "config": {}
65
+ }
66
+ },
67
+ "performanceHistory": []
68
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "config": {
3
+ "id": "1770117726719-w6hsf3v",
4
+ "name": "SafetyCheck",
5
+ "type": "critic",
6
+ "subtype": "safety",
7
+ "capabilities": [
8
+ {
9
+ "name": "evaluation",
10
+ "description": "Evaluate outputs from other agents",
11
+ "confidence": 0.85,
12
+ "performanceMetrics": {
13
+ "tasksCompleted": 0,
14
+ "averageQuality": 0,
15
+ "averageTimeMs": 0
16
+ }
17
+ },
18
+ {
19
+ "name": "validation",
20
+ "description": "Validate correctness and accuracy",
21
+ "confidence": 0.8,
22
+ "performanceMetrics": {
23
+ "tasksCompleted": 0,
24
+ "averageQuality": 0,
25
+ "averageTimeMs": 0
26
+ }
27
+ },
28
+ {
29
+ "name": "feedback",
30
+ "description": "Provide constructive feedback",
31
+ "confidence": 0.9,
32
+ "performanceMetrics": {
33
+ "tasksCompleted": 0,
34
+ "averageQuality": 0,
35
+ "averageTimeMs": 0
36
+ }
37
+ },
38
+ {
39
+ "name": "logical_analysis",
40
+ "description": "Analyze logical consistency",
41
+ "confidence": 0.85,
42
+ "performanceMetrics": {
43
+ "tasksCompleted": 0,
44
+ "averageQuality": 0,
45
+ "averageTimeMs": 0
46
+ }
47
+ }
48
+ ],
49
+ "maxConcurrentTasks": 5,
50
+ "confidenceThreshold": 0.7,
51
+ "metadata": {
52
+ "createdAt": "2026-02-03T11:22:06.719Z",
53
+ "version": "1.0.0",
54
+ "config": {}
55
+ }
56
+ },
57
+ "performanceHistory": []
58
+ }
@@ -0,0 +1,150 @@
1
+ {
2
+ "id": "1770117726720-frcwj99",
3
+ "topic": "Architecting a scalable microservices system",
4
+ "status": "completed",
5
+ "currentBranchId": "main",
6
+ "branches": {
7
+ "_type": "Map",
8
+ "data": [
9
+ [
10
+ "main",
11
+ {
12
+ "id": "main",
13
+ "sessionId": "1770117726720-frcwj99",
14
+ "name": "Main",
15
+ "description": "Primary reasoning path",
16
+ "rootThoughtId": "",
17
+ "thoughtIds": [],
18
+ "parentBranchId": null,
19
+ "childBranchIds": [],
20
+ "status": "active",
21
+ "confidence": 0.5,
22
+ "metadata": {
23
+ "createdAt": "2026-02-03T11:22:06.720Z"
24
+ }
25
+ }
26
+ ]
27
+ ]
28
+ },
29
+ "thoughts": {
30
+ "_type": "Map",
31
+ "data": [
32
+ [
33
+ "1770117726722-j28xiub",
34
+ {
35
+ "id": "1770117726722-j28xiub",
36
+ "sessionId": "1770117726720-frcwj99",
37
+ "content": "We need to break down the monolithic application into smaller services.",
38
+ "stepNumber": 1,
39
+ "thoughtType": "analysis",
40
+ "confidence": {
41
+ "overall": 0.8,
42
+ "components": {
43
+ "logicalConsistency": 0.5,
44
+ "factualAccuracy": 0.5,
45
+ "reasoningQuality": 0.5,
46
+ "evidenceStrength": 0.5
47
+ },
48
+ "uncertaintyBounds": [
49
+ 0.3,
50
+ 0.7
51
+ ],
52
+ "calibrationHistory": []
53
+ },
54
+ "parentThoughtId": null,
55
+ "childThoughtIds": [
56
+ "1770117726726-hkgov5d"
57
+ ],
58
+ "branchId": "main",
59
+ "revisionOf": null,
60
+ "revisionHistory": [],
61
+ "metadata": {
62
+ "createdAt": "2026-02-03T11:22:06.722Z",
63
+ "modifiedAt": "2026-02-03T11:22:06.722Z",
64
+ "processingTimeMs": 0,
65
+ "tokensUsed": 0
66
+ },
67
+ "tags": [],
68
+ "assumptions": [],
69
+ "dependencies": []
70
+ }
71
+ ],
72
+ [
73
+ "1770117726726-hkgov5d",
74
+ {
75
+ "id": "1770117726726-hkgov5d",
76
+ "sessionId": "1770117726720-frcwj99",
77
+ "content": "{\n \"conclusion\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on these reasoning steps, provide a final co...\",\n \"reasoningChain\": [\n {\n \"step\": 1,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.63,\n \"isFinal\": false\n },\n {\n \"step\": 2,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.66,\n \"isFinal\": false\n },\n {\n \"step\": 3,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.69,\n \"isFinal\": false\n },\n {\n \"step\": 4,\n \"content\": \"[MOCK RESPONSE from gemini] I have analyzed your request: Based on the current context, generate the next re...\",\n \"confidence\": 0.72,\n \"isFinal\": true\n }\n ],\n \"iterations\": 4,\n \"strategy\": \"chain_of_thought\",\n \"problem\": \"[object Object]\"\n}",
78
+ "stepNumber": 2,
79
+ "thoughtType": "synthesis",
80
+ "confidence": {
81
+ "overall": 0.675,
82
+ "components": {
83
+ "logicalConsistency": 0.5,
84
+ "factualAccuracy": 0.5,
85
+ "reasoningQuality": 0.5,
86
+ "evidenceStrength": 0.5
87
+ },
88
+ "uncertaintyBounds": [
89
+ 0.3,
90
+ 0.7
91
+ ],
92
+ "calibrationHistory": []
93
+ },
94
+ "parentThoughtId": "1770117726722-j28xiub",
95
+ "childThoughtIds": [],
96
+ "branchId": "main",
97
+ "revisionOf": null,
98
+ "revisionHistory": [],
99
+ "metadata": {
100
+ "createdAt": "2026-02-03T11:22:06.726Z",
101
+ "modifiedAt": "2026-02-03T11:22:06.726Z",
102
+ "processingTimeMs": 0,
103
+ "tokensUsed": 0
104
+ },
105
+ "tags": [
106
+ "swarm-result",
107
+ "LogicMaster"
108
+ ],
109
+ "assumptions": [],
110
+ "dependencies": []
111
+ }
112
+ ]
113
+ ]
114
+ },
115
+ "metaNotes": {
116
+ "_type": "Map",
117
+ "data": []
118
+ },
119
+ "context": {
120
+ "originalProblem": "Architecting a scalable microservices system",
121
+ "constraints": [],
122
+ "relevantInformation": [],
123
+ "workingMemory": {
124
+ "_type": "Map",
125
+ "data": []
126
+ },
127
+ "longTermReferences": []
128
+ },
129
+ "settings": {
130
+ "maxBranches": 5,
131
+ "maxDepth": 20,
132
+ "confidenceThreshold": 0.6,
133
+ "enableSelfCorrection": true,
134
+ "enableMetaReasoning": true,
135
+ "enableParallelHypotheses": true,
136
+ "adaptiveGranularity": true,
137
+ "granularitySettings": {
138
+ "minStepDetail": 0.1,
139
+ "maxStepDetail": 1,
140
+ "complexityThreshold": 0.7
141
+ }
142
+ },
143
+ "metadata": {
144
+ "createdAt": "2026-02-03T11:22:06.720Z",
145
+ "lastActivityAt": "2026-02-03T11:22:06.726Z",
146
+ "totalThoughts": 2,
147
+ "totalBranches": 1,
148
+ "completedAt": "2026-02-03T11:22:06.734Z"
149
+ }
150
+ }
@@ -75,7 +75,7 @@ export declare class MetaReasoningAgent extends BaseAgent {
75
75
  * @param thoughts - Thoughts to analyze
76
76
  * @returns Variance
77
77
  */
78
- private calculateConfidenceVariance;
78
+ calculateConfidenceVariance(thoughts: Thought[]): number;
79
79
  /**
80
80
  * Generate meta-observation for a thought
81
81
  * @param thought - Thought to analyze
@@ -1 +1 @@
1
- {"version":3,"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OAAO,GAAG,eAAe,GAAG,IAAI;IAiCjE;;;OAGG;IACH,qBAAqB,IAAI,eAAe,EAAE;CAG3C"}
@@ -78,7 +78,7 @@ export class MetaReasoningAgent extends BaseAgent {
78
78
  let systemPrompt = 'You are a meta-reasoning agent. Your role is to analyze and reflect on the thinking processes of other agents or sessions, identifying patterns, biases, and areas for improvement.';
79
79
  const sessionData = input.session ? `Session Topic: ${input.session.topic}\nSession Status: ${input.session.status}\n` : '';
80
80
  const thoughtsData = (input.thoughts || (input.session ? Array.from(input.session.thoughts.values()) : []))
81
- .map(t => `Step ${t.stepNumber} (${t.thoughtType}, Confidence: ${t.confidence.overall}):\n${t.content}`).join('\n\n');
81
+ .map(t => `Step ${t.stepNumber} (${t.thoughtType}, Confidence: ${t.confidence?.overall ?? 'N/A'}):\n${t.content}`).join('\n\n');
82
82
  switch (input.operation) {
83
83
  case 'reflect':
84
84
  prompt = `Perform a comprehensive reflection on this thinking session. What are the key insights? What has been achieved? What is still missing?\n\n${sessionData}${thoughtsData}`;
@@ -154,8 +154,8 @@ export class MetaReasoningAgent extends BaseAgent {
154
154
  const sorted = [...thoughts].sort((a, b) => a.metadata.createdAt.getTime() - b.metadata.createdAt.getTime());
155
155
  const firstThird = sorted.slice(0, Math.ceil(sorted.length / 3));
156
156
  const lastThird = sorted.slice(-Math.ceil(sorted.length / 3));
157
- const initial = firstThird.reduce((sum, t) => sum + t.confidence.overall, 0) / firstThird.length;
158
- const final = lastThird.reduce((sum, t) => sum + t.confidence.overall, 0) / lastThird.length;
157
+ const initial = firstThird.reduce((sum, t) => sum + (t.confidence?.overall ?? 0.5), 0) / firstThird.length;
158
+ const final = lastThird.reduce((sum, t) => sum + (t.confidence?.overall ?? 0.5), 0) / lastThird.length;
159
159
  const diff = final - initial;
160
160
  const threshold = 0.1;
161
161
  let trend;
@@ -191,7 +191,7 @@ export class MetaReasoningAgent extends BaseAgent {
191
191
  calculateConfidenceVariance(thoughts) {
192
192
  if (thoughts.length < 2)
193
193
  return 0;
194
- const values = thoughts.map(t => t.confidence.overall);
194
+ const values = thoughts.map(t => t.confidence?.overall ?? 0.5);
195
195
  const mean = values.reduce((a, b) => a + b, 0) / values.length;
196
196
  const squaredDiffs = values.map(v => Math.pow(v - mean, 2));
197
197
  return squaredDiffs.reduce((a, b) => a + b, 0) / values.length;
@@ -205,13 +205,14 @@ export class MetaReasoningAgent extends BaseAgent {
205
205
  const observations = [];
206
206
  const triggeredActions = [];
207
207
  // Check for high uncertainty
208
- const uncertaintyRange = thought.confidence.uncertaintyBounds[1] - thought.confidence.uncertaintyBounds[0];
208
+ const confidence = thought.confidence || { overall: 0.5, uncertaintyBounds: [0.3, 0.7] };
209
+ const uncertaintyRange = (confidence.uncertaintyBounds?.[1] ?? 0.7) - (confidence.uncertaintyBounds?.[0] ?? 0.3);
209
210
  if (uncertaintyRange > 0.4) {
210
211
  observations.push('High uncertainty detected');
211
212
  triggeredActions.push('gather_more_evidence');
212
213
  }
213
214
  // Check for low confidence
214
- if (thought.confidence.overall < 0.4) {
215
+ if (confidence.overall < 0.4) {
215
216
  observations.push('Low confidence in this thought');
216
217
  triggeredActions.push('review_reasoning');
217
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"meta-reasoning-agent.js","sourceRoot":"","sources":["../../src/agents/meta-reasoning-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,SAAS,EAOV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAarD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,0BAA0B;IAClB,kBAAkB,GAAsB,EAAE,CAAC;IAEnD;;;OAGG;IACH,YAAY,MAGX;QACC,MAAM,mBAAmB,GAAsB;YAC7C;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,yCAAyC;gBACtD,UAAU,EA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,GAAG,EAAE,CAAC;YAC3B,YAAY,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;YAC/C,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChD,CAAC;QAED,2BAA2B;QAC3B,IAAI,UAAU,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC;YAC7B,YAAY,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACpD,gBAAgB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC5C,CAAC;QAED,gCAAgC;QAChC,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrC,YAAY,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;YACxD,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAE3C,OAAO;YACL,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YACpC,gBAAgB;SACjB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,qBAAqB;QACnB,OAAO,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { generateId, generateUUID, generateShortId, clamp, clampConfidence, lerp
13
13
  /**
14
14
  * Library version
15
15
  */
16
- export declare const VERSION = "1.0.0";
16
+ export declare const VERSION = "1.1.5";
17
17
  /**
18
18
  * Default export - MCPServer
19
19
  */
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ export { generateId, generateUUID, generateShortId, clamp, clampConfidence, lerp
19
19
  /**
20
20
  * Library version
21
21
  */
22
- export const VERSION = '1.0.0';
22
+ export const VERSION = '1.1.5';
23
23
  /**
24
24
  * Default export - MCPServer
25
25
  */
@@ -96,7 +96,7 @@ export class MCPServer {
96
96
  registeredAgents = new Map();
97
97
  dataDir = './data';
98
98
  constructor() {
99
- this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.0.0' }, { capabilities: { tools: {} } });
99
+ this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.1.5' }, { capabilities: { tools: {} } });
100
100
  this.sessionManager = new SessionManager(this.dataDir);
101
101
  this.swarmCoordinator = new SwarmCoordinator(this.dataDir);
102
102
  this.setupHandlers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/seq-thinking",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "Advanced Sequential Thinking MCP Tool with Swarm Agent Coordination",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -114,7 +114,7 @@ export class MetaReasoningAgent extends BaseAgent {
114
114
 
115
115
  const sessionData = input.session ? `Session Topic: ${input.session.topic}\nSession Status: ${input.session.status}\n` : '';
116
116
  const thoughtsData = (input.thoughts || (input.session ? Array.from(input.session.thoughts.values()) : []))
117
- .map(t => `Step ${t.stepNumber} (${t.thoughtType}, Confidence: ${t.confidence.overall}):\n${t.content}`).join('\n\n');
117
+ .map(t => `Step ${t.stepNumber} (${t.thoughtType}, Confidence: ${t.confidence?.overall ?? 'N/A'}):\n${t.content}`).join('\n\n');
118
118
 
119
119
  switch (input.operation) {
120
120
  case 'reflect':
@@ -217,8 +217,8 @@ export class MetaReasoningAgent extends BaseAgent {
217
217
  const firstThird = sorted.slice(0, Math.ceil(sorted.length / 3));
218
218
  const lastThird = sorted.slice(-Math.ceil(sorted.length / 3));
219
219
 
220
- const initial = firstThird.reduce((sum, t) => sum + t.confidence.overall, 0) / firstThird.length;
221
- const final = lastThird.reduce((sum, t) => sum + t.confidence.overall, 0) / lastThird.length;
220
+ const initial = firstThird.reduce((sum, t) => sum + (t.confidence?.overall ?? 0.5), 0) / firstThird.length;
221
+ const final = lastThird.reduce((sum, t) => sum + (t.confidence?.overall ?? 0.5), 0) / lastThird.length;
222
222
 
223
223
  const diff = final - initial;
224
224
  const threshold = 0.1;
@@ -256,10 +256,10 @@ export class MetaReasoningAgent extends BaseAgent {
256
256
  * @param thoughts - Thoughts to analyze
257
257
  * @returns Variance
258
258
  */
259
- private calculateConfidenceVariance(thoughts: Thought[]): number {
259
+ calculateConfidenceVariance(thoughts: Thought[]): number {
260
260
  if (thoughts.length < 2) return 0;
261
261
 
262
- const values = thoughts.map(t => t.confidence.overall);
262
+ const values = thoughts.map(t => t.confidence?.overall ?? 0.5);
263
263
  const mean = values.reduce((a, b) => a + b, 0) / values.length;
264
264
  const squaredDiffs = values.map(v => Math.pow(v - mean, 2));
265
265
 
@@ -276,14 +276,15 @@ export class MetaReasoningAgent extends BaseAgent {
276
276
  const triggeredActions: string[] = [];
277
277
 
278
278
  // Check for high uncertainty
279
- const uncertaintyRange = thought.confidence.uncertaintyBounds[1] - thought.confidence.uncertaintyBounds[0];
279
+ const confidence = thought.confidence || { overall: 0.5, uncertaintyBounds: [0.3, 0.7] };
280
+ const uncertaintyRange = (confidence.uncertaintyBounds?.[1] ?? 0.7) - (confidence.uncertaintyBounds?.[0] ?? 0.3);
280
281
  if (uncertaintyRange > 0.4) {
281
282
  observations.push('High uncertainty detected');
282
283
  triggeredActions.push('gather_more_evidence');
283
284
  }
284
285
 
285
286
  // Check for low confidence
286
- if (thought.confidence.overall < 0.4) {
287
+ if (confidence.overall < 0.4) {
287
288
  observations.push('Low confidence in this thought');
288
289
  triggeredActions.push('review_reasoning');
289
290
  }
package/src/index.ts CHANGED
@@ -110,7 +110,7 @@ export {
110
110
  /**
111
111
  * Library version
112
112
  */
113
- export const VERSION = '1.0.0';
113
+ export const VERSION = '1.1.5';
114
114
 
115
115
  /**
116
116
  * Default export - MCPServer
package/src/mcp-server.ts CHANGED
@@ -97,7 +97,7 @@ export class MCPServer {
97
97
  private dataDir = './data';
98
98
 
99
99
  constructor() {
100
- this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.0.0' }, { capabilities: { tools: {} } });
100
+ this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.1.5' }, { capabilities: { tools: {} } });
101
101
  this.sessionManager = new SessionManager(this.dataDir);
102
102
  this.swarmCoordinator = new SwarmCoordinator(this.dataDir);
103
103
  this.setupHandlers();